(window.webpackJsonp=window.webpackJsonp||[]).push([[194,3,5,7,8,17,20],{"++UQ":function(et,Ve,z){},"+NIl":function(et,Ve,z){(function(le){le(z("VrN/"))})(function(le){"use strict";le.defineMode("stex",function(Q,j){"use strict";function w(u,s){u.cmdState.push(s)}function P(u){return u.cmdState.length>0?u.cmdState[u.cmdState.length-1]:null}function b(u){var s=u.cmdState.pop();s&&s.closeBracket()}function T(u){for(var s=u.cmdState,h=s.length-1;h>=0;h--){var i=s[h];if(i.name=="DEFAULT")continue;return i}return{styleIdentifier:function(){return null}}}function C(u,s,h){return function(){this.name=u,this.bracketNo=0,this.style=s,this.styles=h,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var c={};c.importmodule=C("importmodule","tag",["string","builtin"]),c.documentclass=C("documentclass","tag",["","atom"]),c.usepackage=C("usepackage","tag",["atom"]),c.begin=C("begin","tag",["atom"]),c.end=C("end","tag",["atom"]),c.label=C("label","tag",["atom"]),c.ref=C("ref","tag",["atom"]),c.eqref=C("eqref","tag",["atom"]),c.cite=C("cite","tag",["atom"]),c.bibitem=C("bibitem","tag",["atom"]),c.Bibitem=C("Bibitem","tag",["atom"]),c.RBibitem=C("RBibitem","tag",["atom"]),c.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function p(u,s){u.f=s}function d(u,s){var h;if(u.match(/^\\[a-zA-Z@]+/)){var i=u.current().slice(1);return h=c.hasOwnProperty(i)?c[i]:c.DEFAULT,h=new h,w(s,h),p(s,a),h.style}if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/\\]/))return"tag";if(u.match("\\["))return p(s,function(t,f){return o(t,f,"\\]")}),"keyword";if(u.match("\\("))return p(s,function(t,f){return o(t,f,"\\)")}),"keyword";if(u.match("$$"))return p(s,function(t,f){return o(t,f,"$$")}),"keyword";if(u.match("$"))return p(s,function(t,f){return o(t,f,"$")}),"keyword";var n=u.next();if(n=="%")return u.skipToEnd(),"comment";if(n=="}"||n=="]"){if(h=P(s),h)h.closeBracket(n),p(s,a);else return"error";return"bracket"}else return n=="{"||n=="["?(h=c.DEFAULT,h=new h,w(s,h),"bracket"):/\d/.test(n)?(u.eatWhile(/[\w.%]/),"atom"):(u.eatWhile(/[\w\-_]/),h=T(s),h.name=="begin"&&(h.argument=u.current()),h.styleIdentifier())}function o(u,s,h){if(u.eatSpace())return null;if(h&&u.match(h))return p(s,d),"keyword";if(u.match(/^\\[a-zA-Z@]+/))return"tag";if(u.match(/^[a-zA-Z]+/))return"variable-2";if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/]/))return"tag";if(u.match(/^[\^_&]/))return"tag";if(u.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(u.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var i=u.next();return i=="{"||i=="}"||i=="["||i=="]"||i=="("||i==")"?"bracket":i=="%"?(u.skipToEnd(),"comment"):"error"}function a(u,s){var h=u.peek(),i;return h=="{"||h=="["?(i=P(s),i.openBracket(h),u.eat(h),p(s,d),"bracket"):/[ \t\r]/.test(h)?(u.eat(h),null):(p(s,d),b(s),d(u,s))}return{startState:function(){var u=j.inMathMode?function(s,h){return o(s,h)}:d;return{cmdState:[],f:u}},copyState:function(u){return{cmdState:u.cmdState.slice(),f:u.f}},token:function(u,s){return s.f(u,s)},blankLine:function(u){u.f=d,u.cmdState.length=0},lineComment:"%"}}),le.defineMIME("text/x-stex","stex"),le.defineMIME("text/x-latex","stex")})},"+QRC":function(et,Ve,z){"use strict";var le=z("E9nw"),Q={"text/plain":"Text","text/html":"Url",default:"Text"},j="Copy to clipboard: #{key}, Enter";function w(b){var T=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return b.replace(/#{\s*key\s*}/g,T)}function P(b,T){var C,c,p,d,o,a,u=!1;T||(T={}),C=T.debug||!1;try{p=le(),d=document.createRange(),o=document.getSelection(),a=document.createElement("span"),a.textContent=b,a.style.all="unset",a.style.position="fixed",a.style.top=0,a.style.clip="rect(0, 0, 0, 0)",a.style.whiteSpace="pre",a.style.webkitUserSelect="text",a.style.MozUserSelect="text",a.style.msUserSelect="text",a.style.userSelect="text",a.addEventListener("copy",function(h){if(h.stopPropagation(),T.format)if(h.preventDefault(),typeof h.clipboardData=="undefined"){C&&console.warn("unable to use e.clipboardData"),C&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var i=Q[T.format]||Q.default;window.clipboardData.setData(i,b)}else h.clipboardData.clearData(),h.clipboardData.setData(T.format,b);T.onCopy&&(h.preventDefault(),T.onCopy(h.clipboardData))}),document.body.appendChild(a),d.selectNodeContents(a),o.addRange(d);var s=document.execCommand("copy");if(!s)throw new Error("copy command was unsuccessful");u=!0}catch(h){C&&console.error("unable to copy using execCommand: ",h),C&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(T.format||"text",b),T.onCopy&&T.onCopy(window.clipboardData),u=!0}catch(i){C&&console.error("unable to copy using clipboardData: ",i),C&&console.error("falling back to prompt"),c=w("message"in T?T.message:j),window.prompt(c,b)}}finally{o&&(typeof o.removeRange=="function"?o.removeRange(d):o.removeAllRanges()),a&&document.body.removeChild(a),p()}return u}et.exports=P},"07cG":function(et,Ve,z){et.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},"0r65":function(et,Ve){var z=arguments[3],le=arguments[4],Q=arguments[5],j=JSON.stringify;et.exports=function(w,P){for(var b,T=Object.keys(Q),C=0,c=T.length;C")):null:S.match("--")?A(s("comment","-->")):S.match("DOCTYPE",!0,!0)?(S.eatWhile(/[\w\._\-]/),A(h(1))):null:S.eat("?")?(S.eatWhile(/[\w\._\-]/),O.tokenize=s("meta","?>"),"meta"):(p=S.eat("/")?"closeTag":"openTag",O.tokenize=a,"tag bracket");if(D=="&"){var I;return S.eat("#")?S.eat("x")?I=S.eatWhile(/[a-fA-F\d]/)&&S.eat(";"):I=S.eatWhile(/[\d]/)&&S.eat(";"):I=S.eatWhile(/[\w\.\-:]/)&&S.eat(";"),I?"atom":"error"}else return S.eatWhile(/[^&<]/),null}o.isInText=!0;function a(S,O){var A=S.next();if(A==">"||A=="/"&&S.eat(">"))return O.tokenize=o,p=A==">"?"endTag":"selfcloseTag","tag bracket";if(A=="=")return p="equals",null;if(A=="<"){O.tokenize=o,O.state=f,O.tagName=O.tagStart=null;var D=O.tokenize(S,O);return D?D+" tag error":"tag error"}else return/[\'\"]/.test(A)?(O.tokenize=u(A),O.stringStartCol=S.column(),O.tokenize(S,O)):(S.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function u(S){var O=function(A,D){for(;!A.eol();)if(A.next()==S){D.tokenize=a;break}return"string"};return O.isInAttribute=!0,O}function s(S,O){return function(A,D){for(;!A.eol();){if(A.match(O)){D.tokenize=o;break}A.next()}return S}}function h(S){return function(O,A){for(var D;(D=O.next())!=null;){if(D=="<")return A.tokenize=h(S+1),A.tokenize(O,A);if(D==">")if(S==1){A.tokenize=o;break}else return A.tokenize=h(S-1),A.tokenize(O,A)}return"meta"}}function i(S,O,A){this.prev=S.context,this.tagName=O,this.indent=S.indented,this.startOfLine=A,(T.doNotIndent.hasOwnProperty(O)||S.context&&S.context.noIndent)&&(this.noIndent=!0)}function n(S){S.context&&(S.context=S.context.prev)}function t(S,O){for(var A;;){if(!S.context)return;if(A=S.context.tagName,!T.contextGrabbers.hasOwnProperty(A)||!T.contextGrabbers[A].hasOwnProperty(O))return;n(S)}}function f(S,O,A){return S=="openTag"?(A.tagStart=O.column(),v):S=="closeTag"?m:f}function v(S,O,A){return S=="word"?(A.tagName=O.current(),d="tag",g):T.allowMissingTagName&&S=="endTag"?(d="tag bracket",g(S,O,A)):(d="error",v)}function m(S,O,A){if(S=="word"){var D=O.current();return A.context&&A.context.tagName!=D&&T.implicitlyClosed.hasOwnProperty(A.context.tagName)&&n(A),A.context&&A.context.tagName==D||T.matchClosing===!1?(d="tag",_):(d="tag error",E)}else return T.allowMissingTagName&&S=="endTag"?(d="tag bracket",_(S,O,A)):(d="error",E)}function _(S,O,A){return S!="endTag"?(d="error",_):(n(A),f)}function E(S,O,A){return d="error",_(S,O,A)}function g(S,O,A){if(S=="word")return d="attribute",y;if(S=="endTag"||S=="selfcloseTag"){var D=A.tagName,I=A.tagStart;return A.tagName=A.tagStart=null,S=="selfcloseTag"||T.autoSelfClosers.hasOwnProperty(D)?t(A,D):(t(A,D),A.context=new i(A,D,I==A.indented)),f}return d="error",g}function y(S,O,A){return S=="equals"?x:(T.allowMissing||(d="error"),g(S,O,A))}function x(S,O,A){return S=="string"?l:S=="word"&&T.allowUnquoted?(d="string",g):(d="error",g(S,O,A))}function l(S,O,A){return S=="string"?l:g(S,O,A)}return{startState:function(S){var O={tokenize:o,state:f,indented:S||0,tagName:null,tagStart:null,context:null};return S!=null&&(O.baseIndent=S),O},token:function(S,O){if(!O.tagName&&S.sol()&&(O.indented=S.indentation()),S.eatSpace())return null;p=null;var A=O.tokenize(S,O);return(A||p)&&A!="comment"&&(d=null,O.state=O.state(p||A,S,O),d&&(A=d=="error"?A+" error":d)),A},indent:function(S,O,A){var D=S.context;if(S.tokenize.isInAttribute)return S.tagStart==S.indented?S.stringStartCol+1:S.indented+b;if(D&&D.noIndent)return le.Pass;if(S.tokenize!=a&&S.tokenize!=o)return A?A.match(/^(\s*)/)[0].length:0;if(S.tagName)return T.multilineTagIndentPastTag!==!1?S.tagStart+S.tagName.length+2:S.tagStart+b*(T.multilineTagIndentFactor||1);if(T.alignCDATA&&/$/,blockCommentStart:"",configuration:T.htmlMode?"html":"xml",helperType:T.htmlMode?"html":"xml",skipAttribute:function(S){S.state==x&&(S.state=g)},xmlCurrentTag:function(S){return S.tagName?{name:S.tagName,close:S.type=="closeTag"}:null},xmlCurrentContext:function(S){for(var O=[],A=S.context;A;A=A.prev)A.tagName&&O.push(A.tagName);return O.reverse()}}}),le.defineMIME("text/xml","xml"),le.defineMIME("application/xml","xml"),le.mimeModes.hasOwnProperty("text/html")||le.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1j5w":function(et,Ve,z){"use strict";z.d(Ve,"d",function(){return q}),z.d(Ve,"b",function(){return Ze}),z.d(Ve,"c",function(){return Ct}),z.d(Ve,"a",function(){return Qt});var le=z("VTBJ"),Q=z("1OyB"),j=z("vuIU"),w=z("JX7q"),P=z("Ji7U"),b=z("LK+K"),T=z("q1tI"),C=z("I8Z2"),c=z("BGR+"),p=z("wx14"),d=z("rePB"),o=z("4IlW"),a=z("2GS6"),u=z("Gytx"),s=z.n(u),h=z("TSYQ"),i=z.n(h),n=z("U8pU"),t=z("ODXe"),f=/iPhone/i,v=/iPod/i,m=/iPad/i,_=/\bAndroid(?:.+)Mobile\b/i,E=/Android/i,g=/\bAndroid(?:.+)SD4930UR\b/i,y=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,x=/Windows Phone/i,l=/\bWindows(?:.+)ARM\b/i,S=/BlackBerry/i,O=/BB10/i,A=/Opera Mini/i,D=/\b(CriOS|Chrome)(?:.+)Mobile/i,I=/Mobile(?:.+)Firefox\b/i;function B(Lt,at){return Lt.test(at)}function H(Lt){var at=Lt||(typeof navigator!="undefined"?navigator.userAgent:""),pt=at.split("[FBAN");if(typeof pt[1]!="undefined"){var st=pt,De=Object(t.a)(st,1);at=De[0]}if(pt=at.split("Twitter"),typeof pt[1]!="undefined"){var Ke=pt,yt=Object(t.a)(Ke,1);at=yt[0]}var ot={apple:{phone:B(f,at)&&!B(x,at),ipod:B(v,at),tablet:!B(f,at)&&B(m,at)&&!B(x,at),device:(B(f,at)||B(v,at)||B(m,at))&&!B(x,at)},amazon:{phone:B(g,at),tablet:!B(g,at)&&B(y,at),device:B(g,at)||B(y,at)},android:{phone:!B(x,at)&&B(g,at)||!B(x,at)&&B(_,at),tablet:!B(x,at)&&!B(g,at)&&!B(_,at)&&(B(y,at)||B(E,at)),device:!B(x,at)&&(B(g,at)||B(y,at)||B(_,at)||B(E,at))||B(/\bokhttp\b/i,at)},windows:{phone:B(x,at),tablet:B(l,at),device:B(x,at)||B(l,at)},other:{blackberry:B(S,at),blackberry10:B(O,at),opera:B(A,at),firefox:B(I,at),chrome:B(D,at),device:B(S,at)||B(O,at)||B(A,at)||B(I,at)||B(D,at)},any:null,phone:null,tablet:null};return ot.any=ot.apple.device||ot.android.device||ot.windows.device||ot.other.device,ot.phone=ot.apple.phone||ot.android.phone||ot.windows.phone,ot.tablet=ot.apple.tablet||ot.android.tablet||ot.windows.tablet,ot}var te=Object(le.a)(Object(le.a)({},H()),{},{isMobile:H}),W=te;function V(){}function X(Lt,at,pt){var st=at||"";return Lt.key||"".concat(st,"item_").concat(pt)}function ne(Lt){return"".concat(Lt,"-menu-")}function Y(Lt,at){var pt=-1;T.Children.forEach(Lt,function(st){pt+=1,st&&st.type&&st.type.isMenuItemGroup?T.Children.forEach(st.props.children,function(De){pt+=1,at(De,pt)}):at(st,pt)})}function ee(Lt,at,pt){if(!Lt||pt.find)return;T.Children.forEach(Lt,function(st){if(st){var De=st.type;if(!De||!(De.isSubMenu||De.isMenuItem||De.isMenuItemGroup))return;at.indexOf(st.key)!==-1?pt.find=!0:st.props.children&&ee(st.props.children,at,pt)}})}var ce=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],de=function(at){var pt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,st=at&&typeof at.getBoundingClientRect=="function"&&at.getBoundingClientRect().width;if(st){if(pt){var De=getComputedStyle(at),Ke=De.marginLeft,yt=De.marginRight;st+=+Ke.replace("px","")+ +yt.replace("px","")}st=+st.toFixed(6)}return st||0},Ce=function(at,pt,st){at&&Object(n.a)(at.style)==="object"&&(at.style[pt]=st)},Se=function(){return W.any},Pe=z("KQm4"),ye=z("Ff2n"),Ee=z("i8i4"),Ge=z("bdgK"),Ue=z("uciX"),Fe=z("8XRh"),He={adjustX:1,adjustY:1},be={topLeft:{points:["bl","tl"],overflow:He,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:He,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:He,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:He,offset:[4,0]}},me={topLeft:{points:["bl","tl"],overflow:He,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:He,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:He,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:He,offset:[4,0]}},We=be,ze=0,nt={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},re=function(at,pt,st){var De=ne(pt),Ke=at.getState();at.setState({defaultActiveFirst:Object(le.a)(Object(le.a)({},Ke.defaultActiveFirst),{},Object(d.a)({},De,st))})},k=function(Lt){Object(P.a)(pt,Lt);var at=Object(b.a)(pt);function pt(st){var De;Object(Q.a)(this,pt),De=at.call(this,st),De.onDestroy=function(rt){De.props.onDestroy(rt)},De.onKeyDown=function(rt){var Tt=rt.keyCode,Ft=De.menuInstance,zt=De.props,Zt=zt.isOpen,Re=zt.store;if(Tt===o.a.ENTER)return De.onTitleClick(rt),re(Re,De.props.eventKey,!0),!0;if(Tt===o.a.RIGHT)return Zt?Ft.onKeyDown(rt):(De.triggerOpenChange(!0),re(Re,De.props.eventKey,!0)),!0;if(Tt===o.a.LEFT){var ve;if(Zt)ve=Ft.onKeyDown(rt);else return;return ve||(De.triggerOpenChange(!1),ve=!0),ve}return Zt&&(Tt===o.a.UP||Tt===o.a.DOWN)?Ft.onKeyDown(rt):void 0},De.onOpenChange=function(rt){De.props.onOpenChange(rt)},De.onPopupVisibleChange=function(rt){De.triggerOpenChange(rt,rt?"mouseenter":"mouseleave")},De.onMouseEnter=function(rt){var Tt=De.props,Ft=Tt.eventKey,zt=Tt.onMouseEnter,Zt=Tt.store;re(Zt,De.props.eventKey,!1),zt({key:Ft,domEvent:rt})},De.onMouseLeave=function(rt){var Tt=De.props,Ft=Tt.parentMenu,zt=Tt.eventKey,Zt=Tt.onMouseLeave;Ft.subMenuInstance=Object(w.a)(De),Zt({key:zt,domEvent:rt})},De.onTitleMouseEnter=function(rt){var Tt=De.props,Ft=Tt.eventKey,zt=Tt.onItemHover,Zt=Tt.onTitleMouseEnter;zt({key:Ft,hover:!0}),Zt({key:Ft,domEvent:rt})},De.onTitleMouseLeave=function(rt){var Tt=De.props,Ft=Tt.parentMenu,zt=Tt.eventKey,Zt=Tt.onItemHover,Re=Tt.onTitleMouseLeave;Ft.subMenuInstance=Object(w.a)(De),Zt({key:zt,hover:!1}),Re({key:zt,domEvent:rt})},De.onTitleClick=function(rt){var Tt=Object(w.a)(De),Ft=Tt.props;if(Ft.onTitleClick({key:Ft.eventKey,domEvent:rt}),Ft.triggerSubMenuAction==="hover")return;De.triggerOpenChange(!Ft.isOpen,"click"),re(Ft.store,De.props.eventKey,!1)},De.onSubMenuClick=function(rt){typeof De.props.onClick=="function"&&De.props.onClick(De.addKeyPath(rt))},De.onSelect=function(rt){De.props.onSelect(rt)},De.onDeselect=function(rt){De.props.onDeselect(rt)},De.getPrefixCls=function(){return"".concat(De.props.rootPrefixCls,"-submenu")},De.getActiveClassName=function(){return"".concat(De.getPrefixCls(),"-active")},De.getDisabledClassName=function(){return"".concat(De.getPrefixCls(),"-disabled")},De.getSelectedClassName=function(){return"".concat(De.getPrefixCls(),"-selected")},De.getOpenClassName=function(){return"".concat(De.props.rootPrefixCls,"-submenu-open")},De.saveMenuInstance=function(rt){De.menuInstance=rt},De.addKeyPath=function(rt){return Object(le.a)(Object(le.a)({},rt),{},{keyPath:(rt.keyPath||[]).concat(De.props.eventKey)})},De.triggerOpenChange=function(rt,Tt){var Ft=De.props.eventKey,zt=function(){De.onOpenChange({key:Ft,item:Object(w.a)(De),trigger:Tt,open:rt})};Tt==="mouseenter"?De.mouseenterTimeout=setTimeout(function(){zt()},0):zt()},De.isChildrenSelected=function(){var rt={find:!1};return ee(De.props.children,De.props.selectedKeys,rt),rt.find},De.isOpen=function(){return De.props.openKeys.indexOf(De.props.eventKey)!==-1},De.adjustWidth=function(){if(!De.subMenuTitle||!De.menuInstance)return;var rt=Ee.findDOMNode(De.menuInstance);if(rt.offsetWidth>=De.subMenuTitle.offsetWidth)return;rt.style.minWidth="".concat(De.subMenuTitle.offsetWidth,"px")},De.saveSubMenuTitle=function(rt){De.subMenuTitle=rt},De.getBaseProps=function(){var rt=Object(w.a)(De),Tt=rt.props;return{mode:Tt.mode==="horizontal"?"vertical":Tt.mode,visible:De.props.isOpen,level:Tt.level+1,inlineIndent:Tt.inlineIndent,focusable:!1,onClick:De.onSubMenuClick,onSelect:De.onSelect,onDeselect:De.onDeselect,onDestroy:De.onDestroy,selectedKeys:Tt.selectedKeys,eventKey:"".concat(Tt.eventKey,"-menu-"),openKeys:Tt.openKeys,motion:Tt.motion,onOpenChange:De.onOpenChange,subMenuOpenDelay:Tt.subMenuOpenDelay,parentMenu:Object(w.a)(De),subMenuCloseDelay:Tt.subMenuCloseDelay,forceSubMenuRender:Tt.forceSubMenuRender,triggerSubMenuAction:Tt.triggerSubMenuAction,builtinPlacements:Tt.builtinPlacements,defaultActiveFirst:Tt.store.getState().defaultActiveFirst[ne(Tt.eventKey)],multiple:Tt.multiple,prefixCls:Tt.rootPrefixCls,id:De.internalMenuId,manualRef:De.saveMenuInstance,itemIcon:Tt.itemIcon,expandIcon:Tt.expandIcon,direction:Tt.direction}},De.getMotion=function(rt,Tt){var Ft=Object(w.a)(De),zt=Ft.haveRendered,Zt=De.props,Re=Zt.motion,ve=Zt.rootPrefixCls,K=Object(le.a)(Object(le.a)({},Re),{},{leavedClassName:"".concat(ve,"-hidden"),removeOnLeave:!1,motionAppear:zt||!Tt||rt!=="inline"});return K};var Ke=st.store,yt=st.eventKey,ot=Ke.getState(),kt=ot.defaultActiveFirst;De.isRootMenu=!1;var Dt=!1;return kt&&(Dt=kt[yt]),re(Ke,yt,Dt),De}return Object(j.a)(pt,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var De=this,Ke=this.props,yt=Ke.mode,ot=Ke.parentMenu,kt=Ke.manualRef;if(kt&&kt(this),yt!=="horizontal"||!ot.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return De.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var De=this.props,Ke=De.onDestroy,yt=De.eventKey;Ke&&Ke(yt),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(De){var Ke=this,yt=this.getBaseProps(),ot=this.getMotion(yt.mode,yt.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||yt.visible||yt.forceSubMenuRender,!this.haveOpened)return T.createElement("div",null);var kt=yt.direction;return T.createElement(Fe.default,Object.assign({visible:yt.visible},ot),function(Dt){var rt=Dt.className,Tt=Dt.style,Ft=i()("".concat(yt.prefixCls,"-sub"),rt,Object(d.a)({},"".concat(yt.prefixCls,"-rtl"),kt==="rtl"));return T.createElement(Be,Object.assign({},yt,{id:Ke.internalMenuId,className:Ft,style:Tt}),De)})}},{key:"render",value:function(){var De,Ke=Object(le.a)({},this.props),yt=Ke.isOpen,ot=this.getPrefixCls(),kt=Ke.mode==="inline",Dt=i()(ot,"".concat(ot,"-").concat(Ke.mode),(De={},Object(d.a)(De,Ke.className,!!Ke.className),Object(d.a)(De,this.getOpenClassName(),yt),Object(d.a)(De,this.getActiveClassName(),Ke.active||yt&&!kt),Object(d.a)(De,this.getDisabledClassName(),Ke.disabled),Object(d.a)(De,this.getSelectedClassName(),this.isChildrenSelected()),De));this.internalMenuId||(Ke.eventKey?this.internalMenuId="".concat(Ke.eventKey,"$Menu"):(ze+=1,this.internalMenuId="$__$".concat(ze,"$Menu")));var rt={},Tt={},Ft={};Ke.disabled||(rt={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},Tt={onClick:this.onTitleClick},Ft={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var zt={},Zt=Ke.direction;kt&&(Zt==="rtl"?zt.paddingRight=Ke.inlineIndent*Ke.level:zt.paddingLeft=Ke.inlineIndent*Ke.level);var Re={};this.props.isOpen&&(Re={"aria-owns":this.internalMenuId});var ve=null;Ke.mode!=="horizontal"&&(ve=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(ve=T.createElement(this.props.expandIcon,Object(le.a)({},this.props))));var K=T.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:zt,className:"".concat(ot,"-title"),role:"button"},Ft,Tt,{"aria-expanded":yt},Re,{"aria-haspopup":"true",title:typeof Ke.title=="string"?Ke.title:void 0}),Ke.title,ve||T.createElement("i",{className:"".concat(ot,"-arrow")})),Z=this.renderChildren(Ke.children),oe=Ke.parentMenu.isRootMenu?Ke.parentMenu.props.getPopupContainer:function(cn){return cn.parentNode},he=nt[Ke.mode],Oe=Ke.popupOffset?{offset:Ke.popupOffset}:{},Je=Ke.mode==="inline"?"":Ke.popupClassName;Je+=Zt==="rtl"?" ".concat(ot,"-rtl"):"";var lt=Ke.disabled,Pt=Ke.triggerSubMenuAction,Nt=Ke.subMenuOpenDelay,ht=Ke.forceSubMenuRender,Mt=Ke.subMenuCloseDelay,nn=Ke.builtinPlacements;ce.forEach(function(cn){return delete Ke[cn]}),delete Ke.onClick;var Rt=Zt==="rtl"?Object.assign({},me,nn):Object.assign({},be,nn);return delete Ke.direction,T.createElement("li",Object.assign({},Ke,rt,{className:Dt,role:"menuitem"}),kt&&K,kt&&Z,!kt&&T.createElement(Ue.a,{prefixCls:ot,popupClassName:i()("".concat(ot,"-popup"),Je),getPopupContainer:oe,builtinPlacements:Rt,popupPlacement:he,popupVisible:yt,popupAlign:Oe,popup:Z,action:lt?[]:[Pt],mouseEnterDelay:Nt,mouseLeaveDelay:Mt,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:ht},K))}}]),pt}(T.Component);k.defaultProps={onMouseEnter:V,onMouseLeave:V,onTitleMouseEnter:V,onTitleMouseLeave:V,onTitleClick:V,manualRef:V,mode:"vertical",title:""};var U=Object(C.b)(function(Lt,at){var pt=Lt.openKeys,st=Lt.activeKey,De=Lt.selectedKeys,Ke=at.eventKey,yt=at.subMenuKey;return{isOpen:pt.indexOf(Ke)>-1,active:st[yt]===Ke,selectedKeys:De}})(k);U.isSubMenu=!0;var q=U,$="menuitem-overflowed",J=.5,xe=function(Lt){Object(P.a)(pt,Lt);var at=Object(b.a)(pt);function pt(){var st;return Object(Q.a)(this,pt),st=at.apply(this,arguments),st.resizeObserver=null,st.mutationObserver=null,st.originalTotalWidth=0,st.overflowedItems=[],st.menuItemSizes=[],st.cancelFrameId=null,st.state={lastVisibleIndex:void 0},st.getMenuItemNodes=function(){var De=st.props.prefixCls,Ke=Ee.findDOMNode(Object(w.a)(st));return Ke?[].slice.call(Ke.children).filter(function(yt){return yt.className.split(" ").indexOf("".concat(De,"-overflowed-submenu"))<0}):[]},st.getOverflowedSubMenuItem=function(De,Ke,yt){var ot=st.props,kt=ot.overflowedIndicator,Dt=ot.level,rt=ot.mode,Tt=ot.prefixCls,Ft=ot.theme;if(Dt!==1||rt!=="horizontal")return null;var zt=st.props.children[0],Zt=zt.props,Re=Zt.children,ve=Zt.title,K=Zt.style,Z=Object(ye.a)(Zt,["children","title","style"]),oe=Object(le.a)({},K),he="".concat(De,"-overflowed-indicator"),Oe="".concat(De,"-overflowed-indicator");Ke.length===0&&yt!==!0?oe=Object(le.a)(Object(le.a)({},oe),{},{display:"none"}):yt&&(oe=Object(le.a)(Object(le.a)({},oe),{},{visibility:"hidden",position:"absolute"}),he="".concat(he,"-placeholder"),Oe="".concat(Oe,"-placeholder"));var Je=Ft?"".concat(Tt,"-").concat(Ft):"",lt={};return ce.forEach(function(Pt){Z[Pt]!==void 0&&(lt[Pt]=Z[Pt])}),T.createElement(q,Object.assign({title:kt,className:"".concat(Tt,"-overflowed-submenu"),popupClassName:Je},lt,{key:he,eventKey:Oe,disabled:!1,style:oe}),Ke)},st.setChildrenWidthAndResize=function(){if(st.props.mode!=="horizontal")return;var De=Ee.findDOMNode(Object(w.a)(st));if(!De)return;var Ke=De.children;if(!Ke||Ke.length===0)return;var yt=De.children[Ke.length-1];Ce(yt,"display","inline-block");var ot=st.getMenuItemNodes(),kt=ot.filter(function(Dt){return Dt.className.split(" ").indexOf($)>=0});kt.forEach(function(Dt){Ce(Dt,"display","inline-block")}),st.menuItemSizes=ot.map(function(Dt){return de(Dt,!0)}),kt.forEach(function(Dt){Ce(Dt,"display","none")}),st.overflowedIndicatorWidth=de(De.children[De.children.length-1],!0),st.originalTotalWidth=st.menuItemSizes.reduce(function(Dt,rt){return Dt+rt},0),st.handleResize(),Ce(yt,"display","none")},st.handleResize=function(){if(st.props.mode!=="horizontal")return;var De=Ee.findDOMNode(Object(w.a)(st));if(!De)return;var Ke=de(De);st.overflowedItems=[];var yt=0,ot;st.originalTotalWidth>Ke+J&&(ot=-1,st.menuItemSizes.forEach(function(kt){yt+=kt,yt+st.overflowedIndicatorWidth<=Ke&&(ot+=1)})),st.setState({lastVisibleIndex:ot})},st}return Object(j.a)(pt,[{key:"componentDidMount",value:function(){var De=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var Ke=Ee.findDOMNode(this);if(!Ke)return;this.resizeObserver=new Ge.default(function(yt){yt.forEach(function(){var ot=De.cancelFrameId;cancelAnimationFrame(ot),De.cancelFrameId=requestAnimationFrame(De.setChildrenWidthAndResize)})}),[].slice.call(Ke.children).concat(Ke).forEach(function(yt){De.resizeObserver.observe(yt)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){De.resizeObserver.disconnect(),[].slice.call(Ke.children).concat(Ke).forEach(function(yt){De.resizeObserver.observe(yt)}),De.setChildrenWidthAndResize()}),this.mutationObserver.observe(Ke,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(De){var Ke=this,yt=this.state.lastVisibleIndex;return(De||[]).reduce(function(ot,kt,Dt){var rt=kt;if(Ke.props.mode==="horizontal"){var Tt=Ke.getOverflowedSubMenuItem(kt.props.eventKey,[]);yt!==void 0&&Ke.props.className.indexOf("".concat(Ke.props.prefixCls,"-root"))!==-1&&(Dt>yt&&(rt=T.cloneElement(kt,{style:{display:"none"},eventKey:"".concat(kt.props.eventKey,"-hidden"),className:"".concat($)})),Dt===yt+1&&(Ke.overflowedItems=De.slice(yt+1).map(function(zt){return T.cloneElement(zt,{key:zt.props.eventKey,mode:"vertical-left"})}),Tt=Ke.getOverflowedSubMenuItem(kt.props.eventKey,Ke.overflowedItems)));var Ft=[].concat(Object(Pe.a)(ot),[Tt,rt]);return Dt===De.length-1&&Ft.push(Ke.getOverflowedSubMenuItem(kt.props.eventKey,[],!0)),Ft}return[].concat(Object(Pe.a)(ot),[rt])},[])}},{key:"render",value:function(){var De=this.props,Ke=De.visible,yt=De.prefixCls,ot=De.overflowedIndicator,kt=De.mode,Dt=De.level,rt=De.tag,Tt=De.children,Ft=De.theme,zt=Object(ye.a)(De,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),Zt=rt;return T.createElement(Zt,Object.assign({},zt),this.renderChildren(Tt))}}]),pt}(T.Component);xe.defaultProps={tag:"div",className:""};var ke=xe;function dt(Lt){return Lt.length?Lt.every(function(at){return!!at.props.disabled}):!0}function Ne(Lt,at,pt){var st=Lt.getState();Lt.setState({activeKey:Object(le.a)(Object(le.a)({},st.activeKey),{},Object(d.a)({},at,pt))})}function je(Lt){return Lt.eventKey||"0-menu-"}function tt(Lt,at){var pt=at,st=Lt.children,De=Lt.eventKey;if(pt){var Ke;if(Y(st,function(yt,ot){yt&&yt.props&&!yt.props.disabled&&pt===X(yt,De,ot)&&(Ke=!0)}),Ke)return pt}return pt=null,Lt.defaultActiveFirst&&Y(st,function(yt,ot){!pt&&yt&&!yt.props.disabled&&(pt=X(yt,De,ot))}),pt}function mt(Lt){if(Lt){var at=this.instanceArray.indexOf(Lt);at!==-1?this.instanceArray[at]=Lt:this.instanceArray.push(Lt)}}var Qe=function(Lt){Object(P.a)(pt,Lt);var at=Object(b.a)(pt);function pt(st){var De;return Object(Q.a)(this,pt),De=at.call(this,st),De.onKeyDown=function(Ke,yt){var ot=Ke.keyCode,kt;if(De.getFlatInstanceArray().forEach(function(rt){rt&&rt.props.active&&rt.onKeyDown&&(kt=rt.onKeyDown(Ke))}),kt)return 1;var Dt=null;return(ot===o.a.UP||ot===o.a.DOWN)&&(Dt=De.step(ot===o.a.UP?-1:1)),Dt?(Ke.preventDefault(),Ne(De.props.store,je(De.props),Dt.props.eventKey),typeof yt=="function"&&yt(Dt),1):void 0},De.onItemHover=function(Ke){var yt=Ke.key,ot=Ke.hover;Ne(De.props.store,je(De.props),ot?yt:null)},De.onDeselect=function(Ke){De.props.onDeselect(Ke)},De.onSelect=function(Ke){De.props.onSelect(Ke)},De.onClick=function(Ke){De.props.onClick(Ke)},De.onOpenChange=function(Ke){De.props.onOpenChange(Ke)},De.onDestroy=function(Ke){De.props.onDestroy(Ke)},De.getFlatInstanceArray=function(){return De.instanceArray},De.step=function(Ke){var yt=De.getFlatInstanceArray(),ot=De.props.store.getState().activeKey[je(De.props)],kt=yt.length;if(!kt)return null;Ke<0&&(yt=yt.concat().reverse());var Dt=-1;if(yt.every(function(zt,Zt){return zt&&zt.props.eventKey===ot?(Dt=Zt,!1):!0}),!De.props.defaultActiveFirst&&Dt!==-1&&dt(yt.slice(Dt,kt-1)))return;var rt=(Dt+1)%kt,Tt=rt;do{var Ft=yt[Tt];if(!Ft||Ft.props.disabled)Tt=(Tt+1)%kt;else return Ft}while(Tt!==rt);return null},De.renderCommonMenuItem=function(Ke,yt,ot){var kt=De.props.store.getState(),Dt=Object(w.a)(De),rt=Dt.props,Tt=X(Ke,rt.eventKey,yt),Ft=Ke.props;if(!Ft||typeof Ke.type=="string")return Ke;var zt=Tt===kt.activeKey,Zt=Object(le.a)(Object(le.a)({mode:Ft.mode||rt.mode,level:rt.level,inlineIndent:rt.inlineIndent,renderMenuItem:De.renderMenuItem,rootPrefixCls:rt.prefixCls,index:yt,parentMenu:rt.parentMenu,manualRef:Ft.disabled?void 0:Object(a.a)(Ke.ref,mt.bind(Object(w.a)(De))),eventKey:Tt,active:!Ft.disabled&&zt,multiple:rt.multiple,onClick:function(ve){(Ft.onClick||V)(ve),De.onClick(ve)},onItemHover:De.onItemHover,motion:rt.motion,subMenuOpenDelay:rt.subMenuOpenDelay,subMenuCloseDelay:rt.subMenuCloseDelay,forceSubMenuRender:rt.forceSubMenuRender,onOpenChange:De.onOpenChange,onDeselect:De.onDeselect,onSelect:De.onSelect,builtinPlacements:rt.builtinPlacements,itemIcon:Ft.itemIcon||De.props.itemIcon,expandIcon:Ft.expandIcon||De.props.expandIcon},ot),{},{direction:rt.direction});return(rt.mode==="inline"||Se())&&(Zt.triggerSubMenuAction="click"),T.cloneElement(Ke,Zt)},De.renderMenuItem=function(Ke,yt,ot){if(!Ke)return null;var kt=De.props.store.getState(),Dt={openKeys:kt.openKeys,selectedKeys:kt.selectedKeys,triggerSubMenuAction:De.props.triggerSubMenuAction,subMenuKey:ot};return De.renderCommonMenuItem(Ke,yt,Dt)},st.store.setState({activeKey:Object(le.a)(Object(le.a)({},st.store.getState().activeKey),{},Object(d.a)({},st.eventKey,tt(st,st.activeKey)))}),De.instanceArray=[],De}return Object(j.a)(pt,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(De){return this.props.visible||De.visible||this.props.className!==De.className||!s()(this.props.style,De.style)}},{key:"componentDidUpdate",value:function(De){var Ke=this.props,yt="activeKey"in Ke?Ke.activeKey:Ke.store.getState().activeKey[je(Ke)],ot=tt(Ke,yt);if(ot!==yt)Ne(Ke.store,je(Ke),ot);else if("activeKey"in De){var kt=tt(De,De.activeKey);ot!==kt&&Ne(Ke.store,je(Ke),ot)}}},{key:"render",value:function(){var De=this,Ke=Object(p.a)({},this.props);this.instanceArray=[];var yt=i()(Ke.prefixCls,Ke.className,"".concat(Ke.prefixCls,"-").concat(Ke.mode)),ot={className:yt,role:Ke.role||"menu"};Ke.id&&(ot.id=Ke.id),Ke.focusable&&(ot.tabIndex=0,ot.onKeyDown=this.onKeyDown);var kt=Ke.prefixCls,Dt=Ke.eventKey,rt=Ke.visible,Tt=Ke.level,Ft=Ke.mode,zt=Ke.overflowedIndicator,Zt=Ke.theme;return ce.forEach(function(Re){return delete Ke[Re]}),delete Ke.onClick,T.createElement(ke,Object.assign({},Ke,{prefixCls:kt,mode:Ft,tag:"ul",level:Tt,theme:Zt,visible:rt,overflowedIndicator:zt},ot),T.Children.map(Ke.children,function(Re,ve){return De.renderMenuItem(Re,ve,Dt||"0-menu-")}))}}]),pt}(T.Component);Qe.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:V};var Xe=Object(C.b)()(Qe),Be=Xe,Ie=z("Kwbf");function Me(Lt,at,pt){var st=Lt.prefixCls,De=Lt.motion,Ke=Lt.defaultMotions,yt=Ke===void 0?{}:Ke,ot=Lt.openAnimation,kt=Lt.openTransitionName,Dt=at.switchingModeFromInline;if(De)return De;if(Object(n.a)(ot)==="object"&&ot)Object(Ie.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof ot=="string")return{motionName:"".concat(st,"-open-").concat(ot)};if(kt)return{motionName:kt};var rt=yt[pt];return rt||(Dt?null:yt.other)}var _e=function(Lt){Object(P.a)(pt,Lt);var at=Object(b.a)(pt);function pt(st){var De;Object(Q.a)(this,pt),De=at.call(this,st),De.inlineOpenKeys=[],De.onSelect=function(ot){var kt=Object(w.a)(De),Dt=kt.props;if(Dt.selectable){var rt=De.store.getState(),Tt=rt.selectedKeys,Ft=ot.key;Dt.multiple?Tt=Tt.concat([Ft]):Tt=[Ft],"selectedKeys"in Dt||De.store.setState({selectedKeys:Tt}),Dt.onSelect(Object(le.a)(Object(le.a)({},ot),{},{selectedKeys:Tt}))}},De.onClick=function(ot){var kt=De.getRealMenuMode(),Dt=Object(w.a)(De),rt=Dt.store,Tt=Dt.props.onOpenChange;kt!=="inline"&&!("openKeys"in De.props)&&(rt.setState({openKeys:[]}),Tt([])),De.props.onClick(ot)},De.onKeyDown=function(ot,kt){De.innerMenu.getWrappedInstance().onKeyDown(ot,kt)},De.onOpenChange=function(ot){var kt=Object(w.a)(De),Dt=kt.props,rt=De.store.getState().openKeys.concat(),Tt=!1,Ft=function(Zt){var Re=!1;if(Zt.open)Re=rt.indexOf(Zt.key)===-1,Re&&rt.push(Zt.key);else{var ve=rt.indexOf(Zt.key);Re=ve!==-1,Re&&rt.splice(ve,1)}Tt=Tt||Re};Array.isArray(ot)?ot.forEach(Ft):Ft(ot),Tt&&("openKeys"in De.props||De.store.setState({openKeys:rt}),Dt.onOpenChange(rt))},De.onDeselect=function(ot){var kt=Object(w.a)(De),Dt=kt.props;if(Dt.selectable){var rt=De.store.getState().selectedKeys.concat(),Tt=ot.key,Ft=rt.indexOf(Tt);Ft!==-1&&rt.splice(Ft,1),"selectedKeys"in Dt||De.store.setState({selectedKeys:rt}),Dt.onDeselect(Object(le.a)(Object(le.a)({},ot),{},{selectedKeys:rt}))}},De.onMouseEnter=function(ot){De.restoreModeVerticalFromInline();var kt=De.props.onMouseEnter;kt&&kt(ot)},De.onTransitionEnd=function(ot){var kt=ot.propertyName==="width"&&ot.target===ot.currentTarget,Dt=ot.target.className,rt=Object.prototype.toString.call(Dt)==="[object SVGAnimatedString]"?Dt.animVal:Dt,Tt=ot.propertyName==="font-size"&&rt.indexOf("anticon")>=0;(kt||Tt)&&De.restoreModeVerticalFromInline()},De.setInnerMenu=function(ot){De.innerMenu=ot},De.isRootMenu=!0;var Ke=st.defaultSelectedKeys,yt=st.defaultOpenKeys;return"selectedKeys"in st&&(Ke=st.selectedKeys||[]),"openKeys"in st&&(yt=st.openKeys||[]),De.store=Object(C.c)({selectedKeys:Ke,openKeys:yt,activeKey:{"0-menu-":tt(st,st.activeKey)}}),De.state={switchingModeFromInline:!1},De}return Object(j.a)(pt,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(De){this.updateOpentKeysWhenSwitchMode(De),this.updateMiniStore();var Ke=this.props,yt=Ke.siderCollapsed,ot=Ke.inlineCollapsed,kt=Ke.onOpenChange;(!De.inlineCollapsed&&ot||!De.siderCollapsed&&yt)&&kt([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(De){var Ke=this.props,yt=this.store,ot=this.inlineOpenKeys,kt=yt.getState(),Dt={};De.mode==="inline"&&Ke.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in Ke||((Ke.inlineCollapsed&&!De.inlineCollapsed||Ke.siderCollapsed&&!De.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=kt.openKeys.concat(),Dt.openKeys=[]),(!Ke.inlineCollapsed&&De.inlineCollapsed||!Ke.siderCollapsed&&De.siderCollapsed)&&(Dt.openKeys=ot,this.inlineOpenKeys=[])),Object.keys(Dt).length&&yt.setState(Dt)}},{key:"updateMenuDisplay",value:function(){var De=this.props.collapsedWidth,Ke=this.store,yt=this.prevOpenKeys,ot=this.getInlineCollapsed()&&(De===0||De==="0"||De==="0px");ot?(this.prevOpenKeys=Ke.getState().openKeys.concat(),this.store.setState({openKeys:[]})):yt&&(this.store.setState({openKeys:yt}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var De=this.props.mode,Ke=this.state.switchingModeFromInline,yt=this.getInlineCollapsed();return Ke&&yt?"inline":yt?"vertical":De}},{key:"getInlineCollapsed",value:function(){var De=this.props,Ke=De.inlineCollapsed,yt=De.siderCollapsed;return yt!==void 0?yt:Ke}},{key:"restoreModeVerticalFromInline",value:function(){var De=this.state.switchingModeFromInline;De&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var De=Object(le.a)({},Object(c.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),Ke=this.getRealMenuMode();return De.className+=" ".concat(De.prefixCls,"-root"),De.direction==="rtl"&&(De.className+=" ".concat(De.prefixCls,"-rtl")),De=Object(le.a)(Object(le.a)({},De),{},{mode:Ke,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Me(this.props,this.state,Ke)}),delete De.openAnimation,delete De.openTransitionName,T.createElement(C.a,{store:this.store},T.createElement(Be,Object.assign({},De,{ref:this.setInnerMenu}),this.props.children))}}]),pt}(T.Component);_e.defaultProps={selectable:!0,onClick:V,onSelect:V,onOpenChange:V,onDeselect:V,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:T.createElement("span",null,"\xB7\xB7\xB7")};var Ae=_e,Le=function(Lt){Object(P.a)(pt,Lt);var at=Object(b.a)(pt);function pt(){var st;return Object(Q.a)(this,pt),st=at.apply(this,arguments),st.onKeyDown=function(De){var Ke=De.keyCode;return Ke===o.a.ENTER?(st.onClick(De),!0):void 0},st.onMouseLeave=function(De){var Ke=st.props,yt=Ke.eventKey,ot=Ke.onItemHover,kt=Ke.onMouseLeave;ot({key:yt,hover:!1}),kt({key:yt,domEvent:De})},st.onMouseEnter=function(De){var Ke=st.props,yt=Ke.eventKey,ot=Ke.onItemHover,kt=Ke.onMouseEnter;ot({key:yt,hover:!0}),kt({key:yt,domEvent:De})},st.onClick=function(De){var Ke=st.props,yt=Ke.eventKey,ot=Ke.multiple,kt=Ke.onClick,Dt=Ke.onSelect,rt=Ke.onDeselect,Tt=Ke.isSelected,Ft={key:yt,keyPath:[yt],item:Object(w.a)(st),domEvent:De};kt(Ft),ot?Tt?rt(Ft):Dt(Ft):Tt||Dt(Ft)},st.saveNode=function(De){st.node=De},st}return Object(j.a)(pt,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var De=this.props;De.onDestroy&&De.onDestroy(De.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var De,Ke=Object(le.a)({},this.props),yt=i()(this.getPrefixCls(),Ke.className,(De={},Object(d.a)(De,this.getActiveClassName(),!Ke.disabled&&Ke.active),Object(d.a)(De,this.getSelectedClassName(),Ke.isSelected),Object(d.a)(De,this.getDisabledClassName(),Ke.disabled),De)),ot=Object(le.a)(Object(le.a)({},Ke.attribute),{},{title:typeof Ke.title=="string"?Ke.title:void 0,className:yt,role:Ke.role||"menuitem","aria-disabled":Ke.disabled});Ke.role==="option"?ot=Object(le.a)(Object(le.a)({},ot),{},{role:"option","aria-selected":Ke.isSelected}):(Ke.role===null||Ke.role==="none")&&(ot.role="none");var kt={onClick:Ke.disabled?null:this.onClick,onMouseLeave:Ke.disabled?null:this.onMouseLeave,onMouseEnter:Ke.disabled?null:this.onMouseEnter},Dt=Object(le.a)({},Ke.style);Ke.mode==="inline"&&(Ke.direction==="rtl"?Dt.paddingRight=Ke.inlineIndent*Ke.level:Dt.paddingLeft=Ke.inlineIndent*Ke.level),ce.forEach(function(Tt){return delete Ke[Tt]}),delete Ke.direction;var rt=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(rt=T.createElement(this.props.itemIcon,this.props)),T.createElement("li",Object.assign({},Object(c.default)(Ke,["onClick","onMouseEnter","onMouseLeave","onSelect"]),ot,kt,{style:Dt,ref:this.saveNode}),Ke.children,rt)}}]),pt}(T.Component);Le.isMenuItem=!0,Le.defaultProps={onSelect:V,onMouseEnter:V,onMouseLeave:V,manualRef:V};var Te=Object(C.b)(function(Lt,at){var pt=Lt.activeKey,st=Lt.selectedKeys,De=at.eventKey,Ke=at.subMenuKey;return{active:pt[Ke]===De,isSelected:st.indexOf(De)!==-1}})(Le),Ze=Te,ut=function(Lt){Object(P.a)(pt,Lt);var at=Object(b.a)(pt);function pt(){var st;return Object(Q.a)(this,pt),st=at.apply(this,arguments),st.renderInnerMenuItem=function(De){var Ke=st.props,yt=Ke.renderMenuItem,ot=Ke.index;return yt(De,ot,st.props.subMenuKey)},st}return Object(j.a)(pt,[{key:"render",value:function(){var De=Object(p.a)({},this.props),Ke=De.className,yt=Ke===void 0?"":Ke,ot=De.rootPrefixCls,kt="".concat(ot,"-item-group-title"),Dt="".concat(ot,"-item-group-list"),rt=De.title,Tt=De.children;return ce.forEach(function(Ft){return delete De[Ft]}),delete De.onClick,delete De.direction,T.createElement("li",Object.assign({},De,{className:"".concat(yt," ").concat(ot,"-item-group")}),T.createElement("div",{className:kt,title:typeof rt=="string"?rt:void 0},rt),T.createElement("ul",{className:Dt},T.Children.map(Tt,this.renderInnerMenuItem)))}}]),pt}(T.Component);ut.isMenuItemGroup=!0,ut.defaultProps={disabled:!0};var Ct=ut,Ht=function(at){var pt=at.className,st=at.rootPrefixCls,De=at.style;return T.createElement("li",{className:"".concat(pt," ").concat(st,"-item-divider"),style:De})};Ht.defaultProps={disabled:!0,className:"",style:{}};var Qt=Ht,bt=Ve.e=Ae},"3tLw":function(et,Ve,z){et.exports=z.p+"static/a.39070d50.svg"},"4xil":function(et,Ve,z){et.exports={watermark:"watermark___2DVjg",videovideo:"videovideo___3jScv",animate__loop:"animate__loop___36IZ1",upDown:"upDown___3FGkz",container:"container___GV_Ds","video-container":"video-container___35tqx","video-controls":"video-controls___u99fM",hide:"hide___2GDit","video-progress":"video-progress___2LKQJ",seek:"seek___3b-US","seek-tooltip":"seek-tooltip___bZ9sZ","bottom-controls":"bottom-controls___74sQw","left-controls":"left-controls___2kBb3","volume-controls":"volume-controls___QLaWH","fullscreen-button":"fullscreen-button___2nHzc","pip-button":"pip-button___18qQG","playback-animation":"playback-animation___gCL6X",volume:"volume___10eUe",hidden:"hidden___2JBJW"}},"55Ip":function(et,Ve,z){"use strict";z.d(Ve,"a",function(){return t}),z.d(Ve,"b",function(){return g});var le=z("Ty5D"),Q=z("dI71"),j=z("q1tI"),w=z.n(j),P=z("YS25"),b=z("17x9"),T=z.n(b),C=z("wx14"),c=z("zLVn"),p=z("9R94"),d=function(x){Object(Q.a)(l,x);function l(){for(var O,A=arguments.length,D=new Array(A),I=0;I=0||A.relatedTarget.className.indexOf("".concat(H,"-next"))>=0))return;x.setState({goInputText:""}),B(x.getValidValue())},x.go=function(A){var D=x.state.goInputText;if(D==="")return;(A.keyCode===u.ENTER||A.type==="click")&&(x.setState({goInputText:""}),x.props.quickGo(x.getValidValue()))},x}return Object(P.a)(y,[{key:"getValidValue",value:function(){var l=this.state,S=l.goInputText,O=l.current;return!S||isNaN(S)?O:Number(S)}},{key:"getPageSizeOptions",value:function(){var l=this.props,S=l.pageSize,O=l.pageSizeOptions;return O.some(function(A){return A.toString()===S.toString()})?O:O.concat([S.toString()]).sort(function(A,D){var I=isNaN(Number(A))?0:Number(A),B=isNaN(Number(D))?0:Number(D);return I-B})}},{key:"render",value:function(){var l=this,S=this.props,O=S.pageSize,A=S.locale,D=S.rootPrefixCls,I=S.changeSize,B=S.quickGo,H=S.goButton,te=S.selectComponentClass,W=S.buildOptionText,V=S.selectPrefixCls,X=S.disabled,ne=this.state.goInputText,Y="".concat(D,"-options"),ee=te,ce=null,de=null,Ce=null;if(!I&&!B)return null;var Se=this.getPageSizeOptions();if(I&&ee){var Pe=Se.map(function(ye,Ee){return c.a.createElement(ee.Option,{key:Ee,value:ye.toString()},(W||l.buildOptionText)(ye))});ce=c.a.createElement(ee,{disabled:X,prefixCls:V,showSearch:!1,className:"".concat(Y,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(O||Se[0]).toString(),onChange:this.changeSize,getPopupContainer:function(Ee){return Ee.parentNode}},Pe)}return B&&(H&&(Ce=typeof H=="boolean"?c.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:X,className:"".concat(Y,"-quick-jumper-button")},A.jump_to_confirm):c.a.createElement("span",{onClick:this.go,onKeyUp:this.go},H)),de=c.a.createElement("div",{className:"".concat(Y,"-quick-jumper")},A.jump_to,c.a.createElement("input",{disabled:X,type:"text",value:ne,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),A.page,Ce)),c.a.createElement("li",{className:"".concat(Y)},ce,de)}}]),y}(c.a.Component);s.defaultProps={pageSizeOptions:["10","20","50","100"]};var h=s,i=z("N2Kk");function n(){}function t(E){return typeof E=="number"&&isFinite(E)&&Math.floor(E)===E}function f(E,g,y){return y}function v(E,g,y){var x=typeof E=="undefined"?g.pageSize:E;return Math.floor((y.total-1)/x)+1}var m=function(E){Object(b.a)(y,E);var g=Object(T.a)(y);function y(x){var l;Object(w.a)(this,y),l=g.call(this,x),l.getJumpPrevPage=function(){return Math.max(1,l.state.current-(l.props.showLessItems?3:5))},l.getJumpNextPage=function(){return Math.min(v(void 0,l.state,l.props),l.state.current+(l.props.showLessItems?3:5))},l.getItemIcon=function(I,B){var H=l.props.prefixCls,te=I||c.a.createElement("button",{type:"button","aria-label":B,className:"".concat(H,"-item-link")});return typeof I=="function"&&(te=c.a.createElement(I,Object(j.a)({},l.props))),te},l.savePaginationNode=function(I){l.paginationNode=I},l.isValid=function(I){return t(I)&&I!==l.state.current},l.shouldDisplayQuickJumper=function(){var I=l.props,B=I.showQuickJumper,H=I.pageSize,te=I.total;return te<=H?!1:B},l.handleKeyDown=function(I){(I.keyCode===u.ARROW_UP||I.keyCode===u.ARROW_DOWN)&&I.preventDefault()},l.handleKeyUp=function(I){var B=l.getValidValue(I),H=l.state.currentInputValue;B!==H&&l.setState({currentInputValue:B}),I.keyCode===u.ENTER?l.handleChange(B):I.keyCode===u.ARROW_UP?l.handleChange(B-1):I.keyCode===u.ARROW_DOWN&&l.handleChange(B+1)},l.changePageSize=function(I){var B=l.state.current,H=v(I,l.state,l.props);B=B>H?H:B,H===0&&(B=l.state.current),typeof I=="number"&&("pageSize"in l.props||l.setState({pageSize:I}),"current"in l.props||l.setState({current:B,currentInputValue:B})),l.props.onShowSizeChange(B,I),"onChange"in l.props&&l.props.onChange&&l.props.onChange(B,I)},l.handleChange=function(I){var B=l.props.disabled,H=I;if(l.isValid(H)&&!B){var te=v(void 0,l.state,l.props);H>te?H=te:H<1&&(H=1),"current"in l.props||l.setState({current:H,currentInputValue:H});var W=l.state.pageSize;return l.props.onChange(H,W),H}return l.state.current},l.prev=function(){l.hasPrev()&&l.handleChange(l.state.current-1)},l.next=function(){l.hasNext()&&l.handleChange(l.state.current+1)},l.jumpPrev=function(){l.handleChange(l.getJumpPrevPage())},l.jumpNext=function(){l.handleChange(l.getJumpNextPage())},l.hasPrev=function(){return l.state.current>1},l.hasNext=function(){return l.state.current2?H-2:0),W=2;W=O?D=O:D=Number(S),D}},{key:"getShowSizeChanger",value:function(){var l=this.props,S=l.showSizeChanger,O=l.total,A=l.totalBoundaryShowSizeChanger;return typeof S!="undefined"?S:O>A}},{key:"renderPrev",value:function(l){var S=this.props,O=S.prevIcon,A=S.itemRender,D=A(l,"prev",this.getItemIcon(O,"prev page")),I=!this.hasPrev();return Object(C.isValidElement)(D)?Object(C.cloneElement)(D,{disabled:I}):D}},{key:"renderNext",value:function(l){var S=this.props,O=S.nextIcon,A=S.itemRender,D=A(l,"next",this.getItemIcon(O,"next page")),I=!this.hasNext();return Object(C.isValidElement)(D)?Object(C.cloneElement)(D,{disabled:I}):D}},{key:"render",value:function(){var l=this,S=this.props,O=S.prefixCls,A=S.className,D=S.style,I=S.disabled,B=S.hideOnSinglePage,H=S.total,te=S.locale,W=S.showQuickJumper,V=S.showLessItems,X=S.showTitle,ne=S.showTotal,Y=S.simple,ee=S.itemRender,ce=S.showPrevNextJumpers,de=S.jumpPrevIcon,Ce=S.jumpNextIcon,Se=S.selectComponentClass,Pe=S.selectPrefixCls,ye=S.pageSizeOptions,Ee=this.state,Ge=Ee.current,Ue=Ee.pageSize,Fe=Ee.currentInputValue;if(B===!0&&H<=Ue)return null;var He=v(void 0,this.state,this.props),be=[],me=null,We=null,ze=null,nt=null,re=null,k=W&&W.goButton,U=V?1:2,q=Ge-1>0?Ge-1:0,$=Ge+1=U*2&&Ge!==1+2&&(be[0]=Object(C.cloneElement)(be[0],{className:"".concat(O,"-item-after-jump-prev")}),be.unshift(me)),He-Ge>=U*2&&Ge!==He-2&&(be[be.length-1]=Object(C.cloneElement)(be[be.length-1],{className:"".concat(O,"-item-before-jump-next")}),be.push(We)),tt!==1&&be.unshift(ze),mt!==He&&be.push(nt)}var Be=null;ne&&(Be=c.a.createElement("li",{className:"".concat(O,"-total-text")},ne(H,[H===0?0:(Ge-1)*Ue+1,Ge*Ue>H?H:Ge*Ue])));var Ie=!this.hasPrev()||!He,Me=!this.hasNext()||!He;return c.a.createElement("ul",Object(le.a)({className:d()(O,A,Object(Q.a)({},"".concat(O,"-disabled"),I)),style:D,unselectable:"unselectable",ref:this.savePaginationNode},J),Be,c.a.createElement("li",{title:X?te.prev_page:null,onClick:this.prev,tabIndex:Ie?null:0,onKeyPress:this.runIfEnterPrev,className:d()("".concat(O,"-prev"),Object(Q.a)({},"".concat(O,"-disabled"),Ie)),"aria-disabled":Ie},this.renderPrev(q)),be,c.a.createElement("li",{title:X?te.next_page:null,onClick:this.next,tabIndex:Me?null:0,onKeyPress:this.runIfEnterNext,className:d()("".concat(O,"-next"),Object(Q.a)({},"".concat(O,"-disabled"),Me)),"aria-disabled":Me},this.renderNext($)),c.a.createElement(h,{disabled:I,locale:te,rootPrefixCls:O,selectComponentClass:Se,selectPrefixCls:Pe,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Ge,pageSize:Ue,pageSizeOptions:ye,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:k}))}}],[{key:"getDerivedStateFromProps",value:function(l,S){var O={};if("current"in l&&(O.current=l.current,l.current!==S.current&&(O.currentInputValue=O.current)),"pageSize"in l&&l.pageSize!==S.pageSize){var A=S.current,D=v(l.pageSize,S,l);A=A>D?D:A,"current"in l||(O.current=A,O.currentInputValue=A),O.pageSize=l.pageSize}return O}}]),y}(c.a.Component);m.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:n,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:n,locale:i.a,style:{},itemRender:f,totalBoundaryShowSizeChanger:50};var _=m},"6RRn":function(et,Ve,z){"use strict";var le=z("wCXF"),Q=z("n6Qo");z.d(Ve,"b",function(){return Q.a});var j=z("IBYe"),w=z("6eGT"),P=z("hW8S");z.d(Ve,"a",function(){return P.a}),Ve.c=le.b},"6eGT":function(et,Ve,z){"use strict";function le(Q){return null}Ve.a=le},"7+5b":function(et,Ve,z){et.exports=z.p+"static/v.e7f297d6.svg"},"7Cbv":function(et,Ve,z){"use strict";var le=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Q=new Uint8Array(16);function j(){if(!le)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return le(Q)}var w=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function P(a){return typeof a=="string"&&w.test(a)}for(var b=P,T=[],C=0;C<256;++C)T.push((C+256).toString(16).substr(1));function c(a){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=(T[a[u+0]]+T[a[u+1]]+T[a[u+2]]+T[a[u+3]]+"-"+T[a[u+4]]+T[a[u+5]]+"-"+T[a[u+6]]+T[a[u+7]]+"-"+T[a[u+8]]+T[a[u+9]]+"-"+T[a[u+10]]+T[a[u+11]]+T[a[u+12]]+T[a[u+13]]+T[a[u+14]]+T[a[u+15]]).toLowerCase();if(!b(s))throw TypeError("Stringified UUID is invalid");return s}var p=c;function d(a,u,s){a=a||{};var h=a.random||(a.rng||j)();if(h[6]=h[6]&15|64,h[8]=h[8]&63|128,u){s=s||0;for(var i=0;i<16;++i)u[s+i]=h[i];return u}return p(h)}var o=Ve.a=d},"7ahc":function(et,Ve,z){"use strict";z.d(Ve,"a",function(){return v});var le=z("k1fw"),Q=z("0Owb"),j=z("+L6B"),w=z("2/Rp"),P=z("y8nQ"),b=z("Vl3Y"),T=z("tJVT"),C=z("OaEy"),c=z("2fM7"),p=z("q1tI"),d=z.n(p),o=z("VrN/"),a=z.n(o),u=z("p77/"),s=z.n(u),h=z("c5Ni"),i=z.n(h),n=c.a.Option,t={labelCol:{span:4},wrapperCol:{span:20}},f={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};Ve.b=function(m){var _=m.callback,E=m.onCancel,g=Object(p.useState)("python"),y=Object(T.a)(g,2),x=y[0],l=y[1];function S(A){l(f[A][1])}function O(A){_(A)}return d.a.createElement(b.a,Object(Q.a)({},t,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:O}),d.a.createElement(b.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},d.a.createElement(c.a,{onChange:S},Object.keys(f).map(function(A){return d.a.createElement(n,{key:A,value:A},f[A][0])}))),d.a.createElement(b.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},d.a.createElement(v,{mode:x})),d.a.createElement("div",{className:"flex-container flex-end"},d.a.createElement(w.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),d.a.createElement(w.a,{type:"ghost",onClick:E},"\u53D6\u6D88")))};function v(m){var _=m.value,E=m.onChange,g=m.mode,y=m.options,x=y===void 0?{}:y,l=Object(p.useRef)(),S=Object(p.useState)(),O=Object(T.a)(S,2),A=O[0],D=O[1];return Object(p.useEffect)(function(){if(A){function I(B){var H=B.getValue();E&&E(H)}return A.on("change",I),function(){A.off("change",I)}}},[A,E]),Object(p.useEffect)(function(){A&&A.setOption("mode",g)},[A,g]),Object(p.useEffect)(function(){A&&((_!==A.getValue()||_==="")&&setTimeout(function(){A.setValue(_||" ")},300))},[A,_]),Object(p.useEffect)(function(){if(l.current&&!A){var I=a.a.fromTextArea(l.current,Object(le.a)({mode:g,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},x));D(I)}},[l.current,A]),d.a.createElement("div",{className:"my-codemirror-container"},d.a.createElement("textarea",{ref:l}))}},"7ixt":function(et,Ve,z){"use strict";z.d(Ve,"a",function(){return j});var le={adjustX:1,adjustY:1},Q=[0,0],j={left:{points:["cr","cl"],overflow:le,offset:[-4,0],targetOffset:Q},right:{points:["cl","cr"],overflow:le,offset:[4,0],targetOffset:Q},top:{points:["bc","tc"],overflow:le,offset:[0,-4],targetOffset:Q},bottom:{points:["tc","bc"],overflow:le,offset:[0,4],targetOffset:Q},topLeft:{points:["bl","tl"],overflow:le,offset:[0,-4],targetOffset:Q},leftTop:{points:["tr","tl"],overflow:le,offset:[-4,0],targetOffset:Q},topRight:{points:["br","tr"],overflow:le,offset:[0,-4],targetOffset:Q},rightTop:{points:["tl","tr"],overflow:le,offset:[4,0],targetOffset:Q},bottomRight:{points:["tr","br"],overflow:le,offset:[0,4],targetOffset:Q},rightBottom:{points:["bl","br"],overflow:le,offset:[4,0],targetOffset:Q},bottomLeft:{points:["tl","bl"],overflow:le,offset:[0,4],targetOffset:Q},leftBottom:{points:["br","bl"],overflow:le,offset:[-4,0],targetOffset:Q}},w=j},"7qur":function(et,Ve,z){"use strict";z.d(Ve,"m",function(){return Q}),z.d(Ve,"s",function(){return j}),z.d(Ve,"h",function(){return w}),z.d(Ve,"o",function(){return P}),z.d(Ve,"n",function(){return b}),z.d(Ve,"l",function(){return T}),z.d(Ve,"b",function(){return C}),z.d(Ve,"q",function(){return c}),z.d(Ve,"t",function(){return p}),z.d(Ve,"v",function(){return d}),z.d(Ve,"w",function(){return o}),z.d(Ve,"u",function(){return a}),z.d(Ve,"p",function(){return u}),z.d(Ve,"f",function(){return s}),z.d(Ve,"a",function(){return h}),z.d(Ve,"j",function(){return i}),z.d(Ve,"k",function(){return n}),z.d(Ve,"d",function(){return t}),z.d(Ve,"g",function(){return f}),z.d(Ve,"c",function(){return v}),z.d(Ve,"e",function(){return m}),z.d(Ve,"i",function(){return _}),z.d(Ve,"r",function(){return E});var le=z("ErOA");function Q(g){return Object(le.c)("mypractices/".concat(g,".json"),{hidePopLogin:!0})}function j(g,y){return Object(le.f)("mypractices/".concat(g,"/code_submit.json"),y)}function w(g,y){return Object(le.c)("mypractices/".concat(g,"/code_debug.json"),y)}function P(g,y){return Object(le.c)("mypractices/".concat(g,"/submit_records.json"),y)}function b(g){return Object(le.c)("mypractices/record_detail.json",{id:g})}function T(g,y){return Object(le.c)("mypractices/".concat(g,"/result.json"),{mode:y})}function C(g,y){return Object(le.f)("mypractices/".concat(g,"/add_notes.json"),y)}function c(g,y){return Object(le.f)("mypractices/".concat(g,"/restore_initial_code.json"),y)}function p(g,y){return Object(le.f)("mypractices/".concat(g,"/sync_code.json"),y)}function d(g,y){return Object(le.f)("mypractices/".concat(g,"/update_code.json"),y)}function o(g){return Object(le.f)("mypractices/".concat(g,"/initial_codes.json"))}function a(g,y){return Object(le.f)("discusses/".concat(g,"/plus.json"),y)}function u(g){return Object(le.c)("practices/practices_list.json",g)}function s(g,y){return Object(le.c)("practices/".concat(g,"/question_solution_articles"),y)}function h(g,y){return Object(le.f)("practices/".concat(g,"/question_solution_articles"),y)}function i(g,y){return Object(le.g)("practices/".concat(g,"/question_solution_articles/").concat(y==null?void 0:y.active),y)}function n(g,y){return Object(le.c)("practices/".concat(g,"/question_solution_articles/").concat(y==null?void 0:y.active,"/edit"),y)}function t(g,y){return Object(le.c)("practices/".concat(g,"/question_solution_articles/").concat(y==null?void 0:y.active),y)}function f(g,y){return Object(le.f)("practices/".concat(g,"/question_solution_articles/").concat(y==null?void 0:y.active,"/set_authority_or_excellent"),y)}function v(g,y){return Object(le.f)("practices/".concat(g,"/question_solution_articles/").concat(y==null?void 0:y.active,"/praise_or_treads"),y)}function m(g,y){return Object(le.f)("practices/".concat(g,"/question_solution_articles/").concat(y==null?void 0:y.active,"/hide"))}function _(g,y){return Object(le.b)("practices/".concat(g,"/question_solution_articles/").concat(y==null?void 0:y.active),y)}function E(g,y){return Object(le.f)("mypractices/".concat(g,"/update_practice_time_sum"),y)}},"815F":function(et,Ve,z){"use strict";z.d(Ve,"e",function(){return T}),z.d(Ve,"c",function(){return c}),z.d(Ve,"d",function(){return p}),z.d(Ve,"a",function(){return o}),z.d(Ve,"f",function(){return a}),z.d(Ve,"b",function(){return u});var le=z("KQm4"),Q=z("VTBJ"),j=z("Ff2n"),w=z("Zm9Q"),P=z("Kwbf"),b=z("OZM5");function T(s,h){return s!=null?s:h}function C(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],h=new Map;function i(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(n||[]).forEach(function(f){var v=f.key,m=f.children;Object(P.a)(v!=null,"Tree node must have a certain key: [".concat(t).concat(v,"]"));var _=String(v);Object(P.a)(!h.has(_)||v===null||v===void 0,"Same 'key' exist in the Tree: ".concat(_)),h.set(_,!0),i(m,"".concat(t).concat(_," > "))})}i(s)}function c(s){function h(i){var n=Object(w.a)(i);return n.map(function(t){if(!Object(b.i)(t))return Object(P.a)(!t,"Tree/TreeNode can only accept TreeNode as children."),null;var f=t.key,v=t.props,m=v.children,_=Object(j.a)(v,["children"]),E=Object(Q.a)({key:f},_),g=h(m);return g.length&&(E.children=g),E}).filter(function(t){return t})}return h(s)}function p(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=new Set(h===!0?[]:h),n=[];function t(f){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return f.map(function(m,_){var E=Object(b.h)(v?v.pos:"0",_),g=T(m.key,E),y=Object(Q.a)(Object(Q.a)({},m),{},{parent:v,pos:E,children:null,data:m,isStart:[].concat(Object(le.a)(v?v.isStart:[]),[_===0]),isEnd:[].concat(Object(le.a)(v?v.isEnd:[]),[_===f.length-1])});return n.push(y),h===!0||i.has(g)?y.children=t(m.children||[],y):y.children=[],y})}return t(s),n}function d(s,h,i){var n;i?typeof i=="string"?n=function(v){return v[i]}:typeof i=="function"&&(n=function(v){return i(v)}):n=function(v,m){return T(v.key,m)};function t(f,v,m){var _=f?f.children:s,E=f?Object(b.h)(m.pos,v):"0";if(f){var g=n(f,E),y={node:f,index:v,pos:E,key:g,parentPos:m.node?m.pos:null,level:m.level+1};h(y)}_&&_.forEach(function(x,l){t(x,l,{node:f,pos:E,level:m?m.level+1:-1})})}t(null)}function o(s){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=h.initWrapper,n=h.processEntity,t=h.onProcessFinished,f=arguments.length>2?arguments[2]:void 0,v={},m={},_={posEntities:v,keyEntities:m};return i&&(_=i(_)||_),d(s,function(E){var g=E.node,y=E.index,x=E.pos,l=E.key,S=E.parentPos,O=E.level,A={node:g,index:y,key:l,pos:x,level:O},D=T(l,x);v[x]=A,m[D]=A,A.parent=v[S],A.parent&&(A.parent.children=A.parent.children||[],A.parent.children.push(A)),n&&n(A,_)},f),t&&t(_),_}function a(s,h){var i=h.expandedKeys,n=h.selectedKeys,t=h.loadedKeys,f=h.loadingKeys,v=h.checkedKeys,m=h.halfCheckedKeys,_=h.dragOverNodeKey,E=h.dropPosition,g=h.keyEntities,y=g[s],x={eventKey:s,expanded:i.indexOf(s)!==-1,selected:n.indexOf(s)!==-1,loaded:t.indexOf(s)!==-1,loading:f.indexOf(s)!==-1,checked:v.indexOf(s)!==-1,halfChecked:m.indexOf(s)!==-1,pos:String(y?y.pos:""),dragOver:_===s&&E===0,dragOverGapTop:_===s&&E===-1,dragOverGapBottom:_===s&&E===1};return x}function u(s){var h=s.data,i=s.expanded,n=s.selected,t=s.checked,f=s.loaded,v=s.loading,m=s.halfChecked,_=s.dragOver,E=s.dragOverGapTop,g=s.dragOverGapBottom,y=s.pos,x=s.active,l=Object(Q.a)(Object(Q.a)({},h),{},{expanded:i,selected:n,checked:t,loaded:f,loading:v,halfChecked:m,dragOver:_,dragOverGapTop:E,dragOverGapBottom:g,pos:y,active:x});return"props"in l||Object.defineProperty(l,"props",{get:function(){return Object(P.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),s}}),l}},"8EBN":function(et,Ve,z){(function(le){le(z("VrN/"))})(function(le){"use strict";le.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var Q=0;Q-1&&w.substring(T+1,w.length);if(C)return le.findModeByExtension(C)},le.findModeByName=function(w){w=w.toLowerCase();for(var P=0;P=ae.length?pe.slice(ae.length):pe}).join(`
`)}var i=[],n=[""],t=new u.a.Renderer,f=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function v(){i.length=0,n=[""]}var m={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function _(ie,N,F,ae){if(N>=ie.length||ie[N].level<=F)return N;var pe=ie[N];ae.push("- "+pe.text+""),N++;var se=[];return N=_(ie,N,pe.level,se),se.length>0&&(ae.push("
"),se.forEach(function($e){ae.push($e)}),ae.push("
")),ae.push(" "),N=_(ie,N,F,ae),N}function E(){return _(i,0,0,n),n.push("
"),n.join("")}var g={heading:function(N){var F=f.exec(N);if(F)return{type:"heading",raw:F[0],depth:F[1].length,text:F[2]}},fences:function(N){var F=this.rules.block.fences.exec(N);if(F){var ae=F[0],pe=h(ae,F[3]||""),se=F[2]?F[2].trim():F[2];if(["latex","katex","math"].indexOf(se)>=0){var $e=l(),_t=pe;pe=$e,S[$e]={type:"block",expression:_t}}return{type:"code",raw:ae,lang:se,text:pe}}}},y=/(?:\${2})([^\n`]+?)(?:\${2})/gi,x=0,l=function(){return"__special_katext_id_".concat(x++,"__")},S={};function O(){return S}function A(){x=0,S={}}function D(ie){return ie=ie.replace(y,function(N,F){var ae=l();return S[ae]={type:"inline",expression:F},ae}),ie}var I=t.listitem;t.listitem=function(ie){return I(D(ie))};var B=t.paragraph;t.paragraph=function(ie){return B(D(ie))};var H=t.tablecell;t.tablecell=function(ie,N){return H(D(ie),N)},t.code=function(ie,N,F){var ae=(N||"").match(/\S*/)[0];return ae?["latex","katex","math"].indexOf(ae)>=0?"".concat(ie,"
"):'
').concat(F?ie:Object(s.escape)(ie,!0),`
`):''+(F?ie:Object(s.escape)(ie,!0))+"
"},t.heading=function(ie,N,F){var ae=this.options.headerPrefix+F.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return i.push({anchor:ae,level:N,text:ie}),"'+ie+""},u.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),u.a.use({tokenizer:g,renderer:t});var te=u.a,W=z("SJMd"),V=z("ulZh"),X=z.n(V),ne=z("m3rI"),Y=z("Oy/b"),ee=z("p5ED"),ce=z("ErOA");/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var de=function(ie,N){return(de=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,ae){F.__proto__=ae}||function(F,ae){for(var pe in ae)Object.prototype.hasOwnProperty.call(ae,pe)&&(F[pe]=ae[pe])})(ie,N)};function Ce(ie,N){function F(){this.constructor=ie}de(ie,N),ie.prototype=N===null?Object.create(N):(F.prototype=N.prototype,new F)}function Se(ie,N,F,ae){return new(F||(F=Promise))(function(pe,se){function $e(Vt){try{it(ae.next(Vt))}catch(At){se(At)}}function _t(Vt){try{it(ae.throw(Vt))}catch(At){se(At)}}function it(Vt){var At;Vt.done?pe(Vt.value):(At=Vt.value,At instanceof F?At:new F(function(Bt){Bt(At)})).then($e,_t)}it((ae=ae.apply(ie,N||[])).next())})}function Pe(ie,N){var F,ae,pe,se,$e={label:0,sent:function(){if(1&pe[0])throw pe[1];return pe[1]},trys:[],ops:[]};return se={next:_t(0),throw:_t(1),return:_t(2)},typeof Symbol=="function"&&(se[Symbol.iterator]=function(){return this}),se;function _t(it){return function(Vt){return function(At){if(F)throw new TypeError("Generator is already executing.");for(;$e;)try{if(F=1,ae&&(pe=2&At[0]?ae.return:At[0]?ae.throw||((pe=ae.return)&&pe.call(ae),0):ae.next)&&!(pe=pe.call(ae,At[1])).done)return pe;switch(ae=0,pe&&(At=[2&At[0],pe.value]),At[0]){case 0:case 1:pe=At;break;case 4:return $e.label++,{value:At[1],done:!1};case 5:$e.label++,ae=At[1],At=[0];continue;case 7:At=$e.ops.pop(),$e.trys.pop();continue;default:if(!(pe=$e.trys,(pe=pe.length>0&&pe[pe.length-1])||At[0]!==6&&At[0]!==2)){$e=0;continue}if(At[0]===3&&(!pe||At[1]>pe[0]&&At[1]',"select"),this.addActionButton(ae,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(ae,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(ae,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(ae,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(ae,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(ae,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(ae,'',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(se){var $e=document.createElement("div");$e.className=""+F.toolbarButtonStyleClass.name,$e.setAttribute("data-type-name",se.typeName),$e.innerHTML=se.icon,$e.addEventListener("click",function(){F.markerToolbarButtonClicked($e,se)}),F.buttons.push($e),F.markerButtons.push($e)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var pe=document.createElement("div");pe.className=this.toolbarBlockStyleClass.name,pe.style.whiteSpace="nowrap",pe.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(pe),this.addActionButton(pe,'',"render"),this.addActionButton(pe,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},ie.prototype.addButtonClickListener=function(N){this.buttonClickListeners.push(N)},ie.prototype.removeButtonClickListener=function(N){this.buttonClickListeners.indexOf(N)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(N),1)},ie.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},ie.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var N=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var F=0;F0&&this.buttonClickListeners.forEach(function(ae){return ae("marker",F)}),this.markerButtonOverflowBlock.style.display="none"},ie.prototype.actionToolbarButtonClicked=function(N,F){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(ae){return ae("action",F)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},ie.prototype.setActiveButton=function(N){this.resetButtonStyles(),N.className=N.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),N.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},ie.prototype.setActiveMarkerButton=function(N){var F=this.markerButtons.find(function(ae){return ae.getAttribute("data-type-name")===N});F&&this.setActiveButton(F)},ie.prototype.setCurrentMarker=function(N){var F=this;this.currentMarker=N,this.buttons.filter(function(ae){return/delete|notes/.test(ae.getAttribute("data-action"))}).forEach(function(ae){F.currentMarker===void 0?(ae.style.fillOpacity="0.4",ae.style.pointerEvents="none"):(ae.style.fillOpacity="1",ae.style.pointerEvents="all")})},ie}(),ze=function(){function ie(N,F,ae,pe){this.panels=[],this.panelButtons=[],this.markerjsContainer=N,this.displayMode=F,this.uiStyleSettings=ae,this.styles=pe,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return ie.prototype.addStyles=function(){var N;this.toolboxStyleClass=this.styles.addClass(new me("toolbox",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: column;
font-family: sans-serif;
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
box-sizing: content-box;
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolboxStyleColorsClass=this.styles.addClass(new me("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var F=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new me("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new me("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new me("toolbox-panel-row",`
display: flex;
`+(this.displayMode==="inline"?"position: absolute;":"")+`
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
cursor: default;
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
`+(this.displayMode==="inline"?"width: 100%;":"")+`
box-sizing: content-box;
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new me("toolbox-panel-row_colors",`
background-color: `+((N=this.uiStyleSettings.toolboxBackgroundColor)!==null&&N!==void 0?N:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new me("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*F)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*F)+`px;
padding: `+F+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new me("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new me("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new be("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new be("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},ie.prototype.show=function(N){var F;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=N,this.uiContainer.className=this.toolboxStyleClass.name+" "+((F=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&F!==void 0?F:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},ie.prototype.setPanelButtons=function(N){var F,ae,pe=this;this.panels=N,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((F=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&F!==void 0?F:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((ae=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&ae!==void 0?ae:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(se){var $e;se.uiStyleSettings=pe.uiStyleSettings;var _t=document.createElement("div");_t.className=pe.toolboxButtonStyleClass.name+" "+(($e=pe.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&$e!==void 0?$e:pe.toolboxButtonStyleColorsClass.name),_t.innerHTML=se.icon,_t.title=se.title,_t.addEventListener("click",function(){pe.panelButtonClick(se)}),pe.panelButtons.push(_t),pe.buttonRow.appendChild(_t)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},ie.prototype.panelButtonClick=function(N){var F=this,ae=-1;if(N!==this.activePanel){ae=this.panels.indexOf(N),this.panelRow.innerHTML="";var pe=N.getUi();pe.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(pe),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=N}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){F.displayMode==="inline"?F.panelRow.style.display="none":F.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(se,$e){var _t,it;se.className=F.toolboxButtonStyleClass.name+" "+($e===ae?""+((_t=F.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&_t!==void 0?_t:F.toolboxActiveButtonStyleColorsClass.name):""+((it=F.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&it!==void 0?it:F.toolboxButtonStyleColorsClass.name))})},ie}(),nt=function(ie,N){this.title=ie,this.icon=N},re=function(ie){function N(F,ae,pe,se){var $e=ie.call(this,F,se||'')||this;return $e.colors=[],$e.addTransparent=!1,$e.colorBoxes=[],$e.colors=ae,$e.currentColor=pe,$e.setCurrentColor=$e.setCurrentColor.bind($e),$e.getColorBox=$e.getColorBox.bind($e),$e}return Ce(N,ie),N.prototype.getUi=function(){var F=this,ae=document.createElement("div");return ae.style.overflow="hidden",ae.style.whiteSpace="nowrap",this.colors.forEach(function(pe){var se=F.getColorBox(pe);ae.appendChild(se),F.colorBoxes.push(se)}),ae},N.prototype.getColorBox=function(F){var ae=this,pe=this.uiStyleSettings.toolbarHeight/4,se=this.uiStyleSettings.toolbarHeight-pe,$e=document.createElement("div");$e.style.display="inline-block",$e.style.boxSizing="content-box",$e.style.width=se-2+"px",$e.style.height=se-2+"px",$e.style.padding="1px",$e.style.marginRight="2px",$e.style.marginBottom="2px",$e.style.borderWidth="2px",$e.style.borderStyle="solid",$e.style.borderRadius=(se+2)/2+"px",$e.style.borderColor=F===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",$e.addEventListener("click",function(){ae.setCurrentColor(F,$e)});var _t=document.createElement("div");return _t.style.display="inline-block",_t.style.width=se-2+"px",_t.style.height=se-2+"px",_t.style.backgroundColor=F,_t.style.borderRadius=se/2+"px",F==="transparent"&&(_t.style.fill=this.uiStyleSettings.toolboxAccentColor,_t.innerHTML=``),$e.appendChild(_t),$e},N.prototype.setCurrentColor=function(F,ae){var pe=this;this.currentColor=F,this.colorBoxes.forEach(function(se){se.style.borderColor=se===ae?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(F)},N}(nt),k=function(){function ie(N,F,ae){this._state="new",this._isSelected=!1,this._container=N,this._overlayContainer=F,this.globalSettings=ae,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(ie.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),ie.prototype.ownsTarget=function(N){return!1},Object.defineProperty(ie.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),ie.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},ie.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},ie.prototype.pointerDown=function(N,F){},ie.prototype.dblClick=function(N,F){},ie.prototype.manipulate=function(N){},ie.prototype.pointerUp=function(N){this.stateChanged()},ie.prototype.dispose=function(){},ie.prototype.addMarkerVisualToContainer=function(N){this.container.childNodes.length>0?this.container.insertBefore(N,this.container.childNodes[0]):this.container.appendChild(N)},ie.prototype.getState=function(){return{typeName:ie.typeName,state:this.state,notes:this.notes}},ie.prototype.restoreState=function(N){this._state=N.state,this.notes=N.notes},ie.prototype.scale=function(N,F){},ie.prototype.colorChanged=function(N){this.onColorChanged&&this.onColorChanged(N),this.stateChanged()},ie.prototype.fillColorChanged=function(N){this.onFillColorChanged&&this.onFillColorChanged(N),this.stateChanged()},ie.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var N=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),N.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(N)&&this.onStateChanged(this)}},ie.typeName="MarkerBase",ie}(),U=function(){function ie(){this.findGripByVisual=this.findGripByVisual.bind(this)}return ie.prototype.findGripByVisual=function(N){return this.topLeft.ownsTarget(N)?this.topLeft:this.topCenter.ownsTarget(N)?this.topCenter:this.topRight.ownsTarget(N)?this.topRight:this.centerLeft.ownsTarget(N)?this.centerLeft:this.centerRight.ownsTarget(N)?this.centerRight:this.bottomLeft.ownsTarget(N)?this.bottomLeft:this.bottomCenter.ownsTarget(N)?this.bottomCenter:this.bottomRight.ownsTarget(N)?this.bottomRight:void 0},ie}(),q=function(){function ie(){this.GRIP_SIZE=10,this.visual=Ee.createGroup(),this.visual.appendChild(Ee.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Ee.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ie.prototype.ownsTarget=function(N){return N===this.visual||N===this.visual.childNodes[0]||N===this.visual.childNodes[1]},ie}(),$=function(){function ie(){}return ie.toITransformMatrix=function(N){return{a:N.a,b:N.b,c:N.c,d:N.d,e:N.e,f:N.f}},ie.toSVGMatrix=function(N,F){return N.a=F.a,N.b=F.b,N.c=F.c,N.d=F.d,N.e=F.e,N.f=F.f,N},ie}(),J=function(ie){function N(F,ae,pe){var se=ie.call(this,F,ae,pe)||this;return se.left=0,se.top=0,se.width=0,se.height=0,se.defaultSize={x:50,y:20},se.offsetX=0,se.offsetY=0,se.rotationAngle=0,se.CB_DISTANCE=10,se._suppressMarkerCreateEvent=!1,se.container.transform.baseVal.appendItem(Ee.createTransform()),se.setupControlBox(),se}return Ce(N,ie),Object.defineProperty(N.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"visual",{get:function(){return this._visual},set:function(F){this._visual=F;var ae=Ee.createTransform();this._visual.transform.baseVal.appendItem(ae)},enumerable:!1,configurable:!0}),N.prototype.ownsTarget=function(F){return!!ie.prototype.ownsTarget.call(this,F)||!!(this.controlGrips.findGripByVisual(F)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(F))},N.prototype.pointerDown=function(F,ae){ie.prototype.pointerDown.call(this,F,ae),this.state==="new"&&(this.left=F.x,this.top=F.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var pe=this.unrotatePoint(F);if(this.manipulationStartX=pe.x,this.manipulationStartY=pe.y,this.offsetX=pe.x-this.left,this.offsetY=pe.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(ae),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(ae)){this.activeGrip=this.rotatorGrip;var se=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=se.x-this.width/2,this.top=se.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var $e=this.container.transform.baseVal.getItem(0);$e.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem($e,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},N.prototype.pointerUp=function(F){var ae=this.state;ie.prototype.pointerUp.call(this,F),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(F),this._state="select",ae==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},N.prototype.moveVisual=function(F){this.visual.style.transform="translate("+F.x+"px, "+F.y+"px)"},N.prototype.manipulate=function(F){var ae=this.unrotatePoint(F);this.state==="creating"?this.resize(F):this.state==="move"?(this.left=this.manipulationStartLeft+(ae.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(ae.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(ae):this.state==="rotate"&&this.rotate(F)},N.prototype.resize=function(F){var ae=this.manipulationStartLeft,pe=this.manipulationStartWidth,se=this.manipulationStartTop,$e=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:ae=this.manipulationStartLeft+F.x-this.manipulationStartX,pe=this.manipulationStartWidth+this.manipulationStartLeft-ae;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:pe=this.manipulationStartWidth+F.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:se=this.manipulationStartTop+F.y-this.manipulationStartY,$e=this.manipulationStartHeight+this.manipulationStartTop-se;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:$e=this.manipulationStartHeight+F.y-this.manipulationStartY}pe>=0?(this.left=ae,this.width=pe):(this.left=ae+pe,this.width=-pe),$e>=0?(this.top=se,this.height=$e):(this.top=se+$e,this.height=-$e),this.setSize()},N.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},N.prototype.rotate=function(F){if(Math.abs(F.x-this.centerX)>.1){var ae=Math.sign(F.x-this.centerX);this.rotationAngle=180*Math.atan((F.y-this.centerY)/(F.x-this.centerX))/Math.PI+90*ae,this.applyRotation()}},N.prototype.applyRotation=function(){var F=this.container.transform.baseVal.getItem(0);F.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(F,0)},N.prototype.rotatePoint=function(F){if(this.rotationAngle===0)return F;var ae=this.container.getCTM(),pe=Ee.createPoint(F.x,F.y);return{x:(pe=pe.matrixTransform(ae)).x,y:pe.y}},N.prototype.unrotatePoint=function(F){if(this.rotationAngle===0)return F;var ae=this.container.getCTM();ae=ae.inverse();var pe=Ee.createPoint(F.x,F.y);return{x:(pe=pe.matrixTransform(ae)).x,y:pe.y}},N.prototype.select=function(){ie.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},N.prototype.deselect=function(){ie.prototype.deselect.call(this),this.controlBox.style.display="none"},N.prototype.setupControlBox=function(){this.controlBox=Ee.createGroup();var F=Ee.createTransform();F.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(F),this.container.appendChild(this.controlBox),this.controlRect=Ee.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=Ee.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new U,this.addControlGrips(),this.controlBox.style.display="none"},N.prototype.adjustControlBox=function(){var F=this.controlBox.transform.baseVal.getItem(0);F.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(F,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},N.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},N.prototype.createGrip=function(){var F=new q;return F.visual.transform.baseVal.appendItem(Ee.createTransform()),this.controlBox.appendChild(F.visual),F},N.prototype.positionGrips=function(){var F=this.controlGrips.topLeft.GRIP_SIZE,ae=-F/2,pe=ae,se=(this.width+this.CB_DISTANCE)/2-F/2,$e=(this.height+this.CB_DISTANCE)/2-F/2,_t=this.height+this.CB_DISTANCE-F/2,it=this.width+this.CB_DISTANCE-F/2;this.positionGrip(this.controlGrips.topLeft.visual,ae,pe),this.positionGrip(this.controlGrips.topCenter.visual,se,pe),this.positionGrip(this.controlGrips.topRight.visual,it,pe),this.positionGrip(this.controlGrips.centerLeft.visual,ae,$e),this.positionGrip(this.controlGrips.centerRight.visual,it,$e),this.positionGrip(this.controlGrips.bottomLeft.visual,ae,_t),this.positionGrip(this.controlGrips.bottomCenter.visual,se,_t),this.positionGrip(this.controlGrips.bottomRight.visual,it,_t),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,se,pe-3*this.CB_DISTANCE)},N.prototype.positionGrip=function(F,ae,pe){var se=F.transform.baseVal.getItem(0);se.setTranslate(ae,pe),F.transform.baseVal.replaceItem(se,0)},N.prototype.hideControlBox=function(){this.controlBox.style.display="none"},N.prototype.showControlBox=function(){this.controlBox.style.display=""},N.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:$.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:$.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},ie.prototype.getState.call(this))},N.prototype.restoreState=function(F){ie.prototype.restoreState.call(this,F);var ae=F;this.left=ae.left,this.top=ae.top,this.width=ae.width,this.height=ae.height,this.rotationAngle=ae.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix($.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,ae.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix($.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,ae.containerTransformMatrix))},N.prototype.scale=function(F,ae){ie.prototype.scale.call(this,F,ae);var pe=this.rotatePoint({x:this.left,y:this.top}),se=this.unrotatePoint({x:pe.x*F,y:pe.y*ae});this.left=se.x,this.top=se.y,this.width=this.width*F,this.height=this.height*ae,this.adjustControlBox()},N}(k),xe=function(ie){function N(F,ae,pe){var se=ie.call(this,F,ae,pe)||this;return se.fillColor="transparent",se.strokeColor="transparent",se.strokeWidth=0,se.strokeDasharray="",se.opacity=1,se.setStrokeColor=se.setStrokeColor.bind(se),se.setFillColor=se.setFillColor.bind(se),se.setStrokeWidth=se.setStrokeWidth.bind(se),se.setStrokeDasharray=se.setStrokeDasharray.bind(se),se.createVisual=se.createVisual.bind(se),se}return Ce(N,ie),N.prototype.ownsTarget=function(F){return!(!ie.prototype.ownsTarget.call(this,F)&&F!==this.visual)},N.prototype.createVisual=function(){this.visual=Ee.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},N.prototype.pointerDown=function(F,ae){ie.prototype.pointerDown.call(this,F,ae),this.state==="new"&&(this.createVisual(),this.moveVisual(F),this._state="creating")},N.prototype.manipulate=function(F){ie.prototype.manipulate.call(this,F)},N.prototype.resize=function(F){ie.prototype.resize.call(this,F),this.setSize()},N.prototype.setSize=function(){ie.prototype.setSize.call(this),Ee.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},N.prototype.pointerUp=function(F){ie.prototype.pointerUp.call(this,F),this.setSize()},N.prototype.setStrokeColor=function(F){this.strokeColor=F,this.visual&&Ee.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(F),this.stateChanged()},N.prototype.setFillColor=function(F){this.fillColor=F,this.visual&&Ee.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},N.prototype.setStrokeWidth=function(F){this.strokeWidth=F,this.visual&&Ee.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},N.prototype.setStrokeDasharray=function(F){this.strokeDasharray=F,this.visual&&Ee.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},N.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ie.prototype.getState.call(this))},N.prototype.restoreState=function(F){var ae=F;this.fillColor=ae.fillColor,this.strokeColor=ae.strokeColor,this.strokeWidth=ae.strokeWidth,this.strokeDasharray=ae.strokeDasharray,this.opacity=ae.opacity,this.createVisual(),ie.prototype.restoreState.call(this,F),this.setSize()},N.prototype.scale=function(F,ae){ie.prototype.scale.call(this,F,ae),this.setSize()},N.title="Rectangle marker",N}(J),ke=function(ie){function N(F,ae,pe,se){var $e=ie.call(this,F,se||'')||this;return $e.widths=[],$e.widthBoxes=[],$e.widths=ae,$e.currentWidth=pe,$e.setCurrentWidth=$e.setCurrentWidth.bind($e),$e}return Ce(N,ie),N.prototype.getUi=function(){var F=this,ae=document.createElement("div");return ae.style.display="flex",ae.style.overflow="hidden",ae.style.flexGrow="2",this.widths.forEach(function(pe){var se=document.createElement("div");se.style.display="flex",se.style.flexGrow="2",se.style.alignItems="center",se.style.justifyContent="space-between",se.style.padding="5px",se.style.borderWidth="2px",se.style.borderStyle="solid",se.style.borderColor=pe===F.currentWidth?F.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){F.setCurrentWidth(pe,se)}),ae.appendChild(se);var $e=document.createElement("div");$e.innerText=pe.toString(),$e.style.marginRight="5px",se.appendChild($e);var _t=document.createElement("div");_t.style.minHeight="20px",_t.style.flexGrow="2",_t.style.display="flex",_t.style.alignItems="center";var it=document.createElement("hr");it.style.minWidth="20px",it.style.border="0px",it.style.borderTop=pe+"px solid "+F.uiStyleSettings.toolboxColor,it.style.flexGrow="2",_t.appendChild(it),se.appendChild(_t),F.widthBoxes.push(se)}),ae},N.prototype.setCurrentWidth=function(F,ae){var pe=this;this.currentWidth=F,this.widthBoxes.forEach(function(se){se.style.borderColor=se===ae?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},N}(nt),dt=function(ie){function N(F,ae,pe,se){var $e=ie.call(this,F,se||'')||this;return $e.styles=[],$e.styleBoxes=[],$e.styles=ae,$e.currentStyle=pe,$e.setCurrentStyle=$e.setCurrentStyle.bind($e),$e}return Ce(N,ie),N.prototype.getUi=function(){var F=this,ae=document.createElement("div");return ae.style.display="flex",ae.style.overflow="hidden",ae.style.flexGrow="2",this.styles.forEach(function(pe){var se=document.createElement("div");se.style.display="flex",se.style.alignItems="center",se.style.justifyContent="space-between",se.style.padding="5px",se.style.borderWidth="2px",se.style.borderStyle="solid",se.style.overflow="hidden",se.style.maxWidth=100/F.styles.length-5+"%",se.style.borderColor=pe===F.currentStyle?F.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){F.setCurrentStyle(pe,se)}),ae.appendChild(se);var $e=document.createElement("div");$e.style.minHeight="20px",$e.style.flexGrow="2",$e.style.overflow="hidden";var _t=``;$e.innerHTML=_t,se.appendChild($e),F.styleBoxes.push(se)}),ae},N.prototype.setCurrentStyle=function(F,ae){var pe=this;this.currentStyle=F,this.styleBoxes.forEach(function(se){se.style.borderColor=se===ae?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},N}(nt),Ne=function(ie){function N(F,ae,pe){var se=ie.call(this,F,ae,pe)||this;return se.strokeColor=pe.defaultColor,se.strokeWidth=pe.defaultStrokeWidth,se.strokeDasharray=pe.defaultStrokeDasharray,se.strokePanel=new re("Line color",pe.defaultColorSet,pe.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.strokeWidthPanel=new ke("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new dt("Line style",pe.defaultStrokeDasharrays,pe.defaultStrokeDasharray),se.strokeStylePanel.onStyleChanged=se.setStrokeDasharray,se}return Ce(N,ie),Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var F=ie.prototype.getState.call(this);return F.typeName=N.typeName,F},N.typeName="FrameMarker",N.title="Frame marker",N.icon='',N}(xe),je=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},tt=function(ie){function N(F,ae,pe){var se=ie.call(this,F,ae,pe)||this;return se.x1=0,se.y1=0,se.x2=0,se.y2=0,se.defaultLength=50,se.manipulationStartX=0,se.manipulationStartY=0,se.manipulationStartX1=0,se.manipulationStartY1=0,se.manipulationStartX2=0,se.manipulationStartY2=0,se.setupControlBox(),se}return Ce(N,ie),N.prototype.ownsTarget=function(F){return!!ie.prototype.ownsTarget.call(this,F)||!(!this.grip1.ownsTarget(F)&&!this.grip2.ownsTarget(F))},N.prototype.pointerDown=function(F,ae){ie.prototype.pointerDown.call(this,F,ae),this.manipulationStartX=F.x,this.manipulationStartY=F.y,this.state==="new"&&(this.x1=F.x,this.y1=F.y,this.x2=F.x,this.y2=F.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(ae)?this.activeGrip=this.grip1:this.grip2.ownsTarget(ae)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},N.prototype.pointerUp=function(F){var ae=this.state;ie.prototype.pointerUp.call(this,F),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(F),this._state="select",ae==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},N.prototype.adjustVisual=function(){},N.prototype.manipulate=function(F){this.state==="creating"?this.resize(F):this.state==="move"?(this.x1=this.manipulationStartX1+F.x-this.manipulationStartX,this.y1=this.manipulationStartY1+F.y-this.manipulationStartY,this.x2=this.manipulationStartX2+F.x-this.manipulationStartX,this.y2=this.manipulationStartY2+F.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(F)},N.prototype.resize=function(F){switch(this.activeGrip){case this.grip1:this.x1=F.x,this.y1=F.y;break;case this.grip2:case void 0:this.x2=F.x,this.y2=F.y}this.adjustVisual(),this.adjustControlBox()},N.prototype.select=function(){ie.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},N.prototype.deselect=function(){ie.prototype.deselect.call(this),this.controlBox.style.display="none"},N.prototype.setupControlBox=function(){this.controlBox=Ee.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},N.prototype.adjustControlBox=function(){this.positionGrips()},N.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},N.prototype.createGrip=function(){var F=new q;return F.visual.transform.baseVal.appendItem(Ee.createTransform()),this.controlBox.appendChild(F.visual),F},N.prototype.positionGrips=function(){var F=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-F/2,this.y1-F/2),this.positionGrip(this.grip2.visual,this.x2-F/2,this.y2-F/2)},N.prototype.positionGrip=function(F,ae,pe){var se=F.transform.baseVal.getItem(0);se.setTranslate(ae,pe),F.transform.baseVal.replaceItem(se,0)},N.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},ie.prototype.getState.call(this))},N.prototype.restoreState=function(F){ie.prototype.restoreState.call(this,F);var ae=F;this.x1=ae.x1,this.y1=ae.y1,this.x2=ae.x2,this.y2=ae.y2},N.prototype.scale=function(F,ae){ie.prototype.scale.call(this,F,ae),this.x1=this.x1*F,this.y1=this.y1*ae,this.x2=this.x2*F,this.y2=this.y2*ae,this.adjustVisual(),this.adjustControlBox()},N}(k),mt=function(ie){function N(F,ae,pe){var se=ie.call(this,F,ae,pe)||this;return se.strokeColor="transparent",se.strokeWidth=0,se.strokeDasharray="",se.setStrokeColor=se.setStrokeColor.bind(se),se.setStrokeWidth=se.setStrokeWidth.bind(se),se.setStrokeDasharray=se.setStrokeDasharray.bind(se),se.strokeColor=pe.defaultColor,se.strokeWidth=pe.defaultStrokeWidth,se.strokeDasharray=pe.defaultStrokeDasharray,se.strokePanel=new re("Line color",pe.defaultColorSet,pe.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.strokeWidthPanel=new ke("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new dt("Line style",pe.defaultStrokeDasharrays,pe.defaultStrokeDasharray),se.strokeStylePanel.onStyleChanged=se.setStrokeDasharray,se}return Ce(N,ie),N.prototype.ownsTarget=function(F){return!(!ie.prototype.ownsTarget.call(this,F)&&F!==this.visual&&F!==this.selectorLine&&F!==this.visibleLine)},N.prototype.createVisual=function(){this.visual=Ee.createGroup(),this.selectorLine=Ee.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=Ee.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},N.prototype.pointerDown=function(F,ae){ie.prototype.pointerDown.call(this,F,ae),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},N.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),Ee.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),Ee.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),Ee.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},N.prototype.setStrokeColor=function(F){this.strokeColor=F,this.adjustVisual(),this.colorChanged(F)},N.prototype.setStrokeWidth=function(F){this.strokeWidth=F,this.adjustVisual()},N.prototype.setStrokeDasharray=function(F){this.strokeDasharray=F,this.adjustVisual(),this.stateChanged()},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var F=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},ie.prototype.getState.call(this));return F.typeName=N.typeName,F},N.prototype.restoreState=function(F){ie.prototype.restoreState.call(this,F);var ae=F;this.strokeColor=ae.strokeColor,this.strokeWidth=ae.strokeWidth,this.strokeDasharray=ae.strokeDasharray,this.createVisual(),this.adjustVisual()},N.typeName="LineMarker",N.title="Line marker",N.icon='',N}(tt),Qe=function(ie){function N(F,ae,pe,se){var $e=ie.call(this,F,se||'')||this;return $e.fonts=[],$e.fontBoxes=[],$e.fonts=ae,$e.currentFont=pe,$e.setCurrentFont=$e.setCurrentFont.bind($e),$e}return Ce(N,ie),N.prototype.getUi=function(){var F=this,ae=document.createElement("div");return ae.style.overflow="hidden",ae.style.flexGrow="2",this.fonts.forEach(function(pe){var se=document.createElement("div");se.style.display="inline-block",se.style.alignItems="center",se.style.justifyContent="space-between",se.style.padding="5px",se.style.borderWidth="2px",se.style.borderStyle="solid",se.style.overflow="hidden",se.style.maxWidth=100/F.fonts.length-5+"%",se.style.borderColor=pe===F.currentFont?F.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){F.setCurrentFont(pe,se)}),ae.appendChild(se);var $e=document.createElement("div");$e.style.display="flex",$e.style.minHeight="20px",$e.style.flexGrow="2",$e.style.fontFamily=pe,$e.style.overflow="hidden";var _t=document.createElement("div");_t.style.whiteSpace="nowrap",_t.style.overflow="hidden",_t.style.textOverflow="ellipsis",_t.innerHTML="The quick brown fox jumps over the lazy dog",$e.appendChild(_t),se.appendChild($e),F.fontBoxes.push(se)}),ae},N.prototype.setCurrentFont=function(F,ae){var pe=this;this.currentFont=F,this.fontBoxes.forEach(function(se){se.style.borderColor=se===ae?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},N}(nt),Xe=function(ie){function N(F,ae,pe){var se=ie.call(this,F,ae,pe)||this;return se.color="transparent",se.padding=5,se.DEFAULT_TEXT="your text here",se.text=se.DEFAULT_TEXT,se.isMoved=!1,se.color=pe.defaultColor,se.fontFamily=pe.defaultFontFamily,se.defaultSize={x:100,y:30},se.setColor=se.setColor.bind(se),se.setFont=se.setFont.bind(se),se.renderText=se.renderText.bind(se),se.sizeText=se.sizeText.bind(se),se.textEditDivClicked=se.textEditDivClicked.bind(se),se.showTextEditor=se.showTextEditor.bind(se),se.setSize=se.setSize.bind(se),se.positionTextEditor=se.positionTextEditor.bind(se),se.colorPanel=new re("Color",pe.defaultColorSet,pe.defaultColor),se.colorPanel.onColorChanged=se.setColor,se.fontFamilyPanel=new Qe("Font",pe.defaultFontFamilies,pe.defaultFontFamily),se.fontFamilyPanel.onFontChanged=se.setFont,se}return Ce(N,ie),N.prototype.ownsTarget=function(F){if(ie.prototype.ownsTarget.call(this,F)||F===this.visual||F===this.textElement||F===this.bgRectangle)return!0;var ae=!1;return this.textElement.childNodes.forEach(function(pe){pe===F&&(ae=!0)}),ae},N.prototype.createVisual=function(){this.visual=Ee.createGroup(),this.bgRectangle=Ee.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=Ee.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(Ee.createTransform()),this.textElement.transform.baseVal.appendItem(Ee.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},N.prototype.pointerDown=function(F,ae){ie.prototype.pointerDown.call(this,F,ae),this.isMoved=!1,this.pointerDownPoint=F,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(F),this._state="creating")},N.prototype.renderText=function(){var F=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(ae){F.textElement.appendChild(Ee.createTSpan(ae.trim()===""?" ":ae.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},N.prototype.getTextScale=function(){var F=this.textElement.getBBox(),ae=1;if(F.width>0&&F.height>0){var pe=(1*this.width-this.width*this.padding*2/100)/F.width,se=(1*this.height-this.height*this.padding*2/100)/F.height;ae=Math.min(pe,se)}return ae},N.prototype.getTextPosition=function(F){var ae=this.textElement.getBBox(),pe=0,se=0;return ae.width>0&&ae.height>0&&(pe=(this.width-ae.width*F)/2,se=this.height/2-ae.height*F/2),{x:pe,y:se}},N.prototype.sizeText=function(){var F=this.textElement.getBBox(),ae=this.getTextScale(),pe=this.getTextPosition(ae);pe.y-=F.y*ae,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+pe.x+"px, "+pe.y+"px) scale("+ae+", "+ae+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(pe.x,pe.y),this.textElement.transform.baseVal.getItem(1).setScale(ae,ae))},N.prototype.manipulate=function(F){ie.prototype.manipulate.call(this,F),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(F.x-this.pointerDownPoint.x)>5||Math.abs(F.y-this.pointerDownPoint.y)>5)},N.prototype.resize=function(F){ie.prototype.resize.call(this,F),this.isMoved=!0,this.setSize(),this.sizeText()},N.prototype.setSize=function(){ie.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(Ee.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Ee.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},N.prototype.pointerUp=function(F){var ae=this.state;ae==="creating"&&(this._suppressMarkerCreateEvent=!0),ie.prototype.pointerUp.call(this,F),this.setSize(),(ae==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},N.prototype.showTextEditor=function(){var F=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(ae){ae.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var ae=Number.parseFloat(F.textEditor.style.fontSize);F.textEditor.clientWidth>=Number.parseInt(F.textEditor.style.maxWidth)&&ae>.9;)ae-=.1,F.textEditor.style.fontSize=Math.max(ae,.9)+"em"}),this.textEditor.addEventListener("keyup",function(ae){ae.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(ae){if(ae.clipboardData){var pe=ae.clipboardData.getData("text"),se=window.getSelection();if(!se.rangeCount)return!1;se.deleteFromDocument(),se.getRangeAt(0).insertNode(document.createTextNode(pe)),ae.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){F.textEditDivClicked(F.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},N.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var F=this.getTextScale(),ae=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),pe=this.textElement.getBBox(),se={x:pe.width*F,y:pe.height*F};ae.x-=se.x/2,ae.y-=se.y/2,this.textEditor.style.top=ae.y+"px",this.textEditor.style.left=ae.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-ae.x+"px",this.textEditor.style.fontSize=Math.max(16*F,12)+"px",this.textElement.style.display="none"}},N.prototype.textEditDivClicked=function(F){this.text=F.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},N.prototype.select=function(){ie.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},N.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),ie.prototype.deselect.call(this)},N.prototype.dblClick=function(F,ae){ie.prototype.dblClick.call(this,F,ae),this.showTextEditor()},N.prototype.setColor=function(F){this.textElement&&Ee.setAttributes(this.textElement,[["fill",F]]),this.color=F,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(F)},N.prototype.setFont=function(F){this.textElement&&Ee.setAttributes(this.textElement,[["font-family",F]]),this.fontFamily=F,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},N.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},N.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var F=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},ie.prototype.getState.call(this));return F.typeName=N.typeName,F},N.prototype.restoreState=function(F){var ae=F;this.color=ae.color,this.fontFamily=ae.fontFamily,this.padding=ae.padding,this.text=ae.text,this.createVisual(),ie.prototype.restoreState.call(this,F),this.setSize()},N.prototype.scale=function(F,ae){ie.prototype.scale.call(this,F,ae),this.setSize(),this.sizeText(),this.positionTextEditor()},N.typeName="TextMarker",N.title="Text marker",N.icon='',N}(J),Be=function(ie){function N(F,ae,pe){var se=ie.call(this,F,ae,pe)||this;return se.color="transparent",se.lineWidth=3,se.drawing=!1,se.pixelRatio=1,se.color=pe.defaultColor,se.lineWidth=pe.defaultStrokeWidth,se.pixelRatio=pe.freehandPixelRatio,se.setColor=se.setColor.bind(se),se.addCanvas=se.addCanvas.bind(se),se.finishCreation=se.finishCreation.bind(se),se.setLineWidth=se.setLineWidth.bind(se),se.colorPanel=new re("Color",pe.defaultColorSet,pe.defaultColor),se.colorPanel.onColorChanged=se.setColor,se.lineWidthPanel=new ke("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),se.lineWidthPanel.onWidthChanged=se.setLineWidth,se}return Ce(N,ie),N.prototype.ownsTarget=function(F){return!(!ie.prototype.ownsTarget.call(this,F)&&F!==this.visual&&F!==this.drawingImage)},N.prototype.createVisual=function(){this.visual=Ee.createGroup(),this.drawingImage=Ee.createImage(),this.visual.appendChild(this.drawingImage);var F=Ee.createTransform();this.visual.transform.baseVal.appendItem(F),this.addMarkerVisualToContainer(this.visual)},N.prototype.pointerDown=function(F,ae){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(F.x,F.y),this.drawing=!0):ie.prototype.pointerDown.call(this,F,ae)},N.prototype.manipulate=function(F){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(F.x,F.y),this.canvasContext.stroke()):ie.prototype.manipulate.call(this,F)},N.prototype.resize=function(F){ie.prototype.resize.call(this,F),Ee.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Ee.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},N.prototype.pointerUp=function(F){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):ie.prototype.pointerUp.call(this,F)},N.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},N.prototype.select=function(){this.state==="creating"&&this.finishCreation(),ie.prototype.select.call(this)},N.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),ie.prototype.deselect.call(this)},N.prototype.finishCreation=function(){for(var F=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),ae=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],pe=ae[0],se=ae[1],$e=ae[2],_t=ae[3],it=!1,Vt=0;Vt0&&(it=!0,Vt_t&&(_t=Vt),At>$e&&($e=At));if(it){this.left=pe/this.pixelRatio,this.top=se/this.pixelRatio,this.width=($e-pe)/this.pixelRatio,this.height=(_t-se)/this.pixelRatio;var Bt=document.createElement("canvas");Bt.width=$e-pe,Bt.height=_t-se,Bt.getContext("2d").putImageData(this.canvasContext.getImageData(pe,se,$e-pe,_t-se),0,0),this.drawingImgUrl=Bt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},N.prototype.setDrawingImage=function(){Ee.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),Ee.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},N.prototype.setColor=function(F){this.color=F,this.colorChanged(F)},N.prototype.setLineWidth=function(F){this.lineWidth=F},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var F=Object.assign({drawingImgUrl:this.drawingImgUrl},ie.prototype.getState.call(this));return F.typeName=N.typeName,F},N.prototype.restoreState=function(F){this.createVisual(),ie.prototype.restoreState.call(this,F),this.drawingImgUrl=F.drawingImgUrl,this.setDrawingImage()},N.prototype.scale=function(F,ae){ie.prototype.scale.call(this,F,ae),this.setDrawingImage()},N.typeName="FreehandMarker",N.title="Freehand marker",N.icon='',N}(J),Ie=function(ie){function N(F,ae,pe){var se=ie.call(this,F,pe||'')||this;return se.typeBoxes=[],se.currentType=ae,se.setCurrentType=se.setCurrentType.bind(se),se}return Ce(N,ie),N.prototype.getUi=function(){var F=this,ae=document.createElement("div");ae.style.display="flex",ae.style.overflow="hidden",ae.style.flexGrow="2";for(var pe=function(_t){var it="both";switch(_t){case 0:it="both";break;case 1:it="start";break;case 2:it="end";break;case 3:it="none"}var Vt=document.createElement("div");if(Vt.style.display="flex",Vt.style.flexGrow="2",Vt.style.alignItems="center",Vt.style.justifyContent="space-between",Vt.style.padding="5px",Vt.style.borderWidth="2px",Vt.style.borderStyle="solid",Vt.style.borderColor=it===se.currentType?se.uiStyleSettings.toolboxAccentColor:"transparent",Vt.addEventListener("click",function(){F.setCurrentType(it,Vt)}),ae.appendChild(Vt),it==="both"||it==="start"){var At=document.createElement("div");At.style.display="flex",At.style.alignItems="center",At.style.minHeight="20px",At.innerHTML=``,At.style.marginLeft="5px",Vt.appendChild(At)}var Bt=document.createElement("div");Bt.style.display="flex",Bt.style.alignItems="center",Bt.style.minHeight="20px",Bt.style.flexGrow="2";var on=document.createElement("hr");if(on.style.minWidth="20px",on.style.border="0px",on.style.borderTop="3px solid "+(se.uiStyleSettings!==void 0?se.uiStyleSettings.toolboxColor:"#eeeeee"),on.style.flexGrow="2",Bt.appendChild(on),Vt.appendChild(Bt),it==="both"||it==="end"){var In=document.createElement("div");In.style.display="flex",In.style.alignItems="center",In.style.minHeight="20px",In.innerHTML=``,In.style.marginRight="5px",Vt.appendChild(In)}se.typeBoxes.push(Vt)},se=this,$e=0;$e<4;$e++)pe($e);return ae},N.prototype.setCurrentType=function(F,ae){var pe=this;this.currentType=F,this.typeBoxes.forEach(function(se){se.style.borderColor=se===ae?pe.uiStyleSettings!==void 0?pe.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},N}(nt),Me=function(ie){function N(F,ae,pe){var se=ie.call(this,F,ae,pe)||this;return se.arrowType="end",se.arrowBaseHeight=10,se.arrowBaseWidth=10,se.getArrowPoints=se.getArrowPoints.bind(se),se.setArrowType=se.setArrowType.bind(se),se.arrowTypePanel=new Ie("Arrow type","end"),se.arrowTypePanel.onArrowTypeChanged=se.setArrowType,se}return Ce(N,ie),N.prototype.ownsTarget=function(F){return!(!ie.prototype.ownsTarget.call(this,F)&&F!==this.arrow1&&F!==this.arrow2)},N.prototype.getArrowPoints=function(F,ae){var pe=this.arrowBaseWidth+2*this.strokeWidth,se=this.arrowBaseHeight+2*this.strokeWidth;return F-pe/2+","+(ae+se/2)+" "+F+","+(ae-se/2)+" "+(F+pe/2)+","+(ae+se/2)},N.prototype.createTips=function(){this.arrow1=Ee.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(Ee.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=Ee.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(Ee.createTransform()),this.visual.appendChild(this.arrow2)},N.prototype.pointerDown=function(F,ae){ie.prototype.pointerDown.call(this,F,ae),this.state==="creating"&&this.createTips()},N.prototype.adjustVisual=function(){if(ie.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",Ee.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),Ee.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var F=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),ae=this.arrow1.transform.baseVal.getItem(0);ae.setRotate(F,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(ae,0);var pe=this.arrow2.transform.baseVal.getItem(0);pe.setRotate(F+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(pe,0)}},N.prototype.setArrowType=function(F){this.arrowType=F,this.adjustVisual(),this.stateChanged()},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var F=Object.assign({arrowType:this.arrowType},ie.prototype.getState.call(this));return F.typeName=N.typeName,F},N.prototype.restoreState=function(F){ie.prototype.restoreState.call(this,F);var ae=F;this.arrowType=ae.arrowType,this.createTips(),this.adjustVisual()},N.typeName="ArrowMarker",N.title="Arrow marker",N.icon='',N}(mt),_e=function(ie){function N(F,ae,pe){var se=ie.call(this,F,ae,pe)||this;return se.fillColor=pe.defaultFillColor,se.strokeWidth=0,se.fillPanel=new re("Color",pe.defaultColorSet,pe.defaultFillColor),se.fillPanel.onColorChanged=se.setFillColor,se}return Ce(N,ie),Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var F=ie.prototype.getState.call(this);return F.typeName=N.typeName,F},N.typeName="CoverMarker",N.title="Cover marker",N.icon='',N}(xe),Ae=function(ie){function N(F,ae,pe,se){var $e=ie.call(this,F,se||'')||this;return $e.opacities=[],$e.opacityBoxes=[],$e.opacities=ae,$e.currentOpacity=pe,$e.setCurrentOpacity=$e.setCurrentOpacity.bind($e),$e}return Ce(N,ie),N.prototype.getUi=function(){var F=this,ae=document.createElement("div");return ae.style.display="flex",ae.style.overflow="hidden",ae.style.flexGrow="2",ae.style.justifyContent="space-between",this.opacities.forEach(function(pe){var se=document.createElement("div");se.style.display="flex",se.style.alignItems="center",se.style.justifyContent="center",se.style.padding="5px",se.style.borderWidth="2px",se.style.borderStyle="solid",se.style.borderColor=pe===F.currentOpacity?F.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){F.setCurrentOpacity(pe,se)}),ae.appendChild(se);var $e=document.createElement("div");$e.innerText=100*pe+"%",se.appendChild($e),F.opacityBoxes.push(se)}),ae},N.prototype.setCurrentOpacity=function(F,ae){var pe=this;this.currentOpacity=F,this.opacityBoxes.forEach(function(se){se.style.borderColor=se===ae?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},N}(nt),Le=function(ie){function N(F,ae,pe){var se=ie.call(this,F,ae,pe)||this;return se.setOpacity=se.setOpacity.bind(se),se.fillColor=pe.defaultHighlightColor,se.strokeWidth=0,se.opacity=pe.defaultHighlightOpacity,se.fillPanel=new re("Color",pe.defaultColorSet,se.fillColor),se.fillPanel.onColorChanged=se.setFillColor,se.opacityPanel=new Ae("Opacity",pe.defaultOpacitySteps,se.opacity),se.opacityPanel.onOpacityChanged=se.setOpacity,se}return Ce(N,ie),N.prototype.setOpacity=function(F){this.opacity=F,this.visual&&Ee.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var F=ie.prototype.getState.call(this);return F.typeName=N.typeName,F},N.typeName="HighlightMarker",N.title="Highlight marker",N.icon='',N}(_e),Te='',Ze=function(ie){function N(F,ae,pe){var se=ie.call(this,F,ae,pe)||this;return se.bgColor="transparent",se.tipPosition={x:0,y:0},se.tipBase1Position={x:0,y:0},se.tipBase2Position={x:0,y:0},se.tipMoving=!1,se.color=pe.defaultStrokeColor,se.bgColor=pe.defaultFillColor,se.fontFamily=pe.defaultFontFamily,se.defaultSize={x:100,y:30},se.setBgColor=se.setBgColor.bind(se),se.getTipPoints=se.getTipPoints.bind(se),se.positionTip=se.positionTip.bind(se),se.setTipPoints=se.setTipPoints.bind(se),se.colorPanel=new re("Text color",pe.defaultColorSet,se.color,''),se.colorPanel.onColorChanged=se.setColor,se.bgColorPanel=new re("Fill color",pe.defaultColorSet,se.bgColor,Te),se.bgColorPanel.onColorChanged=se.setBgColor,se.fontFamilyPanel=new Qe("Font",pe.defaultFontFamilies,pe.defaultFontFamily),se.fontFamilyPanel.onFontChanged=se.setFont,se.tipGrip=new q,se.tipGrip.visual.transform.baseVal.appendItem(Ee.createTransform()),se.controlBox.appendChild(se.tipGrip.visual),se}return Ce(N,ie),N.prototype.ownsTarget=function(F){return ie.prototype.ownsTarget.call(this,F)||this.tipGrip.ownsTarget(F)||this.tip===F},N.prototype.createTip=function(){Ee.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=Ee.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},N.prototype.pointerDown=function(F,ae){this.state==="new"&&ie.prototype.pointerDown.call(this,F,ae),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(ae)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):ie.prototype.pointerDown.call(this,F,ae)},N.prototype.pointerUp=function(F){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,ie.prototype.pointerUp.call(this,F);else{var ae=this.state==="creating";ie.prototype.pointerUp.call(this,F),this.setTipPoints(ae),this.positionTip()}},N.prototype.manipulate=function(F){if(this.tipMoving){var ae=this.unrotatePoint(F);this.tipPosition={x:ae.x-this.manipulationStartLeft,y:ae.y-this.manipulationStartTop},this.positionTip()}else ie.prototype.manipulate.call(this,F)},N.prototype.setBgColor=function(F){this.bgRectangle&&this.tip&&(Ee.setAttributes(this.bgRectangle,[["fill",F]]),Ee.setAttributes(this.tip,[["fill",F]])),this.bgColor=F,this.fillColorChanged(F)},N.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},N.prototype.setTipPoints=function(F){F===void 0&&(F=!1);var ae=Math.min(this.height/2,15),pe=this.height/5;F&&(this.tipPosition={x:ae+pe/2,y:this.height+20});var se=Math.atan(this.height/2/(this.width/2));this.tipPosition.x=this.width/2&&this.tipPosition.y=this.width/2&&this.tipPosition.y>=this.height/2?se',N}(Xe),ut=function(ie){function N(F,ae,pe){var se=ie.call(this,F,ae,pe)||this;return se.fillColor="transparent",se.strokeColor="transparent",se.strokeWidth=0,se.strokeDasharray="",se.opacity=1,se.strokeColor=pe.defaultColor,se.strokeWidth=pe.defaultStrokeWidth,se.strokeDasharray=pe.defaultStrokeDasharray,se.fillColor=pe.defaultFillColor,se.setStrokeColor=se.setStrokeColor.bind(se),se.setFillColor=se.setFillColor.bind(se),se.setStrokeWidth=se.setStrokeWidth.bind(se),se.setStrokeDasharray=se.setStrokeDasharray.bind(se),se.setOpacity=se.setOpacity.bind(se),se.createVisual=se.createVisual.bind(se),se.strokePanel=new re("Line color",ye(pe.defaultColorSet,["transparent"]),pe.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.fillPanel=new re("Fill color",ye(pe.defaultColorSet,["transparent"]),se.fillColor,Te),se.fillPanel.onColorChanged=se.setFillColor,se.strokeWidthPanel=new ke("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new dt("Line style",pe.defaultStrokeDasharrays,pe.defaultStrokeDasharray),se.strokeStylePanel.onStyleChanged=se.setStrokeDasharray,se.opacityPanel=new Ae("Opacity",pe.defaultOpacitySteps,se.opacity),se.opacityPanel.onOpacityChanged=se.setOpacity,se}return Ce(N,ie),N.prototype.ownsTarget=function(F){return!(!ie.prototype.ownsTarget.call(this,F)&&F!==this.visual)},N.prototype.createVisual=function(){this.visual=Ee.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},N.prototype.pointerDown=function(F,ae){ie.prototype.pointerDown.call(this,F,ae),this.state==="new"&&(this.createVisual(),this.moveVisual(F),this._state="creating")},N.prototype.manipulate=function(F){ie.prototype.manipulate.call(this,F)},N.prototype.resize=function(F){ie.prototype.resize.call(this,F),this.setSize()},N.prototype.setSize=function(){ie.prototype.setSize.call(this),Ee.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},N.prototype.pointerUp=function(F){ie.prototype.pointerUp.call(this,F),this.setSize()},N.prototype.setStrokeColor=function(F){this.strokeColor=F,this.visual&&Ee.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(F),this.stateChanged()},N.prototype.setFillColor=function(F){this.fillColor=F,this.visual&&Ee.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(F),this.stateChanged()},N.prototype.setStrokeWidth=function(F){this.strokeWidth=F,this.visual&&Ee.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},N.prototype.setStrokeDasharray=function(F){this.strokeDasharray=F,this.visual&&Ee.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},N.prototype.setOpacity=function(F){this.opacity=F,this.visual&&Ee.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var F=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ie.prototype.getState.call(this));return F.typeName=N.typeName,F},N.prototype.restoreState=function(F){var ae=F;this.fillColor=ae.fillColor,this.strokeColor=ae.strokeColor,this.strokeWidth=ae.strokeWidth,this.strokeDasharray=ae.strokeDasharray,this.opacity=ae.opacity,this.createVisual(),ie.prototype.restoreState.call(this,F),this.setSize()},N.prototype.scale=function(F,ae){ie.prototype.scale.call(this,F,ae),this.setSize()},N.typeName="EllipseMarker",N.title="Ellipse marker",N.icon='',N}(J),Ct=function(ie){function N(F,ae,pe){return ie.call(this,F,ae,pe)||this}return Ce(N,ie),Object.defineProperty(N.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),N.prototype.ownsTarget=function(F){return!(!ie.prototype.ownsTarget.call(this,F)&&F!==this.tip1&&F!==this.tip2)},N.prototype.createTips=function(){this.tip1=Ee.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(Ee.createTransform()),this.visual.appendChild(this.tip1),this.tip2=Ee.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(Ee.createTransform()),this.visual.appendChild(this.tip2)},N.prototype.pointerDown=function(F,ae){ie.prototype.pointerDown.call(this,F,ae),this.state==="creating"&&this.createTips()},N.prototype.adjustVisual=function(){if(ie.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(Ee.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Ee.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var F=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),ae=this.tip1.transform.baseVal.getItem(0);ae.setRotate(F,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(ae,0);var pe=this.tip2.transform.baseVal.getItem(0);pe.setRotate(F+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(pe,0)}},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var F=ie.prototype.getState.call(this);return F.typeName=N.typeName,F},N.prototype.restoreState=function(F){ie.prototype.restoreState.call(this,F),this.createTips(),this.adjustVisual()},N.typeName="MeasurementMarker",N.title="Measurement marker",N.icon='',N}(mt),Ht=function(ie){function N(F,ae,pe){var se=ie.call(this,F,ae,pe)||this;return se.strokePanel.colors=pe.defaultColorSet,se.fillColor="transparent",se}return Ce(N,ie),Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var F=ie.prototype.getState.call(this);return F.typeName=N.typeName,F},N.typeName="EllipseFrameMarker",N.title="Ellipse frame marker",N.icon='',N}(ut),Qt=function(){function ie(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(ie.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),ie.prototype.addUndoStep=function(N){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(N)||(this.undoStack.push(N),JSON.stringify(this.lastRedoStep)!==JSON.stringify(N)&&this.redoStack.splice(0,this.redoStack.length))},ie.prototype.replaceLastUndoStep=function(N){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=N)},ie.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},ie.prototype.undo=function(){if(this.undoStack.length>1){var N=this.undoStack.pop();return N!==void 0&&this.redoStack.push(N),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},ie.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},ie}(),bt=function(ie){function N(F,ae,pe){var se=ie.call(this,F,ae,pe)||this;return se.strokeColor="transparent",se.strokeWidth=0,se.strokeDasharray="",se.curveX=0,se.curveY=0,se.manipulationStartCurveX=0,se.manipulationStartCurveY=0,se.setStrokeColor=se.setStrokeColor.bind(se),se.setStrokeWidth=se.setStrokeWidth.bind(se),se.setStrokeDasharray=se.setStrokeDasharray.bind(se),se.positionGrips=se.positionGrips.bind(se),se.addControlGrips=se.addControlGrips.bind(se),se.adjustVisual=se.adjustVisual.bind(se),se.setupControlBox=se.setupControlBox.bind(se),se.resize=se.resize.bind(se),se.strokeColor=pe.defaultColor,se.strokeWidth=pe.defaultStrokeWidth,se.strokeDasharray=pe.defaultStrokeDasharray,se.strokePanel=new re("Line color",pe.defaultColorSet,pe.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.strokeWidthPanel=new ke("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new dt("Line style",pe.defaultStrokeDasharrays,pe.defaultStrokeDasharray),se.strokeStylePanel.onStyleChanged=se.setStrokeDasharray,se}return Ce(N,ie),N.prototype.ownsTarget=function(F){return!(!ie.prototype.ownsTarget.call(this,F)&&F!==this.visual&&F!==this.selectorCurve&&F!==this.visibleCurve&&!this.curveGrip.ownsTarget(F))},N.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},N.prototype.createVisual=function(){this.visual=Ee.createGroup(),this.selectorCurve=Ee.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=Ee.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},N.prototype.pointerDown=function(F,ae){ie.prototype.pointerDown.call(this,F,ae),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=F.x,this.curveY=F.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(ae)&&(this.activeGrip=this.curveGrip,this._state="resize")},N.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),Ee.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),Ee.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),Ee.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},N.prototype.setupControlBox=function(){ie.prototype.setupControlBox.call(this),this.curveControlLine1=Ee.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=Ee.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},N.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,ie.prototype.addControlGrips.call(this)},N.prototype.positionGrips=function(){ie.prototype.positionGrips.call(this);var F=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-F/2,this.curveY-F/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},N.prototype.manipulate=function(F){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+F.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+F.y-this.manipulationStartY),ie.prototype.manipulate.call(this,F)},N.prototype.resize=function(F){this.activeGrip===this.curveGrip&&(this.curveX=F.x,this.curveY=F.y),ie.prototype.resize.call(this,F),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},N.prototype.setStrokeColor=function(F){this.strokeColor=F,this.adjustVisual(),this.colorChanged(F)},N.prototype.setStrokeWidth=function(F){this.strokeWidth=F,this.adjustVisual()},N.prototype.setStrokeDasharray=function(F){this.strokeDasharray=F,this.adjustVisual()},N.prototype.scale=function(F,ae){this.curveX=this.curveX*F,this.curveY=this.curveY*ae,ie.prototype.scale.call(this,F,ae)},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var F=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},ie.prototype.getState.call(this));return F.typeName=N.typeName,F},N.prototype.restoreState=function(F){ie.prototype.restoreState.call(this,F);var ae=F;this.strokeColor=ae.strokeColor,this.strokeWidth=ae.strokeWidth,this.strokeDasharray=ae.strokeDasharray,this.curveX=ae.curveX,this.curveY=ae.curveY,this.createVisual(),this.adjustVisual()},N.typeName="CurveMarker",N.title="Curve marker",N.icon='',N}(tt),Lt=function(){function ie(N,F){F===void 0&&(F=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=N,this.cancelable=F}return Object.defineProperty(ie.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),ie.prototype.preventDefault=function(){this._defaultPrevented=!0},ie}(),at=function(ie){function N(F,ae,pe){var se=ie.call(this,F,!1)||this;return se.dataUrl=ae,se.state=pe,se}return Ce(N,ie),N}(Lt),pt=function(ie){function N(F,ae,pe){pe===void 0&&(pe=!1);var se=ie.call(this,F,pe)||this;return se.marker=ae,se}return Ce(N,ie),N}(Lt),st=function(){function ie(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return ie.prototype.addEventListener=function(N,F){this[N].push(F)},ie.prototype.removeEventListener=function(N,F){var ae=this[N].indexOf(F);ae>-1&&this[N].splice(ae,1)},ie}(),De=function(){function ie(N){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new je,this._isOpen=!1,this.undoRedoManager=new Qt,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new st,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=ie.instanceCounter++,this.styles=new He(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=N,this.targetRoot=document.body,this.width=N.clientWidth,this.height=N.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(ie.prototype,"ALL_MARKER_TYPES",{get:function(){return[Ne,Be,Me,Xe,Ht,ut,Le,Ze,Ct,_e,mt,bt]},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Ne,Be,Me,Xe,ut,Le,Ze]},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Ne,Be,Me,Xe,Le]},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(N){var F=this;this._availableMarkerTypes.splice(0),N.forEach(function(ae){if(typeof ae=="string"){var pe=F.ALL_MARKER_TYPES.find(function(se){return se.typeName===ae});pe!==void 0&&F._availableMarkerTypes.push(pe)}else F._availableMarkerTypes.push(ae)})},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(N){this._zoomLevel=N,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),ie.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Ge.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},ie.prototype.show=function(){var N=this;this.styles.styleSheetRoot===void 0&&Fe.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Fe.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(F){return F(new Lt(N))})},ie.prototype.render=function(){return Se(this,void 0,void 0,function(){var N;return Pe(this,function(F){switch(F.label){case 0:return this.setCurrentMarker(),(N=new Ue).naturalSize=this.renderAtNaturalSize,N.imageType=this.renderImageType,N.imageQuality=this.renderImageQuality,N.markersOnly=this.renderMarkersOnly,N.width=this.renderWidth,N.height=this.renderHeight,[4,N.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return F.sent(),[4,N.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,F.sent()]}})})},ie.prototype.close=function(N){var F=this;if(N===void 0&&(N=!1),this.isOpen){var ae=!1;N||this.eventListeners.beforeclose.forEach(function(pe){var se=new Lt(F,!0);pe(se),se.defaultPrevented&&(ae=!0)}),ae||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(pe){return pe(new Lt(F))}),this.detachEvents(),this._isOpen=!1)}},ie.prototype.addMarkersToToolbar=function(){for(var N,F=[],ae=0;aethis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*N:this.editorCanvas.clientWidth,ae=F',N.title="Powered by marker.js",N.style.display="grid",N.style.alignItems="center",N.style.justifyItems="center",N.style.padding="3px",N.style.width="20px",N.style.height="20px",this.logoUI.appendChild(N),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},ie.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},ie.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},ie.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ie.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var N=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=N+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new We(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y-1&&this.markers.splice(this.markers.indexOf(N),1),N.dispose()},ie.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},ie.prototype.toolbarButtonClicked=function(N,F){if(N==="marker"&&F!==void 0)this.createNewMarker(F);else if(N==="action")switch(F){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},ie.prototype.deleteSelectedMarker=function(){var N=this;if(this._currentMarker!==void 0){var F=!1;if(this.eventListeners.markerbeforedelete.forEach(function(pe){var se=new pt(N,N._currentMarker,!0);pe(se),se.defaultPrevented&&(F=!0)}),!F){var ae=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(pe){return pe(new pt(N,ae))})}}},ie.prototype.clear=function(){var N=this,F=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function($e){var _t=new pt(N,void 0,!0);$e(_t),_t.defaultPrevented&&(F=!0)}),!F)){this.setCurrentMarker();for(var ae=function($e){var _t=pe.markers[$e];pe.setCurrentMarker(pe.markers[$e]),pe._currentMarker.dispose(),pe.markerImage.removeChild(pe._currentMarker.container),pe.markers.splice(pe.markers.indexOf(pe._currentMarker),1),pe.eventListeners.markerdelete.forEach(function(it){return it(new pt(N,_t))})},pe=this,se=this.markers.length-1;se>=0;se--)ae(se);this.addUndoStep()}},Object.defineProperty(ie.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),ie.prototype.showNotesEditor=function(){var N;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(N=this._currentMarker.notes)!==null&&N!==void 0?N:"",this.overlayContainer.appendChild(this.notesArea))},ie.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},ie.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},ie.prototype.addUndoStep=function(){var N=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var F=this.getState(),ae=this.undoRedoManager.getLastUndoStep();if(!ae||ae.width===F.width&&ae.height===F.height){var pe=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(F),pe1&&this.panTo({x:N.clientX,y:N.clientY}))},ie.prototype.onPointerUp=function(N){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(N.clientX,N.clientY)),this.isDragging=!1,this.addUndoStep()},ie.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},ie.prototype.onKeyUp=function(N){this._currentMarker===void 0||this.notesArea!==void 0||N.key!=="Delete"&&N.key!=="Backspace"||this.deleteSelectedMarker()},ie.prototype.clientToLocalCoordinates=function(N,F){var ae=this.markerImage.getBoundingClientRect();return{x:(N-ae.left)/this.zoomLevel,y:(F-ae.top)/this.zoomLevel}},ie.prototype.onWindowResize=function(){this.positionUI()},ie.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var N=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=N+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},ie.prototype.addLicenseKey=function(N){Ge.addKey(N)},ie.prototype.addEventListener=function(N,F){this.eventListeners.addEventListener(N,F)},ie.prototype.removeEventListener=function(N,F){this.eventListeners.removeEventListener(N,F)},ie.prototype.renderState=function(N){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(N),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(ie.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),ie.prototype.focus=function(){var N=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(F){return F(new Lt(N))}))},ie.prototype.blur=function(){var N=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(F){return F(new Lt(N))}))},ie.instanceCounter=0,ie}();/* **********************************
cropro version 1.2.0
@license SEE LICENSE IN LICENSE
copyright Alan Mendelevich
see README and LICENSE for details
********************************** *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Ke=function(ie,N){return(Ke=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,ae){F.__proto__=ae}||function(F,ae){for(var pe in ae)Object.prototype.hasOwnProperty.call(ae,pe)&&(F[pe]=ae[pe])})(ie,N)};function yt(ie,N){if(typeof N!="function"&&N!==null)throw new TypeError("Class extends value "+String(N)+" is not a constructor or null");function F(){this.constructor=ie}Ke(ie,N),ie.prototype=N===null?Object.create(N):(F.prototype=N.prototype,new F)}function ot(ie,N,F,ae){return new(F||(F=Promise))(function(pe,se){function $e(Vt){try{it(ae.next(Vt))}catch(At){se(At)}}function _t(Vt){try{it(ae.throw(Vt))}catch(At){se(At)}}function it(Vt){var At;Vt.done?pe(Vt.value):(At=Vt.value,At instanceof F?At:new F(function(Bt){Bt(At)})).then($e,_t)}it((ae=ae.apply(ie,N||[])).next())})}function kt(ie,N){var F,ae,pe,se,$e={label:0,sent:function(){if(1&pe[0])throw pe[1];return pe[1]},trys:[],ops:[]};return se={next:_t(0),throw:_t(1),return:_t(2)},typeof Symbol=="function"&&(se[Symbol.iterator]=function(){return this}),se;function _t(it){return function(Vt){return function(At){if(F)throw new TypeError("Generator is already executing.");for(;$e;)try{if(F=1,ae&&(pe=2&At[0]?ae.return:At[0]?ae.throw||((pe=ae.return)&&pe.call(ae),0):ae.next)&&!(pe=pe.call(ae,At[1])).done)return pe;switch(ae=0,pe&&(At=[2&At[0],pe.value]),At[0]){case 0:case 1:pe=At;break;case 4:return $e.label++,{value:At[1],done:!1};case 5:$e.label++,ae=At[1],At=[0];continue;case 7:At=$e.ops.pop(),$e.trys.pop();continue;default:if(!(pe=$e.trys,(pe=pe.length>0&&pe[pe.length-1])||At[0]!==6&&At[0]!==2)){$e=0;continue}if(At[0]===3&&(!pe||At[1]>pe[0]&&At[1]0&&F>0){var ae=new oe(N,F),pe=ae.ratio>=1?20:ae.getHorizontalLength(20),se=ae.ratio<1?20:ae.getVerticalLength(20),$e=document.createElementNS("http://www.w3.org/2000/svg","svg");$e.setAttribute("xmlns","http://www.w3.org/2000/svg"),$e.setAttribute("viewBox","0 0 24 24"),document.body.appendChild($e);var _t=rt.createDefs();$e.appendChild(_t);var it=rt.createElement("clipPath",[["id","text-bg-clip"]]);_t.appendChild(it);var Vt=rt.createPath(rt.getHollowRectanglePath((24-pe)/2,(24-se)/2,pe,se,(24-pe)/2+2,(24-se)/2+2,pe-4,se-4));$e.appendChild(Vt);var At=rt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);At.appendChild(rt.createTSpan(N+":"+F)),$e.appendChild(At);var Bt=At.getBBox();rt.setAttributes(At,[["x",((24-Bt.width)/2).toString()],["y",((24-Bt.height)/2-Bt.y).toString()]]);var on=rt.createPath(rt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Bt.width))/2,(24-Math.ceil(Bt.height))/2,Math.ceil(Bt.width),Math.ceil(Bt.height)));return it.appendChild(on),rt.setAttributes(Vt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild($e),$e.outerHTML}return''},ie}(),Oe=function(ie){function N(F,ae,pe){var se=ie.call(this,F,ae)||this;return se.isDropdownOpen=!1,se.onClick=se.dropdownButtonClicked,se.dropdownButtons=pe,se}return yt(N,ie),N.prototype.setupDropdown=function(){var F=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(ae){ae.className=F.className,ae.colorsClassName=F.colorsClassName,F.dropdownBlock.appendChild(ae.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},N.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},N.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},N.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},N.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},N.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},N}(K),Je=function(){function ie(N,F){this.GRIP_SIZE=10,this.color=N,this.fillColor=F,this.visual=rt.createGroup(),this.visual.appendChild(rt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(rt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ie.prototype.ownsTarget=function(N){return N===this.visual||N===this.visual.childNodes[0]||N===this.visual.childNodes[1]},ie.prototype.setCenter=function(N,F){this.visual.childNodes.forEach(function(ae){return rt.setAttributes(ae,[["cx",N.toString()],["cy",F.toString()]])})},ie}(),lt=function(){function ie(N,F,ae,pe){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=N,this.canvasHeight=F,this.margin=ae,this.container=pe,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(ie.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(N){this._aspectRatio=N,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(N){this._isGridVisible=N,this.gridContainer&&rt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(N){this._zoomFactor=N,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),ie.prototype.open=function(){var N=this;this.cropShadeElement=rt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=rt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var F=0;Fthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-F.height/2),rt.setAttributes(this.cropRectElement,[["x",F.x.toString()],["y",F.y.toString()],["width",F.width.toString()],["height",F.height.toString()]]);var ae=F.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(se,$e){var _t=F.y+ae*($e+1);rt.setAttributes(se,[["x1",""+F.x],["y1",""+_t],["x2",""+(F.x+F.width)],["y2",""+_t]])});var pe=F.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(se,$e){var _t=F.x+pe*($e+1);rt.setAttributes(se,[["x1",""+_t],["y1",""+F.y],["x2",""+_t],["y2",""+(F.y+F.height)]])}),rt.setAttributes(this.cropShadeElement,[["d",rt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,F.x,F.y,F.width,F.height)]]),this.topLeftGrip.setCenter(F.x,F.y),this.topRightGrip.setCenter(F.x+F.width,F.y),this.bottomLeftGrip.setCenter(F.x,F.y+F.height),this.bottomRightGrip.setCenter(F.x+F.width,F.y+F.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},ie.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},ie.prototype.clientToLocalCoordinates=function(N,F){var ae=this.container.getBoundingClientRect();return{x:N-ae.left+this.margin,y:F-ae.top+this.margin}},ie.prototype.onPointerDown=function(N){this.container.setPointerCapture(N.pointerId),this.previousPoint=this.clientToLocalCoordinates(N.clientX,N.clientY),this.cropRectElement===N.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(N.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(N.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(N.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(N.target)&&(this.activeGrip=this.bottomRightGrip)},ie.prototype.onPointerMove=function(N){if(this.isMoving)this.move(this.clientToLocalCoordinates(N.clientX,N.clientY));else if(this.activeGrip){var F=this.clientToLocalCoordinates(N.clientX,N.clientY);this.resize(F)}N.preventDefault()},ie.prototype.onPointerUp=function(N){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(N.pointerId)},ie.prototype.move=function(N){var F=N.x-this.previousPoint.x,ae=N.y-this.previousPoint.y;this.zoomFactor!==1&&(F=-F/this.zoomFactor,ae=-ae/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+F),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+ae),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=N},ie.prototype.resize=function(N){var F=Object.assign({},this.cropRect),ae=N.x-this.previousPoint.x,pe=N.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:F.x+aethis.canvasWidth*this.zoomFactor&&(ae=this.canvasWidth*this.zoomFactor-F.width),F.width+=ae}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(F.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(ae),F.height=this.aspectRatio.getVerticalLength(F.width)):(F.y+=pe,F.height=this.cropRect.y+this.cropRect.height-F.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?F.height=this.aspectRatio.getVerticalLength(F.width):F.height+=pe}F.width<10&&(F.x=this.cropRect.x,F.width=10),F.height<10&&(F.y=this.cropRect.y,F.height=10),this.previousPoint=N,F.x>=this.margin&&F.y>=this.margin&&F.x-this.margin+F.width<=this.canvasWidth&&F.y-this.margin+F.height<=this.canvasHeight&&(this.cropRect=F,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},ie.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var N=this.cropRect.x+this.cropRect.width/2,F=this.cropRect.y+this.cropRect.height/2,ae=this.aspectRatio.getHorizontalLength(this.cropRect.height),pe=this.aspectRatio.getVerticalLength(this.cropRect.width);ae/this.canvasWidththis.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=N-this.cropRect.width/2,this.cropRect.y=F-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},ie.prototype.getRescaledRect=function(N,F,ae,pe,se,$e){var _t=ae/N,it=pe/F;return{x:(se.x-$e)*_t+$e,y:(se.y-$e)*it+$e,width:se.width*_t,height:se.height*it}},ie.prototype.scaleCanvas=function(N,F){var ae=this.getRescaledRect(this.canvasWidth,this.canvasHeight,N,F,this.cropRect,this.margin);this.canvasWidth=N,this.canvasHeight=F,this.onCropChange&&this.onCropChange(ae),this.setCropRectangle(ae)},ie}(),Pt=function(){function ie(N){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=N,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(ie.prototype,"angle",{get:function(){return this._angle},set:function(N){this._angle=N,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),ie.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},ie.prototype.onPointerDown=function(N){this.controlContainer.setPointerCapture(N.pointerId),this.isDragging=!0,this.previousPoint={x:N.clientX,y:N.clientY}},ie.prototype.onPointerMove=function(N){this.isDragging&&(this.onAngleChange&&this.onAngleChange((N.clientX-this.previousPoint.x)/5),this.previousPoint.x=N.clientX)},ie.prototype.onPointerUp=function(N){this.isDragging&&this.onAngleChange&&this.onAngleChange((N.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(N.pointerId)},ie.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var N=this.angleLabelText.getBBox();rt.setAttributes(this.angleLabelElement,[["x",((this.width-N.width)/2).toString()],["y",(this.height/2).toString()]])}},ie.prototype.positionScaleShape=function(){if(this.scaleShape){var N=this.scaleShape.transform.baseVal.getItem(0);N.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(N,0)}},ie.prototype.getVisual=function(){var N=document.createElementNS("http://www.w3.org/2000/svg","svg");N.setAttribute("xmlns","http://www.w3.org/2000/svg"),N.setAttribute("width",this.width+"px"),N.setAttribute("height",this.height+"px"),N.setAttribute("viewBox","0 0 "+this.width+" "+this.height),N.style.flexShrink="0",document.body.appendChild(N);for(var F="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,ae=1;ae<=this.width/5+10;ae++){var pe=ae%5==0?this.height/3:this.height/6;F+="h4v"+-pe+"h1v"+pe}F+="v1H0Z",this.scaleShape=rt.createPath(F);var se=rt.createTransform();this.scaleShape.transform.baseVal.appendItem(se),N.appendChild(this.scaleShape),this.angleLabelElement=rt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=rt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var $e=rt.createTSpan("");return $e.innerHTML="°",this.angleLabelElement.appendChild($e),N.appendChild(this.angleLabelElement),document.body.removeChild(N),N},ie}(),Nt=function(){function ie(){this.naturalSize=!1,this.imageType="image/png"}return ie.prototype.rasterize=function(N,F,ae,pe,se,$e,_t){var it=this;return new Promise(function(Vt){var At=document.createElement("canvas");At.width=N.width.baseVal.value-2*pe,At.height=N.height.baseVal.value-2*pe;var Bt=1,on=1;it.naturalSize===!0?(Bt=F.naturalWidth/(N.width.baseVal.value-2*pe)/$e,on=F.naturalHeight/(N.height.baseVal.value-2*pe)/_t,At.width=F.naturalWidth/$e,At.height=F.naturalHeight/_t):it.width!==void 0&&it.height!==void 0&&(Bt=it.width/ae.width,on=it.height/ae.height,At.width*=Bt,At.height*=on);var In=At.getContext("2d");In.translate(At.width/2,At.height/2),In.rotate(se*Math.PI/180),In.scale($e,_t),In.translate(-At.width/2,-At.height/2),In.drawImage(F,0,0,At.width,At.height);var Lr=document.createElement("canvas");Lr.width=ae.width*Bt,Lr.height=ae.height*on,Lr.getContext("2d").putImageData(In.getImageData((ae.x-pe)*Bt,(ae.y-pe)*on,ae.width*Bt,ae.height*on),0,0),Vt(Lr.toDataURL(it.imageType,it.imageQuality))})},ie}(),ht=function(){function ie(N){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=ie.instanceCounter++,this.styles=new Tt(this.instanceNo),this.target=N,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(ie.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(N){this._zoomToCropEnabled=N,N?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(N){this._isGridVisible=N,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"gridLines",{get:function(){return this._gridLines},set:function(N){this._gridLines=N,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(N){this._rotationAngle=N,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"aspectRatio",{get:function(){var N;return(N=this._aspectRatio)!==null&&N!==void 0?N:this.aspectRatios[0]},set:function(N){this._aspectRatio=N},enumerable:!1,configurable:!0}),ie.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},ie.prototype.show=function(){this.showUI(),this.open()},ie.prototype.close=function(N){N===void 0&&(N=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),N||this.closeEventListeners.forEach(function(F){return F()}),this._isOpen=!1)},ie.prototype.addRenderEventListener=function(N){this.renderEventListeners.push(N)},ie.prototype.removeRenderEventListener=function(N){this.renderEventListeners.indexOf(N)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(N),1)},ie.prototype.addCloseEventListener=function(N){this.closeEventListeners.push(N)},ie.prototype.removeCloseEventListener=function(N){this.closeEventListeners.indexOf(N)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(N),1)},ie.prototype.setupResizeObserver=function(){var N=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){N.resize(N.target.clientWidth,N.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},ie.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var N=1*this.target.clientWidth/this.target.clientHeight,F=this.contentDiv.clientWidth/N>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*N:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,ae=F+2*this.CANVAS_MARGINN+this.CANVAS_MARGIN?this.target.offsetTop-(N+this.CANVAS_MARGIN):0;this.coverDiv.style.top=F+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},ie.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},ie.prototype.addTopToolbar=function(){var N=this;this.topToolbar=new Zt,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var F=new ve;F.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(F);var ae=[];this.aspectRatios.forEach(function(on){var In=new K(he.getIcon(on.horizontal,on.vertical),on.horizontal===0&&on.vertical===0?"FREE":on.horizontal+":"+on.vertical);In.onClick=function(){return N.ratioButtonClicked(on)},ae.push(In)}),this.aspectRatioButton=new Oe(he.getIcon(0,0),"Aspect ratio",ae),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,F.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var pe=new K('',"Toggle grid");pe.isActive=this.isGridVisible,pe.onClick=function(){N.isGridVisible=!N.isGridVisible,pe.isActive=N.isGridVisible},F.addButton(pe);var se=new K('',"Zoom to selection");if(se.isActive=this.zoomToCropEnabled,se.onClick=function(){N.zoomToCropEnabled=!N.zoomToCropEnabled,se.isActive=N.zoomToCropEnabled},F.addButton(se),!Dt.isLicensed){var $e=new Z;this.topToolbar.addElementBlock($e);var _t=document.createElement("div");_t.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var it=document.createElement("a");it.style.color="currentColor",it.href="https://markerjs.com/products/cropro",it.target="_blank",it.innerHTML='',_t.appendChild(it),$e.addElement(_t)}var Vt=new ve;Vt.minWidth=3*this.toolbarHeight+"px",Vt.contentAlign="end",this.topToolbar.addButtonBlock(Vt);var At=new K('',"OK");At.onClick=this.startRenderAndClose,Vt.addButton(At),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(At.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Bt=new K('',"Close");Bt.onClick=this.close,Vt.addButton(Bt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Bt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},ie.prototype.addBottomToolbar=function(){var N=this;this.bottomToolbar=new Zt,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var F=new ve;F.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(F);var ae=new K('',"Rotate left");ae.onClick=this.rotateLeftButtonClicked,F.addButton(ae);var pe=new K('',"Rotate right");pe.onClick=this.rotateRightButtonClicked,F.addButton(pe);var se=new Z;se.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(se),this.straightener=new Pt("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(Vt){N.rotateBy(Vt),N.straightener.angle=N.rotationAngle},se.addElement(this.straightener.getUI());var $e=new ve;$e.minWidth=2*this.toolbarHeight+"px",$e.contentAlign="end",this.bottomToolbar.addButtonBlock($e);var _t=new K('',"Flip horizontal");_t.onClick=this.flipHorizontallyButtonClicked,$e.addButton(_t);var it=new K('',"Flip vertical");it.onClick=this.flipVerticallyButtonClicked,$e.addButton(it)},ie.prototype.ratioButtonClicked=function(N){this.aspectRatio=N,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},ie.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=he.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},ie.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new oe(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},ie.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ie.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},ie.prototype.restoreState=function(N){if(N){var F=this.cropLayer.getRescaledRect(N.width,N.height,this.imageWidth,this.imageHeight,N.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(F),this.cropRectChanged(F),this.flippedHorizontally=N.flippedHorizontally,this.flippedVertically=N.flippedVertically,this.applyFlip(),this.rotationAngle=N.rotationAngle,this.applyRotation()}},ie.prototype.clientToLocalCoordinates=function(N,F){var ae=this.cropImage.getBoundingClientRect();return{x:N-ae.left,y:F-ae.top}},ie.prototype.onWindowResize=function(){this.positionUI()},ie.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var N=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=N+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},ie.prototype.rotateLeftButtonClicked=function(){var N=this.rotationAngle-90;this.rotationAngle%90!=0&&(N+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(N)},ie.prototype.rotateRightButtonClicked=function(){var N=this.rotationAngle+90;this.rotationAngle%90!=0&&(N-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(N)},ie.prototype.rotateTo=function(N){N=(N=N>180?N-360:N)<=-180?N+360:N,this.rotationAngle=N,this.applyRotation()},ie.prototype.rotateBy=function(N){this.rotateTo((this.rotationAngle+N)%360)},ie.prototype.applyRotation=function(){var N=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var F=this.editingTargetRotationContainer.transform.baseVal.getItem(0);F.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(F,0);var ae=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/ae.width,this.imageHeight/ae.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=N},ie.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},ie.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},ie.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},ie.prototype.startRenderAndClose=function(){return ot(this,void 0,void 0,function(){var N,F;return kt(this,function(ae){switch(ae.label){case 0:return[4,this.render()];case 1:return N=ae.sent(),F=this.getState(),this.renderEventListeners.forEach(function(pe){return pe(N,F)}),this.close(!0),[2]}})})},ie.prototype.render=function(){return ot(this,void 0,void 0,function(){var N;return kt(this,function(F){switch(F.label){case 0:return(N=new Nt).naturalSize=this.renderAtNaturalSize,N.imageType=this.renderImageType,N.imageQuality=this.renderImageQuality,N.width=this.renderWidth,N.height=this.renderHeight,this.unzoomFromCrop(),rt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,N.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return F.sent(),[4,N.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,F.sent()]}})})},ie.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new zt("toolbar",`
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.toolbarHeight+`px;
box-sizing: content-box;
overflow: hidden;
line-height: 0px;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new zt("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new zt("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var N=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new zt("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*N)+`px;
height: `+(this.toolbarHeight-2*N)+`px;
padding: `+N+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new zt("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new zt("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new Ft("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new Ft("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new zt("toolbar_dropdown",`
position: absolute;
max-width: `+4*this.toolbarHeight+`px;
z-index: 20;
white-space: normal;
box-sizing: content-box;
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
line-height: 0px;
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new zt("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new zt("toolbar_straightener_block",`
display: flex;
overflow: hidden;
justify-content: center;
-webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new zt("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*N)+`px;
padding: `+N+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new zt("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},ie.instanceCounter=0,ie}(),Mt=z("8hTe"),nn=z.n(Mt),Rt=/]*>/g;function cn(ie){var N=document.createElement("div");return N.innerHTML=ie,N.childNodes.length===0?"":N.childNodes[0].nodeValue}var an=Ve.a=function(ie){var N=ie.value,F=N===void 0?"":N,ae=ie.edit,pe=ae===void 0?!1:ae,se=ie.className,$e=ie.showTextOnly,_t=ie.showLines,it=ie.replaces,Vt=ie.zoomImg,At=ie.hasMask,Bt=ie.style,on=Bt===void 0?{}:Bt,In=ie.stylesPrev,Lr=In===void 0?{}:In,Sr=String(F),Un=Object(p.useRef)(),ur=Object(p.useRef)(),mi=Object(p.useState)(""),Ar=Object(T.a)(mi,2),fr=Ar[0],br=Ar[1],Xr=Object(p.useState)("office"),Dr=Object(T.a)(Xr,2),Yr=Dr[0],gr=Dr[1],gi=function(){var wn=new ht(ur.current);wn.displayMode="popup",wn.addRenderEventListener(function(){var Er=Object(b.a)(c.a.mark(function qn(kr){var hr;return c.a.wrap(function(Nr){for(;;)switch(Nr.prev=Nr.next){case 0:return Un.current.style.display="none",Nr.next=3,Object(ce.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:kr}});case 3:hr=Nr.sent,hr!=null&&hr.id&&it(ur.current.getAttribute("src").replace(ne.a.API_SERVER,""),"/api/attachments/".concat(hr==null?void 0:hr.id,"?type=").concat(hr.content_type));case 5:case"end":return Nr.stop()}},qn)}));return function(qn){return Er.apply(this,arguments)}}()),wn.show()},si=function(){var wn=new De(ur.current);wn.settings.displayMode="popup",wn.addEventListener("render",function(){var Er=Object(b.a)(c.a.mark(function qn(kr){var hr;return c.a.wrap(function(Nr){for(;;)switch(Nr.prev=Nr.next){case 0:if(Un.current.style.display="none",!ur.current){Nr.next=6;break}return Nr.next=4,Object(ce.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:kr.dataUrl}});case 4:hr=Nr.sent,hr!=null&&hr.id&&it(ur.current.getAttribute("src").replace(ne.a.API_SERVER,""),"/api/attachments/".concat(hr==null?void 0:hr.id,"?type=").concat(hr.content_type));case 6:case"end":return Nr.stop()}},qn)}));return function(qn){return Er.apply(this,arguments)}}()),wn.show(),window.markerArea=wn},Pr=Object(p.useMemo)(function(){try{var Fn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,wn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Er=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Sr=Sr.replace(Fn,"("+ne.a.API_SERVER+"/api/attachments/").replace(wn,'"'+ne.a.API_SERVER+"/api/attachments/").replace(Er,'"'+ne.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`),Sr=Sr.replace(new RegExp("(?[TOC]
",E()),v()),qn=qn.replace(/(__special_katext_id_\d+__)/g,function(Ui,Nr){var Ur=kr[Nr],yi=Ur.type,Zr=Ur.expression;return Object(Y.renderToString)(cn(Zr)||"",{displayMode:yi==="block",throwOnError:!1,output:"html"})}),qn=qn.replace(/▁/g,"\u2581\u2581\u2581"),A(),$e){var hr=document.createElement("div");return hr.innerHTML=qn,hr.innerText}return setTimeout(function(){return vi()},500),qn},[Sr]),Fr=Object(p.useRef)();m.WebkitLineClamp=_t,_t&&(on=Object(P.a)(Object(P.a)({},on),m));function _i(Fn){var wn=Fn.target;if(wn.tagName.toUpperCase()==="IMG"){if(Vt){var Er=wn.getAttribute("src");br(Er),gr("image")}}else if(wn.tagName.toUpperCase()==="A"){var qn=wn.getAttribute("href");if(qn.indexOf("office")>-1)Fn.preventDefault(),br(qn),gr("office");else if(qn.indexOf("application/pdf")>-1)Fn.preventDefault(),br(qn),gr("pdf");else if(qn.indexOf("type=text")>-1)Fn.preventDefault(),br(qn),gr("html");else if(qn.startsWith("#")){Fn.preventDefault();var kr=document.getElementById(qn.replace("#",""));kr&&kr.scrollIntoView(!0)}}}var vi=function(){var wn,Er=(wn=Fr.current)===null||wn===void 0?void 0:wn.querySelectorAll("video");Er==null||Er.forEach(function(qn){if(qn.oncontextmenu=function(){return!1},qn.src.indexOf(".m3u8")>-1&&!qn.canPlayType("application/vnd.apple.mpegurl")){if(X.a.isSupported()){var kr=new X.a;kr.loadSource(qn.src),kr.attachMedia(qn)}}})};Object(p.useEffect)(function(){if(Fr.current&&Pr&&(Pr.match(Rt)&&window.PR.prettyPrint()),Fr.current)return Fr.current.addEventListener("click",_i),function(){Fr.current.removeEventListener("click",_i),A(),v()}},[Pr,Fr.current,_i]);var di=function(wn){if(!pe)return;wn.target.nodeName==="IMG"?(Un.current.style.display="flex",Un.current.style.width=wn.target.clientWidth+"px",Un.current.style.height=wn.target.clientHeight+"px",Un.current.style.top=wn.target.offsetTop+"px",Un.current.style.left=wn.target.offsetLeft+"px",ur.current.src=wn.target.getAttribute("src")):Un.current.style.display="none"};return d.a.createElement("div",{style:{position:"relative"}},d.a.createElement("div",{ref:Fr,style:Object(P.a)({},on),className:"".concat(se||""," markdown-body ").concat(nn.a.mdBody),onMouseOver:di,dangerouslySetInnerHTML:{__html:Pr}}),d.a.createElement("div",{ref:Un,className:nn.a.button},d.a.createElement(Q.a,null,d.a.createElement(w.a,{onClick:function(){return gi()}},"\u88C1\u526A"),d.a.createElement(w.a,{onClick:function(){return si()}},"\u7F16\u8F91"))),d.a.createElement("img",{ref:ur,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),d.a.createElement(ee.a,{close:!0,data:fr,hasMask:At,type:fr!=null&&fr.length?Yr:"",style:Object(P.a)({},Lr),onClose:function(){return br("")}}))}},"9VGf":function(et,Ve,z){"use strict";z.d(Ve,"a",function(){return j});var le=z("q1tI"),Q=z.n(le);function j(w,P){var b=Object(le.useRef)();Object(le.useEffect)(function(){b.current=w}),Object(le.useEffect)(function(){function T(){b.current()}if(P!==null){var C=setInterval(T,P);return function(){return clearInterval(C)}}},[P])}},AMnG:function(et,Ve,z){"use strict";var le=z("miYZ"),Q=z("tsqr"),j=z("tJVT"),w=z("q1tI"),P=z.n(w),b=z("nWbc"),T=z.n(b),C=z("Ot1p");Ve.a=function(c){var p=c.id,d=c.activeDiscussIndex,o=c.onReplyDiscuss,a=Object(w.useState)(""),u=Object(j.a)(a,2),s=u[0],h=u[1];function i(t){h(t)}function n(){if(!s){Q.b.info("\u56DE\u590D\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A!");return}o(p,s),h("")}return P.a.createElement("div",{key:p,className:"discuss-item-editor",style:{display:d===p?"block":"none",width:"100%"}},P.a.createElement(C.a,{miniToolbar:!0,startInit:d===p,defaultValue:s,id:p,noStorage:!0,watch:!1,height:155,placeholder:"\u6211\u8981\u56DE\u590D",showResizeBar:!0,onChange:i}),P.a.createElement("a",{onClick:n,className:"btn-send"},"\u53D1\u9001"))}},Aky1:function(et,Ve,z){"use strict";z.d(Ve,"a",function(){return c});var le=z("ErOA"),Q=z("ppsT"),j=z.n(Q),w="",P,b="";function T(p){C(p)}function C(p){P=new j.a.Vod({timeout:6e4,partSize:1048576,parallel:5,retryCount:3,retryDuration:2,region:"ap-southeast-1",userId:1829848226361863,enableUploadProgress:!1,addFileSuccess:function(o){console.log("addFileSuccess: "+o.file.name),p.addFileSuccess&&p.addFileSuccess(o),P.startUpload()},onUploadstarted:function(o){var a=o.file.name;if(o.videoId){var h="/api/users/".concat(w,"/video_auths.json");Object(le.a)(h,{method:"put",body:{video_id:o.videoId,title:a,file_name:a,virtual_classroom_id:b}}).then(function(i){if(i.status==-1){p.onUploadError&&p.onUploadError(o);return}var n=i.data,t=n.UploadAuth,f=n.UploadAddress,v=n.VideoId;P.setUploadAuthAndAddress(o,t,f)}).catch(function(i){P.deleteFile(P._curIndex),P.nextUpload(),console.log(i)})}else{var u="/api/users/".concat(w,"/video_auths.json"),s="";Object(le.a)(u,{method:"Post",body:{title:s+a,file_name:s+a,virtual_classroom_id:b}}).then(function(i){if(i){var n=i.data,t=n.UploadAuth,f=n.UploadAddress,v=n.VideoId;P.setUploadAuthAndAddress(o,t,f,v)}}).catch(function(i){P.deleteFile(P._curIndex),P.nextUpload(),console.log(i)}),console.log("\u6587\u4EF6\u5F00\u59CB\u4E0A\u4F20...")}},onUploadSucceed:function(o){p.onUploadSucceed&&p.onUploadSucceed(o),console.log("\u6587\u4EF6\u4E0A\u4F20\u6210\u529F!")},onUploadFailed:function(o,a,u){p.onUploadFailed&&p.onUploadFailed(o),console.log("\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25!")},onUploadCanceled:function(o,a,u){console.log("\u6587\u4EF6\u4E0A\u4F20\u5DF2\u6682\u505C!")},onUploadProgress:function(o,a,u){p.onUploadProgress&&p.onUploadProgress(o,a,u);var s=Math.ceil(u*100);console.log("\u6587\u4EF6\u4E0A\u4F20\u4E2D...")},onUploadTokenExpired:function(o){console.log("\u6587\u4EF6\u4E0A\u4F20\u8D85\u65F6!");var a="/api/users/".concat(w,"/video_auths.json");Object(le.a)(a,{method:"put",body:{video_id:o.videoId}}).then(function(u){var s=u.data,h=s.UploadAuth;P.resumeUploadWithAuth(h)}).catch(function(u){console.log(u)})},onUploadEnd:function(o){p.onUploadEnd&&p.onUploadEnd(o),console.log("onUploadEnd: uploaded all the files")}}),p.gotUploader&&p.gotUploader(P)}function c(p,d,o){p&&(w=p),d&&(b=d),T(o)}},BU3w:function(et,Ve,z){"use strict";z.d(Ve,"a",function(){return b});var le=z("MNnm"),Q="rc-util-key";function j(T){if(T.attachTo)return T.attachTo;var C=document.querySelector("head");return C||document.body}function w(T){var C,c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(le.a)())return null;var p=document.createElement("style");if((C=c.csp)===null||C===void 0?void 0:C.nonce){var d;p.nonce=(d=c.csp)===null||d===void 0?void 0:d.nonce}p.innerHTML=T;var o=j(c),a=o.firstChild;return c.prepend&&o.prepend?o.prepend(p):c.prepend&&a?o.insertBefore(p,a):o.appendChild(p),p}var P=new Map;function b(T,C){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},p=j(c);if(!P.has(p)){var d=w("",c),o=d.parentNode;P.set(p,o),o.removeChild(d)}var a=Array.from(P.get(p).children).find(function(n){return n.tagName==="STYLE"&&n[Q]===C});if(a){var u,s;if(((u=c.csp)===null||u===void 0?void 0:u.nonce)&&a.nonce!==((s=c.csp)===null||s===void 0?void 0:s.nonce)){var h;a.nonce=(h=c.csp)===null||h===void 0?void 0:h.nonce}return a.innerHTML!==T&&(a.innerHTML=T),a}var i=w(T,c);return i[Q]=C,i}},Bd2K:function(et,Ve,z){(function(le){le(z("VrN/"),z("osHv"))})(function(le){le.defineOption("autoCloseTags",!1,function(c,p,d){if(d!=le.Init&&d&&c.removeKeyMap("autoCloseTags"),!p)return;var o={name:"autoCloseTags"};(typeof p!="object"||p.whenClosing!==!1)&&(o["'/'"]=function(a){return b(a)}),(typeof p!="object"||p.whenOpening!==!1)&&(o["'>'"]=function(a){return w(a)}),c.addKeyMap(o)});var Q=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],j=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function w(c){if(c.getOption("disableInput"))return le.Pass;for(var p=c.listSelections(),d=[],o=c.getOption("autoCloseTags"),a=0;au.ch&&(t=t.slice(0,t.length-s.end+u.ch));var _=t.toLowerCase();if(!t||s.type=="string"&&(s.end!=u.ch||!/[\"\']/.test(s.string.charAt(s.string.length-1))||s.string.length==1)||s.type=="tag"&&n.close||s.string.indexOf("/")==u.ch-s.start-1||v&&T(v,_)>-1||C(c,h.mode.xmlCurrentContext&&h.mode.xmlCurrentContext(i)||[],t,u,!0))return le.Pass;var E=typeof o=="object"&&o.emptyTags;if(E&&T(E,t)>-1){d[a]={text:"/>",newPos:le.Pos(u.line,u.ch+2)};continue}var g=m&&T(m,_)>-1;d[a]={indent:g,text:">"+(g?`
`:"")+""+t+">",newPos:g?le.Pos(u.line+1,0):le.Pos(u.line,u.ch+1)}}for(var y=typeof o=="object"&&o.dontIndentOnAutoClose,a=p.length-1;a>=0;a--){var x=d[a];c.replaceRange(x.text,p[a].head,p[a].anchor,"+insert");var l=c.listSelections().slice(0);l[a]={head:x.newPos,anchor:x.newPos},c.setSelections(l),!y&&x.indent&&(c.indentLine(x.newPos.line,null,!0),c.indentLine(x.newPos.line+1,null,!0))}}function P(c,p){for(var d=c.listSelections(),o=[],a=p?"/":"",u=c.getOption("autoCloseTags"),s=typeof u=="object"&&u.dontIndentOnSlash,h=0;h"&&(v+=">"),o[h]=v}if(c.replaceSelections(o),d=c.listSelections(),!s)for(var h=0;h=0&&p[i]==d;i--)++h;o=s.to;for(var i=1;i0){for(var p=0;p1&&arguments[1]!==void 0?arguments[1]:"",p=[],d=0;d=0;p--){var d=j().key(p);c(w(d),d)}}function T(c){return j().removeItem(c)}function C(){return j().clear()}},D1Df:function(et,Ve,z){"use strict";function le(D){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?le=function(B){return typeof B}:le=function(B){return B&&typeof Symbol=="function"&&B.constructor===Symbol&&B!==Symbol.prototype?"symbol":typeof B},le(D)}function Q(){return Q=Object.assign||function(D){for(var I=1;I=0)continue;if(!Object.prototype.propertyIsEnumerable.call(D,H))continue;B[H]=D[H]}}return B}function b(D,I){if(D==null)return{};var B={},H=Object.keys(D),te,W;for(W=0;W=0)continue;B[te]=D[te]}return B}function T(D,I){if(!(D instanceof I))throw new TypeError("Cannot call a class as a function")}function C(D,I){for(var B=0;B>6),I+=String.fromCharCode(128|H&63)):H<55296||H>=57344?(I+=String.fromCharCode(224|H>>12),I+=String.fromCharCode(128|H>>6&63),I+=String.fromCharCode(128|H&63)):(B++,H=65536+((H&1023)<<10|D.charCodeAt(B)&1023),I+=String.fromCharCode(240|H>>18),I+=String.fromCharCode(128|H>>12&63),I+=String.fromCharCode(128|H>>6&63),I+=String.fromCharCode(128|H&63))}return I}var v={size:128,level:"L",bgColor:"#FFFFFF",fgColor:"#000000",includeMargin:!1},m={},_=4,E=.1;function g(D){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,B=[];return D.forEach(function(H,te){var W=null;H.forEach(function(V,X){if(!V&&W!==null){B.push("M".concat(W+I," ").concat(te+I,"h").concat(X-W,"v1H").concat(W+I,"z")),W=null;return}if(X===H.length-1){if(!V)return;W===null?B.push("M".concat(X+I,",").concat(te+I," h1v1H").concat(X+I,"z")):B.push("M".concat(W+I,",").concat(te+I," h").concat(X+1-W,"v1H").concat(W+I,"z"));return}V&&W===null&&(W=X)})}),B.join("")}function y(D,I){return D.slice().map(function(B,H){return H=I.y+I.h?B:B.map(function(te,W){return W=I.x+I.w?te:!1})})}function x(D,I){var B=D.imageSettings,H=D.size,te=D.includeMargin;if(B==null)return null;var W=te?_:0,V=I.length+W*2,X=Math.floor(H*E),ne=V/H,Y=(B.width||X)*ne,ee=(B.height||X)*ne,ce=B.x==null?I.length/2-Y/2:B.x*ne,de=B.y==null?I.length/2-ee/2:B.y*ne,Ce=null;if(B.excavate){var Se=Math.floor(ce),Pe=Math.floor(de),ye=Math.ceil(Y+ce-Se),Ee=Math.ceil(ee+de-Pe);Ce={x:Se,y:Pe,w:ye,h:Ee}}return{x:ce,y:de,h:ee,w:Y,excavation:Ce}}var l=function(){try{new Path2D().addPath(new Path2D)}catch(D){return!1}return!0}(),S=function(D){a(I,D);function I(){var B,H;T(this,I);for(var te=arguments.length,W=new Array(te),V=0;VBe.length)&&(Ie=Be.length);for(var Me=0,_e=new Array(Ie);Me=Be.length?{done:!0}:{done:!1,value:Be[_e++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return Me=Be[Symbol.iterator](),Me.next.bind(Me)}function b(Be,Ie){return Ie={exports:{}},Be(Ie,Ie.exports),Ie.exports}var T=b(function(Be){function Ie(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function Me(_e){Be.exports.defaults=_e}Be.exports={defaults:Ie(),getDefaults:Ie,changeDefaults:Me}}),C=T.defaults,c=T.getDefaults,p=T.changeDefaults,d=/[&<>"']/,o=/[&<>"']/g,a=/[<>"']|&(?!#?\w+;)/,u=/[<>"']|&(?!#?\w+;)/g,s={"&":"&","<":"<",">":">",'"':""","'":"'"},h=function(Ie){return s[Ie]};function i(Be,Ie){if(Ie){if(d.test(Be))return Be.replace(o,h)}else if(a.test(Be))return Be.replace(u,h);return Be}var n=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function t(Be){return Be.replace(n,function(Ie,Me){return Me=Me.toLowerCase(),Me==="colon"?":":Me.charAt(0)==="#"?Me.charAt(1)==="x"?String.fromCharCode(parseInt(Me.substring(2),16)):String.fromCharCode(+Me.substring(1)):""})}var f=/(^|[^\[])\^/g;function v(Be,Ie){Be=Be.source||Be,Ie=Ie||"";var Me={replace:function(Ae,Le){return Le=Le.source||Le,Le=Le.replace(f,"$1"),Be=Be.replace(Ae,Le),Me},getRegex:function(){return new RegExp(Be,Ie)}};return Me}var m=/[^\w:]/g,_=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function E(Be,Ie,Me){if(Be){var _e;try{_e=decodeURIComponent(t(Me)).replace(m,"").toLowerCase()}catch(Ae){return null}if(_e.indexOf("javascript:")===0||_e.indexOf("vbscript:")===0||_e.indexOf("data:")===0)return null}Ie&&!_.test(Me)&&(Me=S(Ie,Me));try{Me=encodeURI(Me).replace(/%25/g,"%")}catch(Ae){return null}return Me}var g={},y=/^[^:]+:\/*[^/]*$/,x=/^([^:]+:)[\s\S]*$/,l=/^([^:]+:\/*[^/]*)[\s\S]*$/;function S(Be,Ie){g[" "+Be]||(y.test(Be)?g[" "+Be]=Be+"/":g[" "+Be]=I(Be,"/",!0)),Be=g[" "+Be];var Me=Be.indexOf(":")===-1;return Ie.substring(0,2)==="//"?Me?Ie:Be.replace(x,"$1")+Ie:Ie.charAt(0)==="/"?Me?Ie:Be.replace(l,"$1")+Ie:Be+Ie}var O={exec:function(){}};function A(Be){for(var Ie=1,Me,_e;Ie=0&&Ze[Ct]==="\\";)ut=!ut;return ut?"|":" |"}),_e=Me.split(/ \|/),Ae=0;if(_e.length>Ie)_e.splice(Ie);else for(;_e.length=_e.length?Ae.slice(_e.length):Ae}).join(`
`)}var de=function(){function Be(Me){this.options=Me||W}var Ie=Be.prototype;return Ie.space=function(_e){var Ae=this.rules.block.newline.exec(_e);if(Ae)return Ae[0].length>1?{type:"space",raw:Ae[0]}:{raw:`
`}},Ie.code=function(_e,Ae){var Le=this.rules.block.code.exec(_e);if(Le){var Te=Ae[Ae.length-1];if(Te&&Te.type==="paragraph")return{raw:Le[0],text:Le[0].trimRight()};var Ze=Le[0].replace(/^ {4}/gm,"");return{type:"code",raw:Le[0],codeBlockStyle:"indented",text:this.options.pedantic?Ze:V(Ze,`
`)}}},Ie.fences=function(_e){var Ae=this.rules.block.fences.exec(_e);if(Ae){var Le=Ae[0],Te=ce(Le,Ae[3]||"");return{type:"code",raw:Le,lang:Ae[2]?Ae[2].trim():Ae[2],text:Te}}},Ie.heading=function(_e){var Ae=this.rules.block.heading.exec(_e);if(Ae)return{type:"heading",raw:Ae[0],depth:Ae[1].length,text:Ae[2]}},Ie.nptable=function(_e){var Ae=this.rules.block.nptable.exec(_e);if(Ae){var Le={type:"table",header:X(Ae[1].replace(/^ *| *\| *$/g,"")),align:Ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Ae[3]?Ae[3].replace(/\n$/,"").split(`
`):[],raw:Ae[0]};if(Le.header.length===Le.align.length){var Te=Le.align.length,Ze;for(Ze=0;Ze ?/gm,"");return{type:"blockquote",raw:Ae[0],text:Le}}},Ie.list=function(_e){var Ae=this.rules.block.list.exec(_e);if(Ae){for(var Le=Ae[0],Te=Ae[2],Ze=Te.length>1,ut=Te[Te.length-1]===")",Ct={type:"list",raw:Le,ordered:Ze,start:Ze?+Te.slice(0,-1):"",loose:!1,items:[]},Ht=Ae[0].match(this.rules.block.item),Qt=!1,bt,Lt,at,pt,st,De,Ke,yt=Ht.length,ot=0;ot1||this.options.smartLists&&at!==Te)&&(pt=Ht.slice(ot+1).join(`
`),Ct.raw=Ct.raw.substring(0,Ct.raw.length-pt.length),ot=yt-1)),st=Qt||/\n\n(?!\s*$)/.test(bt),ot!==yt-1&&(Qt=bt.charAt(bt.length-1)===`
`,st||(st=Qt)),st&&(Ct.loose=!0),De=/^\[[ xX]\] /.test(bt),Ke=void 0,De&&(Ke=bt[1]!==" ",bt=bt.replace(/^\[[ xX]\] +/,"")),Ct.items.push({type:"list_item",raw:Le,task:De,checked:Ke,loose:st,text:bt});return Ct}},Ie.html=function(_e){var Ae=this.rules.block.html.exec(_e);if(Ae)return{type:this.options.sanitize?"paragraph":"html",raw:Ae[0],pre:!this.options.sanitizer&&(Ae[1]==="pre"||Ae[1]==="script"||Ae[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ae[0]):ne(Ae[0]):Ae[0]}},Ie.def=function(_e){var Ae=this.rules.block.def.exec(_e);if(Ae){Ae[3]&&(Ae[3]=Ae[3].substring(1,Ae[3].length-1));var Le=Ae[1].toLowerCase().replace(/\s+/g," ");return{tag:Le,raw:Ae[0],href:Ae[2],title:Ae[3]}}},Ie.table=function(_e){var Ae=this.rules.block.table.exec(_e);if(Ae){var Le={type:"table",header:X(Ae[1].replace(/^ *| *\| *$/g,"")),align:Ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Ae[3]?Ae[3].replace(/\n$/,"").split(`
`):[]};if(Le.header.length===Le.align.length){Le.raw=Ae[0];var Te=Le.align.length,Ze;for(Ze=0;Ze/i.test(Te[0])&&(Ae=!1),!Le&&/^<(pre|code|kbd|script)(\s|>)/i.test(Te[0])?Le=!0:Le&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Te[0])&&(Le=!1),{type:this.options.sanitize?"text":"html",raw:Te[0],inLink:Ae,inRawBlock:Le,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Te[0]):ne(Te[0]):Te[0]}},Ie.link=function(_e){var Ae=this.rules.inline.link.exec(_e);if(Ae){var Le=Y(Ae[2],"()");if(Le>-1){var Te=Ae[0].indexOf("!")===0?5:4,Ze=Te+Ae[1].length+Le;Ae[2]=Ae[2].substring(0,Le),Ae[0]=Ae[0].substring(0,Ze).trim(),Ae[3]=""}var ut=Ae[2],Ct="";if(this.options.pedantic){var Ht=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ut);Ht?(ut=Ht[1],Ct=Ht[3]):Ct=""}else Ct=Ae[3]?Ae[3].slice(1,-1):"";ut=ut.trim().replace(/^<([\s\S]*)>$/,"$1");var Qt=ee(Ae,{href:ut&&ut.replace(this.rules.inline._escapes,"$1"),title:Ct&&Ct.replace(this.rules.inline._escapes,"$1")},Ae[0]);return Qt}},Ie.reflink=function(_e,Ae){var Le;if((Le=this.rules.inline.reflink.exec(_e))||(Le=this.rules.inline.nolink.exec(_e))){var Te=(Le[2]||Le[1]).replace(/\s+/g," ");if(Te=Ae[Te.toLowerCase()],!Te||!Te.href){var Ze=Le[0].charAt(0);return{type:"text",raw:Ze,text:Ze}}var ut=ee(Le,Te,Le[0]);return ut}},Ie.strong=function(_e,Ae,Le){Le===void 0&&(Le="");var Te=this.rules.inline.strong.start.exec(_e);if(Te&&(!Te[1]||Te[1]&&(Le===""||this.rules.inline.punctuation.exec(Le)))){Ae=Ae.slice(-1*_e.length);var Ze=Te[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Ze.lastIndex=0;for(var ut;(Te=Ze.exec(Ae))!=null;)if(ut=this.rules.inline.strong.middle.exec(Ae.slice(0,Te.index+3)),ut)return{type:"strong",raw:_e.slice(0,ut[0].length),text:_e.slice(2,ut[0].length-2)}}},Ie.em=function(_e,Ae,Le){Le===void 0&&(Le="");var Te=this.rules.inline.em.start.exec(_e);if(Te&&(!Te[1]||Te[1]&&(Le===""||this.rules.inline.punctuation.exec(Le)))){Ae=Ae.slice(-1*_e.length);var Ze=Te[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Ze.lastIndex=0;for(var ut;(Te=Ze.exec(Ae))!=null;)if(ut=this.rules.inline.em.middle.exec(Ae.slice(0,Te.index+2)),ut)return{type:"em",raw:_e.slice(0,ut[0].length),text:_e.slice(1,ut[0].length-1)}}},Ie.codespan=function(_e){var Ae=this.rules.inline.code.exec(_e);if(Ae){var Le=Ae[2].replace(/\n/g," "),Te=/[^ ]/.test(Le),Ze=Le.startsWith(" ")&&Le.endsWith(" ");return Te&&Ze&&(Le=Le.substring(1,Le.length-1)),Le=ne(Le,!0),{type:"codespan",raw:Ae[0],text:Le}}},Ie.br=function(_e){var Ae=this.rules.inline.br.exec(_e);if(Ae)return{type:"br",raw:Ae[0]}},Ie.del=function(_e){var Ae=this.rules.inline.del.exec(_e);if(Ae)return{type:"del",raw:Ae[0],text:Ae[1]}},Ie.autolink=function(_e,Ae){var Le=this.rules.inline.autolink.exec(_e);if(Le){var Te,Ze;return Le[2]==="@"?(Te=ne(this.options.mangle?Ae(Le[1]):Le[1]),Ze="mailto:"+Te):(Te=ne(Le[1]),Ze=Te),{type:"link",raw:Le[0],text:Te,href:Ze,tokens:[{type:"text",raw:Te,text:Te}]}}},Ie.url=function(_e,Ae){var Le;if(Le=this.rules.inline.url.exec(_e)){var Te,Ze;if(Le[2]==="@")Te=ne(this.options.mangle?Ae(Le[0]):Le[0]),Ze="mailto:"+Te;else{var ut;do ut=Le[0],Le[0]=this.rules.inline._backpedal.exec(Le[0])[0];while(ut!==Le[0]);Te=ne(Le[0]),Le[1]==="www."?Ze="http://"+Te:Ze=Te}return{type:"link",raw:Le[0],text:Te,href:Ze,tokens:[{type:"text",raw:Te,text:Te}]}}},Ie.inlineText=function(_e,Ae,Le){var Te=this.rules.inline.text.exec(_e);if(Te){var Ze;return Ae?Ze=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Te[0]):ne(Te[0]):Te[0]:Ze=ne(this.options.smartypants?Le(Te[0]):Te[0]),{type:"text",raw:Te[0],text:Ze}}},Be}(),Ce=te.noopTest,Se=te.edit,Pe=te.merge,ye={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Ce,table:Ce,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ye._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ye._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ye.def=Se(ye.def).replace("label",ye._label).replace("title",ye._title).getRegex(),ye.bullet=/(?:[*+-]|\d{1,9}[.)])/,ye.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ye.item=Se(ye.item,"gm").replace(/bull/g,ye.bullet).getRegex(),ye.list=Se(ye.list).replace(/bull/g,ye.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ye.def.source+")").getRegex(),ye._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ye._comment=//,ye.html=Se(ye.html,"i").replace("comment",ye._comment).replace("tag",ye._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ye.paragraph=Se(ye._paragraph).replace("hr",ye.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ye._tag).getRegex(),ye.blockquote=Se(ye.blockquote).replace("paragraph",ye.paragraph).getRegex(),ye.normal=Pe({},ye),ye.gfm=Pe({},ye.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),ye.gfm.nptable=Se(ye.gfm.nptable).replace("hr",ye.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ye._tag).getRegex(),ye.gfm.table=Se(ye.gfm.table).replace("hr",ye.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ye._tag).getRegex(),ye.pedantic=Pe({},ye.normal,{html:Se(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ye._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Ce,paragraph:Se(ye.normal._paragraph).replace("hr",ye.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",ye.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Ee={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ce,tag:"^comment|^[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Ce,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",Ee.punctuation=Se(Ee.punctuation).replace(/punctuation/g,Ee._punctuation).getRegex(),Ee._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",Ee._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",Ee.em.start=Se(Ee.em.start).replace(/punctuation/g,Ee._punctuation).getRegex(),Ee.em.middle=Se(Ee.em.middle).replace(/punctuation/g,Ee._punctuation).replace(/overlapSkip/g,Ee._overlapSkip).getRegex(),Ee.em.endAst=Se(Ee.em.endAst,"g").replace(/punctuation/g,Ee._punctuation).getRegex(),Ee.em.endUnd=Se(Ee.em.endUnd,"g").replace(/punctuation/g,Ee._punctuation).getRegex(),Ee.strong.start=Se(Ee.strong.start).replace(/punctuation/g,Ee._punctuation).getRegex(),Ee.strong.middle=Se(Ee.strong.middle).replace(/punctuation/g,Ee._punctuation).replace(/blockSkip/g,Ee._blockSkip).getRegex(),Ee.strong.endAst=Se(Ee.strong.endAst,"g").replace(/punctuation/g,Ee._punctuation).getRegex(),Ee.strong.endUnd=Se(Ee.strong.endUnd,"g").replace(/punctuation/g,Ee._punctuation).getRegex(),Ee.blockSkip=Se(Ee._blockSkip,"g").getRegex(),Ee.overlapSkip=Se(Ee._overlapSkip,"g").getRegex(),Ee._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Ee._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Ee._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Ee.autolink=Se(Ee.autolink).replace("scheme",Ee._scheme).replace("email",Ee._email).getRegex(),Ee._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Ee.tag=Se(Ee.tag).replace("comment",ye._comment).replace("attribute",Ee._attribute).getRegex(),Ee._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ee._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,Ee._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Ee.link=Se(Ee.link).replace("label",Ee._label).replace("href",Ee._href).replace("title",Ee._title).getRegex(),Ee.reflink=Se(Ee.reflink).replace("label",Ee._label).getRegex(),Ee.reflinkSearch=Se(Ee.reflinkSearch,"g").replace("reflink",Ee.reflink).replace("nolink",Ee.nolink).getRegex(),Ee.normal=Pe({},Ee),Ee.pedantic=Pe({},Ee.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Se(/^!?\[(label)\]\((.*?)\)/).replace("label",Ee._label).getRegex(),reflink:Se(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ee._label).getRegex()}),Ee.gfm=Pe({},Ee.normal,{escape:Se(Ee.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\.5&&(_e="x"+_e.toString(16)),Ie+=""+_e+";";return Ie}var We=function(){function Be(Me){this.tokens=[],this.tokens.links=Object.create(null),this.options=Me||Ue,this.options.tokenizer=this.options.tokenizer||new de,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var _e={block:Fe.normal,inline:He.normal};this.options.pedantic?(_e.block=Fe.pedantic,_e.inline=He.pedantic):this.options.gfm&&(_e.block=Fe.gfm,this.options.breaks?_e.inline=He.breaks:_e.inline=He.gfm),this.tokenizer.rules=_e}Be.lex=function(_e,Ae){var Le=new Be(Ae);return Le.lex(_e)};var Ie=Be.prototype;return Ie.lex=function(_e){return _e=_e.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(_e,this.tokens,!0),this.inline(this.tokens),this.tokens},Ie.blockTokens=function(_e,Ae,Le){Ae===void 0&&(Ae=[]),Le===void 0&&(Le=!0),_e=_e.replace(/^ +$/gm,"");for(var Te,Ze,ut,Ct;_e;){if(Te=this.tokenizer.space(_e)){_e=_e.substring(Te.raw.length),Te.type&&Ae.push(Te);continue}if(Te=this.tokenizer.code(_e,Ae)){_e=_e.substring(Te.raw.length),Te.type?Ae.push(Te):(Ct=Ae[Ae.length-1],Ct.raw+=`
`+Te.raw,Ct.text+=`
`+Te.text);continue}if(Te=this.tokenizer.fences(_e)){_e=_e.substring(Te.raw.length),Ae.push(Te);continue}if(Te=this.tokenizer.heading(_e)){_e=_e.substring(Te.raw.length),Ae.push(Te);continue}if(Te=this.tokenizer.nptable(_e)){_e=_e.substring(Te.raw.length),Ae.push(Te);continue}if(Te=this.tokenizer.hr(_e)){_e=_e.substring(Te.raw.length),Ae.push(Te);continue}if(Te=this.tokenizer.blockquote(_e)){_e=_e.substring(Te.raw.length),Te.tokens=this.blockTokens(Te.text,[],Le),Ae.push(Te);continue}if(Te=this.tokenizer.list(_e)){for(_e=_e.substring(Te.raw.length),ut=Te.items.length,Ze=0;Ze0)for(;(Ht=this.tokenizer.rules.inline.reflinkSearch.exec(Ct))!=null;)Qt.includes(Ht[0].slice(Ht[0].lastIndexOf("[")+1,-1))&&(Ct=Ct.slice(0,Ht.index)+"["+"a".repeat(Ht[0].length-2)+"]"+Ct.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ht=this.tokenizer.rules.inline.blockSkip.exec(Ct))!=null;)Ct=Ct.slice(0,Ht.index)+"["+"a".repeat(Ht[0].length-2)+"]"+Ct.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;_e;){if(ut=this.tokenizer.escape(_e)){_e=_e.substring(ut.raw.length),Ae.push(ut);continue}if(ut=this.tokenizer.tag(_e,Le,Te)){_e=_e.substring(ut.raw.length),Le=ut.inLink,Te=ut.inRawBlock,Ae.push(ut);continue}if(ut=this.tokenizer.link(_e)){_e=_e.substring(ut.raw.length),ut.type==="link"&&(ut.tokens=this.inlineTokens(ut.text,[],!0,Te)),Ae.push(ut);continue}if(ut=this.tokenizer.reflink(_e,this.tokens.links)){_e=_e.substring(ut.raw.length),ut.type==="link"&&(ut.tokens=this.inlineTokens(ut.text,[],!0,Te)),Ae.push(ut);continue}if(ut=this.tokenizer.strong(_e,Ct,Ze)){_e=_e.substring(ut.raw.length),ut.tokens=this.inlineTokens(ut.text,[],Le,Te),Ae.push(ut);continue}if(ut=this.tokenizer.em(_e,Ct,Ze)){_e=_e.substring(ut.raw.length),ut.tokens=this.inlineTokens(ut.text,[],Le,Te),Ae.push(ut);continue}if(ut=this.tokenizer.codespan(_e)){_e=_e.substring(ut.raw.length),Ae.push(ut);continue}if(ut=this.tokenizer.br(_e)){_e=_e.substring(ut.raw.length),Ae.push(ut);continue}if(ut=this.tokenizer.del(_e)){_e=_e.substring(ut.raw.length),ut.tokens=this.inlineTokens(ut.text,[],Le,Te),Ae.push(ut);continue}if(ut=this.tokenizer.autolink(_e,me)){_e=_e.substring(ut.raw.length),Ae.push(ut);continue}if(!Le&&(ut=this.tokenizer.url(_e,me))){_e=_e.substring(ut.raw.length),Ae.push(ut);continue}if(ut=this.tokenizer.inlineText(_e,Te,be)){_e=_e.substring(ut.raw.length),Ze=ut.raw.slice(-1),Ae.push(ut);continue}if(_e){var bt="Infinite loop on byte: "+_e.charCodeAt(0);if(this.options.silent){console.error(bt);break}else throw new Error(bt)}}return Ae},Q(Be,null,[{key:"rules",get:function(){return{block:Fe,inline:He}}}]),Be}(),ze=T.defaults,nt=te.cleanUrl,re=te.escape,k=function(){function Be(Me){this.options=Me||ze}var Ie=Be.prototype;return Ie.code=function(_e,Ae,Le){var Te=(Ae||"").match(/\S*/)[0];if(this.options.highlight){var Ze=this.options.highlight(_e,Te);Ze!=null&&Ze!==_e&&(Le=!0,_e=Ze)}return Te?''+(Le?_e:re(_e,!0))+`
`:""+(Le?_e:re(_e,!0))+`
`},Ie.blockquote=function(_e){return`
`+_e+`
`},Ie.html=function(_e){return _e},Ie.heading=function(_e,Ae,Le,Te){return this.options.headerIds?"
`:""+_e+"
`},Ie.hr=function(){return this.options.xhtml?`
`:`
`},Ie.list=function(_e,Ae,Le){var Te=Ae?"ol":"ul",Ze=Ae&&Le!==1?' start="'+Le+'"':"";return"<"+Te+Ze+`>
`+_e+""+Te+`>
`},Ie.listitem=function(_e){return""+_e+`
`},Ie.checkbox=function(_e){return" "},Ie.paragraph=function(_e){return""+_e+`
`},Ie.table=function(_e,Ae){return Ae&&(Ae=""+Ae+""),`
`},Ie.tablerow=function(_e){return`
`+_e+`
`},Ie.tablecell=function(_e,Ae){var Le=Ae.header?"th":"td",Te=Ae.align?"<"+Le+' align="'+Ae.align+'">':"<"+Le+">";return Te+_e+""+Le+`>
`},Ie.strong=function(_e){return""+_e+""},Ie.em=function(_e){return""+_e+""},Ie.codespan=function(_e){return""+_e+""},Ie.br=function(){return this.options.xhtml?"
":"
"},Ie.del=function(_e){return""+_e+""},Ie.link=function(_e,Ae,Le){if(_e=nt(this.options.sanitize,this.options.baseUrl,_e),_e===null)return Le;var Te='"+Le+"",Te},Ie.image=function(_e,Ae,Le){if(_e=nt(this.options.sanitize,this.options.baseUrl,_e),_e===null)return Le;var Te='
":">",Te},Ie.text=function(_e){return _e},Be}(),U=function(){function Be(){}var Ie=Be.prototype;return Ie.strong=function(_e){return _e},Ie.em=function(_e){return _e},Ie.codespan=function(_e){return _e},Ie.del=function(_e){return _e},Ie.html=function(_e){return _e},Ie.text=function(_e){return _e},Ie.link=function(_e,Ae,Le){return""+Le},Ie.image=function(_e,Ae,Le){return""+Le},Ie.br=function(){return""},Be}(),q=function(){function Be(){this.seen={}}var Ie=Be.prototype;return Ie.slug=function(_e){var Ae=_e.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Ae)){var Le=Ae;do this.seen[Le]++,Ae=Le+"-"+this.seen[Le];while(this.seen.hasOwnProperty(Ae))}return this.seen[Ae]=0,Ae},Be}(),$=T.defaults,J=te.unescape,xe=function(){function Be(Me){this.options=Me||$,this.options.renderer=this.options.renderer||new k,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new U,this.slugger=new q}Be.parse=function(_e,Ae){var Le=new Be(Ae);return Le.parse(_e)};var Ie=Be.prototype;return Ie.parse=function(_e,Ae){Ae===void 0&&(Ae=!0);var Le="",Te,Ze,ut,Ct,Ht,Qt,bt,Lt,at,pt,st,De,Ke,yt,ot,kt,Dt,rt,Tt=_e.length;for(Te=0;Te0&&ot.tokens[0].type==="text"?(ot.tokens[0].text=rt+" "+ot.tokens[0].text,ot.tokens[0].tokens&&ot.tokens[0].tokens.length>0&&ot.tokens[0].tokens[0].type==="text"&&(ot.tokens[0].tokens[0].text=rt+" "+ot.tokens[0].tokens[0].text)):ot.tokens.unshift({type:"text",text:rt}):yt+=rt),yt+=this.parse(ot.tokens,Ke),at+=this.renderer.listitem(yt,Dt,kt);Le+=this.renderer.list(at,st,De);continue}case"html":{Le+=this.renderer.html(pt.text);continue}case"paragraph":{Le+=this.renderer.paragraph(this.parseInline(pt.tokens));continue}case"text":{for(at=pt.tokens?this.parseInline(pt.tokens):pt.text;Te+1An error occurred:"+Ne(ut.message+"",!0)+"
";throw ut}}Qe.options=Qe.setOptions=function(Be){return ke(Qe.defaults,Be),tt(Qe.defaults),Qe},Qe.getDefaults=je,Qe.defaults=mt,Qe.use=function(Be){var Ie=ke({},Be);if(Be.renderer&&function(){var _e=Qe.defaults.renderer||new k,Ae=function(Ze){var ut=_e[Ze];_e[Ze]=function(){for(var Ct=arguments.length,Ht=new Array(Ct),Qt=0;Qt=0;a--){if(!j(o[a]))continue;var u=o[a].split("="),s=unescape(u[0]),h=unescape(u[1]);d(h,s)}}function T(d,o){if(!d)return;w.cookie=escape(d)+"="+escape(o)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function C(d){if(!d||!p(d))return;w.cookie=escape(d)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function c(){b(function(d,o){C(o)})}function p(d){return new RegExp("(?:^|;\\s*)"+escape(d).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(w.cookie)}},E2g8:function(et,Ve,z){(function(le,Q){/*!
* @overview es6-promise - a tiny implementation of Promises/A+.
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
* @license Licensed under MIT license
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
* @version v4.2.8+1e68dce6
*/(function(j,w){et.exports=w()})(this,function(){"use strict";function j(k){var U=typeof k;return k!==null&&(U==="object"||U==="function")}function w(k){return typeof k=="function"}var P=void 0;Array.isArray?P=Array.isArray:P=function(k){return Object.prototype.toString.call(k)==="[object Array]"};var b=P,T=0,C=void 0,c=void 0,p=function(U,q){_[T]=U,_[T+1]=q,T+=2,T===2&&(c?c(E):y())};function d(k){c=k}function o(k){p=k}var a=typeof window!="undefined"?window:void 0,u=a||{},s=u.MutationObserver||u.WebKitMutationObserver,h=typeof self=="undefined"&&typeof le!="undefined"&&{}.toString.call(le)==="[object process]",i=typeof Uint8ClampedArray!="undefined"&&typeof importScripts!="undefined"&&typeof MessageChannel!="undefined";function n(){return function(){return le.nextTick(E)}}function t(){return typeof C!="undefined"?function(){C(E)}:m()}function f(){var k=0,U=new s(E),q=document.createTextNode("");return U.observe(q,{characterData:!0}),function(){q.data=k=++k%2}}function v(){var k=new MessageChannel;return k.port1.onmessage=E,function(){return k.port2.postMessage(0)}}function m(){var k=setTimeout;return function(){return k(E,1)}}var _=new Array(1e3);function E(){for(var k=0;k`,triples:"",explode:"[]{}"},j=le.Pos;le.defineOption("autoCloseBrackets",!1,function(s,h,i){i&&i!=le.Init&&(s.removeKeyMap(P),s.state.closeBrackets=null),h&&(b(w(h,"pairs")),s.state.closeBrackets=h,s.addKeyMap(P))});function w(s,h){return h=="pairs"&&typeof s=="string"?s:typeof s=="object"&&s[h]!=null?s[h]:Q[h]}var P={Backspace:c,Enter:p};function b(s){for(var h=0;h=0;t--){var v=n[t].head;s.replaceRange("",j(v.line,v.ch-1),j(v.line,v.ch+1),"+delete")}}function p(s){var h=C(s),i=h&&w(h,"explode");if(!i||s.getOption("disableInput"))return le.Pass;for(var n=s.listSelections(),t=0;t0;return{anchor:new j(s.anchor.line,s.anchor.ch+(h?-1:1)),head:new j(s.head.line,s.head.ch+(h?1:-1))}}function o(s,h){var i=C(s);if(!i||s.getOption("disableInput"))return le.Pass;var n=w(i,"pairs"),t=n.indexOf(h);if(t==-1)return le.Pass;for(var f=w(i,"closeBefore"),v=w(i,"triples"),m=n.charAt(t+1)==h,_=s.listSelections(),E=t%2==0,g,y=0;y<_.length;y++){var x=_[y],l=x.head,S,O=s.getRange(l,j(l.line,l.ch+1));if(E&&!x.empty())S="surround";else if((m||!E)&&O==h)m&&u(s,l)?S="both":v.indexOf(h)>=0&&s.getRange(l,j(l.line,l.ch+3))==h+h+h?S="skipThree":S="skip";else if(m&&l.ch>1&&v.indexOf(h)>=0&&s.getRange(j(l.line,l.ch-2),l)==h+h){if(l.ch>2&&/\bstring/.test(s.getTokenTypeAt(j(l.line,l.ch-2))))return le.Pass;S="addFour"}else if(m){var A=l.ch==0?" ":s.getRange(j(l.line,l.ch-1),l);if(!le.isWordChar(O)&&A!=h&&!le.isWordChar(A))S="both";else return le.Pass}else if(E&&(O.length===0||/\s/.test(O)||f.indexOf(O)>-1))S="both";else return le.Pass;if(!g)g=S;else if(g!=S)return le.Pass}var D=t%2?n.charAt(t-1):h,I=t%2?h:n.charAt(t+1);s.operation(function(){if(g=="skip")s.execCommand("goCharRight");else if(g=="skipThree")for(var B=0;B<3;B++)s.execCommand("goCharRight");else if(g=="surround"){for(var H=s.getSelections(),B=0;B ").concat(Z);if(Re.ENABLE_CALLBACK&&Re.emitter.emit("log","error",oe),!Re.ENABLE_ERROR)return;console.error?console.error(oe):console.warn?console.warn(oe):console.log(oe)}},{key:"i",value:function(K,Z){(!K||Re.FORCE_GLOBAL_TAG)&&(K=Re.GLOBAL_TAG);var oe="[".concat(K,"] > ").concat(Z);if(Re.ENABLE_CALLBACK&&Re.emitter.emit("log","info",oe),!Re.ENABLE_INFO)return;console.info?console.info(oe):console.log(oe)}},{key:"w",value:function(K,Z){(!K||Re.FORCE_GLOBAL_TAG)&&(K=Re.GLOBAL_TAG);var oe="[".concat(K,"] > ").concat(Z);if(Re.ENABLE_CALLBACK&&Re.emitter.emit("log","warn",oe),!Re.ENABLE_WARN)return;console.warn?console.warn(oe):console.log(oe)}},{key:"d",value:function(K,Z){(!K||Re.FORCE_GLOBAL_TAG)&&(K=Re.GLOBAL_TAG);var oe="[".concat(K,"] > ").concat(Z);if(Re.ENABLE_CALLBACK&&Re.emitter.emit("log","debug",oe),!Re.ENABLE_DEBUG)return;console.debug?console.debug(oe):console.log(oe)}},{key:"v",value:function(K,Z){(!K||Re.FORCE_GLOBAL_TAG)&&(K=Re.GLOBAL_TAG);var oe="[".concat(K,"] > ").concat(Z);if(Re.ENABLE_CALLBACK&&Re.emitter.emit("log","verbose",oe),!Re.ENABLE_VERBOSE)return;console.log(oe)}}]),Re}();T.GLOBAL_TAG="flv.js",T.FORCE_GLOBAL_TAG=!1,T.ENABLE_ERROR=!0,T.ENABLE_INFO=!0,T.ENABLE_WARN=!0,T.ENABLE_DEBUG=!0,T.ENABLE_VERBOSE=!0,T.ENABLE_CALLBACK=!1,T.emitter=new b.a;var C=T,c=function(){function Re(){Object(le.a)(this,Re),this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now}return Object(Q.a)(Re,[{key:"reset",value:function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0}},{key:"addBytes",value:function(K){this._firstCheckpoint===0?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=K,this._totalBytes+=K):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=K,this._totalBytes+=K):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=K,this._totalBytes+=K,this._lastCheckpoint=this._now())}},{key:"currentKBps",get:function(){this.addBytes(0);var K=(this._now()-this._lastCheckpoint)/1e3;return K==0&&(K=1),this._intervalBytes/K/1024}},{key:"lastSecondKBps",get:function(){return this.addBytes(0),this._lastSecondBytes!==0?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0}},{key:"averageKBps",get:function(){var K=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/K/1024}}]),Re}(),p=c,d=z("yKVA"),o=z("879j"),a=function(){function Re(ve){Object(le.a)(this,Re),this._message=ve}return Object(Q.a)(Re,[{key:"name",get:function(){return"RuntimeException"}},{key:"message",get:function(){return this._message}},{key:"toString",value:function(){return this.name+": "+this.message}}]),Re}(),u=function(Re){Object(d.a)(K,Re);var ve=Object(o.a)(K);function K(Z){return Object(le.a)(this,K),ve.call(this,Z)}return Object(Q.a)(K,[{key:"name",get:function(){return"IllegalStateException"}}]),K}(a),s=function(Re){Object(d.a)(K,Re);var ve=Object(o.a)(K);function K(Z){return Object(le.a)(this,K),ve.call(this,Z)}return Object(Q.a)(K,[{key:"name",get:function(){return"InvalidArgumentException"}}]),K}(a),h=function(Re){Object(d.a)(K,Re);var ve=Object(o.a)(K);function K(Z){return Object(le.a)(this,K),ve.call(this,Z)}return Object(Q.a)(K,[{key:"name",get:function(){return"NotImplementedException"}}]),K}(a),i={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},n={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},t=function(){function Re(ve){Object(le.a)(this,Re),this._type=ve||"undefined",this._status=i.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return Object(Q.a)(Re,[{key:"destroy",value:function(){this._status=i.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}},{key:"isWorking",value:function(){return this._status===i.kConnecting||this._status===i.kBuffering}},{key:"type",get:function(){return this._type}},{key:"status",get:function(){return this._status}},{key:"needStashBuffer",get:function(){return this._needStash}},{key:"onContentLengthKnown",get:function(){return this._onContentLengthKnown},set:function(K){this._onContentLengthKnown=K}},{key:"onURLRedirect",get:function(){return this._onURLRedirect},set:function(K){this._onURLRedirect=K}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(K){this._onDataArrival=K}},{key:"onError",get:function(){return this._onError},set:function(K){this._onError=K}},{key:"onComplete",get:function(){return this._onComplete},set:function(K){this._onComplete=K}},{key:"open",value:function(K,Z){throw new h("Unimplemented abstract function!")}},{key:"abort",value:function(){throw new h("Unimplemented abstract function!")}}]),Re}(),f=z("oZsa");function v(Re,ve){for(;!Object.prototype.hasOwnProperty.call(Re,ve)&&!(Re=Object(f.a)(Re),Re===null););return Re}function m(Re,ve,K){return typeof Reflect!="undefined"&&Reflect.get?m=Reflect.get:m=function(oe,he,Oe){var Je=v(oe,he);if(!Je)return;var lt=Object.getOwnPropertyDescriptor(Je,he);return lt.get?lt.get.call(Oe):lt.value},m(Re,ve,K||Re)}var _={};function E(){var Re=self.navigator.userAgent.toLowerCase(),ve=/(edge)\/([\w.]+)/.exec(Re)||/(opr)[\/]([\w.]+)/.exec(Re)||/(chrome)[ \/]([\w.]+)/.exec(Re)||/(iemobile)[\/]([\w.]+)/.exec(Re)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(Re)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(Re)||/(webkit)[ \/]([\w.]+)/.exec(Re)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(Re)||/(msie) ([\w.]+)/.exec(Re)||Re.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(Re)||Re.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(Re)||[],K=/(ipad)/.exec(Re)||/(ipod)/.exec(Re)||/(windows phone)/.exec(Re)||/(iphone)/.exec(Re)||/(kindle)/.exec(Re)||/(android)/.exec(Re)||/(windows)/.exec(Re)||/(mac)/.exec(Re)||/(linux)/.exec(Re)||/(cros)/.exec(Re)||[],Z={browser:ve[5]||ve[3]||ve[1]||"",version:ve[2]||ve[4]||"0",majorVersion:ve[4]||ve[2]||"0",platform:K[0]||""},oe={};if(Z.browser){oe[Z.browser]=!0;var he=Z.majorVersion.split(".");oe.version={major:parseInt(Z.majorVersion,10),string:Z.version},he.length>1&&(oe.version.minor=parseInt(he[1],10)),he.length>2&&(oe.version.build=parseInt(he[2],10))}if(Z.platform&&(oe[Z.platform]=!0),(oe.chrome||oe.opr||oe.safari)&&(oe.webkit=!0),oe.rv||oe.iemobile){oe.rv&&delete oe.rv;var Oe="msie";Z.browser=Oe,oe[Oe]=!0}if(oe.edge){delete oe.edge;var Je="msedge";Z.browser=Je,oe[Je]=!0}if(oe.opr){var lt="opera";Z.browser=lt,oe[lt]=!0}if(oe.safari&&oe.android){var Pt="android";Z.browser=Pt,oe[Pt]=!0}oe.name=Z.browser,oe.platform=Z.platform;for(var Nt in _)_.hasOwnProperty(Nt)&&delete _[Nt];Object.assign(_,oe)}E();var g=_,y=function(Re){Object(d.a)(K,Re);var ve=Object(o.a)(K);function K(Z,oe){var he;return Object(le.a)(this,K),he=ve.call(this,"fetch-stream-loader"),he.TAG="FetchStreamLoader",he._seekHandler=Z,he._config=oe,he._needStash=!0,he._requestAbort=!1,he._contentLength=null,he._receivedLength=0,he}return Object(Q.a)(K,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),m(Object(f.a)(K.prototype),"destroy",this).call(this)}},{key:"open",value:function(oe,he){var Oe=this;this._dataSource=oe,this._range=he;var Je=oe.url;this._config.reuseRedirectedURL&&oe.redirectedURL!=null&&(Je=oe.redirectedURL);var lt=this._seekHandler.getConfig(Je,he),Pt=new self.Headers;if(typeof lt.headers=="object"){var Nt=lt.headers;for(var ht in Nt)Nt.hasOwnProperty(ht)&&Pt.append(ht,Nt[ht])}var Mt={method:"GET",headers:Pt,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(var nn in this._config.headers)Pt.append(nn,this._config.headers[nn]);oe.cors===!1&&(Mt.mode="same-origin"),oe.withCredentials&&(Mt.credentials="include"),oe.referrerPolicy&&(Mt.referrerPolicy=oe.referrerPolicy),this._status=i.kConnecting,self.fetch(lt.url,Mt).then(function(Rt){if(Oe._requestAbort){Oe._requestAbort=!1,Oe._status=i.kIdle;return}if(Rt.ok&&Rt.status>=200&&Rt.status<=299){if(Rt.url!==lt.url&&Oe._onURLRedirect){var cn=Oe._seekHandler.removeURLParameters(Rt.url);Oe._onURLRedirect(cn)}var an=Rt.headers.get("Content-Length");return an!=null&&(Oe._contentLength=parseInt(an),Oe._contentLength!==0&&(Oe._onContentLengthKnown&&Oe._onContentLengthKnown(Oe._contentLength))),Oe._pump.call(Oe,Rt.body.getReader())}else if(Oe._status=i.kError,Oe._onError)Oe._onError(n.HTTP_STATUS_CODE_INVALID,{code:Rt.status,msg:Rt.statusText});else throw new a("FetchStreamLoader: Http code invalid, "+Rt.status+" "+Rt.statusText)}).catch(function(Rt){if(Oe._status=i.kError,Oe._onError)Oe._onError(n.EXCEPTION,{code:-1,msg:Rt.message});else throw Rt})}},{key:"abort",value:function(){this._requestAbort=!0}},{key:"_pump",value:function(oe){var he=this;return oe.read().then(function(Oe){if(Oe.done)if(he._contentLength!==null&&he._receivedLength=15048,he=g.msedge?oe:!0;return self.fetch&&self.ReadableStream&&he}catch(Oe){return!1}}}]),K}(t),x=y,l=function(Re){Object(d.a)(K,Re);var ve=Object(o.a)(K);function K(Z,oe){var he;return Object(le.a)(this,K),he=ve.call(this,"xhr-moz-chunked-loader"),he.TAG="MozChunkedLoader",he._seekHandler=Z,he._config=oe,he._needStash=!0,he._xhr=null,he._requestAbort=!1,he._contentLength=null,he._receivedLength=0,he}return Object(Q.a)(K,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),m(Object(f.a)(K.prototype),"destroy",this).call(this)}},{key:"open",value:function(oe,he){this._dataSource=oe,this._range=he;var Oe=oe.url;this._config.reuseRedirectedURL&&oe.redirectedURL!=null&&(Oe=oe.redirectedURL);var Je=this._seekHandler.getConfig(Oe,he);this._requestURL=Je.url;var lt=this._xhr=new XMLHttpRequest;if(lt.open("GET",Je.url,!0),lt.responseType="moz-chunked-arraybuffer",lt.onreadystatechange=this._onReadyStateChange.bind(this),lt.onprogress=this._onProgress.bind(this),lt.onloadend=this._onLoadEnd.bind(this),lt.onerror=this._onXhrError.bind(this),oe.withCredentials&&(lt.withCredentials=!0),typeof Je.headers=="object"){var Pt=Je.headers;for(var Nt in Pt)Pt.hasOwnProperty(Nt)&<.setRequestHeader(Nt,Pt[Nt])}if(typeof this._config.headers=="object"){var ht=this._config.headers;for(var Mt in ht)ht.hasOwnProperty(Mt)&<.setRequestHeader(Mt,ht[Mt])}this._status=i.kConnecting,lt.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=i.kComplete}},{key:"_onReadyStateChange",value:function(oe){var he=oe.target;if(he.readyState===2){if(he.responseURL!=null&&he.responseURL!==this._requestURL&&this._onURLRedirect){var Oe=this._seekHandler.removeURLParameters(he.responseURL);this._onURLRedirect(Oe)}if(he.status!==0&&(he.status<200||he.status>299))if(this._status=i.kError,this._onError)this._onError(n.HTTP_STATUS_CODE_INVALID,{code:he.status,msg:he.statusText});else throw new a("MozChunkedLoader: Http code invalid, "+he.status+" "+he.statusText);else this._status=i.kBuffering}}},{key:"_onProgress",value:function(oe){if(this._status===i.kError)return;this._contentLength===null&&(oe.total!==null&&oe.total!==0&&(this._contentLength=oe.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)));var he=oe.target.response,Oe=this._range.from+this._receivedLength;this._receivedLength+=he.byteLength,this._onDataArrival&&this._onDataArrival(he,Oe,this._receivedLength)}},{key:"_onLoadEnd",value:function(oe){if(this._requestAbort===!0){this._requestAbort=!1;return}else if(this._status===i.kError)return;this._status=i.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)}},{key:"_onXhrError",value:function(oe){this._status=i.kError;var he=0,Oe=null;if(this._contentLength&&oe.loaded=200&&he.status<=299){if(this._status=i.kBuffering,he.responseURL!=null){var Oe=this._seekHandler.removeURLParameters(he.responseURL);he.responseURL!==this._currentRequestURL&&Oe!==this._currentRedirectedURL&&(this._currentRedirectedURL=Oe,this._onURLRedirect&&this._onURLRedirect(Oe))}var Je=he.getResponseHeader("Content-Length");if(Je!=null&&this._contentLength==null){var lt=parseInt(Je);lt>0&&(this._contentLength=lt,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}}else if(this._status=i.kError,this._onError)this._onError(n.HTTP_STATUS_CODE_INVALID,{code:he.status,msg:he.statusText});else throw new a("MSStreamLoader: Http code invalid, "+he.status+" "+he.statusText);else if(he.readyState===3&&(he.status>=200&&he.status<=299)){this._status=i.kBuffering;var Pt=he.response;this._reader.readAsArrayBuffer(Pt)}}},{key:"_xhrOnError",value:function(oe){this._status=i.kError;var he=n.EXCEPTION,Oe={code:-1,msg:oe.constructor.name+" "+oe.type};if(this._onError)this._onError(he,Oe);else throw new a(Oe.msg)}},{key:"_msrOnProgress",value:function(oe){var he=oe.target,Oe=he.result;if(Oe==null){this._doReconnectIfNeeded();return}var Je=Oe.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=Oe.byteLength;var lt=this._totalRange.from+this._receivedLength;this._receivedLength+=Je.byteLength,this._onDataArrival&&this._onDataArrival(Je,lt,this._receivedLength),Oe.byteLength>=this._bufferLimit&&(C.v(this.TAG,"MSStream buffer exceeded max size near ".concat(lt+Je.byteLength,", reconnecting...")),this._doReconnectIfNeeded())}},{key:"_doReconnectIfNeeded",value:function(){if(this._contentLength==null||this._receivedLength=this._contentLength&&(Oe=this._range.from+this._contentLength-1)),this._currentRequestRange={from:he,to:Oe},this._internalOpen(this._dataSource,this._currentRequestRange)}},{key:"_internalOpen",value:function(oe,he){this._lastTimeLoaded=0;var Oe=oe.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?Oe=this._currentRedirectedURL:oe.redirectedURL!=null&&(Oe=oe.redirectedURL));var Je=this._seekHandler.getConfig(Oe,he);this._currentRequestURL=Je.url;var lt=this._xhr=new XMLHttpRequest;if(lt.open("GET",Je.url,!0),lt.responseType="arraybuffer",lt.onreadystatechange=this._onReadyStateChange.bind(this),lt.onprogress=this._onProgress.bind(this),lt.onload=this._onLoad.bind(this),lt.onerror=this._onXhrError.bind(this),oe.withCredentials&&(lt.withCredentials=!0),typeof Je.headers=="object"){var Pt=Je.headers;for(var Nt in Pt)Pt.hasOwnProperty(Nt)&<.setRequestHeader(Nt,Pt[Nt])}if(typeof this._config.headers=="object"){var ht=this._config.headers;for(var Mt in ht)ht.hasOwnProperty(Mt)&<.setRequestHeader(Mt,ht[Mt])}lt.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._internalAbort(),this._status=i.kComplete}},{key:"_internalAbort",value:function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)}},{key:"_onReadyStateChange",value:function(oe){var he=oe.target;if(he.readyState===2){if(he.responseURL!=null){var Oe=this._seekHandler.removeURLParameters(he.responseURL);he.responseURL!==this._currentRequestURL&&Oe!==this._currentRedirectedURL&&(this._currentRedirectedURL=Oe,this._onURLRedirect&&this._onURLRedirect(Oe))}if(he.status>=200&&he.status<=299){if(this._waitForTotalLength)return;this._status=i.kBuffering}else if(this._status=i.kError,this._onError)this._onError(n.HTTP_STATUS_CODE_INVALID,{code:he.status,msg:he.statusText});else throw new a("RangeLoader: Http code invalid, "+he.status+" "+he.statusText)}}},{key:"_onProgress",value:function(oe){if(this._status===i.kError)return;if(this._contentLength===null){var he=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,he=!0;var Oe=oe.total;this._internalAbort(),Oe!=null&Oe!==0&&(this._totalLength=Oe)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,he){this._openSubRange();return}this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var Je=oe.loaded-this._lastTimeLoaded;this._lastTimeLoaded=oe.loaded,this._speedSampler.addBytes(Je)}},{key:"_normalizeSpeed",value:function(oe){var he=this._chunkSizeKBList,Oe=he.length-1,Je=0,lt=0,Pt=Oe;if(oe=he[Je]&&oe=3&&(he=this._speedSampler.currentKBps)),he!==0){var Oe=this._normalizeSpeed(he);this._currentSpeedNormalized!==Oe&&(this._currentSpeedNormalized=Oe,this._currentChunkSizeKB=Oe)}var Je=oe.target.response,lt=this._range.from+this._receivedLength;this._receivedLength+=Je.byteLength;var Pt=!1;this._contentLength!=null&&this._receivedLength0&&this._receivedLength0)for(var Je=oe.split("&"),lt=0;lt0;Pt[0]!==this._startName&&Pt[0]!==this._endName&&(Nt&&(Oe+="&"),Oe+=Je[lt])}return Oe.length===0?Z:Z+"?"+Oe}}]),Re}(),X=V,ne=function(){function Re(ve,K,Z){Object(le.a)(this,Re),this.TAG="IOController",this._config=K,this._extraData=Z,this._stashInitialSize=1024*384,K.stashInitialSize!=null&&K.stashInitialSize>0&&(this._stashInitialSize=K.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=1024*1024*3,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,K.enableStashBuffer===!1&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=ve,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(ve.url),this._refTotalLength=ve.filesize?ve.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new p,this._speedNormalizeList=[64,128,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return Object(Q.a)(Re,[{key:"destroy",value:function(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null}},{key:"isWorking",value:function(){return this._loader&&this._loader.isWorking()&&!this._paused}},{key:"isPaused",value:function(){return this._paused}},{key:"status",get:function(){return this._loader.status}},{key:"extraData",get:function(){return this._extraData},set:function(K){this._extraData=K}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(K){this._onDataArrival=K}},{key:"onSeeked",get:function(){return this._onSeeked},set:function(K){this._onSeeked=K}},{key:"onError",get:function(){return this._onError},set:function(K){this._onError=K}},{key:"onComplete",get:function(){return this._onComplete},set:function(K){this._onComplete=K}},{key:"onRedirect",get:function(){return this._onRedirect},set:function(K){this._onRedirect=K}},{key:"onRecoveredEarlyEof",get:function(){return this._onRecoveredEarlyEof},set:function(K){this._onRecoveredEarlyEof=K}},{key:"currentURL",get:function(){return this._dataSource.url}},{key:"hasRedirect",get:function(){return this._redirectedURL!=null||this._dataSource.redirectedURL!=null}},{key:"currentRedirectedURL",get:function(){return this._redirectedURL||this._dataSource.redirectedURL}},{key:"currentSpeed",get:function(){return this._loaderClass===I?this._loader.currentSpeed:this._speedSampler.lastSecondKBps}},{key:"loaderType",get:function(){return this._loader.type}},{key:"_selectSeekHandler",value:function(){var K=this._config;if(K.seekType==="range")this._seekHandler=new W(this._config.rangeLoadZeroStart);else if(K.seekType==="param"){var Z=K.seekParamStart||"bstart",oe=K.seekParamEnd||"bend";this._seekHandler=new X(Z,oe)}else if(K.seekType==="custom"){if(typeof K.customSeekHandler!="function")throw new s("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new K.customSeekHandler}else throw new s("Invalid seekType in config: ".concat(K.seekType))}},{key:"_selectLoader",value:function(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=H;else if(x.isSupported())this._loaderClass=x;else if(S.isSupported())this._loaderClass=S;else if(I.isSupported())this._loaderClass=I;else throw new a("Your browser doesn't support xhr with arraybuffer responseType!")}},{key:"_createLoader",value:function(){this._loader=new this._loaderClass(this._seekHandler,this._config),this._loader.needStashBuffer===!1&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)}},{key:"open",value:function(K){this._currentRange={from:0,to:-1},K&&(this._currentRange.from=K),this._speedSampler.reset(),K||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))}},{key:"abort",value:function(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)}},{key:"pause",value:function(){this.isWorking()&&(this._loader.abort(),this._stashUsed!==0?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)}},{key:"resume",value:function(){if(this._paused){this._paused=!1;var K=this._resumeFrom;this._resumeFrom=0,this._internalSeek(K,!0)}}},{key:"seek",value:function(K){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(K,!0)}},{key:"_internalSeek",value:function(K,Z){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(Z),this._loader.destroy(),this._loader=null;var oe={from:K,to:-1};this._currentRange={from:oe.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,oe),this._onSeeked&&this._onSeeked()}},{key:"updateUrl",value:function(K){if(!K||typeof K!="string"||K.length===0)throw new s("Url must be a non-empty string!");this._dataSource.url=K}},{key:"_expandBuffer",value:function(K){for(var Z=this._stashSize;Z+1024*1024*10){var he=new Uint8Array(this._stashBuffer,0,this._stashUsed),Oe=new Uint8Array(oe,0,Z);Oe.set(he,0)}this._stashBuffer=oe,this._bufferSize=Z}},{key:"_normalizeSpeed",value:function(K){var Z=this._speedNormalizeList,oe=Z.length-1,he=0,Oe=0,Je=oe;if(K=Z[he]&&K=512&&K<=1024?Z=Math.floor(K*1.5):Z=K*2,Z>8192&&(Z=8192);var oe=Z*1024+1024*1024*1;this._bufferSize0){var cn=this._stashBuffer.slice(0,this._stashUsed),an=this._dispatchChunks(cn,this._stashByteStart);if(an0){var ie=new Uint8Array(cn,an);Rt.set(ie,0),this._stashUsed=ie.byteLength,this._stashByteStart+=an}}else this._stashUsed=0,this._stashByteStart+=an;this._stashUsed+K.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+K.byteLength),Rt=new Uint8Array(this._stashBuffer,0,this._bufferSize)),Rt.set(new Uint8Array(K),this._stashUsed),this._stashUsed+=K.byteLength}else{var N=this._dispatchChunks(K,Z);if(Nthis._bufferSize&&(this._expandBuffer(F),Rt=new Uint8Array(this._stashBuffer,0,this._bufferSize)),Rt.set(new Uint8Array(K,N),0),this._stashUsed+=F,this._stashByteStart=Z+N}}}else if(this._stashUsed===0){var Je=this._dispatchChunks(K,Z);if(Jethis._bufferSize&&this._expandBuffer(lt);var Pt=new Uint8Array(this._stashBuffer,0,this._bufferSize);Pt.set(new Uint8Array(K,Je),0),this._stashUsed+=lt,this._stashByteStart=Z+Je}}else{this._stashUsed+K.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+K.byteLength);var Nt=new Uint8Array(this._stashBuffer,0,this._bufferSize);Nt.set(new Uint8Array(K),this._stashUsed),this._stashUsed+=K.byteLength;var ht=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(ht0){var Mt=new Uint8Array(this._stashBuffer,ht);Nt.set(Mt,0)}this._stashUsed-=ht,this._stashByteStart+=ht}}},{key:"_flushStashBuffer",value:function(K){if(this._stashUsed>0){var Z=this._stashBuffer.slice(0,this._stashUsed),oe=this._dispatchChunks(Z,this._stashByteStart),he=Z.byteLength-oe;if(oe0){var Oe=new Uint8Array(this._stashBuffer,0,this._bufferSize),Je=new Uint8Array(Z,oe);Oe.set(Je,0),this._stashUsed=Je.byteLength,this._stashByteStart+=oe}return 0}return this._stashUsed=0,this._stashByteStart=0,he}return 0}},{key:"_onLoaderComplete",value:function(K,Z){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}},{key:"_onLoaderError",value:function(K,Z){C.e(this.TAG,"Loader error, code = ".concat(Z.code,", msg = ").concat(Z.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,K=n.UNRECOVERABLE_EARLY_EOF);switch(K){case n.EARLY_EOF:{if(!this._config.isLive&&this._totalLength){var oe=this._currentRange.to+1;oe0){var Z=Re.getConfig();K.emit("change",Z)}}},{key:"registerListener",value:function(K){Re.emitter.addListener("change",K)}},{key:"removeListener",value:function(K){Re.emitter.removeListener("change",K)}},{key:"addLogListener",value:function(K){C.emitter.addListener("log",K),C.emitter.listenerCount("log")>0&&(C.ENABLE_CALLBACK=!0,Re._notifyChange())}},{key:"removeLogListener",value:function(K){C.emitter.removeListener("log",K),C.emitter.listenerCount("log")===0&&(C.ENABLE_CALLBACK=!1,Re._notifyChange())}}]),Re}();ye.emitter=new b.a;var Ee=ye,Ge=function(){function Re(){Object(le.a)(this,Re),this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}return Object(Q.a)(Re,[{key:"isComplete",value:function(){var K=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,Z=this.hasVideo===!1||this.hasVideo===!0&&this.videoCodec!=null&&this.width!=null&&this.height!=null&&this.fps!=null&&this.profile!=null&&this.level!=null&&this.refFrames!=null&&this.chromaFormat!=null&&this.sarNum!=null&&this.sarDen!=null;return this.mimeType!=null&&this.duration!=null&&this.metadata!=null&&this.hasKeyframesIndex!=null&&K&&Z}},{key:"isSeekable",value:function(){return this.hasKeyframesIndex===!0}},{key:"getNearestKeyframe",value:function(K){if(this.keyframesIndex==null)return null;var Z=this.keyframesIndex,oe=this._search(Z.times,K);return{index:oe,milliseconds:Z.times[oe],fileposition:Z.filepositions[oe]}}},{key:"_search",value:function(K,Z){var oe=0,he=K.length-1,Oe=0,Je=0,lt=he;for(Z=K[Oe]&&Z=128){ve.push(String.fromCharCode(he&65535)),Z+=2;continue}}}else if(K[Z]<240){if(Fe(K,Z,2)){var Oe=(K[Z]&15)<<12|(K[Z+1]&63)<<6|K[Z+2]&63;if(Oe>=2048&&(Oe&63488)!==55296){ve.push(String.fromCharCode(Oe&65535)),Z+=3;continue}}}else if(K[Z]<248&&Fe(K,Z,3)){var Je=(K[Z]&7)<<18|(K[Z+1]&63)<<12|(K[Z+2]&63)<<6|K[Z+3]&63;if(Je>65536&&Je<1114112){Je-=65536,ve.push(String.fromCharCode(Je>>>10|55296)),ve.push(String.fromCharCode(Je&1023|56320)),Z+=4;continue}}}ve.push(String.fromCharCode(65533)),++Z}return ve.join("")}var be=He,me=function(){var Re=new ArrayBuffer(2);return new DataView(Re).setInt16(0,256,!0),new Int16Array(Re)[0]===256}(),We=function(){function Re(){Object(le.a)(this,Re)}return Object(Q.a)(Re,null,[{key:"parseScriptData",value:function(K,Z,oe){var he={};try{var Oe=Re.parseValue(K,Z,oe),Je=Re.parseValue(K,Z+Oe.size,oe-Oe.size);he[Oe.data]=Je.data}catch(lt){C.e("AMF",lt.toString())}return he}},{key:"parseObject",value:function(K,Z,oe){if(oe<3)throw new u("Data not enough when parse ScriptDataObject");var he=Re.parseString(K,Z,oe),Oe=Re.parseValue(K,Z+he.size,oe-he.size),Je=Oe.objectEnd;return{data:{name:he.data,value:Oe.data},size:he.size+Oe.size,objectEnd:Je}}},{key:"parseVariable",value:function(K,Z,oe){return Re.parseObject(K,Z,oe)}},{key:"parseString",value:function(K,Z,oe){if(oe<2)throw new u("Data not enough when parse String");var he=new DataView(K,Z,oe),Oe=he.getUint16(0,!me),Je;return Oe>0?Je=be(new Uint8Array(K,Z+2,Oe)):Je="",{data:Je,size:2+Oe}}},{key:"parseLongString",value:function(K,Z,oe){if(oe<4)throw new u("Data not enough when parse LongString");var he=new DataView(K,Z,oe),Oe=he.getUint32(0,!me),Je;return Oe>0?Je=be(new Uint8Array(K,Z+4,Oe)):Je="",{data:Je,size:4+Oe}}},{key:"parseDate",value:function(K,Z,oe){if(oe<10)throw new u("Data size invalid when parse Date");var he=new DataView(K,Z,oe),Oe=he.getFloat64(0,!me),Je=he.getInt16(8,!me);return Oe+=Je*60*1e3,{data:new Date(Oe),size:8+2}}},{key:"parseValue",value:function(K,Z,oe){if(oe<1)throw new u("Data not enough when parse Value");var he=new DataView(K,Z,oe),Oe=1,Je=he.getUint8(0),lt,Pt=!1;try{switch(Je){case 0:lt=he.getFloat64(1,!me),Oe+=8;break;case 1:{var Nt=he.getUint8(1);lt=!!Nt,Oe+=1;break}case 2:{var ht=Re.parseString(K,Z+1,oe-1);lt=ht.data,Oe+=ht.size;break}case 3:{lt={};var Mt=0;for((he.getUint32(oe-4,!me)&16777215)===9&&(Mt=3);Oe32)throw new s("ExpGolomb: readBits() bits exceeded max 32bits!");if(K<=this._current_word_bits_left){var Z=this._current_word>>>32-K;return this._current_word<<=K,this._current_word_bits_left-=K,Z}var oe=this._current_word_bits_left?this._current_word:0;oe=oe>>>32-this._current_word_bits_left;var he=K-this._current_word_bits_left;this._fillCurrentWord();var Oe=Math.min(he,this._current_word_bits_left),Je=this._current_word>>>32-Oe;return this._current_word<<=Oe,this._current_word_bits_left-=Oe,oe=oe<>>K)!==0)return this._current_word<<=K,this._current_word_bits_left-=K,K;return this._fillCurrentWord(),K+this._skipLeadingZero()}},{key:"readUEG",value:function(){var K=this._skipLeadingZero();return this.readBits(K+1)-1}},{key:"readSEG",value:function(){var K=this.readUEG();return K&1?K+1>>>1:-1*(K>>>1)}}]),Re}(),re=nt,k=function(){function Re(){Object(le.a)(this,Re)}return Object(Q.a)(Re,null,[{key:"_ebsp2rbsp",value:function(K){for(var Z=K,oe=Z.byteLength,he=new Uint8Array(oe),Oe=0,Je=0;Je=2&&(Z[Je]===3&&Z[Je-1]===0&&Z[Je-2]===0))continue;he[Oe]=Z[Je],Oe++}return new Uint8Array(he.buffer,0,Oe)}},{key:"parseSPS",value:function(K){var Z=Re._ebsp2rbsp(K),oe=new re(Z);oe.readByte();var he=oe.readByte();oe.readByte();var Oe=oe.readByte();oe.readUEG();var Je=Re.getProfileString(he),lt=Re.getLevelString(Oe),Pt=1,Nt=420,ht=[0,420,422,444],Mt=8;if((he===100||he===110||he===122||he===244||he===44||he===83||he===86||he===118||he===128||he===138||he===144)&&(Pt=oe.readUEG(),Pt===3&&oe.readBits(1),Pt<=3&&(Nt=ht[Pt]),Mt=oe.readUEG()+8,oe.readUEG(),oe.readBits(1),oe.readBool()))for(var nn=Pt!==3?8:12,Rt=0;Rt0&&ur<16?(At=mi[ur-1],Bt=Ar[ur-1]):ur===255&&(At=oe.readByte()<<8|oe.readByte(),Bt=oe.readByte()<<8|oe.readByte())}if(oe.readBool()&&oe.readBool(),oe.readBool()&&(oe.readBits(4),oe.readBool()&&oe.readBits(24)),oe.readBool()&&(oe.readUEG(),oe.readUEG()),oe.readBool()){var fr=oe.readBits(32),br=oe.readBits(32);In=oe.readBool(),Lr=br,Sr=fr*2,on=Lr/Sr}}var Xr=1;(At!==1||Bt!==1)&&(Xr=At/Bt);var Dr=0,Yr=0;if(Pt===0)Dr=1,Yr=2-pe;else{var gr=Pt===3?1:2,gi=Pt===1?2:1;Dr=gr,Yr=gi*(2-pe)}var si=(F+1)*16,Pr=(2-pe)*((ae+1)*16);si-=(se+$e)*Dr,Pr-=(_t+it)*Yr;var Fr=Math.ceil(si*Xr);return oe.destroy(),oe=null,{profile_string:Je,level_string:lt,bit_depth:Mt,ref_frames:N,chroma_format:Nt,chroma_format_string:Re.getChromaFormatString(Nt),frame_rate:{fixed:In,fps:on,fps_den:Sr,fps_num:Lr},sar_ratio:{width:At,height:Bt},codec_size:{width:si,height:Pr},present_size:{width:Fr,height:Pr}}}},{key:"_skipScalingList",value:function(K,Z){for(var oe=8,he=8,Oe=0,Je=0;Je>>8&255|(Re&255)<<8}function xe(Re){return(Re&4278190080)>>>24|(Re&16711680)>>>8|(Re&65280)<<8|(Re&255)<<24}function ke(Re,ve){return Re[ve]<<24|Re[ve+1]<<16|Re[ve+2]<<8|Re[ve+3]}var dt=function(){function Re(ve,K){Object(le.a)(this,Re),this.TAG="FLVDemuxer",this._config=K,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=ve.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=ve.hasAudioTrack,this._hasVideo=ve.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new Ue,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){var Z=new ArrayBuffer(2);return new DataView(Z).setInt16(0,256,!0),new Int16Array(Z)[0]===256}()}return Object(Q.a)(Re,[{key:"destroy",value:function(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null}},{key:"bindDataSource",value:function(K){return K.onDataArrival=this.parseChunks.bind(this),this}},{key:"onTrackMetadata",get:function(){return this._onTrackMetadata},set:function(K){this._onTrackMetadata=K}},{key:"onMediaInfo",get:function(){return this._onMediaInfo},set:function(K){this._onMediaInfo=K}},{key:"onMetaDataArrived",get:function(){return this._onMetaDataArrived},set:function(K){this._onMetaDataArrived=K}},{key:"onScriptDataArrived",get:function(){return this._onScriptDataArrived},set:function(K){this._onScriptDataArrived=K}},{key:"onError",get:function(){return this._onError},set:function(K){this._onError=K}},{key:"onDataAvailable",get:function(){return this._onDataAvailable},set:function(K){this._onDataAvailable=K}},{key:"timestampBase",get:function(){return this._timestampBase},set:function(K){this._timestampBase=K}},{key:"overridedDuration",get:function(){return this._duration},set:function(K){this._durationOverrided=!0,this._duration=K,this._mediaInfo.duration=K}},{key:"overridedHasAudio",set:function(K){this._hasAudioFlagOverrided=!0,this._hasAudio=K,this._mediaInfo.hasAudio=K}},{key:"overridedHasVideo",set:function(K){this._hasVideoFlagOverrided=!0,this._hasVideo=K,this._mediaInfo.hasVideo=K}},{key:"resetMediaInfo",value:function(){this._mediaInfo=new Ue}},{key:"_isInitialMetadataDispatched",value:function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!this._hasAudio&&this._hasVideo?this._videoInitialMetadataDispatched:!1}},{key:"parseChunks",value:function(K,Z){if(!this._onError||!this._onMediaInfo||!this._onTrackMetadata||!this._onDataAvailable)throw new u("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var oe=0,he=this._littleEndian;if(Z===0)if(K.byteLength>13){var Oe=Re.probe(K);oe=Oe.dataOffset}else return 0;if(this._firstParse){this._firstParse=!1,Z+oe!==this._dataOffset&&C.w(this.TAG,"First time parsing but chunk byteStart invalid!");var Je=new DataView(K,oe),lt=Je.getUint32(0,!he);lt!==0&&C.w(this.TAG,"PrevTagSize0 !== 0 !!!"),oe+=4}for(;oeK.byteLength)break;var Nt=Pt.getUint8(0),ht=Pt.getUint32(0,!he)&16777215;if(oe+11+ht+4>K.byteLength)break;if(Nt!==8&&Nt!==9&&Nt!==18){C.w(this.TAG,"Unsupported tag type ".concat(Nt,", skipped")),oe+=11+ht+4;continue}var Mt=Pt.getUint8(4),nn=Pt.getUint8(5),Rt=Pt.getUint8(6),cn=Pt.getUint8(7),an=Rt|nn<<8|Mt<<16|cn<<24,ie=Pt.getUint32(7,!he)&16777215;ie!==0&&C.w(this.TAG,"Meet tag which has StreamID != 0!");var N=oe+11;switch(Nt){case 8:this._parseAudioData(K,N,ht,an);break;case 9:this._parseVideoData(K,N,ht,an,Z+oe);break;case 18:this._parseScriptData(K,N,ht);break}var F=Pt.getUint32(11+ht,!he);F!==11+ht&&C.w(this.TAG,"Invalid PrevTagSize ".concat(F)),oe+=11+ht+4}return this._isInitialMetadataDispatched()&&(this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack)),oe}},{key:"_parseScriptData",value:function(K,Z,oe){var he=ze.parseScriptData(K,Z,oe);if(he.hasOwnProperty("onMetaData")){if(he.onMetaData==null||typeof he.onMetaData!="object"){C.w(this.TAG,"Invalid onMetaData structure!");return}this._metadata&&C.w(this.TAG,"Found another onMetaData tag!"),this._metadata=he;var Oe=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},Oe)),typeof Oe.hasAudio=="boolean"&&(this._hasAudioFlagOverrided===!1&&(this._hasAudio=Oe.hasAudio,this._mediaInfo.hasAudio=this._hasAudio)),typeof Oe.hasVideo=="boolean"&&(this._hasVideoFlagOverrided===!1&&(this._hasVideo=Oe.hasVideo,this._mediaInfo.hasVideo=this._hasVideo)),typeof Oe.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=Oe.audiodatarate),typeof Oe.videodatarate=="number"&&(this._mediaInfo.videoDataRate=Oe.videodatarate),typeof Oe.width=="number"&&(this._mediaInfo.width=Oe.width),typeof Oe.height=="number"&&(this._mediaInfo.height=Oe.height),typeof Oe.duration=="number"){if(!this._durationOverrided){var Je=Math.floor(Oe.duration*this._timescale);this._duration=Je,this._mediaInfo.duration=Je}}else this._mediaInfo.duration=0;if(typeof Oe.framerate=="number"){var lt=Math.floor(Oe.framerate*1e3);if(lt>0){var Pt=lt/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=Pt,this._referenceFrameRate.fps_num=lt,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=Pt}}if(typeof Oe.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;var Nt=Oe.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(Nt),Oe.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=Oe,C.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(he).length>0&&(this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},he)))}},{key:"_parseKeyframesIndex",value:function(K){for(var Z=[],oe=[],he=1;he>>4;if(Pt!==2&&Pt!==10){this._onError($.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+Pt);return}var Nt=0,ht=(lt&12)>>>2;if(ht>=0&&ht<=4)Nt=this._flvSoundRateTable[ht];else{this._onError($.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+ht);return}var Mt=(lt&2)>>>1,nn=lt&1,Rt=this._audioMetadata,cn=this._audioTrack;if(Rt||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),Rt=this._audioMetadata={},Rt.type="audio",Rt.id=cn.id,Rt.timescale=this._timescale,Rt.duration=this._duration,Rt.audioSampleRate=Nt,Rt.channelCount=nn===0?1:2),Pt===10){var an=this._parseAACAudioData(K,Z+1,oe-1);if(an==null)return;if(an.packetType===0){Rt.config&&C.w(this.TAG,"Found another AudioSpecificConfig!");var ie=an.data;Rt.audioSampleRate=ie.samplingRate,Rt.channelCount=ie.channelCount,Rt.codec=ie.codec,Rt.originalCodec=ie.originalCodec,Rt.config=ie.config,Rt.refSampleDuration=1024/Rt.audioSampleRate*Rt.timescale,C.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",Rt);var N=this._mediaInfo;N.audioCodec=Rt.originalCodec,N.audioSampleRate=Rt.audioSampleRate,N.audioChannelCount=Rt.channelCount,N.hasVideo?N.videoCodec!=null&&(N.mimeType='video/x-flv; codecs="'+N.videoCodec+","+N.audioCodec+'"'):N.mimeType='video/x-flv; codecs="'+N.audioCodec+'"',N.isComplete()&&this._onMediaInfo(N)}else if(an.packetType===1){var F=this._timestampBase+he,ae={unit:an.data,length:an.data.byteLength,dts:F,pts:F};cn.samples.push(ae),cn.length+=an.data.length}else C.e(this.TAG,"Flv: Unsupported AAC data type ".concat(an.packetType))}else if(Pt===2){if(!Rt.codec){var pe=this._parseMP3AudioData(K,Z+1,oe-1,!0);if(pe==null)return;Rt.audioSampleRate=pe.samplingRate,Rt.channelCount=pe.channelCount,Rt.codec=pe.codec,Rt.originalCodec=pe.originalCodec,Rt.refSampleDuration=1152/Rt.audioSampleRate*Rt.timescale,C.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",Rt);var se=this._mediaInfo;se.audioCodec=Rt.codec,se.audioSampleRate=Rt.audioSampleRate,se.audioChannelCount=Rt.channelCount,se.audioDataRate=pe.bitRate,se.hasVideo?se.videoCodec!=null&&(se.mimeType='video/x-flv; codecs="'+se.videoCodec+","+se.audioCodec+'"'):se.mimeType='video/x-flv; codecs="'+se.audioCodec+'"',se.isComplete()&&this._onMediaInfo(se)}var $e=this._parseMP3AudioData(K,Z+1,oe-1,!1);if($e==null)return;var _t=this._timestampBase+he,it={unit:$e,length:$e.byteLength,dts:_t,pts:_t};cn.samples.push(it),cn.length+=$e.length}}},{key:"_parseAACAudioData",value:function(K,Z,oe){if(oe<=1){C.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");return}var he={},Oe=new Uint8Array(K,Z,oe);return he.packetType=Oe[0],Oe[0]===0?he.data=this._parseAACAudioSpecificConfig(K,Z+1,oe-1):he.data=Oe.subarray(1),he}},{key:"_parseAACAudioSpecificConfig",value:function(K,Z,oe){var he=new Uint8Array(K,Z,oe),Oe=null,Je=0,lt=0,Pt=null,Nt=0,ht=null;if(Je=lt=he[0]>>>3,Nt=(he[0]&7)<<1|he[1]>>>7,Nt<0||Nt>=this._mpegSamplingRates.length){this._onError($.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");return}var Mt=this._mpegSamplingRates[Nt],nn=(he[1]&120)>>>3;if(nn<0||nn>=8){this._onError($.FORMAT_ERROR,"Flv: AAC invalid channel configuration");return}Je===5&&(ht=(he[1]&7)<<1|he[2]>>>7,Pt=(he[2]&124)>>>2);var Rt=self.navigator.userAgent.toLowerCase();return Rt.indexOf("firefox")!==-1?Nt>=6?(Je=5,Oe=new Array(4),ht=Nt-3):(Je=2,Oe=new Array(2),ht=Nt):Rt.indexOf("android")!==-1?(Je=2,Oe=new Array(2),ht=Nt):(Je=5,ht=Nt,Oe=new Array(4),Nt>=6?ht=Nt-3:nn===1&&(Je=2,Oe=new Array(2),ht=Nt)),Oe[0]=Je<<3,Oe[0]|=(Nt&15)>>>1,Oe[1]=(Nt&15)<<7,Oe[1]|=(nn&15)<<3,Je===5&&(Oe[1]|=(ht&15)>>>1,Oe[2]=(ht&1)<<7,Oe[2]|=2<<2,Oe[3]=0),{config:Oe,samplingRate:Mt,channelCount:nn,codec:"mp4a.40."+Je,originalCodec:"mp4a.40."+lt}}},{key:"_parseMP3AudioData",value:function(K,Z,oe,he){if(oe<4){C.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");return}var Oe=this._littleEndian,Je=new Uint8Array(K,Z,oe),lt=null;if(he){if(Je[0]!==255)return;var Pt=Je[1]>>>3&3,Nt=(Je[1]&6)>>1,ht=(Je[2]&240)>>>4,Mt=(Je[2]&12)>>>2,nn=Je[3]>>>6&3,Rt=nn!==3?2:1,cn=0,an=0,ie=34,N="mp3";switch(Pt){case 0:cn=this._mpegAudioV25SampleRateTable[Mt];break;case 2:cn=this._mpegAudioV20SampleRateTable[Mt];break;case 3:cn=this._mpegAudioV10SampleRateTable[Mt];break}switch(Nt){case 1:ie=34,ht>>4,Pt=Je&15;if(Pt!==7){this._onError($.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(Pt));return}this._parseAVCVideoPacket(K,Z+1,oe-1,he,Oe,lt)}},{key:"_parseAVCVideoPacket",value:function(K,Z,oe,he,Oe,Je){if(oe<4){C.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");return}var lt=this._littleEndian,Pt=new DataView(K,Z,oe),Nt=Pt.getUint8(0),ht=Pt.getUint32(0,!lt)&16777215,Mt=ht<<8>>8;if(Nt===0)this._parseAVCDecoderConfigurationRecord(K,Z+4,oe-4);else if(Nt===1)this._parseAVCVideoData(K,Z+4,oe-4,he,Oe,Je,Mt);else if(!(Nt===2)){this._onError($.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(Nt));return}}},{key:"_parseAVCDecoderConfigurationRecord",value:function(K,Z,oe){if(oe<7){C.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");return}var he=this._videoMetadata,Oe=this._videoTrack,Je=this._littleEndian,lt=new DataView(K,Z,oe);he?typeof he.avcc!="undefined"&&C.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),he=this._videoMetadata={},he.type="video",he.id=Oe.id,he.timescale=this._timescale,he.duration=this._duration);var Pt=lt.getUint8(0),Nt=lt.getUint8(1),ht=lt.getUint8(2),Mt=lt.getUint8(3);if(Pt!==1||Nt===0){this._onError($.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");return}if(this._naluLengthSize=(lt.getUint8(4)&3)+1,this._naluLengthSize!==3&&this._naluLengthSize!==4){this._onError($.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));return}var nn=lt.getUint8(5)&31;if(nn===0){this._onError($.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");return}else nn>1&&C.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(nn));for(var Rt=6,cn=0;cn1&&C.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat(Vt));Rt++;for(var At=0;At=oe){C.w(this.TAG,"Malformed Nalu near timestamp ".concat(cn,", offset = ").concat(nn,", dataSize = ").concat(oe));break}var ie=Nt.getUint32(nn,!Pt);if(Rt===3&&(ie>>>=8),ie>oe-Rt){C.w(this.TAG,"Malformed Nalus near timestamp ".concat(cn,", NaluSize > DataSize!"));return}var N=Nt.getUint8(nn+Rt)&31;N===5&&(an=!0);var F=new Uint8Array(K,Z+nn,Rt+ie),ae={type:N,data:F};ht.push(ae),Mt+=F.byteLength,nn+=Rt+ie}if(ht.length){var pe=this._videoTrack,se={units:ht,length:Mt,isKeyframe:an,dts:cn,cts:lt,pts:cn+lt};an&&(se.fileposition=Oe),pe.samples.push(se),pe.length+=Mt}}}],[{key:"probe",value:function(K){var Z=new Uint8Array(K),oe={match:!1};if(Z[0]!==70||Z[1]!==76||Z[2]!==86||Z[3]!==1)return oe;var he=(Z[4]&4)>>>2!==0,Oe=(Z[4]&1)!==0,Je=ke(Z,5);return Je<9?oe:{match:!0,consumed:Je,dataOffset:Je,hasAudioTrack:he,hasVideoTrack:Oe}}}]),Re}(),Ne=dt,je=function(){function Re(){Object(le.a)(this,Re)}return Object(Q.a)(Re,null,[{key:"init",value:function(){Re.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[]};for(var K in Re.types)Re.types.hasOwnProperty(K)&&(Re.types[K]=[K.charCodeAt(0),K.charCodeAt(1),K.charCodeAt(2),K.charCodeAt(3)]);var Z=Re.constants={};Z.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),Z.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),Z.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),Z.STSC=Z.STCO=Z.STTS,Z.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Z.HDLR_VIDEO=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),Z.HDLR_AUDIO=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),Z.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),Z.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),Z.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}},{key:"box",value:function(K){for(var Z=8,oe=null,he=Array.prototype.slice.call(arguments,1),Oe=he.length,Je=0;Je>>24&255,oe[1]=Z>>>16&255,oe[2]=Z>>>8&255,oe[3]=Z&255,oe.set(K,4);for(var lt=8,Pt=0;Pt>>24&255,K>>>16&255,K>>>8&255,K&255,Z>>>24&255,Z>>>16&255,Z>>>8&255,Z&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]))}},{key:"trak",value:function(K){return Re.box(Re.types.trak,Re.tkhd(K),Re.mdia(K))}},{key:"tkhd",value:function(K){var Z=K.id,oe=K.duration,he=K.presentWidth,Oe=K.presentHeight;return Re.box(Re.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,Z>>>24&255,Z>>>16&255,Z>>>8&255,Z&255,0,0,0,0,oe>>>24&255,oe>>>16&255,oe>>>8&255,oe&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,he>>>8&255,he&255,0,0,Oe>>>8&255,Oe&255,0,0]))}},{key:"mdia",value:function(K){return Re.box(Re.types.mdia,Re.mdhd(K),Re.hdlr(K),Re.minf(K))}},{key:"mdhd",value:function(K){var Z=K.timescale,oe=K.duration;return Re.box(Re.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,Z>>>24&255,Z>>>16&255,Z>>>8&255,Z&255,oe>>>24&255,oe>>>16&255,oe>>>8&255,oe&255,85,196,0,0]))}},{key:"hdlr",value:function(K){var Z=null;return K.type==="audio"?Z=Re.constants.HDLR_AUDIO:Z=Re.constants.HDLR_VIDEO,Re.box(Re.types.hdlr,Z)}},{key:"minf",value:function(K){var Z=null;return K.type==="audio"?Z=Re.box(Re.types.smhd,Re.constants.SMHD):Z=Re.box(Re.types.vmhd,Re.constants.VMHD),Re.box(Re.types.minf,Z,Re.dinf(),Re.stbl(K))}},{key:"dinf",value:function(){var K=Re.box(Re.types.dinf,Re.box(Re.types.dref,Re.constants.DREF));return K}},{key:"stbl",value:function(K){var Z=Re.box(Re.types.stbl,Re.stsd(K),Re.box(Re.types.stts,Re.constants.STTS),Re.box(Re.types.stsc,Re.constants.STSC),Re.box(Re.types.stsz,Re.constants.STSZ),Re.box(Re.types.stco,Re.constants.STCO));return Z}},{key:"stsd",value:function(K){return K.type==="audio"?K.codec==="mp3"?Re.box(Re.types.stsd,Re.constants.STSD_PREFIX,Re.mp3(K)):Re.box(Re.types.stsd,Re.constants.STSD_PREFIX,Re.mp4a(K)):Re.box(Re.types.stsd,Re.constants.STSD_PREFIX,Re.avc1(K))}},{key:"mp3",value:function(K){var Z=K.channelCount,oe=K.audioSampleRate,he=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,Z,0,16,0,0,0,0,oe>>>8&255,oe&255,0,0]);return Re.box(Re.types[".mp3"],he)}},{key:"mp4a",value:function(K){var Z=K.channelCount,oe=K.audioSampleRate,he=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,Z,0,16,0,0,0,0,oe>>>8&255,oe&255,0,0]);return Re.box(Re.types.mp4a,he,Re.esds(K))}},{key:"esds",value:function(K){var Z=K.config||[],oe=Z.length,he=new Uint8Array([0,0,0,0,3,23+oe,0,1,0,4,15+oe,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([oe]).concat(Z).concat([6,1,2]));return Re.box(Re.types.esds,he)}},{key:"avc1",value:function(K){var Z=K.avcc,oe=K.codecWidth,he=K.codecHeight,Oe=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,oe>>>8&255,oe&255,he>>>8&255,he&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return Re.box(Re.types.avc1,Oe,Re.box(Re.types.avcC,Z))}},{key:"mvex",value:function(K){return Re.box(Re.types.mvex,Re.trex(K))}},{key:"trex",value:function(K){var Z=K.id,oe=new Uint8Array([0,0,0,0,Z>>>24&255,Z>>>16&255,Z>>>8&255,Z&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return Re.box(Re.types.trex,oe)}},{key:"moof",value:function(K,Z){return Re.box(Re.types.moof,Re.mfhd(K.sequenceNumber),Re.traf(K,Z))}},{key:"mfhd",value:function(K){var Z=new Uint8Array([0,0,0,0,K>>>24&255,K>>>16&255,K>>>8&255,K&255]);return Re.box(Re.types.mfhd,Z)}},{key:"traf",value:function(K,Z){var oe=K.id,he=Re.box(Re.types.tfhd,new Uint8Array([0,0,0,0,oe>>>24&255,oe>>>16&255,oe>>>8&255,oe&255])),Oe=Re.box(Re.types.tfdt,new Uint8Array([0,0,0,0,Z>>>24&255,Z>>>16&255,Z>>>8&255,Z&255])),Je=Re.sdtp(K),lt=Re.trun(K,Je.byteLength+16+16+8+16+8+8);return Re.box(Re.types.traf,he,Oe,lt,Je)}},{key:"sdtp",value:function(K){for(var Z=K.samples||[],oe=Z.length,he=new Uint8Array(4+oe),Oe=0;Oe>>24&255,he>>>16&255,he>>>8&255,he&255,Z>>>24&255,Z>>>16&255,Z>>>8&255,Z&255],0);for(var lt=0;lt>>24&255,Pt>>>16&255,Pt>>>8&255,Pt&255,Nt>>>24&255,Nt>>>16&255,Nt>>>8&255,Nt&255,ht.isLeading<<2|ht.dependsOn,ht.isDependedOn<<6|ht.hasRedundancy<<4|ht.isNonSync,0,0,Mt>>>24&255,Mt>>>16&255,Mt>>>8&255,Mt&255],12+16*lt)}return Re.box(Re.types.trun,Je)}},{key:"mdat",value:function(K){return Re.box(Re.types.mdat,K)}}]),Re}();je.init();var tt=je,mt=function(){function Re(){Object(le.a)(this,Re)}return Object(Q.a)(Re,null,[{key:"getSilentFrame",value:function(K,Z){if(K==="mp4a.40.2"){if(Z===1)return new Uint8Array([0,200,0,128,35,128]);if(Z===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(Z===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(Z===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(Z===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(Z===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(Z===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(Z===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(Z===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null}}]),Re}(),Qe=mt,Xe=function Re(ve,K,Z,oe,he){Object(le.a)(this,Re),this.dts=ve,this.pts=K,this.duration=Z,this.originalDts=oe,this.isSyncPoint=he,this.fileposition=null},Be=function(){function Re(){Object(le.a)(this,Re),this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}return Object(Q.a)(Re,[{key:"appendSyncPoint",value:function(K){K.isSyncPoint=!0,this.syncPoints.push(K)}}]),Re}(),Ie=function(){function Re(){Object(le.a)(this,Re),this._list=[]}return Object(Q.a)(Re,[{key:"clear",value:function(){this._list=[]}},{key:"appendArray",value:function(K){var Z=this._list;if(K.length===0)return;Z.length>0&&K[0].originalDts=Z[Oe].dts&&KZ[he].lastSample.originalDts&&K=Z[he].lastSample.originalDts&&(he===Z.length-1||he0&&(Oe=this._searchNearestSegmentBefore(oe.originalBeginDts)+1),this._lastAppendLocation=Oe,this._list.splice(Oe,0,oe)}},{key:"getLastSegmentBefore",value:function(K){var Z=this._searchNearestSegmentBefore(K);return Z>=0?this._list[Z]:null}},{key:"getLastSampleBefore",value:function(K){var Z=this.getLastSegmentBefore(K);return Z!=null?Z.lastSample:null}},{key:"getLastSyncPointBefore",value:function(K){for(var Z=this._searchNearestSegmentBefore(K),oe=this._list[Z].syncPoints;oe.length===0&&Z>0;)Z--,oe=this._list[Z].syncPoints;return oe.length>0?oe[oe.length-1]:null}}]),Re}(),_e=function(){function Re(ve){Object(le.a)(this,Re),this.TAG="MP4Remuxer",this._config=ve,this._isLive=ve.isLive===!0,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=Infinity,this._videoDtsBase=Infinity,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new Me("audio"),this._videoSegmentInfoList=new Me("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!!(g.chrome&&(g.version.major<50||g.version.major===50&&g.version.build<2661)),this._fillSilentAfterSeek=g.msedge||g.msie,this._mp3UseMpegAudio=!g.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return Object(Q.a)(Re,[{key:"destroy",value:function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null}},{key:"bindDataSource",value:function(K){return K.onDataAvailable=this.remux.bind(this),K.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}},{key:"onInitSegment",get:function(){return this._onInitSegment},set:function(K){this._onInitSegment=K}},{key:"onMediaSegment",get:function(){return this._onMediaSegment},set:function(K){this._onMediaSegment=K}},{key:"insertDiscontinuity",value:function(){this._audioNextDts=this._videoNextDts=void 0}},{key:"seek",value:function(K){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}},{key:"remux",value:function(K,Z){if(!this._onMediaSegment)throw new u("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(K,Z),this._remuxVideo(Z),this._remuxAudio(K)}},{key:"_onTrackMetadataReceived",value:function(K,Z){var oe=null,he="mp4",Oe=Z.codec;if(K==="audio")this._audioMeta=Z,Z.codec==="mp3"&&this._mp3UseMpegAudio?(he="mpeg",Oe="",oe=new Uint8Array):oe=tt.generateInitSegment(Z);else if(K==="video")this._videoMeta=Z,oe=tt.generateInitSegment(Z);else return;if(!this._onInitSegment)throw new u("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(K,{type:K,data:oe.buffer,codec:Oe,container:"".concat(K,"/").concat(he),mediaDuration:Z.duration})}},{key:"_calculateDtsBase",value:function(K,Z){if(this._dtsBaseInited)return;K.samples&&K.samples.length&&(this._audioDtsBase=K.samples[0].dts),Z.samples&&Z.samples.length&&(this._videoDtsBase=Z.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0}},{key:"flushStashedSamples",value:function(){var K=this._videoStashedLastSample,Z=this._audioStashedLastSample,oe={type:"video",id:1,sequenceNumber:0,samples:[],length:0};K!=null&&(oe.samples.push(K),oe.length=K.length);var he={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};Z!=null&&(he.samples.push(Z),he.length=Z.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(oe,!0),this._remuxAudio(he,!0)}},{key:"_remuxAudio",value:function(K,Z){if(this._audioMeta==null)return;var oe=K,he=oe.samples,Oe=void 0,Je=-1,lt=-1,Pt=-1,Nt=this._audioMeta.refSampleDuration,ht=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,Mt=this._dtsBaseInited&&this._audioNextDts===void 0,nn=!1;if(!he||he.length===0)return;if(he.length===1&&!Z)return;var Rt=0,cn=null,an=0;ht?(Rt=0,an=oe.length):(Rt=8,an=8+oe.length);var ie=null;if(he.length>1&&(ie=he.pop(),an-=ie.length),this._audioStashedLastSample!=null){var N=this._audioStashedLastSample;this._audioStashedLastSample=null,he.unshift(N),an+=N.length}ie!=null&&(this._audioStashedLastSample=ie);var F=he[0].dts-this._dtsBase;if(this._audioNextDts)Oe=F-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())Oe=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&(this._audioMeta.originalCodec!=="mp3"&&(nn=!0));else{var ae=this._audioSegmentInfoList.getLastSampleBefore(F);if(ae!=null){var pe=F-(ae.originalDts+ae.duration);pe<=3&&(pe=0);var se=ae.dts+ae.duration+pe;Oe=F-se}else Oe=0}if(nn){var $e=F-Oe,_t=this._videoSegmentInfoList.getLastSegmentBefore(F);if(_t!=null&&_t.beginDts<$e){var it=Qe.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(it){var Vt=_t.beginDts,At=$e-_t.beginDts;C.v(this.TAG,"InsertPrefixSilentAudio: dts: ".concat(Vt,", duration: ").concat(At)),he.unshift({unit:it,dts:Vt,pts:Vt}),an+=it.byteLength}}else nn=!1}for(var Bt=[],on=0;on=1?ur=Bt[Bt.length-1].duration:ur=Math.floor(Nt);var fr=!1,br=null;if(ur>Nt*1.5&&this._audioMeta.codec!=="mp3"&&this._fillAudioTimestampGap&&!g.safari){fr=!0;var Xr=Math.abs(ur-Nt),Dr=Math.ceil(Xr/Nt),Yr=Un+Nt;C.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.
`+"dts: ".concat(Un+ur," ms, expected: ").concat(Un+Math.round(Nt)," ms, ")+"delta: ".concat(Math.round(Xr)," ms, generate: ").concat(Dr," frames"));var gr=Qe.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);gr==null&&(C.w(this.TAG,"Unable to generate silent frame for "+"".concat(this._audioMeta.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),gr=Lr),br=[];for(var gi=0;gi0){var Pr=br[br.length-1];Pr.duration=si-Pr.dts}var Fr={dts:si,pts:si,cts:0,unit:gr,size:gr.byteLength,duration:0,originalDts:Sr,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};br.push(Fr),an+=Fr.size,Yr+=Nt}var _i=br[br.length-1];_i.duration=Un+ur-_i.dts,ur=Math.round(Nt)}Bt.push({dts:Un,pts:Un,cts:0,unit:In.unit,size:In.unit.byteLength,duration:ur,originalDts:Sr,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),fr&&Bt.push.apply(Bt,br)}ht?cn=new Uint8Array(an):(cn=new Uint8Array(an),cn[0]=an>>>24&255,cn[1]=an>>>16&255,cn[2]=an>>>8&255,cn[3]=an&255,cn.set(tt.types.mdat,4));for(var vi=0;vi1&&(Rt=he.pop(),nn-=Rt.length),this._videoStashedLastSample!=null){var cn=this._videoStashedLastSample;this._videoStashedLastSample=null,he.unshift(cn),nn+=cn.length}Rt!=null&&(this._videoStashedLastSample=Rt);var an=he[0].dts-this._dtsBase;if(this._videoNextDts)Oe=an-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())Oe=0;else{var ie=this._videoSegmentInfoList.getLastSampleBefore(an);if(ie!=null){var N=an-(ie.originalDts+ie.duration);N<=3&&(N=0);var F=ie.dts+ie.duration+N;Oe=an-F}else Oe=0}for(var ae=new Be,pe=[],se=0;se=1?on=pe[pe.length-1].duration:on=Math.floor(this._videoMeta.refSampleDuration);if(it){var Sr=new Xe(Vt,Bt,on,$e.dts,!0);Sr.fileposition=$e.fileposition,ae.appendSyncPoint(Sr)}pe.push({dts:Vt,pts:Bt,cts:At,units:$e.units,size:$e.length,isKeyframe:it,duration:on,originalDts:_t,flags:{isLeading:0,dependsOn:it?2:1,isDependedOn:it?1:0,hasRedundancy:0,isNonSync:it?0:1}})}Mt=new Uint8Array(nn),Mt[0]=nn>>>24&255,Mt[1]=nn>>>16&255,Mt[2]=nn>>>8&255,Mt[3]=nn&255,Mt.set(tt.types.mdat,4);for(var Un=0;Un0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,Oe=this._demuxer.parseChunks(K,Z);else if((he=Ne.probe(K)).match){this._demuxer=new Ne(he,this._config),this._remuxer||(this._remuxer=new Ae(this._config));var Je=this._mediaDataSource;Je.duration!=null&&!isNaN(Je.duration)&&(this._demuxer.overridedDuration=Je.duration),typeof Je.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=Je.hasAudio),typeof Je.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=Je.hasVideo),this._demuxer.timestampBase=Je.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this),Oe=this._demuxer.parseChunks(K,Z)}else he=null,C.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(function(){oe._internalAbort()}),this._emitter.emit(Te.DEMUX_ERROR,$.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),Oe=0;return Oe}},{key:"_onMediaInfo",value:function(K){var Z=this;this._mediaInfo==null&&(this._mediaInfo=Object.assign({},K),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,Ue.prototype));var oe=Object.assign({},K);Object.setPrototypeOf(oe,Ue.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=oe,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(function(){var he=Z._pendingSeekTime;Z._pendingSeekTime=null,Z.seek(he)})}},{key:"_onMetaDataArrived",value:function(K){this._emitter.emit(Te.METADATA_ARRIVED,K)}},{key:"_onScriptDataArrived",value:function(K){this._emitter.emit(Te.SCRIPTDATA_ARRIVED,K)}},{key:"_onIOSeeked",value:function(){this._remuxer.insertDiscontinuity()}},{key:"_onIOComplete",value:function(K){var Z=K,oe=Z+1;oe0&&oe[0].originalDts===he&&(he=oe[0].pts),this._emitter.emit(Te.RECOMMEND_SEEKPOINT,he)}}},{key:"_enableStatisticsReporter",value:function(){this._statisticsReporter==null&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))}},{key:"_disableStatisticsReporter",value:function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"_reportSegmentMediaInfo",value:function(K){var Z=this._mediaInfo.segments[K],oe=Object.assign({},Z);oe.duration=this._mediaInfo.duration,oe.segmentCount=this._mediaInfo.segmentCount,delete oe.segments,delete oe.keyframesIndex,this._emitter.emit(Te.MEDIA_INFO,oe)}},{key:"_reportStatisticsInfo",value:function(){var K={};K.url=this._ioctl.currentURL,K.hasRedirect=this._ioctl.hasRedirect,K.hasRedirect&&(K.redirectedURL=this._ioctl.currentRedirectedURL),K.speed=this._ioctl.currentSpeed,K.loaderType=this._ioctl.loaderType,K.currentSegmentIndex=this._currentSegmentIndex,K.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(Te.STATISTICS_INFO,K)}}]),Re}(),ut=Ze,Ct=function(ve){var K="TransmuxingWorker",Z=null,oe=an.bind(this);w.install(),ve.addEventListener("message",function(ie){switch(ie.data.cmd){case"init":Z=new ut(ie.data.param[0],ie.data.param[1]),Z.on(Te.IO_ERROR,nn.bind(this)),Z.on(Te.DEMUX_ERROR,Rt.bind(this)),Z.on(Te.INIT_SEGMENT,he.bind(this)),Z.on(Te.MEDIA_SEGMENT,Oe.bind(this)),Z.on(Te.LOADING_COMPLETE,Je.bind(this)),Z.on(Te.RECOVERED_EARLY_EOF,lt.bind(this)),Z.on(Te.MEDIA_INFO,Pt.bind(this)),Z.on(Te.METADATA_ARRIVED,Nt.bind(this)),Z.on(Te.SCRIPTDATA_ARRIVED,ht.bind(this)),Z.on(Te.STATISTICS_INFO,Mt.bind(this)),Z.on(Te.RECOMMEND_SEEKPOINT,cn.bind(this));break;case"destroy":Z&&(Z.destroy(),Z=null),ve.postMessage({msg:"destroyed"});break;case"start":Z.start();break;case"stop":Z.stop();break;case"seek":Z.seek(ie.data.param);break;case"pause":Z.pause();break;case"resume":Z.resume();break;case"logging_config":{var N=ie.data.param;Ee.applyConfig(N),N.enableCallback===!0?Ee.addLogListener(oe):Ee.removeLogListener(oe);break}}});function he(ie,N){var F={msg:Te.INIT_SEGMENT,data:{type:ie,data:N}};ve.postMessage(F,[N.data])}function Oe(ie,N){var F={msg:Te.MEDIA_SEGMENT,data:{type:ie,data:N}};ve.postMessage(F,[N.data])}function Je(){var ie={msg:Te.LOADING_COMPLETE};ve.postMessage(ie)}function lt(){var ie={msg:Te.RECOVERED_EARLY_EOF};ve.postMessage(ie)}function Pt(ie){var N={msg:Te.MEDIA_INFO,data:ie};ve.postMessage(N)}function Nt(ie){var N={msg:Te.METADATA_ARRIVED,data:ie};ve.postMessage(N)}function ht(ie){var N={msg:Te.SCRIPTDATA_ARRIVED,data:ie};ve.postMessage(N)}function Mt(ie){var N={msg:Te.STATISTICS_INFO,data:ie};ve.postMessage(N)}function nn(ie,N){ve.postMessage({msg:Te.IO_ERROR,data:{type:ie,info:N}})}function Rt(ie,N){ve.postMessage({msg:Te.DEMUX_ERROR,data:{type:ie,info:N}})}function cn(ie){ve.postMessage({msg:Te.RECOMMEND_SEEKPOINT,data:ie})}function an(ie,N){ve.postMessage({msg:"logcat_callback",data:{type:ie,logcat:N}})}},Ht=Ct,Qt=function(){function Re(ve,K){if(Object(le.a)(this,Re),this.TAG="Transmuxer",this._emitter=new b.a,K.enableWorker&&typeof Worker!="undefined")try{var Z=z("0r65");this._worker=Z(Ht),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[ve,K]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},Ee.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:Ee.getConfig()})}catch(he){C.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new ut(ve,K)}else this._controller=new ut(ve,K);if(this._controller){var oe=this._controller;oe.on(Te.IO_ERROR,this._onIOError.bind(this)),oe.on(Te.DEMUX_ERROR,this._onDemuxError.bind(this)),oe.on(Te.INIT_SEGMENT,this._onInitSegment.bind(this)),oe.on(Te.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),oe.on(Te.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),oe.on(Te.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),oe.on(Te.MEDIA_INFO,this._onMediaInfo.bind(this)),oe.on(Te.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),oe.on(Te.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),oe.on(Te.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),oe.on(Te.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return Object(Q.a)(Re,[{key:"destroy",value:function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),Ee.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(K,Z){this._emitter.addListener(K,Z)}},{key:"off",value:function(K,Z){this._emitter.removeListener(K,Z)}},{key:"hasWorker",value:function(){return this._worker!=null}},{key:"open",value:function(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()}},{key:"close",value:function(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()}},{key:"seek",value:function(K){this._worker?this._worker.postMessage({cmd:"seek",param:K}):this._controller.seek(K)}},{key:"pause",value:function(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()}},{key:"resume",value:function(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()}},{key:"_onInitSegment",value:function(K,Z){var oe=this;Promise.resolve().then(function(){oe._emitter.emit(Te.INIT_SEGMENT,K,Z)})}},{key:"_onMediaSegment",value:function(K,Z){var oe=this;Promise.resolve().then(function(){oe._emitter.emit(Te.MEDIA_SEGMENT,K,Z)})}},{key:"_onLoadingComplete",value:function(){var K=this;Promise.resolve().then(function(){K._emitter.emit(Te.LOADING_COMPLETE)})}},{key:"_onRecoveredEarlyEof",value:function(){var K=this;Promise.resolve().then(function(){K._emitter.emit(Te.RECOVERED_EARLY_EOF)})}},{key:"_onMediaInfo",value:function(K){var Z=this;Promise.resolve().then(function(){Z._emitter.emit(Te.MEDIA_INFO,K)})}},{key:"_onMetaDataArrived",value:function(K){var Z=this;Promise.resolve().then(function(){Z._emitter.emit(Te.METADATA_ARRIVED,K)})}},{key:"_onScriptDataArrived",value:function(K){var Z=this;Promise.resolve().then(function(){Z._emitter.emit(Te.SCRIPTDATA_ARRIVED,K)})}},{key:"_onStatisticsInfo",value:function(K){var Z=this;Promise.resolve().then(function(){Z._emitter.emit(Te.STATISTICS_INFO,K)})}},{key:"_onIOError",value:function(K,Z){var oe=this;Promise.resolve().then(function(){oe._emitter.emit(Te.IO_ERROR,K,Z)})}},{key:"_onDemuxError",value:function(K,Z){var oe=this;Promise.resolve().then(function(){oe._emitter.emit(Te.DEMUX_ERROR,K,Z)})}},{key:"_onRecommendSeekpoint",value:function(K){var Z=this;Promise.resolve().then(function(){Z._emitter.emit(Te.RECOMMEND_SEEKPOINT,K)})}},{key:"_onLoggingConfigChanged",value:function(K){this._worker&&this._worker.postMessage({cmd:"logging_config",param:K})}},{key:"_onWorkerMessage",value:function(K){var Z=K.data,oe=Z.data;if(Z.msg==="destroyed"||this._workerDestroying){this._workerDestroying=!1,this._worker.terminate(),this._worker=null;return}switch(Z.msg){case Te.INIT_SEGMENT:case Te.MEDIA_SEGMENT:this._emitter.emit(Z.msg,oe.type,oe.data);break;case Te.LOADING_COMPLETE:case Te.RECOVERED_EARLY_EOF:this._emitter.emit(Z.msg);break;case Te.MEDIA_INFO:Object.setPrototypeOf(oe,Ue.prototype),this._emitter.emit(Z.msg,oe);break;case Te.METADATA_ARRIVED:case Te.SCRIPTDATA_ARRIVED:case Te.STATISTICS_INFO:this._emitter.emit(Z.msg,oe);break;case Te.IO_ERROR:case Te.DEMUX_ERROR:this._emitter.emit(Z.msg,oe.type,oe.info);break;case Te.RECOMMEND_SEEKPOINT:this._emitter.emit(Z.msg,oe);break;case"logcat_callback":C.emitter.emit("log",oe.type,oe.logcat);break;default:break}}}]),Re}(),bt=Qt,Lt={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"},at=Lt,pt=function(){function Re(ve){Object(le.a)(this,Re),this.TAG="MSEController",this._config=ve,this._emitter=new b.a,this._config.isLive&&this._config.autoCleanupSourceBuffer==null&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new Ie}return Object(Q.a)(Re,[{key:"destroy",value:function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(K,Z){this._emitter.addListener(K,Z)}},{key:"off",value:function(K,Z){this._emitter.removeListener(K,Z)}},{key:"attachMediaElement",value:function(K){if(this._mediaSource)throw new u("MediaSource has been attached to an HTMLMediaElement!");var Z=this._mediaSource=new window.MediaSource;Z.addEventListener("sourceopen",this.e.onSourceOpen),Z.addEventListener("sourceended",this.e.onSourceEnded),Z.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=K,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),K.src=this._mediaSourceObjectURL}},{key:"detachMediaElement",value:function(){if(this._mediaSource){var K=this._mediaSource;for(var Z in this._sourceBuffers){var oe=this._pendingSegments[Z];oe.splice(0,oe.length),this._pendingSegments[Z]=null,this._pendingRemoveRanges[Z]=null,this._lastInitSegments[Z]=null;var he=this._sourceBuffers[Z];if(he){if(K.readyState!=="closed"){try{K.removeSourceBuffer(he)}catch(Oe){C.e(this.TAG,Oe.message)}he.removeEventListener("error",this.e.onSourceBufferError),he.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[Z]=null,this._sourceBuffers[Z]=null}}if(K.readyState==="open")try{K.endOfStream()}catch(Oe){C.e(this.TAG,Oe.message)}K.removeEventListener("sourceopen",this.e.onSourceOpen),K.removeEventListener("sourceended",this.e.onSourceEnded),K.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)}},{key:"appendInitSegment",value:function(K,Z){if(!this._mediaSource||this._mediaSource.readyState!=="open"){this._pendingSourceBufferInit.push(K),this._pendingSegments[K.type].push(K);return}var oe=K,he="".concat(oe.container);oe.codec&&oe.codec.length>0&&(he+=";codecs=".concat(oe.codec));var Oe=!1;if(C.v(this.TAG,"Received Initialization Segment, mimeType: "+he),this._lastInitSegments[oe.type]=oe,he!==this._mimeTypes[oe.type]){if(this._mimeTypes[oe.type])C.v(this.TAG,"Notice: ".concat(oe.type," mimeType changed, origin: ").concat(this._mimeTypes[oe.type],", target: ").concat(he));else{Oe=!0;try{var Je=this._sourceBuffers[oe.type]=this._mediaSource.addSourceBuffer(he);Je.addEventListener("error",this.e.onSourceBufferError),Je.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(lt){C.e(this.TAG,lt.message),this._emitter.emit(at.ERROR,{code:lt.code,msg:lt.message});return}}this._mimeTypes[oe.type]=he}Z||this._pendingSegments[oe.type].push(oe),Oe||this._sourceBuffers[oe.type]&&!this._sourceBuffers[oe.type].updating&&this._doAppendSegments(),g.safari&&oe.container==="audio/mpeg"&&oe.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=oe.mediaDuration/1e3,this._updateMediaSourceDuration())}},{key:"appendMediaSegment",value:function(K){var Z=K;this._pendingSegments[Z.type].push(Z),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var oe=this._sourceBuffers[Z.type];oe&&!oe.updating&&!this._hasPendingRemoveRanges()&&this._doAppendSegments()}},{key:"seek",value:function(K){for(var Z in this._sourceBuffers){if(!this._sourceBuffers[Z])continue;var oe=this._sourceBuffers[Z];if(this._mediaSource.readyState==="open")try{oe.abort()}catch(Nt){C.e(this.TAG,Nt.message)}this._idrList.clear();var he=this._pendingSegments[Z];if(he.splice(0,he.length),this._mediaSource.readyState==="closed")continue;for(var Oe=0;Oe=1&&K-he.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}},{key:"_doCleanupSourceBuffer",value:function(){var K=this._mediaElement.currentTime;for(var Z in this._sourceBuffers){var oe=this._sourceBuffers[Z];if(oe){for(var he=oe.buffered,Oe=!1,Je=0;Je=this._config.autoCleanupMaxBackwardDuration){Oe=!0;var Nt=K-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[Z].push({start:lt,end:Nt})}}else Pt0&&(isNaN(Z)||oe>Z)&&(C.v(this.TAG,"Update MediaSource duration from ".concat(Z," to ").concat(oe)),this._mediaSource.duration=oe),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},{key:"_doRemoveRanges",value:function(){for(var K in this._pendingRemoveRanges){if(!this._sourceBuffers[K]||this._sourceBuffers[K].updating)continue;for(var Z=this._sourceBuffers[K],oe=this._pendingRemoveRanges[K];oe.length&&!Z.updating;){var he=oe.shift();Z.remove(he.start,he.end)}}}},{key:"_doAppendSegments",value:function(){var K=this._pendingSegments;for(var Z in K){if(!this._sourceBuffers[Z]||this._sourceBuffers[Z].updating)continue;if(K[Z].length>0){var oe=K[Z].shift();if(oe.timestampOffset){var he=this._sourceBuffers[Z].timestampOffset,Oe=oe.timestampOffset/1e3,Je=Math.abs(he-Oe);Je>.1&&(C.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(he," to ").concat(Oe)),this._sourceBuffers[Z].timestampOffset=Oe),delete oe.timestampOffset}if(!oe.data||oe.data.byteLength===0)continue;try{this._sourceBuffers[Z].appendBuffer(oe.data),this._isBufferFull=!1,Z==="video"&&oe.hasOwnProperty("info")&&this._idrList.appendArray(oe.info.syncPoints)}catch(lt){this._pendingSegments[Z].unshift(oe),lt.code===22?(this._isBufferFull||this._emitter.emit(at.BUFFER_FULL),this._isBufferFull=!0):(C.e(this.TAG,lt.message),this._emitter.emit(at.ERROR,{code:lt.code,msg:lt.message}))}}}}},{key:"_onSourceOpen",value:function(){if(C.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var K=this._pendingSourceBufferInit;K.length;){var Z=K.shift();this.appendInitSegment(Z,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(at.SOURCE_OPEN)}},{key:"_onSourceEnded",value:function(){C.v(this.TAG,"MediaSource onSourceEnded")}},{key:"_onSourceClose",value:function(){C.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&this.e!=null&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))}},{key:"_hasPendingSegments",value:function(){var K=this._pendingSegments;return K.video.length>0||K.audio.length>0}},{key:"_hasPendingRemoveRanges",value:function(){var K=this._pendingRemoveRanges;return K.video.length>0||K.audio.length>0}},{key:"_onSourceBufferUpdateEnd",value:function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(at.UPDATE_END)}},{key:"_onSourceBufferError",value:function(K){C.e(this.TAG,"SourceBuffer Error: ".concat(K))}}]),Re}(),st=pt,De={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},Ke={NETWORK_EXCEPTION:n.EXCEPTION,NETWORK_STATUS_CODE_INVALID:n.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:n.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:n.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:$.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:$.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:$.CODEC_UNSUPPORTED},yt=function(){function Re(ve,K){if(Object(le.a)(this,Re),this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new b.a,this._config=ce(),typeof K=="object"&&Object.assign(this._config,K),ve.type.toLowerCase()!=="flv")throw new s("FlvPlayer requires an flv MediaDataSource input!");ve.isLive===!0&&(this._config.isLive=!0),this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this),onvSeeking:this._onvSeeking.bind(this),onvCanPlay:this._onvCanPlay.bind(this),onvStalled:this._onvStalled.bind(this),onvProgress:this._onvProgress.bind(this)},self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now,this._pendingSeekTime=null,this._requestSetTime=!1,this._seekpointRecord=null,this._progressChecker=null,this._mediaDataSource=ve,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;var Z=g.chrome&&(g.version.major<50||g.version.major===50&&g.version.build<2661);this._alwaysSeekKeyframe=!!(Z||g.msedge||g.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return Object(Q.a)(Re,[{key:"destroy",value:function(){this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(K,Z){var oe=this;K===Pe.MEDIA_INFO?this._mediaInfo!=null&&Promise.resolve().then(function(){oe._emitter.emit(Pe.MEDIA_INFO,oe.mediaInfo)}):K===Pe.STATISTICS_INFO&&(this._statisticsInfo!=null&&Promise.resolve().then(function(){oe._emitter.emit(Pe.STATISTICS_INFO,oe.statisticsInfo)})),this._emitter.addListener(K,Z)}},{key:"off",value:function(K,Z){this._emitter.removeListener(K,Z)}},{key:"attachMediaElement",value:function(K){var Z=this;if(this._mediaElement=K,K.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),K.addEventListener("seeking",this.e.onvSeeking),K.addEventListener("canplay",this.e.onvCanPlay),K.addEventListener("stalled",this.e.onvStalled),K.addEventListener("progress",this.e.onvProgress),this._msectl=new st(this._config),this._msectl.on(at.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(at.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(at.SOURCE_OPEN,function(){Z._mseSourceOpened=!0,Z._hasPendingLoad&&(Z._hasPendingLoad=!1,Z.load())}),this._msectl.on(at.ERROR,function(oe){Z._emitter.emit(Pe.ERROR,De.MEDIA_ERROR,Ke.MEDIA_MSE_ERROR,oe)}),this._msectl.attachMediaElement(K),this._pendingSeekTime!=null)try{K.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(oe){}}},{key:"detachMediaElement",value:function(){this._mediaElement&&(this._msectl.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)}},{key:"load",value:function(){var K=this;if(!this._mediaElement)throw new u("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new u("FlvPlayer.load() has been called, please call unload() first!");if(this._hasPendingLoad)return;if(this._config.deferLoadAfterSourceOpen&&this._mseSourceOpened===!1){this._hasPendingLoad=!0;return}this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new bt(this._mediaDataSource,this._config),this._transmuxer.on(Te.INIT_SEGMENT,function(Z,oe){K._msectl.appendInitSegment(oe)}),this._transmuxer.on(Te.MEDIA_SEGMENT,function(Z,oe){if(K._msectl.appendMediaSegment(oe),K._config.lazyLoad&&!K._config.isLive){var he=K._mediaElement.currentTime;oe.info.endDts>=(he+K._config.lazyLoadMaxDuration)*1e3&&(K._progressChecker==null&&(C.v(K.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),K._suspendTransmuxer()))}}),this._transmuxer.on(Te.LOADING_COMPLETE,function(){K._msectl.endOfStream(),K._emitter.emit(Pe.LOADING_COMPLETE)}),this._transmuxer.on(Te.RECOVERED_EARLY_EOF,function(){K._emitter.emit(Pe.RECOVERED_EARLY_EOF)}),this._transmuxer.on(Te.IO_ERROR,function(Z,oe){K._emitter.emit(Pe.ERROR,De.NETWORK_ERROR,Z,oe)}),this._transmuxer.on(Te.DEMUX_ERROR,function(Z,oe){K._emitter.emit(Pe.ERROR,De.MEDIA_ERROR,Z,{code:-1,msg:oe})}),this._transmuxer.on(Te.MEDIA_INFO,function(Z){K._mediaInfo=Z,K._emitter.emit(Pe.MEDIA_INFO,Object.assign({},Z))}),this._transmuxer.on(Te.METADATA_ARRIVED,function(Z){K._emitter.emit(Pe.METADATA_ARRIVED,Z)}),this._transmuxer.on(Te.SCRIPTDATA_ARRIVED,function(Z){K._emitter.emit(Pe.SCRIPTDATA_ARRIVED,Z)}),this._transmuxer.on(Te.STATISTICS_INFO,function(Z){K._statisticsInfo=K._fillStatisticsInfo(Z),K._emitter.emit(Pe.STATISTICS_INFO,Object.assign({},K._statisticsInfo))}),this._transmuxer.on(Te.RECOMMEND_SEEKPOINT,function(Z){K._mediaElement&&!K._config.accurateSeek&&(K._requestSetTime=!0,K._mediaElement.currentTime=Z/1e3)}),this._transmuxer.open()}},{key:"unload",value:function(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)}},{key:"play",value:function(){return this._mediaElement.play()}},{key:"pause",value:function(){this._mediaElement.pause()}},{key:"type",get:function(){return this._type}},{key:"buffered",get:function(){return this._mediaElement.buffered}},{key:"duration",get:function(){return this._mediaElement.duration}},{key:"volume",get:function(){return this._mediaElement.volume},set:function(K){this._mediaElement.volume=K}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(K){this._mediaElement.muted=K}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(K){this._mediaElement?this._internalSeek(K):this._pendingSeekTime=K}},{key:"mediaInfo",get:function(){return Object.assign({},this._mediaInfo)}},{key:"statisticsInfo",get:function(){return this._statisticsInfo==null&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)}},{key:"_fillStatisticsInfo",value:function(K){if(K.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return K;var Z=!0,oe=0,he=0;if(this._mediaElement.getVideoPlaybackQuality){var Oe=this._mediaElement.getVideoPlaybackQuality();oe=Oe.totalVideoFrames,he=Oe.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(oe=this._mediaElement.webkitDecodedFrameCount,he=this._mediaElement.webkitDroppedFrameCount):Z=!1;return Z&&(K.decodedFrames=oe,K.droppedFrames=he),K}},{key:"_onmseUpdateEnd",value:function(){if(!this._config.lazyLoad||this._config.isLive)return;for(var K=this._mediaElement.buffered,Z=this._mediaElement.currentTime,oe=0,he=0,Oe=0;Oe=Z+this._config.lazyLoadMaxDuration&&this._progressChecker==null&&(C.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},{key:"_onmseBufferFull",value:function(){C.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),this._progressChecker==null&&this._suspendTransmuxer()}},{key:"_suspendTransmuxer",value:function(){this._transmuxer&&(this._transmuxer.pause(),this._progressChecker==null&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))}},{key:"_checkProgressAndResume",value:function(){for(var K=this._mediaElement.currentTime,Z=this._mediaElement.buffered,oe=!1,he=0;he=Oe&&K=Je-this._config.lazyLoadRecoverDuration&&(oe=!0);break}}oe&&(window.clearInterval(this._progressChecker),this._progressChecker=null,oe&&(C.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}},{key:"_isTimepointBuffered",value:function(K){for(var Z=this._mediaElement.buffered,oe=0;oe=he&&K0){var Oe=this._mediaElement.buffered.start(0);(Oe<1&&K0&&Z.currentTime0){var he=oe.start(0);if(he<1&&Z0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)}},{key:"unload",value:function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"play",value:function(){return this._mediaElement.play()}},{key:"pause",value:function(){this._mediaElement.pause()}},{key:"type",get:function(){return this._type}},{key:"buffered",get:function(){return this._mediaElement.buffered}},{key:"duration",get:function(){return this._mediaElement.duration}},{key:"volume",get:function(){return this._mediaElement.volume},set:function(K){this._mediaElement.volume=K}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(K){this._mediaElement.muted=K}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(K){this._mediaElement?this._mediaElement.currentTime=K:this._pendingSeekTime=K}},{key:"mediaInfo",get:function(){var K=this._mediaElement instanceof HTMLAudioElement?"audio/":"video/",Z={mimeType:K+this._mediaDataSource.type};return this._mediaElement&&(Z.duration=Math.floor(this._mediaElement.duration*1e3),this._mediaElement instanceof HTMLVideoElement&&(Z.width=this._mediaElement.videoWidth,Z.height=this._mediaElement.videoHeight)),Z}},{key:"statisticsInfo",get:function(){var K={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return K;var Z=!0,oe=0,he=0;if(this._mediaElement.getVideoPlaybackQuality){var Oe=this._mediaElement.getVideoPlaybackQuality();oe=Oe.totalVideoFrames,he=Oe.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(oe=this._mediaElement.webkitDecodedFrameCount,he=this._mediaElement.webkitDroppedFrameCount):Z=!1;return Z&&(K.decodedFrames=oe,K.droppedFrames=he),K}},{key:"_onvLoadedMetadata",value:function(K){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(Pe.MEDIA_INFO,this.mediaInfo)}},{key:"_reportStatisticsInfo",value:function(){this._emitter.emit(Pe.STATISTICS_INFO,this.statisticsInfo)}}]),Re}(),Dt=kt;w.install();function rt(Re,ve){var K=Re;if(K==null||typeof K!="object")throw new s("MediaDataSource must be an javascript object!");if(!K.hasOwnProperty("type"))throw new s("MediaDataSource must has type field to indicate video file type!");switch(K.type){case"flv":return new ot(K,ve);default:return new Dt(K,ve)}}function Tt(){return Ce.supportMSEH264Playback()}function Ft(){return Ce.getFeatureList()}var zt={};zt.createPlayer=rt,zt.isSupported=Tt,zt.getFeatureList=Ft,zt.BaseLoader=t,zt.LoaderStatus=i,zt.LoaderErrors=n,zt.Events=Pe,zt.ErrorTypes=De,zt.ErrorDetails=Ke,zt.FlvPlayer=ot,zt.NativePlayer=Dt,zt.LoggingControl=Ee,Object.defineProperty(zt,"version",{enumerable:!0,get:function(){return"__VERSION__"}});var Zt=Ve.a=zt},GgEA:function(et,Ve,z){},Gytx:function(et,Ve){et.exports=function(le,Q,j,w){var P=j?j.call(w,le,Q):void 0;if(P!==void 0)return!!P;if(le===Q)return!0;if(typeof le!="object"||!le||typeof Q!="object"||!Q)return!1;var b=Object.keys(le),T=Object.keys(Q);if(b.length!==T.length)return!1;for(var C=Object.prototype.hasOwnProperty.bind(Q),c=0;c=7&&this.setupTypeNumber(C),this.dataCache==null&&(this.dataCache=b.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,c)},T.setupPositionProbePattern=function(C,c){for(var p=-1;p<=7;p++){if(C+p<=-1||this.moduleCount<=C+p)continue;for(var d=-1;d<=7;d++){if(c+d<=-1||this.moduleCount<=c+d)continue;0<=p&&p<=6&&(d==0||d==6)||0<=d&&d<=6&&(p==0||p==6)||2<=p&&p<=4&&2<=d&&d<=4?this.modules[C+p][c+d]=!0:this.modules[C+p][c+d]=!1}}},T.getBestMaskPattern=function(){for(var C=0,c=0,p=0;p<8;p++){this.makeImpl(!0,p);var d=w.getLostPoint(this);(p==0||C>d)&&(C=d,c=p)}return c},T.createMovieClip=function(C,c,p){var d=C.createEmptyMovieClip(c,p),o=1;this.make();for(var a=0;a>p&1)==1;this.modules[Math.floor(p/3)][p%3+this.moduleCount-8-3]=d}for(var p=0;p<18;p++){var d=!C&&(c>>p&1)==1;this.modules[p%3+this.moduleCount-8-3][Math.floor(p/3)]=d}},T.setupTypeInfo=function(C,c){for(var p=this.errorCorrectLevel<<3|c,d=w.getBCHTypeInfo(p),o=0;o<15;o++){var a=!C&&(d>>o&1)==1;o<6?this.modules[o][8]=a:o<8?this.modules[o+1][8]=a:this.modules[this.moduleCount-15+o][8]=a}for(var o=0;o<15;o++){var a=!C&&(d>>o&1)==1;o<8?this.modules[8][this.moduleCount-o-1]=a:o<9?this.modules[8][15-o-1+1]=a:this.modules[8][15-o-1]=a}this.modules[this.moduleCount-8][8]=!C},T.mapData=function(C,c){for(var p=-1,d=this.moduleCount-1,o=7,a=0,u=this.moduleCount-1;u>0;u-=2)for(u==6&&u--;;){for(var s=0;s<2;s++)if(this.modules[d][u-s]==null){var h=!1;a>>o&1)==1);var i=w.getMask(c,d,u-s);i&&(h=!h),this.modules[d][u-s]=h,o--,o==-1&&(a++,o=7)}if(d+=p,d<0||this.moduleCount<=d){d-=p,p=-p;break}}},b.PAD0=236,b.PAD1=17,b.createData=function(C,c,p){for(var d=Q.getRSBlocks(C,c),o=new j,a=0;as*8)throw new Error("code length overflow. ("+o.getLengthInBits()+">"+s*8+")");for(o.getLengthInBits()+4<=s*8&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(!1);for(;!(o.getLengthInBits()>=s*8);){if(o.put(b.PAD0,8),o.getLengthInBits()>=s*8)break;o.put(b.PAD1,8)}return b.createBytes(o,d)},b.createBytes=function(C,c){for(var p=0,d=0,o=0,a=new Array(c.length),u=new Array(c.length),s=0;s=0?v.get(m):0}}for(var _=0,n=0;n=0;)T^=P.G15<=0;)T^=P.G18<>>=1;return T},getPatternPosition:function(b){return P.PATTERN_POSITION_TABLE[b-1]},getMask:function(b,T,C){switch(b){case w.PATTERN000:return(T+C)%2==0;case w.PATTERN001:return T%2==0;case w.PATTERN010:return C%3==0;case w.PATTERN011:return(T+C)%3==0;case w.PATTERN100:return(Math.floor(T/2)+Math.floor(C/3))%2==0;case w.PATTERN101:return T*C%2+T*C%3==0;case w.PATTERN110:return(T*C%2+T*C%3)%2==0;case w.PATTERN111:return(T*C%3+(T+C)%2)%2==0;default:throw new Error("bad maskPattern:"+b)}},getErrorCorrectPolynomial:function(b){for(var T=new Q([1],0),C=0;C5&&(C+=3+d-5)}for(var c=0;c>>6)+c(128|I&63):c(224|I>>>12&15)+c(128|I>>>6&63)+c(128|I&63)}else{var I=65536+(D.charCodeAt(0)-55296)*1024+(D.charCodeAt(1)-56320);return c(240|I>>>18&7)+c(128|I>>>12&63)+c(128|I>>>6&63)+c(128|I&63)}},d=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,o=function(D){return D.replace(d,p)},a=function(D){var I=[0,2,1][D.length%3],B=D.charCodeAt(0)<<16|(D.length>1?D.charCodeAt(1):0)<<8|(D.length>2?D.charCodeAt(2):0),H=[T.charAt(B>>>18),T.charAt(B>>>12&63),I>=2?"=":T.charAt(B>>>6&63),I>=1?"=":T.charAt(B&63)];return H.join("")},u=w.btoa&&typeof w.btoa=="function"?function(D){return w.btoa(D)}:function(D){if(D.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return D.replace(/[\s\S]{1,3}/g,a)},s=function(D){return u(o(String(D)))},h=function(D){return D.replace(/[+\/]/g,function(I){return I=="+"?"-":"_"}).replace(/=/g,"")},i=function(D,I){return I?h(s(D)):s(D)},n=function(D){return i(D,!0)},t;w.Uint8Array&&(t=function(D,I){for(var B="",H=0,te=D.length;H>>18)+T.charAt(ne>>>12&63)+(typeof V!="undefined"?T.charAt(ne>>>6&63):"=")+(typeof X!="undefined"?T.charAt(ne&63):"=")}return I?h(B):B});var f=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,v=function(D){switch(D.length){case 4:var I=(7&D.charCodeAt(0))<<18|(63&D.charCodeAt(1))<<12|(63&D.charCodeAt(2))<<6|63&D.charCodeAt(3),B=I-65536;return c((B>>>10)+55296)+c((B&1023)+56320);case 3:return c((15&D.charCodeAt(0))<<12|(63&D.charCodeAt(1))<<6|63&D.charCodeAt(2));default:return c((31&D.charCodeAt(0))<<6|63&D.charCodeAt(1))}},m=function(D){return D.replace(f,v)},_=function(D){var I=D.length,B=I%4,H=(I>0?C[D.charAt(0)]<<18:0)|(I>1?C[D.charAt(1)]<<12:0)|(I>2?C[D.charAt(2)]<<6:0)|(I>3?C[D.charAt(3)]:0),te=[c(H>>>16),c(H>>>8&255),c(H&255)];return te.length-=[0,0,2,1][B],te.join("")},E=w.atob&&typeof w.atob=="function"?function(D){return w.atob(D)}:function(D){return D.replace(/\S{1,4}/g,_)},g=function(D){return E(String(D).replace(/[^A-Za-z0-9\+\/]/g,""))},y=function(D){return m(E(D))},x=function(D){return String(D).replace(/[-_]/g,function(I){return I=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},l=function(D){return y(x(D))},S;w.Uint8Array&&(S=function(D){return Uint8Array.from(g(x(D)),function(I){return I.charCodeAt(0)})});var O=function(){var D=w.Base64;return w.Base64=P,D};if(w.Base64={VERSION:b,atob:g,btoa:u,fromBase64:l,toBase64:i,utob:o,encode:i,encodeURI:n,btou:m,decode:l,noConflict:O,fromUint8Array:t,toUint8Array:S},typeof Object.defineProperty=="function"){var A=function(D){return{value:D,enumerable:!1,writable:!0,configurable:!0}};w.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",A(function(){return l(this)})),Object.defineProperty(String.prototype,"toBase64",A(function(D){return i(this,D)})),Object.defineProperty(String.prototype,"toBase64URI",A(function(){return i(this,!0)}))}}return w.Meteor&&(Base64=w.Base64),et.exports?et.exports.Base64=w.Base64:!(Q=[],j=function(){return w.Base64}.apply(Ve,Q),j!==void 0&&(et.exports=j)),{Base64:w.Base64}})}).call(this,z("IyRk"))},JOrW:function(et,Ve,z){et.exports=z.p+"static/gf.09d89ab3.svg"},LdHM:function(et,Ve,z){"use strict";z.d(Ve,"b",function(){return f}),z.d(Ve,"a",function(){return m});var le=z("1OyB"),Q=z("vuIU"),j=z("Ji7U"),w=z("LK+K"),P=z("q1tI"),b=z("rePB"),T=z("Ff2n"),C=z("ODXe"),c=z("4IlW"),p=z("bX4T"),d=z("YrtM"),o=z("TSYQ"),a=z.n(o),u=z("+nKL"),s=z("8OUc"),h=function(X,ne){var Y=X.prefixCls,ee=X.id,ce=X.flattenOptions,de=X.childrenAsData,Ce=X.values,Se=X.searchValue,Pe=X.multiple,ye=X.defaultActiveFirstOption,Ee=X.height,Ge=X.itemHeight,Ue=X.notFoundContent,Fe=X.open,He=X.menuItemSelectedIcon,be=X.virtual,me=X.onSelect,We=X.onToggleOpen,ze=X.onActiveValue,nt=X.onScroll,re=X.onMouseEnter,k="".concat(Y,"-item"),U=Object(d.a)(function(){return ce},[Fe,ce],function(Xe,Be){return Be[0]&&Xe[1]!==Be[1]}),q=P.useRef(null),$=function(Be){Be.preventDefault()},J=function(Be){q.current&&q.current.scrollTo({index:Be})},xe=function(Be){for(var Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Me=U.length,_e=0;_e1&&arguments[1]!==void 0?arguments[1]:!1;return Object(E.a)(V).map(function(ne,Y){if(!P.isValidElement(ne)||!ne.type)return null;var ee=ne.type.isSelectOptGroup,ce=ne.key,de=ne.props,Ce=de.children,Se=Object(T.a)(de,["children"]);return X||!ee?g(ne):Object(_.a)(Object(_.a)({key:"__RC_SELECT_GRP__".concat(ce===null?Y:ce,"__"),label:ce},Se),{},{options:y(Ce)})}).filter(function(ne){return ne})}var x=z("2Qr1"),l=z("qNPg"),S=z("U8pU"),O=z("Kwbf"),A=z("WKfj");function D(V){var X=V.mode,ne=V.options,Y=V.children,ee=V.backfill,ce=V.allowClear,de=V.placeholder,Ce=V.getInputElement,Se=V.showSearch,Pe=V.onSearch,ye=V.defaultOpen,Ee=V.autoFocus,Ge=V.labelInValue,Ue=V.value,Fe=V.inputValue,He=V.optionLabelProp,be=X==="multiple"||X==="tags",me=Se!==void 0?Se:be||X==="combobox",We=ne||y(Y);if(Object(O.a)(X!=="tags"||We.every(function(k){return!k.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),X==="tags"||X==="combobox"){var ze=We.some(function(k){return k.options?k.options.some(function(U){return typeof("value"in U?U.value:U.key)=="number"}):typeof("value"in k?k.value:k.key)=="number"});Object(O.a)(!ze,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(O.a)(X!=="combobox"||!He,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(O.a)(X==="combobox"||!ee,"`backfill` only works with `combobox` mode."),Object(O.a)(X==="combobox"||!Ce,"`getInputElement` only work with `combobox` mode."),Object(O.b)(X!=="combobox"||!Ce||!ce||!de,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Pe&&!me&&X!=="combobox"&&X!=="tags"&&Object(O.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(O.b)(!ye||Ee,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Ue!=null){var nt=Object(A.d)(Ue);Object(O.a)(!Ge||nt.every(function(k){return Object(S.a)(k)==="object"&&("key"in k||"value"in k)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(O.a)(!be||Array.isArray(Ue),"`value` should be array when `mode` is `multiple` or `tags`")}if(Y){var re=null;Object(E.a)(Y).some(function(k){if(!P.isValidElement(k)||!k.type)return!1;var U=k.type;if(U.isSelectOption)return!1;if(U.isSelectOptGroup){var q=Object(E.a)(k.props.children).every(function($){return!P.isValidElement($)||!k.type||$.type.isSelectOption?!0:(re=$.type,!1)});return!q}return re=U,!0}),re&&Object(O.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(re.displayName||re.name||re,"`.")),Object(O.a)(Fe===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var I=D,B=Object(l.a)({prefixCls:"rc-select",components:{optionList:n},convertChildrenToData:y,flattenOptions:x.d,getLabeledValue:x.e,filterOptions:x.b,isValueDisabled:x.g,findValueOption:x.c,warningProps:I,fillOptionsWithMissingValue:x.a}),H=function(V){Object(j.a)(ne,V);var X=Object(w.a)(ne);function ne(){var Y;return Object(le.a)(this,ne),Y=X.apply(this,arguments),Y.selectRef=P.createRef(),Y.focus=function(){Y.selectRef.current.focus()},Y.blur=function(){Y.selectRef.current.blur()},Y}return Object(Q.a)(ne,[{key:"render",value:function(){return P.createElement(B,Object.assign({ref:this.selectRef},this.props))}}]),ne}(P.Component);H.Option=f,H.OptGroup=m;var te=H,W=Ve.c=te},M8RZ:function(et,Ve,z){"use strict";z.d(Ve,"a",function(){return c});var le=z("fWQN"),Q=z("mtLc"),j=z("yKVA"),w=z("879j"),P=z("q1tI"),b=z.n(P),T=z("i8i4"),C=z.n(T),c=function(p){Object(j.a)(o,p);var d=Object(w.a)(o);function o(a){var u;Object(le.a)(this,o),u=d.call(this,a);var s=window.document;return u.node=s.createElement("div"),s.body.appendChild(u.node),u}return Object(Q.a)(o,[{key:"render",value:function(){var u=this.props.children;return Object(T.createPortal)(u,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),o}(b.a.Component)},MFOe:function(et,Ve,z){(function(le){var Q=b(),j=T(),w=C(),P=typeof window!="undefined"?window:le;et.exports={assign:Q,create:j,trim:w,bind:c,slice:p,each:d,map:o,pluck:a,isList:u,isFunction:s,isObject:h,Global:P};function b(){return Object.assign?Object.assign:function(n,t,f,v){for(var m=1;m=0;h-=1){var i=C.get(h)||new Set;i.forEach(function(n){var t=n.parent,f=n.node;if(p(f)||!n.parent||s.has(n.parent.key))return;if(p(n.parent.node)){s.add(t.key);return}var v=!0,m=!1;(t.children||[]).filter(function(_){return!p(_.node)}).forEach(function(_){var E=_.key,g=d.has(E);v&&!g&&(v=!1),!m&&(g||o.has(E))&&(m=!0)}),v&&d.add(t.key),m&&o.add(t.key),s.add(t.key)})}return{checkedKeys:Array.from(d),halfCheckedKeys:Array.from(Q(o,d))}}function P(T,C,c,p,d){for(var o=new Set(T),a=new Set(C),u=0;u<=p;u+=1){var s=c.get(u)||new Set;s.forEach(function(t){var f=t.key,v=t.node,m=t.children,_=m===void 0?[]:m;!o.has(f)&&!a.has(f)&&!d(v)&&_.filter(function(E){return!d(E.node)}).forEach(function(E){o.delete(E.key)})})}a=new Set;for(var h=new Set,i=p;i>=0;i-=1){var n=c.get(i)||new Set;n.forEach(function(t){var f=t.parent,v=t.node;if(d(v)||!t.parent||h.has(t.parent.key))return;if(d(t.parent.node)){h.add(f.key);return}var m=!0,_=!1;(f.children||[]).filter(function(E){return!d(E.node)}).forEach(function(E){var g=E.key,y=o.has(g);m&&!y&&(m=!1),!_&&(y||a.has(g))&&(_=!0)}),m||o.delete(f.key),_&&a.add(f.key),h.add(f.key)})}return{checkedKeys:Array.from(o),halfCheckedKeys:Array.from(Q(a,o))}}function b(T,C,c,p){var d=[],o;p?o=p:o=j;var a=new Set(T.filter(function(i){var n=!!c[i];return n||d.push(i),n})),u=new Map,s=0;Object.keys(c).forEach(function(i){var n=c[i],t=n.level,f=u.get(t);f||(f=new Set,u.set(t,f)),f.add(n),s=Math.max(s,t)}),Object(le.a)(!d.length,"Tree missing follow keys: ".concat(d.slice(0,100).map(function(i){return"'".concat(i,"'")}).join(", ")));var h;return C===!0?h=w(a,u,s,o):h=P(a,C.halfCheckedKeys,u,s,o),h}},OLES:function(et,Ve,z){"use strict";var le=z("U8pU"),Q=z("VTBJ"),j=z("Ff2n"),w=z("q1tI"),P=z("uciX"),b=z("7ixt"),T=function(a){var u=a.overlay,s=a.prefixCls,h=a.id,i=a.overlayInnerStyle;return w.createElement("div",{className:"".concat(s,"-inner"),id:h,role:"tooltip",style:i},typeof u=="function"?u():u)},C=T,c=function(a,u){var s=a.overlayClassName,h=a.trigger,i=h===void 0?["hover"]:h,n=a.mouseEnterDelay,t=n===void 0?0:n,f=a.mouseLeaveDelay,v=f===void 0?.1:f,m=a.overlayStyle,_=a.prefixCls,E=_===void 0?"rc-tooltip":_,g=a.children,y=a.onVisibleChange,x=a.afterVisibleChange,l=a.transitionName,S=a.animation,O=a.placement,A=O===void 0?"right":O,D=a.align,I=D===void 0?{}:D,B=a.destroyTooltipOnHide,H=B===void 0?!1:B,te=a.defaultVisible,W=a.getTooltipContainer,V=a.overlayInnerStyle,X=Object(j.a)(a,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),ne=Object(w.useRef)(null);Object(w.useImperativeHandle)(u,function(){return ne.current});var Y=Object(Q.a)({},X);"visible"in a&&(Y.popupVisible=a.visible);var ee=function(){var Pe=a.arrowContent,ye=Pe===void 0?null:Pe,Ee=a.overlay,Ge=a.id;return[w.createElement("div",{className:"".concat(E,"-arrow"),key:"arrow"},ye),w.createElement(C,{key:"content",prefixCls:E,id:Ge,overlay:Ee,overlayInnerStyle:V})]},ce=!1,de=!1;if(typeof H=="boolean")ce=H;else if(H&&Object(le.a)(H)==="object"){var Ce=H.keepParent;ce=Ce===!0,de=Ce===!1}return w.createElement(P.a,Object.assign({popupClassName:s,prefixCls:E,popup:ee,action:i,builtinPlacements:b.a,popupPlacement:A,ref:ne,popupAlign:I,getPopupContainer:W,onPopupVisibleChange:y,afterPopupVisibleChange:x,popupTransitionName:l,popupAnimation:S,defaultPopupVisible:te,destroyPopupOnHide:ce,autoDestroy:de,mouseLeaveDelay:v,popupStyle:m,mouseEnterDelay:t},Y),g)},p=Object(w.forwardRef)(c),d=Ve.a=p},OZM5:function(et,Ve,z){"use strict";z.d(Ve,"b",function(){return p}),z.d(Ve,"a",function(){return d}),z.d(Ve,"k",function(){return o}),z.d(Ve,"h",function(){return a}),z.d(Ve,"i",function(){return u}),z.d(Ve,"g",function(){return s}),z.d(Ve,"c",function(){return h}),z.d(Ve,"d",function(){return i}),z.d(Ve,"j",function(){return f}),z.d(Ve,"e",function(){return v}),z.d(Ve,"f",function(){return m});var le=z("KQm4"),Q=z("U8pU"),j=z("Ff2n"),w=z("q1tI"),P=z.n(w),b=z("Kwbf"),T=z("WaYH"),C=.25,c=2;function p(_,E){var g=_.slice(),y=g.indexOf(E);return y>=0&&g.splice(y,1),g}function d(_,E){var g=_.slice();return g.indexOf(E)===-1&&g.push(E),g}function o(_){return _.split("-")}function a(_,E){return"".concat(_,"-").concat(E)}function u(_){return _&&_.type&&_.type.isTreeNode}function s(_,E){var g=[_],y=E[_];function x(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];l.forEach(function(S){var O=S.key,A=S.children;g.push(O),x(A)})}return x(y.children),g}function h(_,E){var g=_.clientY,y=E.selectHandle.getBoundingClientRect(),x=y.top,l=y.bottom,S=y.height,O=Math.max(S*C,c);return g<=x+O?-1:g>=l-O?1:0}function i(_,E){if(!_)return;var g=E.multiple;return g?_.slice():_.length?[_[0]]:_}var n=function(E){return E};function t(_,E){if(!_)return[];var g=E||{},y=g.processProps,x=y===void 0?n:y,l=Array.isArray(_)?_:[_];return l.map(function(S){var O=S.children,A=Object(j.a)(S,["children"]),D=t(O,E);return P.a.createElement(T.a,Object.assign({},x(A)),D)})}function f(_){if(!_)return null;var E;if(Array.isArray(_))E={checkedKeys:_,halfCheckedKeys:void 0};else if(Object(Q.a)(_)==="object")E={checkedKeys:_.checked||void 0,halfCheckedKeys:_.halfChecked||void 0};else return Object(b.a)(!1,"`checkedKeys` is not an array or an object"),null;return E}function v(_,E){var g=new Set;function y(x){if(g.has(x))return;var l=E[x];if(!l)return;g.add(x);var S=l.parent,O=l.node;if(O.disabled)return;S&&y(S.key)}return(_||[]).forEach(function(x){y(x)}),Object(le.a)(g)}function m(_){var E={};return Object.keys(_).forEach(function(g){(g.startsWith("data-")||g.startsWith("aria-"))&&(E[g]=_[g])}),E}},"OkW/":function(et,Ve,z){},Ot1p:function(et,Ve,z){"use strict";var le=z("2qtc"),Q=z("kLXV"),j=z("rAM+"),w=z("miYZ"),P=z("tsqr"),b=z("9og8"),T=z("tJVT"),C=z("jrin"),c=z("WmNS"),p=z.n(c),d=z("q1tI"),o=z.n(d),a=z("VrN/"),u=z.n(a),s=z("bdgK"),h=z("p77/"),i=z("Bd2K"),n=z("ELLl"),t=z("19Vz"),f=z("lZu9"),v=z("+NIl"),m=z("kSUc"),_=z("9Bee"),E=function(bt){var Lt=bt.value,at=Lt===void 0?"":Lt,pt=bt.className,st=bt.showTextOnly,De=bt.showLines,Ke=bt.style,yt=Ke===void 0?{}:Ke,ot=Object(d.useMemo)(function(){return""},[at]);return o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{dangerouslySetInnerHTML:{__html:ot}}))},g=z("Q9mQ"),y=z("diRs"),x=z("0Owb"),l=z("dejd"),S=z("C+DQ"),O=z("D1Df"),A=z.n(O),D=z("1vsH"),I=z("m3rI"),B=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function H(bt){var Lt=bt.onActionCallback,at=bt.title,pt=bt.icon,st=bt.actionName,De=bt.className,Ke=De===void 0?"":De,yt=bt.children;function ot(){Lt(st)}return o.a.createElement("a",{title:at,className:Ke,onClick:ot},o.a.createElement("i",{className:"md-iconfont ".concat(pt)}),yt)}var te=function(bt){var Lt=bt.watch,at=bt.showNullButton,pt=bt.onActionCallback,st=bt.fullScreen,De=bt.insertTemp,Ke=bt.hidetoolBar,yt=bt.uuid,ot=bt.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(D.E)("_educoder_session_login"),"&_educoder_session=").concat(Object(D.E)("_educoder_session"),"&key=").concat(yt,"&api=").concat(encodeURIComponent(I.a.PROXY_SERVER)));var kt=[].concat(B,[{title:"".concat(Lt?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Lt?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return o.a.createElement("ul",{className:"markdown-toolbar-container"},!Ke&&kt.map(function(Dt,rt){return o.a.createElement("li",{key:rt},Dt.actionName?o.a.createElement(H,Object(x.a)({},Dt,{onActionCallback:pt})):o.a.createElement("span",{className:"v-line"}))}),at?o.a.createElement("li",null,o.a.createElement(H,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:pt},o.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,De&&o.a.createElement("li",null,o.a.createElement(H,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(De),onActionCallback:pt},o.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),o.a.createElement("li",null,o.a.createElement(y.a,{title:"\u6253\u5F00\u624B\u673A\u626B\u4E00\u626B",content:o.a.createElement("div",null,o.a.createElement(A.a,{size:150,fgColor:"#000",value:"https://test2.educoder.net/upload.html?_educoder_session_login=".concat(Object(D.E)("_educoder_session_login"),"&_educoder_session=").concat(Object(D.E)("_educoder_session"),"&key=").concat(yt,"&api=").concat(encodeURIComponent(I.a.PROXY_SERVER))}))},o.a.createElement("span",{className:"fill-tip",onMouseOver:function(){return ot(!0)}},"\u624B\u673A\u4E0A\u4F20\u6587\u4EF6"))),o.a.createElement("li",{className:"btn-full-screen"},o.a.createElement(H,{icon:"".concat(st?"icon-shrink":"icon-enlarge"),title:st?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:pt})))},W=z("M8RZ"),V=z("+L6B"),X=z("2/Rp"),ne=z("y8nQ"),Y=z("Vl3Y"),ee=z("5NDa"),ce=z("5rEg"),de={labelCol:{span:4},wrapperCol:{span:20}},Ce=function(bt){var Lt=bt.callback,at=bt.onCancel;function pt(st){Lt(st)}return o.a.createElement(Y.a,Object(x.a)({},de,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:pt}),o.a.createElement(Y.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},o.a.createElement(ce.a,null)),o.a.createElement(Y.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},o.a.createElement(ce.a,null)),o.a.createElement("div",{className:"flex-container flex-end"},o.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),o.a.createElement(X.a,{type:"ghost",onClick:at},"\u53D6\u6D88")))},Se=z("7ahc"),Pe=z("k1fw"),ye=z("HmJG"),Ee=z("BjJ7"),Ge=Y.a.useForm,Ue={width:280,marginRight:10},Fe={labelCol:{span:5},wrapperCol:{span:19}},He=function(bt){var Lt=bt.callback,at=bt.onCancel,pt=Ge(),st=Object(T.a)(pt,1),De=st[0],Ke=Object(d.useRef)();function yt(Dt){Lt(Object(Pe.a)(Object(Pe.a)({},Dt),{},{name:Ke.current}))}function ot(Dt,rt){De.setFieldsValue({src:"/api/attachments/".concat(Dt.id,"?type=").concat(Dt.content_type),type:rt.type})}function kt(Dt){var rt=Dt.target.files[0];Ke.current=rt.name,me(rt,ot)}return o.a.createElement(Y.a,Object(x.a)({form:De},Fe,{className:"upload-image-panel",onFinish:yt}),o.a.createElement(Y.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},o.a.createElement("div",{className:"flex-container"},o.a.createElement(Y.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},o.a.createElement(ce.a,{style:Ue})),o.a.createElement(be,{onFileChange:kt}))),o.a.createElement(Y.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},o.a.createElement(ce.a,{style:{width:264}})),o.a.createElement(Y.a.Item,{style:{textAlign:"right"}},o.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),o.a.createElement(X.a,{type:"ghost",onClick:at},"\u53D6\u6D88")))};function be(bt){var Lt=bt.onFileChange;return o.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",o.a.createElement("input",{type:"file",onChange:Lt}))}function me(bt,Lt){if(!bt)throw new String("\u6CA1\u6709\u6587\u4EF6");var at=new FormData;at.append("editormd-image-file",bt),at.append("file_param_name","editormd-image-file"),at.append("byxhr","true");var pt=new window.XMLHttpRequest;pt.withCredentials=!0,pt.addEventListener("load",function(st){Lt(JSON.parse(st.target.responseText),bt)},!1),pt.addEventListener("error",function(st){console.error(st)},!1),pt.open("POST","".concat(Ee.a,"/api/attachments.json")),pt.send(at)}var We=z("giR+"),ze=z("fyUT"),nt=z("7Kak"),re=z("9yH6"),k=re.a.Group,U={margin:"0 8px"},q=function(bt){var Lt=bt.callback,at=bt.onCancel;function pt(st){Lt(st)}return o.a.createElement(Y.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:pt},o.a.createElement("div",{className:"flex-container"},o.a.createElement("span",{style:U},"\u5355\u5143\u683C\u6570\uFF1A"),o.a.createElement("span",{style:U},"\u884C\u6570"),o.a.createElement(Y.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},o.a.createElement(ze.a,null)),o.a.createElement("span",{style:U},"\u5217\u6570"),o.a.createElement(Y.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},o.a.createElement(ze.a,null))),o.a.createElement("div",{className:"flex-container",style:{marginTop:12}},o.a.createElement("span",{style:U},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),o.a.createElement(Y.a.Item,{name:"align"},o.a.createElement(k,null,o.a.createElement(re.a,{value:"default"},o.a.createElement("i",{className:"fa fa-align-justify"})),o.a.createElement(re.a,{value:"left"},o.a.createElement("i",{className:"fa fa-align-left"})),o.a.createElement(re.a,{value:"center"},o.a.createElement("i",{className:"fa fa-align-center"})),o.a.createElement(re.a,{value:"right"},o.a.createElement("i",{className:"fa fa-align-right"}))))),o.a.createElement("div",{className:"flex-container flex-end"},o.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),o.a.createElement(X.a,{type:"ghost",onClick:at},"\u53D6\u6D88")))},$=z("ErOA"),J=z("7Cbv"),xe="link",ke="upload-image",dt="code-block",Ne="add-table",je="------------",tt={default:je,left:":".concat(je),center:":".concat(je,":"),right:"".concat(je,":")},mt=z("9VGf"),Qe,Xe;function Be(){}var Ie=0,Me=1e4,_e="\u2581",Ae=`
**\u6A21\u677F\u6807\u9898**
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function Le(bt){return/^\d+$/.test(bt)?"".concat(bt,"px"):bt}var Te=navigator.platform.toUpperCase().indexOf("MAC")>=0,Ze=Te?"Cmd":"Ctrl",ut=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],Ct=(Qe={},Object(C.a)(Qe,Ze+"-B","bold"),Object(C.a)(Qe,Ze+"-I","italic"),Qe),Ht=(Xe={},Object(C.a)(Xe,xe,"\u6DFB\u52A0\u94FE\u63A5"),Object(C.a)(Xe,dt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(C.a)(Xe,ke,"\u6DFB\u52A0\u6587\u4EF6"),Object(C.a)(Xe,Ne,"\u6DFB\u52A0\u8868\u683C"),Xe),Qt=Ve.a=function(bt){var Lt=bt.defaultValue,at=Lt===void 0?"":Lt,pt=bt.onChange,st=bt.width,De=st===void 0?"100%":st,Ke=bt.height,yt=Ke===void 0?400:Ke,ot=bt.miniToolbar,kt=ot===void 0?!1:ot,Dt=bt.isFocus,rt=Dt===void 0?!1:Dt,Tt=bt.watch,Ft=bt.insertTemp,zt=bt.mode,Zt=zt===void 0?"markdown":zt,Re=bt.id,ve=Re===void 0?"markdown-editor-id":Re,K=bt.showResizeBar,Z=K===void 0?!1:K,oe=bt.noStorage,he=oe===void 0?!1:oe,Oe=bt.showNullButton,Je=Oe===void 0?!1:Oe,lt=bt.hidetoolBar,Pt=lt===void 0?!1:lt,Nt=bt.fullScreen,ht=Nt===void 0?!1:Nt,Mt=bt.onBlur,nn=bt.onCMBeforeChange,Rt=bt.onFullScreen,cn=bt.className,an=cn===void 0?"":cn,ie=bt.disablePaste,N=ie===void 0?!1:ie,F=bt.placeholder,ae=F===void 0?"":F,pe=bt.values,se=pe===void 0?"":pe,$e=Object(d.useState)(null),_t=Object(T.a)($e,2),it=_t[0],Vt=_t[1],At=Object(d.useState)(at),Bt=Object(T.a)(At,2),on=Bt[0],In=Bt[1],Lr=Object(d.useState)(Tt),Sr=Object(T.a)(Lr,2),Un=Sr[0],ur=Sr[1],mi=Object(d.useState)(ht),Ar=Object(T.a)(mi,2),fr=Ar[0],br=Ar[1],Xr=Object(d.useState)(""),Dr=Object(T.a)(Xr,2),Yr=Dr[0],gr=Dr[1],gi=Object(d.useState)(0),si=Object(T.a)(gi,2),Pr=si[0],Fr=si[1],_i=Object(d.useState)(yt),vi=Object(T.a)(_i,2),di=vi[0],Fn=vi[1],wn=Object(d.useState)(!1),Er=Object(T.a)(wn,2),qn=Er[0],kr=Er[1],hr=Object(d.useRef)(Object(J.a)()),Ui=Object(d.useRef)(!1),Nr=Object(d.useRef)(),Ur=Object(d.useRef)(),yi=Object(d.useRef)(),Zr=Object(d.useRef)(),Li=Object(d.useRef)(),qi=function(){var dn=Object(b.a)(p.a.mark(function On(){var gn,qt;return p.a.wrap(function(cr){for(;;)switch(cr.prev=cr.next){case 0:return cr.next=2,Object($.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:hr.current}});case 2:qt=cr.sent,qt!=null&&(gn=qt.attachments)!==null&&gn!==void 0&&gn.length&&(console.log("cm:",it,Ur),qt.attachments.map(function(Zn){Zn.content_type.indexOf("image")>-1?it.replaceSelection(".concat(Zn.content_type,")")):Zn.content_type.indexOf("video")>-1?it.replaceSelection('')):Zn.content_type.indexOf("pdf")>-1?it.replaceSelection('').concat(Zn.name,"")):it.replaceSelection("[".concat(Zn.name,"](").concat(I.a.API_SERVER,"/api/attachments/").concat(Zn.id,"?type=").concat(Zn.content_type,")"))}));case 4:case"end":return cr.stop()}},On)}));return function(){return dn.apply(this,arguments)}}();Object(d.useEffect)(function(){In(se),it==null||it.setValue(se)},[se]),Object(d.useEffect)(function(){Rt==null||Rt(fr)},[fr]),Object(d.useEffect)(function(){if(Ur.current){var dn=u.a.fromTextArea(Ur.current,{mode:Zt,lineNumbers:!kt,lineWrapping:!0,value:at,autoCloseTags:!0,autoCloseBrackets:!0});rt&&dn.focus();function On(gn,qt){if(N){qt.preventDefault();return}var Hn=qt.clipboardData;if(Hn){var cr=Hn.types.toString(),Zn=Hn.items;if(cr==="Files"||Hn.types.indexOf("Files")>-1){if(qt.preventDefault(),Zt=="stex")return;try{var wr,Wr=Zn[1];((wr=Zn[0])===null||wr===void 0?void 0:wr.kind)==="file"&&(Wr=Zn[0]);var zn=Wr.getAsFile(),gt=zn.name.split(".").pop();me(zn,function(ct){if(ct.id){var xt,It,sn;(zn==null||((xt=zn.type)===null||xt===void 0)?void 0:xt.indexOf("image"))>-1?dn.replaceSelection(".concat(ct.content_type,")")):(zn==null||((It=zn.type)===null||It===void 0)?void 0:It.indexOf("video"))>-1?dn.replaceSelection('')):(zn==null||((sn=zn.type)===null||sn===void 0)?void 0:sn.indexOf("pdf"))>-1?dn.replaceSelection('').concat(zn.name,"")):ut.includes(gt)?dn.replaceSelection('').concat(zn.name,"")):dn.replaceSelection("[".concat(zn.name,"](").concat(I.a.API_SERVER,"/api/attachments/").concat(ct.id,"?type=").concat(ct.content_type,")"))}else(ct==null?void 0:ct.status)===401&&(document.location.href="/user/login")})}catch(ct){P.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return dn.on("paste",On),dn.on("dragleave",function(gn,qt){yi.current.classList.remove("mouse-hover-md")}),dn.on("dragover",function(gn,qt){yi.current.classList.add("mouse-hover-md")}),dn.on("drop",function(gn,qt){yi.current.classList.add("mouse-hover-md");var Hn;if(Hn=qt.dataTransfer.files,Hn.length>0){qt.preventDefault(),qt.stopPropagation();for(var cr=function(Wr){var zn=Hn[Wr],gt=zn.name.split(".").pop();me(zn,function(ct){if(ct.id){var xt,It,sn;(zn==null||((xt=zn.type)===null||xt===void 0)?void 0:xt.indexOf("image"))>-1?dn.replaceSelection(".concat(ct.content_type,")")):(zn==null||((It=zn.type)===null||It===void 0)?void 0:It.indexOf("video"))>-1?dn.replaceSelection('')):(zn==null||((sn=zn.type)===null||sn===void 0)?void 0:sn.indexOf("pdf"))>-1?dn.replaceSelection('').concat(zn.name,"")):ut.includes(gt)?dn.replaceSelection('').concat(zn.name,"")):dn.replaceSelection("[".concat(zn.name,"](").concat(I.a.API_SERVER,"/api/attachments/").concat(ct.id,"?type=").concat(ct.content_type,")"))}else(ct==null?void 0:ct.status)===401&&(document.location.href="/user/login")})},Zn=0;Zn0||Zn.target.offsetWidth>0)&&(xi(),it.setSize("100%","100%"),it.refresh())}}catch(wr){Hn.e(wr)}finally{Hn.f()}});return gn.observe(Ur.current.parentElement),gn}if(it){var On=dn();return function(){On.unobserve(Ur.current.parentElement)}}},[it,xi]),Object(d.useEffect)(function(){if(it){for(var dn=[],On=function(){var Zn=qt[gn];Hn=Object(T.a)(Zn,2);var wr=Hn[0],Wr=Hn[1],zn=Object(C.a)({},wr,function(){Pi(Wr)});dn.push(zn),it.addKeyMap(zn)},gn=0,qt=Object.entries(Ct);gn0){var dn=new Date().getTime(),On=window.sessionStorage.getItem(ve);dn>=Pr+Me&&(!On||On!==on)&&(window.sessionStorage.setItem(ve,on),kr(!0))}},Me),Object(d.useEffect)(function(){ur(Tt)},[it,Tt]),Object(d.useEffect)(function(){it&&(rt&&it.focus())},[it,rt]),Object(d.useEffect)(function(){if(Un&&it){var dn=it.getScrollerElement();function On(gn){var qt=gn.target;if(Li.current){var Hn=qt.scrollTop/qt.scrollHeight;Li.current.scrollTop=Li.current.scrollHeight*Hn}}return dn.addEventListener("scroll",On),function(){dn.removeEventListener("scroll",On)}}},[it,Un]),Object(d.useEffect)(function(){if(it&&nn){function dn(On,gn){nn(On,gn)}return it.on("beforeChange",dn),function(){it.off("beforeChange",dn)}}},[it,nn]),Object(d.useEffect)(function(){if(it&&Mt){function dn(){Mt(it.getValue())}return it.on("blur",dn),function(){it.off("blur",dn)}}},[it,Mt]),Object(d.useEffect)(function(){if(it){function dn(On){var gn=On.getValue();In(gn),Fr(new Date().getTime()),On.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),pt&&pt(gn)}return it.on("change",dn),function(){it.off("change",dn)}}},[it,pt]),Object(d.useEffect)(function(){it&&(at==null?(it.setValue(""),In("")):at!==it.getValue()&&(it.setValue(at),In(at),it.setCursor(it.lineCount(),0)))},[it,at]);var Pi=Object(d.useCallback)(function(dn){var On=it.getCursor(),gn=it.getSelection(),qt=gn.split(`
`);switch(dn){case"bold":return it.replaceSelection("**"+gn+"**"),gn===""&&it.setCursor(On.line,On.ch+2),it.focus();case"italic":return it.replaceSelection("*"+gn+"*"),gn===""&&it.setCursor(On.line,On.ch+1),it.focus();case"code":return it.replaceSelection("`"+gn+"`"),gn===""&&it.setCursor(On.line,On.ch+1),it.focus();case"inline-latex":return it.replaceSelection("`$$"+gn+"$$`"),gn===""&&it.setCursor(On.line,On.ch+3),it.focus();case"latex":return it.replaceSelection("```latex\n"+gn+"\n```"),it.setCursor(On.line+1,gn.length+1),it.focus();case"line-break":return it.replaceSelection(`
`),it.focus();case"list-ul":return gn===""?it.replaceSelection("- "+gn):it.replaceSelection(qt.map(function(Hn){return Hn===""?"":"- ".concat(Hn)}).join(`
`)),it.focus();case"list-ol":return gn===""?it.replaceSelection("1. "+gn):it.replaceSelection(qt.map(function(Hn,cr){return Hn===""?"":"".concat(cr+1,". ").concat(Hn)}).join(`
`)),it.focus();case"add-null-ch":return gn===""&&it.setCursor(On.line,On.ch+1),it.replaceSelection(_e),it.focus();case"inster-template-1":return gn===""&&it.setCursor(On.line,On.ch),it.replaceSelection(Ae),it.focus();case"eraser":return it.setValue(""),it.focus();case"trigger-watch":return ur(!Un),it.focus();case"trigger-full-screen":return br(!fr),it.focus();case xe:gr(xe);return;case dt:gr(dt);return;case ke:gr(ke);return;case Ne:gr(Ne);return;default:throw new Error}},[it,Un,fr]),li=Object(d.useCallback)(function(dn){gr("");switch(Yr){case xe:var On=dn.title,gn=dn.link;return it.replaceSelection("[".concat(On,"](").concat(gn,")")),it.focus();case dt:var qt=dn.language,Hn=dn.content;return it.replaceSelection(["```"+qt,Hn,"```"].join(`
`)),it.focus();case ke:var cr=dn.src,Zn=dn.alt,wr=dn.name;return cr.indexOf("type=image")>-1?it.replaceSelection(".concat(cr,' "').concat(Zn||"",'" )')):cr.indexOf("type=application/pdf")>-1?it.replaceSelection('').concat(wr,"")):it.replaceSelection('').concat(wr,"")),it.focus();case Ne:for(var Wr=dn.row,zn=dn.col,gt=dn.align,ct=`
`,xt=0;xt300&&(wr=300);var Wr=yt+wr+"px";Fn(Wr)}}return dn.addEventListener("mousedown",qt),document.addEventListener("mousemove",cr),document.addEventListener("mouseup",Hn),function(){dn.removeEventListener("mousedown",qt),document.removeEventListener("mousemove",cr),document.removeEventListener("mouseup",Hn)}}},[it,Zr]),Object(d.useEffect)(function(){Fn(yt)},[yt]);var hi=Le(De),Zi=Le(di),pa={width:hi,height:Zi},ma=Object(d.useMemo)(function(){if(Pr){var dn=new Date(Pr),On=dn.getHours(),gn=dn.getMinutes(),qt=dn.getSeconds();return On=On<10?"0"+On:On,gn=gn<10?"0"+gn:gn,qt=qt<10?"0"+qt:qt,"".concat(On,":").concat(gn,":").concat(qt)}return 0},[Pr]);function ea(){window.sessionStorage.removeItem(ve),kr(!1),Fr(0)}function ta(){kr(!1),Fr(0),it.setValue(window.sessionStorage.getItem(ve))}function $i(dn,On){var gn=it.getValue();gn=gn.replace(dn,On),In(gn),it==null||it.setValue(gn)}return o.a.createElement(d.Fragment,null,o.a.createElement("div",{className:"markdown-editor-wrapper",ref:yi},o.a.createElement("div",{className:"markdown-editor-container ".concat(an," ").concat(Un?"on-preview":""," ").concat(kt?"mini":""," ").concat(fr?"full-screen":""),style:pa},o.a.createElement(te,{insertTemp:Ft,watch:Un,fullScreen:fr,showNullButton:Je,onActionCallback:Pi,hidetoolBar:Pt,uuid:hr.current,setOpenPhones:function(){Ui.current=!0}}),o.a.createElement("div",{className:"markdown-editor-body"},o.a.createElement("div",{className:"codemirror-container"},o.a.createElement("textarea",{ref:Ur,placeholder:ae})),Un?o.a.createElement("div",{ref:Li,className:"preview-container"},Zt==="stex"&&o.a.createElement(E,{value:on}),Zt!=="stex"&&o.a.createElement(_.a,{edit:!0,value:on,replaces:$i})):null))),Z?o.a.createElement("a",{ref:Zr,className:"editor-resize"}):null,o.a.createElement(W.a,null,Ht[Yr]?o.a.createElement(Q.a,{centered:!0,title:Ht[Yr],visible:!0,onCancel:Si,footer:null},Wi):null))}},P5Jw:function(et,Ve,z){"use strict";var le=z("rHrb"),Q=le.CopyToClipboard;Q.CopyToClipboard=Q,et.exports=Q},PD8m:function(et,Ve){et.exports={name:"memoryStorage",read:le,write:Q,each:j,remove:w,clearAll:P};var z={};function le(b){return z[b]}function Q(b,T){z[b]=T}function j(b){for(var T in z)z.hasOwnProperty(T)&&b(z[T],T)}function w(b){delete z[b]}function P(b){z={}}},RELg:function(et,Ve,z){var le=z("MFOe"),Q=le.Global;et.exports={name:"oldIE-userDataStorage",write:T,read:C,each:c,remove:p,clearAll:d};var j="storejs",w=Q.document,P=u(),b=(Q.navigator?Q.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function T(s,h){if(b)return;var i=a(s);P(function(n){n.setAttribute(i,h),n.save(j)})}function C(s){if(b)return;var h=a(s),i=null;return P(function(n){i=n.getAttribute(h)}),i}function c(s){P(function(h){for(var i=h.XMLDocument.documentElement.attributes,n=i.length-1;n>=0;n--){var t=i[n];s(h.getAttribute(t.name),t.name)}})}function p(s){var h=a(s);P(function(i){i.removeAttribute(h),i.save(j)})}function d(){P(function(s){var h=s.XMLDocument.documentElement.attributes;s.load(j);for(var i=h.length-1;i>=0;i--)s.removeAttribute(h[i].name);s.save(j)})}var o=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function a(s){return s.replace(/^\d/,"___$&").replace(o,"___")}function u(){if(!w||!w.documentElement||!w.documentElement.addBehavior)return null;var s="script",h,i,n;try{i=new ActiveXObject("htmlfile"),i.open(),i.write("<"+s+">document.w=window"+s+'>'),i.close(),h=i.w.frames[0].document,n=h.createElement("div")}catch(t){n=w.createElement("div"),h=w.body}return function(t){var f=[].slice.call(arguments,0);f.unshift(n),h.appendChild(n),n.addBehavior("#default#userData"),n.load(j),t.apply(this,f),h.removeChild(n);return}}},RpDr:function(et,Ve,z){"use strict";z.d(Ve,"a",function(){return _}),z.d(Ve,"c",function(){return y});var le=z("+L6B"),Q=z("2/Rp"),j=z("tJVT"),w=z("k1fw"),P=z("jrin"),b=z("5NDa"),T=z("5rEg"),C=z("q1tI"),c=z.n(C),p=z("8Skl"),d=z("y3Kf"),o=z("bdLU"),a=z("J66h"),u=z.n(a),s=z("++UQ"),h=z.n(s),i=z("IxHN"),n=z("9Bee"),t=z("1vsH"),f,v=T.a.TextArea,m={visible:!1,tabIndex:"0"},_=(f={},Object(P.a)(f,o.a.NOMATCH,"\u6D4B\u8BD5\u7528\u4F8B\u7ED3\u679C\u4E0D\u5339\u914D"),Object(P.a)(f,o.a.OK,"\u8C03\u8BD5\u901A\u8FC7"),Object(P.a)(f,2,"\u8C03\u8BD5\u8D85\u65F6"),Object(P.a)(f,3,"\u8C03\u8BD5pod\u5931\u8D25"),Object(P.a)(f,4,"\u7F16\u8BD1\u5931\u8D25"),Object(P.a)(f,5,"\u6267\u884C\u5931\u8D25"),f),E;(function(l){l[l.SET_VISIBLE=0]="SET_VISIBLE",l[l.SET_TABINDEX=1]="SET_TABINDEX"})(E||(E={}));function g(l,S){switch(S.type){case E.SET_VISIBLE:return Object(w.a)(Object(w.a)({},l),{},{visible:S.payload});case E.SET_TABINDEX:return Object(w.a)(Object(w.a)({},l),{},{tabIndex:S.payload});default:throw new Error}}function y(l){var S=l.status,O=l.error_msg,A=l.output,D=l.input,I=l.expected_output,B=l.is_file,H=l.input_file_url,te=l.output_file_url,W=l.expected_output_file_url,V=null,X={minHeight:150,marginBottom:10,paddingLeft:24,background:"#070f19",color:"#fff"};switch(S){case o.a.NOMATCH:V=c.a.createElement(c.a.Fragment,null,c.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),!B&&c.a.createElement(n.a,{value:D,style:X}),B&&c.a.createElement("div",{style:X},c.a.createElement("a",{onClick:function(){return Object(t.w)(H,D)}},D)),c.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),!B&&c.a.createElement(n.a,{value:A&&a.Base64.decode(A)||"",style:X}),B&&c.a.createElement("div",{style:X},c.a.createElement("a",{onClick:function(){return Object(t.w)(te,A)}},A)),c.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),!B&&c.a.createElement(n.a,{value:I&&a.Base64.decode(I)||"",style:X}),B&&c.a.createElement("div",{style:X},c.a.createElement("a",{onClick:function(){return Object(t.w)(W,I)}},I)));break;case o.a.EXECUTEFAILURE:V=c.a.createElement(c.a.Fragment,null,c.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!B&&c.a.createElement(n.a,{value:D,style:X}),B&&c.a.createElement("div",{style:X},c.a.createElement("a",{onClick:function(){return Object(t.w)(H,D)}},D)),c.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),c.a.createElement("pre",{className:"error"},a.Base64.decode(O)));break;case o.a.COMPILEFAILURE:V=c.a.createElement(c.a.Fragment,null,c.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!B&&c.a.createElement(n.a,{value:D,style:X}),B&&c.a.createElement("div",{style:X},c.a.createElement("a",{onClick:function(){return Object(t.w)(H,D)}},D)),c.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),c.a.createElement("pre",{className:"error"},a.Base64.decode(O)));break;case o.a.PODFAILURE:V=c.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case o.a.TIMEOUT:V=c.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return c.a.createElement(c.a.Fragment,null," ",V," ")}function x(l){var S=l.status,O=l.error_msg,A=l.execute_time,D=l.output,I=l.input,B=l.expected_output,H=l.is_file,te=l.input_file_url,W=l.output_file_url,V=l.expected_output_file_url,X=null;switch(S){case o.a.OK:X=c.a.createElement(c.a.Fragment,null,c.a.createElement("p",null,"\u6267\u884C\u7528\u65F6\uFF1A",A),c.a.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A"),c.a.createElement("pre",null,a.Base64.decode(D)));break;case o.a.NOMATCH:X=c.a.createElement(c.a.Fragment,null,c.a.createElement("p",null,"\u8F93\u5165\uFF1A",c.a.createElement("pre",null,I)),c.a.createElement("p",null,"\u8F93\u51FA\uFF1A",D&&a.Base64.decode(D)),c.a.createElement("p",null,"\u9884\u671F\u8F93\u51FA\uFF1A",B&&a.Base64.decode(B)));break;case o.a.EXECUTEFAILURE:X=c.a.createElement(c.a.Fragment,null,c.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",c.a.createElement("pre",null,I)),c.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),c.a.createElement("pre",{className:"error"},a.Base64.decode(O)));break;case o.a.COMPILEFAILURE:X=c.a.createElement(c.a.Fragment,null,c.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",c.a.createElement("pre",null,I)),c.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),c.a.createElement("pre",{className:"error"},a.Base64.decode(O)));break;case o.a.PODFAILURE:X=c.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case o.a.TIMEOUT:X=c.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return c.a.createElement(c.a.Fragment,null," ",X," ")}Ve.b=function(l){var S=l.id,O=l.input,A=l.debuging,D=l.submitting,I=l.executingMessage,B=l.debugResult,H=l.onChangeInput,te=l.onDebugCode,W=l.onSubmitCode,V=Object(C.useReducer)(g,m),X=Object(j.a)(V,2),ne=X[0],Y=X[1],ee=ne.visible,ce=ne.tabIndex;Object(C.useEffect)(function(){Y({type:E.SET_VISIBLE,payload:!1})},[S]);function de(ye){var Ee=ye.target.id;Y({type:E.SET_TABINDEX,payload:Ee})}function Ce(){Y({type:E.SET_VISIBLE,payload:!ee})}var Se=Object(C.useMemo)(function(){if(B){var ye=B.status;return c.a.createElement(c.a.Fragment,null,x(B))}return null},[B]);function Pe(){Y({type:E.SET_VISIBLE,payload:!0}),Y({type:E.SET_TABINDEX,payload:"1"}),te()}return c.a.createElement("div",{className:"test-case-panel"},c.a.createElement("div",{className:"test-case-panel-body ".concat(ee?"active":"")},c.a.createElement("ul",{className:"s-navs"},c.a.createElement("li",null,c.a.createElement("a",{className:ce==="0"?"active":"",id:"0",onClick:de},"\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B")),c.a.createElement("li",null,c.a.createElement("a",{className:ce==="1"?"active":"",id:"1",onClick:de},"\u4EE3\u7801\u6267\u884C\u7ED3\u679C"))),c.a.createElement("div",{className:"tab-panel-body ".concat(ce==="0"?"":"hide")},c.a.createElement(v,{placeholder:"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D",value:O,onChange:H})),c.a.createElement("div",{className:"tab-panel-body ".concat(ce==="1"?"":"hide")},A?c.a.createElement(i.a,{message:I}):B?c.a.createElement("section",{style:{height:200}}," ",Se," "):c.a.createElement("p",{className:"tip"},"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D"))),c.a.createElement("a",{className:"btn-collapse ".concat(ee?"up":""),onClick:Ce},ee?c.a.createElement(p.a,null):c.a.createElement(d.a,null)),c.a.createElement("footer",{className:"footer"},c.a.createElement("span",{style:{visibility:"hidden"}},"\u63A7\u5236\u53F0"),c.a.createElement("div",{className:"flex-container"},c.a.createElement(Q.a,{id:"oj-prev",className:"btn-blue",type:"ghost"},"\u4E0A\u4E00\u9898"),c.a.createElement(Q.a,{id:"oj-next",className:"btn-blue",type:"ghost"},"\u4E0B\u4E00\u9898"),c.a.createElement(Q.a,{className:"btn-green",type:"ghost",loading:A,onClick:Pe},"\u8C03\u8BD5\u4EE3\u7801"),c.a.createElement(Q.a,{type:"primary",loading:D,disabled:D,onClick:function(){Y({type:E.SET_VISIBLE,payload:!1}),W()}},"\u8BC4\u6D4B\u5E76\u63D0\u4EA4"))))}},"S/kP":function(et,Ve,z){et.exports=z.p+"static/time.a3dc82f3.svg"},"SA+Z":function(et,Ve,z){var le=z("wTVA"),Q=z("EbDI"),j=z("ZhPi"),w=z("wkBT");function P(b){return le(b)||Q(b)||j(b)||w()}et.exports=P,et.exports.__esModule=!0,et.exports.default=et.exports},SJMd:function(et,Ve){/**
* @license
* Copyright (C) 2006 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var z,le,Q,j=!1,w,P;window.PR_SHOULD_USE_CONTINUATION=!0;var b,T;(function(){var C=window,c=["break,continue,do,else,for,if,return,while"],p=[c,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],d=[p,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],o=[d,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],a=[d,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],u=[d,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",h=[d,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],i="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",n=[c,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],t=[c,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],f=[c,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],v=[o,u,a,h,i,n,t,f],m=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,_="str",E="kwd",g="com",y="typ",x="lit",l="pun",S="pln",O="tag",A="dec",D="src",I="atn",B="atv",H="nocode",te="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function W(me){for(var We=0,ze=!1,nt=!1,re=0,k=me.length;re122||(_e<65||Me>90||tt.push([Math.max(65,Me)|32,Math.min(_e,90)|32]),_e<97||Me>122||tt.push([Math.max(97,Me)&~32,Math.min(_e,122)&~32]))}}tt.sort(function(Ze,ut){return Ze[0]-ut[0]||ut[1]-Ze[1]});for(var Ae=[],Le=[],Xe=0;XeTe[0]&&(Te[1]+1>Te[0]&&Qe.push("-"),Qe.push(J(Te[1])))}return Qe.push("]"),Qe.join("")}function ke(Ne){for(var je=Ne.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),tt=je.length,mt=[],Qe=0,Xe=0;Qe=2&&Me==="["?je[Qe]=xe(Be):Me!=="\\"&&(je[Qe]=Be.replace(/[a-zA-Z]/g,function(Le){var Te=Le.charCodeAt(0);return"["+String.fromCharCode(Te&~32,Te|32)+"]"}))}return je.join("")}for(var dt=[],re=0,k=me.length;re=0;)ze[dt.charAt(Ne)]=ke;var je=ke[1],tt=""+je;$.hasOwnProperty(tt)||(q.push(je),$[tt]=null)}q.push(/[\0-\uffff]/),nt=W(q)})();var re=We.length,k=function(U){for(var q=U.sourceCode,$=U.basePos,J=U.sourceNode,xe=[$,S],ke=0,dt=q.match(nt)||[],Ne={},je=0,tt=dt.length;je=5&&Qe.substring(0,5)==="lang-",Be&&!(Xe&&typeof Xe[1]=="string")&&(Be=!1,Qe=D),Be||(Ne[mt]=Qe)}var _e=ke;if(ke+=mt.length,!Be)xe.push($+_e,Qe);else{var Ae=Xe[1],Le=mt.indexOf(Ae),Te=Le+Ae.length;Xe[2]&&(Te=mt.length-Xe[2].length,Le=Te-Ae.length);var Ze=Qe.substring(5);X(J,$+_e,mt.substring(0,Le),k,xe),X(J,$+_e+Le,Ae,Ee(Ze,Ae),xe),X(J,$+_e+Te,mt.substring(Te),k,xe)}}U.decorations=xe};return k}function ce(me){var We=[],ze=[];me.tripleQuotedStrings?We.push([_,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):me.multiLineStrings?We.push([_,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):We.push([_,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),me.verbatimStrings&&ze.push([_,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var nt=me.hashComments;nt&&(me.cStyleComments?(nt>1?We.push([g,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):We.push([g,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),ze.push([_,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):We.push([g,/^#[^\r\n]*/,null,"#"])),me.cStyleComments&&(ze.push([g,/^\/\/[^\r\n]*/,null]),ze.push([g,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var re=me.regexLiterals;if(re){var k=re>1?"":`
\r`,U=k?".":"[\\S\\s]",q="/(?=[^/*"+k+"])(?:[^/\\x5B\\x5C"+k+"]|\\x5C"+U+"|\\x5B(?:[^\\x5C\\x5D"+k+"]|\\x5C"+U+")*(?:\\x5D|$))+/";ze.push(["lang-regex",RegExp("^"+te+"("+q+")")])}var $=me.types;$&&ze.push([y,$]);var J=(""+me.keywords).replace(/^ | $/g,"");J.length&&ze.push([E,new RegExp("^(?:"+J.replace(/[\s,]+/g,"|")+")\\b"),null]),We.push([S,/^\s+/,null,` \r
\xA0`]);var xe="^.[^\\s\\w.$@'\"`/\\\\]*";return me.regexLiterals&&(xe+="(?!s*/)"),ze.push([x,/^@[a-z_$][a-z_$@0-9]*/i,null],[y,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[S,/^[a-z_$][a-z_$@0-9]*/i,null],[x,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[S,/^\\[\s\S]?/,null],[l,new RegExp(xe),null]),ee(We,ze)}var de=ce({keywords:v,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ce(me,We,ze){for(var nt=/(?:^|\s)nocode(?:\s|$)/,re=/\r\n?|\n/,k=me.ownerDocument,U=k.createElement("li");me.firstChild;)U.appendChild(me.firstChild);var q=[U];function $(je){var tt=je.nodeType;if(tt==1&&!nt.test(je.className))if(je.nodeName==="br")J(je),je.parentNode&&je.parentNode.removeChild(je);else for(var mt=je.firstChild;mt;mt=mt.nextSibling)$(mt);else if((tt==3||tt==4)&&ze){var Qe=je.nodeValue,Xe=Qe.match(re);if(Xe){var Be=Qe.substring(0,Xe.index);je.nodeValue=Be;var Ie=Qe.substring(Xe.index+Xe[0].length);if(Ie){var Me=je.parentNode;Me.insertBefore(k.createTextNode(Ie),je.nextSibling)}J(je),Be||je.parentNode.removeChild(je)}}}function J(je){for(;!je.nextSibling;)if(je=je.parentNode,!je)return;function tt(Xe,Be){var Ie=Be?Xe.cloneNode(!1):Xe,Me=Xe.parentNode;if(Me){var _e=tt(Me,1),Ae=Xe.nextSibling;_e.appendChild(Ie);for(var Le=Ae;Le;Le=Ae)Ae=Le.nextSibling,_e.appendChild(Le)}return Ie}for(var mt=tt(je.nextSibling,0),Qe;(Qe=mt.parentNode)&&Qe.nodeType===1;)mt=Qe;q.push(mt)}for(var xe=0;xe=Me&&($+=2),k>=_e&&(ke+=2)}}finally{Qe&&(Qe.style.display=Xe)}}var Pe={};function ye(me,We){for(var ze=We.length;--ze>=0;){var nt=We[ze];Pe.hasOwnProperty(nt)?C.console&&console.warn("cannot override language handler %s",nt):Pe[nt]=me}}function Ee(me,We){return me&&Pe.hasOwnProperty(me)||(me=/^\s*]*(?:>|$)/],[g,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[l,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^"),a.close(),o=a.F;s--;)delete o.prototype[c[s]];return o()};P.exports=Object.create||function(a,u){var s;return a!==null?(d.prototype=T(a),s=new d,d.prototype=null,s[p]=a):s=o(),u===void 0?s:C(s,u)}},{"./_an-object":61,"./_dom-create":70,"./_enum-bug-keys":71,"./_html":79,"./_object-dps":99,"./_shared-key":116}],98:[function(w,P,b){var T=w("./_an-object"),C=w("./_ie8-dom-define"),c=w("./_to-primitive"),p=Object.defineProperty;b.f=w("./_descriptors")?Object.defineProperty:function(d,o,a){if(T(d),o=c(o,!0),T(a),C)try{return p(d,o,a)}catch(u){}if("get"in a||"set"in a)throw TypeError("Accessors not supported!");return"value"in a&&(d[o]=a.value),d}},{"./_an-object":61,"./_descriptors":69,"./_ie8-dom-define":80,"./_to-primitive":126}],99:[function(w,P,b){var T=w("./_object-dp"),C=w("./_an-object"),c=w("./_object-keys");P.exports=w("./_descriptors")?Object.defineProperties:function(p,d){C(p);for(var o,a=c(d),u=a.length,s=0;u>s;)T.f(p,o=a[s++],d[o]);return p}},{"./_an-object":61,"./_descriptors":69,"./_object-dp":98,"./_object-keys":106}],100:[function(w,P,b){var T=w("./_object-pie"),C=w("./_property-desc"),c=w("./_to-iobject"),p=w("./_to-primitive"),d=w("./_has"),o=w("./_ie8-dom-define"),a=Object.getOwnPropertyDescriptor;b.f=w("./_descriptors")?a:function(u,s){if(u=c(u),s=p(s,!0),o)try{return a(u,s)}catch(h){}if(d(u,s))return C(!T.f.call(u,s),u[s])}},{"./_descriptors":69,"./_has":77,"./_ie8-dom-define":80,"./_object-pie":107,"./_property-desc":111,"./_to-iobject":123,"./_to-primitive":126}],101:[function(w,P,b){var T=w("./_to-iobject"),C=w("./_object-gopn").f,c={}.toString,p=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],d=function(o){try{return C(o)}catch(a){return p.slice()}};P.exports.f=function(o){return p&&c.call(o)=="[object Window]"?d(o):C(T(o))}},{"./_object-gopn":102,"./_to-iobject":123}],102:[function(w,P,b){var T=w("./_object-keys-internal"),C=w("./_enum-bug-keys").concat("length","prototype");b.f=Object.getOwnPropertyNames||function(c){return T(c,C)}},{"./_enum-bug-keys":71,"./_object-keys-internal":105}],103:[function(w,P,b){b.f=Object.getOwnPropertySymbols},{}],104:[function(w,P,b){var T=w("./_has"),C=w("./_to-object"),c=w("./_shared-key")("IE_PROTO"),p=Object.prototype;P.exports=Object.getPrototypeOf||function(d){return d=C(d),T(d,c)?d[c]:typeof d.constructor=="function"&&d instanceof d.constructor?d.constructor.prototype:d instanceof Object?p:null}},{"./_has":77,"./_shared-key":116,"./_to-object":125}],105:[function(w,P,b){var T=w("./_has"),C=w("./_to-iobject"),c=w("./_array-includes")(!1),p=w("./_shared-key")("IE_PROTO");P.exports=function(d,o){var a,u=C(d),s=0,h=[];for(a in u)a!=p&&T(u,a)&&h.push(a);for(;o.length>s;)T(u,a=o[s++])&&(~c(h,a)||h.push(a));return h}},{"./_array-includes":62,"./_has":77,"./_shared-key":116,"./_to-iobject":123}],106:[function(w,P,b){var T=w("./_object-keys-internal"),C=w("./_enum-bug-keys");P.exports=Object.keys||function(c){return T(c,C)}},{"./_enum-bug-keys":71,"./_object-keys-internal":105}],107:[function(w,P,b){b.f={}.propertyIsEnumerable},{}],108:[function(w,P,b){var T=w("./_export"),C=w("./_core"),c=w("./_fails");P.exports=function(p,d){var o=(C.Object||{})[p]||Object[p],a={};a[p]=d(o),T(T.S+T.F*c(function(){o(1)}),"Object",a)}},{"./_core":65,"./_export":73,"./_fails":74}],109:[function(w,P,b){P.exports=function(T){try{return{e:!1,v:T()}}catch(C){return{e:!0,v:C}}}},{}],110:[function(w,P,b){var T=w("./_an-object"),C=w("./_is-object"),c=w("./_new-promise-capability");P.exports=function(p,d){if(T(p),C(d)&&d.constructor===p)return d;var o=c.f(p);return(0,o.resolve)(d),o.promise}},{"./_an-object":61,"./_is-object":85,"./_new-promise-capability":95}],111:[function(w,P,b){P.exports=function(T,C){return{enumerable:!(1&T),configurable:!(2&T),writable:!(4&T),value:C}}},{}],112:[function(w,P,b){var T=w("./_hide");P.exports=function(C,c,p){for(var d in c)p&&C[d]?C[d]=c[d]:T(C,d,c[d]);return C}},{"./_hide":78}],113:[function(w,P,b){P.exports=w("./_hide")},{"./_hide":78}],114:[function(w,P,b){"use strict";var T=w("./_global"),C=w("./_core"),c=w("./_object-dp"),p=w("./_descriptors"),d=w("./_wks")("species");P.exports=function(o){var a=typeof C[o]=="function"?C[o]:T[o];p&&a&&!a[d]&&c.f(a,d,{configurable:!0,get:function(){return this}})}},{"./_core":65,"./_descriptors":69,"./_global":76,"./_object-dp":98,"./_wks":131}],115:[function(w,P,b){var T=w("./_object-dp").f,C=w("./_has"),c=w("./_wks")("toStringTag");P.exports=function(p,d,o){p&&!C(p=o?p:p.prototype,c)&&T(p,c,{configurable:!0,value:d})}},{"./_has":77,"./_object-dp":98,"./_wks":131}],116:[function(w,P,b){var T=w("./_shared")("keys"),C=w("./_uid");P.exports=function(c){return T[c]||(T[c]=C(c))}},{"./_shared":117,"./_uid":127}],117:[function(w,P,b){var T=w("./_core"),C=w("./_global"),c=C["__core-js_shared__"]||(C["__core-js_shared__"]={});(P.exports=function(p,d){return c[p]||(c[p]=d!==void 0?d:{})})("versions",[]).push({version:T.version,mode:w("./_library")?"pure":"global",copyright:"\u6F0F 2018 Denis Pushkarev (zloirock.ru)"})},{"./_core":65,"./_global":76,"./_library":92}],118:[function(w,P,b){var T=w("./_an-object"),C=w("./_a-function"),c=w("./_wks")("species");P.exports=function(p,d){var o,a=T(p).constructor;return a===void 0||(o=T(a)[c])==null?d:C(o)}},{"./_a-function":58,"./_an-object":61,"./_wks":131}],119:[function(w,P,b){var T=w("./_to-integer"),C=w("./_defined");P.exports=function(c){return function(p,d){var o,a,u=String(C(p)),s=T(d),h=u.length;return s<0||s>=h?c?"":void 0:(o=u.charCodeAt(s),o<55296||o>56319||s+1===h||(a=u.charCodeAt(s+1))<56320||a>57343?c?u.charAt(s):o:c?u.slice(s,s+2):a-56320+(o-55296<<10)+65536)}}},{"./_defined":68,"./_to-integer":122}],120:[function(w,P,b){var T,C,c,p=w("./_ctx"),d=w("./_invoke"),o=w("./_html"),a=w("./_dom-create"),u=w("./_global"),s=u.process,h=u.setImmediate,i=u.clearImmediate,n=u.MessageChannel,t=u.Dispatch,f=0,v={},m=function(){var E=+this;if(v.hasOwnProperty(E)){var g=v[E];delete v[E],g()}},_=function(E){m.call(E.data)};h&&i||(h=function(E){for(var g=[],y=1;arguments.length>y;)g.push(arguments[y++]);return v[++f]=function(){d(typeof E=="function"?E:Function(E),g)},T(f),f},i=function(E){delete v[E]},w("./_cof")(s)=="process"?T=function(E){s.nextTick(p(m,E,1))}:t&&t.now?T=function(E){t.now(p(m,E,1))}:n?(C=new n,c=C.port2,C.port1.onmessage=_,T=p(c.postMessage,c,1)):u.addEventListener&&typeof postMessage=="function"&&!u.importScripts?(T=function(E){u.postMessage(E+"","*")},u.addEventListener("message",_,!1)):T="onreadystatechange"in a("script")?function(E){o.appendChild(a("script")).onreadystatechange=function(){o.removeChild(this),m.call(E)}}:function(E){setTimeout(p(m,E,1),0)}),P.exports={set:h,clear:i}},{"./_cof":64,"./_ctx":67,"./_dom-create":70,"./_global":76,"./_html":79,"./_invoke":81}],121:[function(w,P,b){var T=w("./_to-integer"),C=Math.max,c=Math.min;P.exports=function(p,d){return p=T(p),p<0?C(p+d,0):c(p,d)}},{"./_to-integer":122}],122:[function(w,P,b){var T=Math.ceil,C=Math.floor;P.exports=function(c){return isNaN(c=+c)?0:(c>0?C:T)(c)}},{}],123:[function(w,P,b){var T=w("./_iobject"),C=w("./_defined");P.exports=function(c){return T(C(c))}},{"./_defined":68,"./_iobject":82}],124:[function(w,P,b){var T=w("./_to-integer"),C=Math.min;P.exports=function(c){return c>0?C(T(c),9007199254740991):0}},{"./_to-integer":122}],125:[function(w,P,b){var T=w("./_defined");P.exports=function(C){return Object(T(C))}},{"./_defined":68}],126:[function(w,P,b){var T=w("./_is-object");P.exports=function(C,c){if(!T(C))return C;var p,d;if(c&&typeof(p=C.toString)=="function"&&!T(d=p.call(C)))return d;if(typeof(p=C.valueOf)=="function"&&!T(d=p.call(C)))return d;if(!c&&typeof(p=C.toString)=="function"&&!T(d=p.call(C)))return d;throw TypeError("Can't convert object to primitive value")}},{"./_is-object":85}],127:[function(w,P,b){var T=0,C=Math.random();P.exports=function(c){return"Symbol(".concat(c===void 0?"":c,")_",(++T+C).toString(36))}},{}],128:[function(w,P,b){var T=w("./_global"),C=T.navigator;P.exports=C&&C.userAgent||""},{"./_global":76}],129:[function(w,P,b){var T=w("./_global"),C=w("./_core"),c=w("./_library"),p=w("./_wks-ext"),d=w("./_object-dp").f;P.exports=function(o){var a=C.Symbol||(C.Symbol=c?{}:T.Symbol||{});o.charAt(0)=="_"||o in a||d(a,o,{value:p.f(o)})}},{"./_core":65,"./_global":76,"./_library":92,"./_object-dp":98,"./_wks-ext":130}],130:[function(w,P,b){b.f=w("./_wks")},{"./_wks":131}],131:[function(w,P,b){var T=w("./_shared")("wks"),C=w("./_uid"),c=w("./_global").Symbol,p=typeof c=="function";(P.exports=function(d){return T[d]||(T[d]=p&&c[d]||(p?c:C)("Symbol."+d))}).store=T},{"./_global":76,"./_shared":117,"./_uid":127}],132:[function(w,P,b){var T=w("./_classof"),C=w("./_wks")("iterator"),c=w("./_iterators");P.exports=w("./_core").getIteratorMethod=function(p){if(p!=null)return p[C]||p["@@iterator"]||c[T(p)]}},{"./_classof":63,"./_core":65,"./_iterators":91,"./_wks":131}],133:[function(w,P,b){"use strict";var T=w("./_ctx"),C=w("./_export"),c=w("./_to-object"),p=w("./_iter-call"),d=w("./_is-array-iter"),o=w("./_to-length"),a=w("./_create-property"),u=w("./core.get-iterator-method");C(C.S+C.F*!w("./_iter-detect")(function(s){Array.from(s)}),"Array",{from:function(s){var h,i,n,t,f=c(s),v=typeof this=="function"?this:Array,m=arguments.length,_=m>1?arguments[1]:void 0,E=_!==void 0,g=0,y=u(f);if(E&&(_=T(_,m>2?arguments[2]:void 0,2)),y==null||v==Array&&d(y))for(h=o(f.length),i=new v(h);h>g;g++)a(i,g,E?_(f[g],g):f[g]);else for(t=y.call(f),i=new v;!(n=t.next()).done;g++)a(i,g,E?p(t,_,[n.value,g],!0):n.value);return i.length=g,i}})},{"./_create-property":66,"./_ctx":67,"./_export":73,"./_is-array-iter":83,"./_iter-call":86,"./_iter-detect":89,"./_to-length":124,"./_to-object":125,"./core.get-iterator-method":132}],134:[function(w,P,b){"use strict";var T=w("./_add-to-unscopables"),C=w("./_iter-step"),c=w("./_iterators"),p=w("./_to-iobject");P.exports=w("./_iter-define")(Array,"Array",function(d,o){this._t=p(d),this._i=0,this._k=o},function(){var d=this._t,o=this._k,a=this._i++;return!d||a>=d.length?(this._t=void 0,C(1)):o=="keys"?C(0,a):o=="values"?C(0,d[a]):C(0,[a,d[a]])},"values"),c.Arguments=c.Array,T("keys"),T("values"),T("entries")},{"./_add-to-unscopables":59,"./_iter-define":88,"./_iter-step":90,"./_iterators":91,"./_to-iobject":123}],135:[function(w,P,b){"use strict";var T=w("./_is-object"),C=w("./_object-gpo"),c=w("./_wks")("hasInstance"),p=Function.prototype;c in p||w("./_object-dp").f(p,c,{value:function(d){if(typeof this!="function"||!T(d))return!1;if(!T(this.prototype))return d instanceof this;for(;d=C(d);)if(this.prototype===d)return!0;return!1}})},{"./_is-object":85,"./_object-dp":98,"./_object-gpo":104,"./_wks":131}],136:[function(w,P,b){var T=w("./_export");T(T.S+T.F,"Object",{assign:w("./_object-assign")})},{"./_export":73,"./_object-assign":96}],137:[function(w,P,b){var T=w("./_export");T(T.S,"Object",{create:w("./_object-create")})},{"./_export":73,"./_object-create":97}],138:[function(w,P,b){var T=w("./_export");T(T.S+T.F*!w("./_descriptors"),"Object",{defineProperty:w("./_object-dp").f})},{"./_descriptors":69,"./_export":73,"./_object-dp":98}],139:[function(w,P,b){w("./_object-sap")("getOwnPropertyNames",function(){return w("./_object-gopn-ext").f})},{"./_object-gopn-ext":101,"./_object-sap":108}],140:[function(w,P,b){var T=w("./_to-object"),C=w("./_object-gpo");w("./_object-sap")("getPrototypeOf",function(){return function(c){return C(T(c))}})},{"./_object-gpo":104,"./_object-sap":108,"./_to-object":125}],141:[function(w,P,b){var T=w("./_to-object"),C=w("./_object-keys");w("./_object-sap")("keys",function(){return function(c){return C(T(c))}})},{"./_object-keys":106,"./_object-sap":108,"./_to-object":125}],142:[function(w,P,b){arguments[4][36][0].apply(b,arguments)},{dup:36}],143:[function(w,P,b){"use strict";var T,C,c,p,d=w("./_library"),o=w("./_global"),a=w("./_ctx"),u=w("./_classof"),s=w("./_export"),h=w("./_is-object"),i=w("./_a-function"),n=w("./_an-instance"),t=w("./_for-of"),f=w("./_species-constructor"),v=w("./_task").set,m=w("./_microtask")(),_=w("./_new-promise-capability"),E=w("./_perform"),g=w("./_user-agent"),y=w("./_promise-resolve"),x=o.TypeError,l=o.process,S=l&&l.versions,O=S&&S.v8||"",A=o.Promise,D=u(l)=="process",I=function(){},B=C=_.f,H=!!function(){try{var ce=A.resolve(1),de=(ce.constructor={})[w("./_wks")("species")]=function(Ce){Ce(I,I)};return(D||typeof PromiseRejectionEvent=="function")&&ce.then(I)instanceof de&&O.indexOf("6.6")!==0&&g.indexOf("Chrome/66")===-1}catch(Ce){}}(),te=function(ce){var de;return!(!h(ce)||typeof(de=ce.then)!="function")&&de},W=function(ce,de){if(!ce._n){ce._n=!0;var Ce=ce._c;m(function(){for(var Se=ce._v,Pe=ce._s==1,ye=0;Ce.length>ye;)!function(Ee){var Ge,Ue,Fe,He=Pe?Ee.ok:Ee.fail,be=Ee.resolve,me=Ee.reject,We=Ee.domain;try{He?(Pe||(ce._h==2&&ne(ce),ce._h=1),He===!0?Ge=Se:(We&&We.enter(),Ge=He(Se),We&&(We.exit(),Fe=!0)),Ge===Ee.promise?me(x("Promise-chain cycle")):(Ue=te(Ge))?Ue.call(Ge,be,me):be(Ge)):me(Se)}catch(ze){We&&!Fe&&We.exit(),me(ze)}}(Ce[ye++]);ce._c=[],ce._n=!1,de&&!ce._h&&V(ce)})}},V=function(ce){v.call(o,function(){var de,Ce,Se,Pe=ce._v,ye=X(ce);if(ye&&(de=E(function(){D?l.emit("unhandledRejection",Pe,ce):(Ce=o.onunhandledrejection)?Ce({promise:ce,reason:Pe}):(Se=o.console)&&Se.error&&Se.error("Unhandled promise rejection",Pe)}),ce._h=D||X(ce)?2:1),ce._a=void 0,ye&&de.e)throw de.v})},X=function(ce){return ce._h!==1&&(ce._a||ce._c).length===0},ne=function(ce){v.call(o,function(){var de;D?l.emit("rejectionHandled",ce):(de=o.onrejectionhandled)&&de({promise:ce,reason:ce._v})})},Y=function(ce){var de=this;de._d||(de._d=!0,de=de._w||de,de._v=ce,de._s=2,de._a||(de._a=de._c.slice()),W(de,!0))},ee=function(ce){var de,Ce=this;if(!Ce._d){Ce._d=!0,Ce=Ce._w||Ce;try{if(Ce===ce)throw x("Promise can't be resolved itself");(de=te(ce))?m(function(){var Se={_w:Ce,_d:!1};try{de.call(ce,a(ee,Se,1),a(Y,Se,1))}catch(Pe){Y.call(Se,Pe)}}):(Ce._v=ce,Ce._s=1,W(Ce,!1))}catch(Se){Y.call({_w:Ce,_d:!1},Se)}}};H||(A=function(ce){n(this,A,"Promise","_h"),i(ce),T.call(this);try{ce(a(ee,this,1),a(Y,this,1))}catch(de){Y.call(this,de)}},T=function(ce){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},T.prototype=w("./_redefine-all")(A.prototype,{then:function(ce,de){var Ce=B(f(this,A));return Ce.ok=typeof ce!="function"||ce,Ce.fail=typeof de=="function"&&de,Ce.domain=D?l.domain:void 0,this._c.push(Ce),this._a&&this._a.push(Ce),this._s&&W(this,!1),Ce.promise},catch:function(ce){return this.then(void 0,ce)}}),c=function(){var ce=new T;this.promise=ce,this.resolve=a(ee,ce,1),this.reject=a(Y,ce,1)},_.f=B=function(ce){return ce===A||ce===p?new c(ce):C(ce)}),s(s.G+s.W+s.F*!H,{Promise:A}),w("./_set-to-string-tag")(A,"Promise"),w("./_set-species")("Promise"),p=w("./_core").Promise,s(s.S+s.F*!H,"Promise",{reject:function(ce){var de=B(this);return(0,de.reject)(ce),de.promise}}),s(s.S+s.F*(d||!H),"Promise",{resolve:function(ce){return y(d&&this===p?A:this,ce)}}),s(s.S+s.F*!(H&&w("./_iter-detect")(function(ce){A.all(ce).catch(I)})),"Promise",{all:function(ce){var de=this,Ce=B(de),Se=Ce.resolve,Pe=Ce.reject,ye=E(function(){var Ee=[],Ge=0,Ue=1;t(ce,!1,function(Fe){var He=Ge++,be=!1;Ee.push(void 0),Ue++,de.resolve(Fe).then(function(me){be||(be=!0,Ee[He]=me,--Ue||Se(Ee))},Pe)}),--Ue||Se(Ee)});return ye.e&&Pe(ye.v),Ce.promise},race:function(ce){var de=this,Ce=B(de),Se=Ce.reject,Pe=E(function(){t(ce,!1,function(ye){de.resolve(ye).then(Ce.resolve,Se)})});return Pe.e&&Se(Pe.v),Ce.promise}})},{"./_a-function":58,"./_an-instance":60,"./_classof":63,"./_core":65,"./_ctx":67,"./_export":73,"./_for-of":75,"./_global":76,"./_is-object":85,"./_iter-detect":89,"./_library":92,"./_microtask":94,"./_new-promise-capability":95,"./_perform":109,"./_promise-resolve":110,"./_redefine-all":112,"./_set-species":114,"./_set-to-string-tag":115,"./_species-constructor":118,"./_task":120,"./_user-agent":128,"./_wks":131}],144:[function(w,P,b){var T=w("./_export"),C=w("./_to-absolute-index"),c=String.fromCharCode,p=String.fromCodePoint;T(T.S+T.F*(!!p&&p.length!=1),"String",{fromCodePoint:function(d){for(var o,a=[],u=arguments.length,s=0;u>s;){if(o=+arguments[s++],C(o,1114111)!==o)throw RangeError(o+" is not a valid code point");a.push(o<65536?c(o):c(55296+((o-=65536)>>10),o%1024+56320))}return a.join("")}})},{"./_export":73,"./_to-absolute-index":121}],145:[function(w,P,b){"use strict";var T=w("./_string-at")(!0);w("./_iter-define")(String,"String",function(C){this._t=String(C),this._i=0},function(){var C,c=this._t,p=this._i;return p>=c.length?{value:void 0,done:!0}:(C=T(c,p),this._i+=C.length,{value:C,done:!1})})},{"./_iter-define":88,"./_string-at":119}],146:[function(w,P,b){"use strict";var T=w("./_global"),C=w("./_has"),c=w("./_descriptors"),p=w("./_export"),d=w("./_redefine"),o=w("./_meta").KEY,a=w("./_fails"),u=w("./_shared"),s=w("./_set-to-string-tag"),h=w("./_uid"),i=w("./_wks"),n=w("./_wks-ext"),t=w("./_wks-define"),f=w("./_enum-keys"),v=w("./_is-array"),m=w("./_an-object"),_=w("./_is-object"),E=w("./_to-iobject"),g=w("./_to-primitive"),y=w("./_property-desc"),x=w("./_object-create"),l=w("./_object-gopn-ext"),S=w("./_object-gopd"),O=w("./_object-dp"),A=w("./_object-keys"),D=S.f,I=O.f,B=l.f,H=T.Symbol,te=T.JSON,W=te&&te.stringify,V=i("_hidden"),X=i("toPrimitive"),ne={}.propertyIsEnumerable,Y=u("symbol-registry"),ee=u("symbols"),ce=u("op-symbols"),de=Object.prototype,Ce=typeof H=="function",Se=T.QObject,Pe=!Se||!Se.prototype||!Se.prototype.findChild,ye=c&&a(function(){return x(I({},"a",{get:function(){return I(this,"a",{value:7}).a}})).a!=7})?function(q,$,J){var xe=D(de,$);xe&&delete de[$],I(q,$,J),xe&&q!==de&&I(de,$,xe)}:I,Ee=function(q){var $=ee[q]=x(H.prototype);return $._k=q,$},Ge=Ce&&typeof H.iterator=="symbol"?function(q){return typeof q=="symbol"}:function(q){return q instanceof H},Ue=function(q,$,J){return q===de&&Ue(ce,$,J),m(q),$=g($,!0),m(J),C(ee,$)?(J.enumerable?(C(q,V)&&q[V][$]&&(q[V][$]=!1),J=x(J,{enumerable:y(0,!1)})):(C(q,V)||I(q,V,y(1,{})),q[V][$]=!0),ye(q,$,J)):I(q,$,J)},Fe=function(q,$){m(q);for(var J,xe=f($=E($)),ke=0,dt=xe.length;dt>ke;)Ue(q,J=xe[ke++],$[J]);return q},He=function(q,$){return $===void 0?x(q):Fe(x(q),$)},be=function(q){var $=ne.call(this,q=g(q,!0));return!(this===de&&C(ee,q)&&!C(ce,q))&&(!($||!C(this,q)||!C(ee,q)||C(this,V)&&this[V][q])||$)},me=function(q,$){if(q=E(q),$=g($,!0),q!==de||!C(ee,$)||C(ce,$)){var J=D(q,$);return!J||!C(ee,$)||C(q,V)&&q[V][$]||(J.enumerable=!0),J}},We=function(q){for(var $,J=B(E(q)),xe=[],ke=0;J.length>ke;)C(ee,$=J[ke++])||$==V||$==o||xe.push($);return xe},ze=function(q){for(var $,J=q===de,xe=B(J?ce:E(q)),ke=[],dt=0;xe.length>dt;)!C(ee,$=xe[dt++])||J&&!C(de,$)||ke.push(ee[$]);return ke};Ce||(H=function(){if(this instanceof H)throw TypeError("Symbol is not a constructor!");var q=h(arguments.length>0?arguments[0]:void 0),$=function(J){this===de&&$.call(ce,J),C(this,V)&&C(this[V],q)&&(this[V][q]=!1),ye(this,q,y(1,J))};return c&&Pe&&ye(de,q,{configurable:!0,set:$}),Ee(q)},d(H.prototype,"toString",function(){return this._k}),S.f=me,O.f=Ue,w("./_object-gopn").f=l.f=We,w("./_object-pie").f=be,w("./_object-gops").f=ze,c&&!w("./_library")&&d(de,"propertyIsEnumerable",be,!0),n.f=function(q){return Ee(i(q))}),p(p.G+p.W+p.F*!Ce,{Symbol:H});for(var nt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),re=0;nt.length>re;)i(nt[re++]);for(var k=A(i.store),U=0;k.length>U;)t(k[U++]);p(p.S+p.F*!Ce,"Symbol",{for:function(q){return C(Y,q+="")?Y[q]:Y[q]=H(q)},keyFor:function(q){if(!Ge(q))throw TypeError(q+" is not a symbol!");for(var $ in Y)if(Y[$]===q)return $},useSetter:function(){Pe=!0},useSimple:function(){Pe=!1}}),p(p.S+p.F*!Ce,"Object",{create:He,defineProperty:Ue,defineProperties:Fe,getOwnPropertyDescriptor:me,getOwnPropertyNames:We,getOwnPropertySymbols:ze}),te&&p(p.S+p.F*(!Ce||a(function(){var q=H();return W([q])!="[null]"||W({a:q})!="{}"||W(Object(q))!="{}"})),"JSON",{stringify:function(q){for(var $,J,xe=[q],ke=1;arguments.length>ke;)xe.push(arguments[ke++]);if(J=$=xe[1],(_($)||q!==void 0)&&!Ge(q))return v($)||($=function(dt,Ne){if(typeof J=="function"&&(Ne=J.call(this,dt,Ne)),!Ge(Ne))return Ne}),xe[1]=$,W.apply(te,xe)}}),H.prototype[X]||w("./_hide")(H.prototype,X,H.prototype.valueOf),s(H,"Symbol"),s(Math,"Math",!0),s(T.JSON,"JSON",!0)},{"./_an-object":61,"./_descriptors":69,"./_enum-keys":72,"./_export":73,"./_fails":74,"./_global":76,"./_has":77,"./_hide":78,"./_is-array":84,"./_is-object":85,"./_library":92,"./_meta":93,"./_object-create":97,"./_object-dp":98,"./_object-gopd":100,"./_object-gopn":102,"./_object-gopn-ext":101,"./_object-gops":103,"./_object-keys":106,"./_object-pie":107,"./_property-desc":111,"./_redefine":113,"./_set-to-string-tag":115,"./_shared":117,"./_to-iobject":123,"./_to-primitive":126,"./_uid":127,"./_wks":131,"./_wks-define":129,"./_wks-ext":130}],147:[function(w,P,b){"use strict";var T=w("./_export"),C=w("./_core"),c=w("./_global"),p=w("./_species-constructor"),d=w("./_promise-resolve");T(T.P+T.R,"Promise",{finally:function(o){var a=p(this,C.Promise||c.Promise),u=typeof o=="function";return this.then(u?function(s){return d(a,o()).then(function(){return s})}:o,u?function(s){return d(a,o()).then(function(){throw s})}:o)}})},{"./_core":65,"./_export":73,"./_global":76,"./_promise-resolve":110,"./_species-constructor":118}],148:[function(w,P,b){"use strict";var T=w("./_export"),C=w("./_new-promise-capability"),c=w("./_perform");T(T.S,"Promise",{try:function(p){var d=C.f(this),o=c(p);return(o.e?d.reject:d.resolve)(o.v),d.promise}})},{"./_export":73,"./_new-promise-capability":95,"./_perform":109}],149:[function(w,P,b){w("./_wks-define")("asyncIterator")},{"./_wks-define":129}],150:[function(w,P,b){w("./_wks-define")("observable")},{"./_wks-define":129}],151:[function(w,P,b){w("./es6.array.iterator");for(var T=w("./_global"),C=w("./_hide"),c=w("./_iterators"),p=w("./_wks")("toStringTag"),d="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),o=0;o0?"-":"+")+p(100*Math.floor(Math.abs(D)/60)+Math.abs(D)%60,4),S:["th","st","nd","rd"][E%10>3?0:(E%100-E%10!=10)*E%10],W:I,N:B};return t.replace(s,function(te){return te in H?H[te]:te.slice(1,te.length-1)})}}();u.masks={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},u.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]},typeof j=="function"&&j.amd?j(function(){return u}):(b===void 0?"undefined":(0,C.default)(b))==="object"?P.exports=u:c.dateFormat=u}(void 0)},{"babel-runtime/helpers/typeof":32}],155:[function(w,P,b){(function(T){function C(){return!(typeof window=="undefined"||!window.process||window.process.type!=="renderer")||typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function c(a){var u=this.useColors;if(a[0]=(u?"%c":"")+this.namespace+(u?" %c":" ")+a[0]+(u?"%c ":" ")+"+"+b.humanize(this.diff),u){var s="color: "+this.color;a.splice(1,0,s,"color: inherit");var h=0,i=0;a[0].replace(/%[a-zA-Z%]/g,function(n){n!=="%%"&&(h++,n==="%c"&&(i=h))}),a.splice(i,0,s)}}function p(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function d(a){try{a==null?b.storage.removeItem("debug"):b.storage.debug=a}catch(u){}}function o(){var a;try{a=b.storage.debug}catch(u){}return!a&&T!==void 0&&"env"in T&&(a=T.env.DEBUG),a}b=P.exports=w("./debug"),b.log=p,b.formatArgs=c,b.save=d,b.load=o,b.useColors=C,b.storage=typeof chrome!="undefined"&&chrome.storage!==void 0?chrome.storage.local:function(){try{return window.localStorage}catch(a){}}(),b.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],b.formatters.j=function(a){try{return JSON.stringify(a)}catch(u){return"[UnexpectedJSONParseError]: "+u.message}},b.enable(o())}).call(this,w("_process"))},{"./debug":156,_process:173}],156:[function(w,P,b){function T(u){var s,h=0;for(s in u)h=(h<<5)-h+u.charCodeAt(s),h|=0;return b.colors[Math.abs(h)%b.colors.length]}function C(u){function s(){if(s.enabled){var h=s,i=+new Date,n=i-(a||i);h.diff=n,h.prev=a,h.curr=i,a=i;for(var t=new Array(arguments.length),f=0;f]/;P.exports=T},{}],158:[function(w,P,b){function T(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function C(o){return typeof o=="function"}function c(o){return typeof o=="number"}function p(o){return typeof o=="object"&&o!==null}function d(o){return o===void 0}P.exports=T,T.EventEmitter=T,T.prototype._events=void 0,T.prototype._maxListeners=void 0,T.defaultMaxListeners=10,T.prototype.setMaxListeners=function(o){if(!c(o)||o<0||isNaN(o))throw TypeError("n must be a positive number");return this._maxListeners=o,this},T.prototype.emit=function(o){var a,u,s,h,i,n;if(this._events||(this._events={}),o==="error"&&(!this._events.error||p(this._events.error)&&!this._events.error.length)){if((a=arguments[1])instanceof Error)throw a;var t=new Error('Uncaught, unspecified "error" event. ('+a+")");throw t.context=a,t}if(u=this._events[o],d(u))return!1;if(C(u))switch(arguments.length){case 1:u.call(this);break;case 2:u.call(this,arguments[1]);break;case 3:u.call(this,arguments[1],arguments[2]);break;default:h=Array.prototype.slice.call(arguments,1),u.apply(this,h)}else if(p(u))for(h=Array.prototype.slice.call(arguments,1),n=u.slice(),s=n.length,i=0;i0&&this._events[o].length>u&&(this._events[o].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[o].length),typeof console.trace=="function"&&console.trace()),this},T.prototype.on=T.prototype.addListener,T.prototype.once=function(o,a){function u(){this.removeListener(o,u),s||(s=!0,a.apply(this,arguments))}if(!C(a))throw TypeError("listener must be a function");var s=!1;return u.listener=a,this.on(o,u),this},T.prototype.removeListener=function(o,a){var u,s,h,i;if(!C(a))throw TypeError("listener must be a function");if(!this._events||!this._events[o])return this;if(u=this._events[o],h=u.length,s=-1,u===a||C(u.listener)&&u.listener===a)delete this._events[o],this._events.removeListener&&this.emit("removeListener",o,a);else if(p(u)){for(i=h;i-- >0;)if(u[i]===a||u[i].listener&&u[i].listener===a){s=i;break}if(s<0)return this;u.length===1?(u.length=0,delete this._events[o]):u.splice(s,1),this._events.removeListener&&this.emit("removeListener",o,a)}return this},T.prototype.removeAllListeners=function(o){var a,u;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[o]&&delete this._events[o],this;if(arguments.length===0){for(a in this._events)a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events={},this}if(u=this._events[o],C(u))this.removeListener(o,u);else if(u)for(;u.length;)this.removeListener(o,u[u.length-1]);return delete this._events[o],this},T.prototype.listeners=function(o){return this._events&&this._events[o]?C(this._events[o])?[this._events[o]]:this._events[o].slice():[]},T.prototype.listenerCount=function(o){if(this._events){var a=this._events[o];if(C(a))return 1;if(a)return a.length}return 0},T.listenerCount=function(o,a){return o.listenerCount(a)}},{}],159:[function(w,P,b){var T=w("http"),C=P.exports;for(var c in T)T.hasOwnProperty(c)&&(C[c]=T[c]);C.request=function(p,d){return p||(p={}),p.scheme="https",p.protocol="https:",T.request.call(this,p,d)}},{http:196}],160:[function(w,P,b){"use strict";var T=w("util"),C=w("ms");P.exports=function(c){if(typeof c=="number")return c;var p=C(c);if(p===void 0){var d=new Error(T.format("humanize-ms(%j) result undefined",c));console.warn(d.stack)}return p}},{ms:169,util:207}],161:[function(w,P,b){b.read=function(T,C,c,p,d){var o,a,u=8*d-p-1,s=(1<>1,i=-7,n=c?d-1:0,t=c?-1:1,f=T[C+n];for(n+=t,o=f&(1<<-i)-1,f>>=-i,i+=u;i>0;o=256*o+T[C+n],n+=t,i-=8);for(a=o&(1<<-i)-1,o>>=-i,i+=p;i>0;a=256*a+T[C+n],n+=t,i-=8);if(o===0)o=1-h;else{if(o===s)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,p),o-=h}return(f?-1:1)*a*Math.pow(2,o-p)},b.write=function(T,C,c,p,d,o){var a,u,s,h=8*o-d-1,i=(1<>1,t=d===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=p?0:o-1,v=p?1:-1,m=C<0||C===0&&1/C<0?1:0;for(C=Math.abs(C),isNaN(C)||C===1/0?(u=isNaN(C)?1:0,a=i):(a=Math.floor(Math.log(C)/Math.LN2),C*(s=Math.pow(2,-a))<1&&(a--,s*=2),C+=a+n>=1?t/s:t*Math.pow(2,1-n),C*s>=2&&(a++,s/=2),a+n>=i?(u=0,a=i):a+n>=1?(u=(C*s-1)*Math.pow(2,d),a+=n):(u=C*Math.pow(2,n-1)*Math.pow(2,d),a=0));d>=8;T[c+f]=255&u,f+=v,u/=256,d-=8);for(a=a<0;T[c+f]=255&a,f+=v,a/=256,h-=8);T[c+f-v]|=128*m}},{}],162:[function(w,P,b){typeof Object.create=="function"?P.exports=function(T,C){T.super_=C,T.prototype=Object.create(C.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}})}:P.exports=function(T,C){T.super_=C;var c=function(){};c.prototype=C.prototype,T.prototype=new c,T.prototype.constructor=T}},{}],163:[function(w,P,b){function T(c){return!!c.constructor&&typeof c.constructor.isBuffer=="function"&&c.constructor.isBuffer(c)}function C(c){return typeof c.readFloatLE=="function"&&typeof c.slice=="function"&&T(c.slice(0,0))}P.exports=function(c){return c!=null&&(T(c)||C(c)||!!c._isBuffer)}},{}],164:[function(w,P,b){!function(T){function C(d){return p.call(d).replace(/^[^{]*{\s*/,"").replace(/\s*}[^}]*$/,"")}function c(d){return typeof d=="function"&&(/^class(\s|\{\}$)/.test(p.call(d))||/^.*classCallCheck\(/.test(C(d)))}var p=Function.prototype.toString;b!==void 0?(P!==void 0&&P.exports&&(b=P.exports=c),b.isClass=c):typeof j=="function"&&j.amd?j([],function(){return c}):T.isClass=c}(this)},{}],165:[function(w,P,b){"use strict";function T(o){var a=o.slice(2);return a=a[0].toLowerCase()+a.slice(1)}var C=w("core-util-is"),c=w("isstream"),p=w("is-class");Object.keys(C).map(function(o){b[T(o)]=C[o]}),b.stream=c,b.readableStream=c.isReadable,b.writableStream=c.isWritable,b.duplexStream=c.isDuplex,b.class=p,b.finite=function(o){return Number.isFinite(o)},b.NaN=function(o){return Number.isNaN(o)},b.generator=function(o){return o&&typeof o.next=="function"&&typeof o.throw=="function"},b.generatorFunction=function(o){return o&&o.constructor&&o.constructor.name==="GeneratorFunction"},b.asyncFunction=function(o){return o&&o.constructor&&o.constructor.name==="AsyncFunction"},b.promise=function(o){return o&&typeof o.then=="function"};var d=Math.pow(2,31);b.int=function(o){return C.isNumber(o)&&o%1==0},b.int32=function(o){return b.int(o)&&o=-d},b.long=function(o){return b.int(o)&&(o>=d||o<-d)},b.Long=function(o){return b.object(o)&&b.number(o.high)&&b.number(o.low)},b.double=function(o){return C.isNumber(o)&&!isNaN(o)&&o%1!=0},b.date=function(o){return o instanceof Date},b.regExp=function(o){return o instanceof RegExp},b.regexp=b.regExp,b.error=function(o){return o instanceof Error},b.array=function(o){return Array.isArray(o)}},{"core-util-is":153,"is-class":164,isstream:167}],166:[function(w,P,b){var T={}.toString;P.exports=Array.isArray||function(C){return T.call(C)=="[object Array]"}},{}],167:[function(w,P,b){function T(o){return o instanceof d.Stream}function C(o){return T(o)&&typeof o._read=="function"&&typeof o._readableState=="object"}function c(o){return T(o)&&typeof o._write=="function"&&typeof o._writableState=="object"}function p(o){return C(o)&&c(o)}var d=w("stream");P.exports=T,P.exports.isReadable=C,P.exports.isWritable=c,P.exports.isDuplex=p},{stream:195}],168:[function(w,P,b){"use strict";function T(c,p,d){if(!c)throw new TypeError("argument dest is required");if(!p)throw new TypeError("argument src is required");return d===void 0&&(d=!0),Object.getOwnPropertyNames(p).forEach(function(o){if(d||!C.call(c,o)){var a=Object.getOwnPropertyDescriptor(p,o);Object.defineProperty(c,o,a)}}),c}P.exports=T;var C=Object.prototype.hasOwnProperty},{}],169:[function(w,P,b){function T(h){if(h=String(h),!(h.length>100)){var i=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(h);if(i){var n=parseFloat(i[1]);switch((i[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*s;case"days":case"day":case"d":return n*u;case"hours":case"hour":case"hrs":case"hr":case"h":return n*a;case"minutes":case"minute":case"mins":case"min":case"m":return n*o;case"seconds":case"second":case"secs":case"sec":case"s":return n*d;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function C(h){return h>=u?Math.round(h/u)+"d":h>=a?Math.round(h/a)+"h":h>=o?Math.round(h/o)+"m":h>=d?Math.round(h/d)+"s":h+"ms"}function c(h){return p(h,u,"day")||p(h,a,"hour")||p(h,o,"minute")||p(h,d,"second")||h+" ms"}function p(h,i,n){if(!(h0)return T(h);if(n==="number"&&isNaN(h)===!1)return i.long?c(h):C(h);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(h))}},{}],170:[function(w,P,b){(function(T){function C(o,a){for(var u=0,s=o.length-1;s>=0;s--){var h=o[s];h==="."?o.splice(s,1):h===".."?(o.splice(s,1),u++):u&&(o.splice(s,1),u--)}if(a)for(;u--;u)o.unshift("..");return o}function c(o){typeof o!="string"&&(o+="");var a,u=0,s=-1,h=!0;for(a=o.length-1;a>=0;--a)if(o.charCodeAt(a)===47){if(!h){u=a+1;break}}else s===-1&&(h=!1,s=a+1);return s===-1?"":o.slice(u,s)}function p(o,a){if(o.filter)return o.filter(a);for(var u=[],s=0;s=-1&&!a;u--){var s=u>=0?arguments[u]:T.cwd();if(typeof s!="string")throw new TypeError("Arguments to path.resolve must be strings");s&&(o=s+"/"+o,a=s.charAt(0)==="/")}return o=C(p(o.split("/"),function(h){return!!h}),!a).join("/"),(a?"/":"")+o||"."},b.normalize=function(o){var a=b.isAbsolute(o),u=d(o,-1)==="/";return o=C(p(o.split("/"),function(s){return!!s}),!a).join("/"),o||a||(o="."),o&&u&&(o+="/"),(a?"/":"")+o},b.isAbsolute=function(o){return o.charAt(0)==="/"},b.join=function(){var o=Array.prototype.slice.call(arguments,0);return b.normalize(p(o,function(a,u){if(typeof a!="string")throw new TypeError("Arguments to path.join must be strings");return a}).join("/"))},b.relative=function(o,a){function u(v){for(var m=0;m=0&&v[_]==="";_--);return m>_?[]:v.slice(m,_-m+1)}o=b.resolve(o).substr(1),a=b.resolve(a).substr(1);for(var s=u(o.split("/")),h=u(a.split("/")),i=Math.min(s.length,h.length),n=i,t=0;t=1;--i)if((a=o.charCodeAt(i))===47){if(!h){s=i;break}}else h=!1;return s===-1?u?"/":".":u&&s===1?"/":o.slice(0,s)},b.basename=function(o,a){var u=c(o);return a&&u.substr(-1*a.length)===a&&(u=u.substr(0,u.length-a.length)),u},b.extname=function(o){typeof o!="string"&&(o+="");for(var a=-1,u=0,s=-1,h=!0,i=0,n=o.length-1;n>=0;--n){var t=o.charCodeAt(n);if(t!==47)s===-1&&(h=!1,s=n+1),t===46?a===-1?a=n:i!==1&&(i=1):a!==-1&&(i=-1);else if(!h){u=n+1;break}}return a===-1||s===-1||i===0||i===1&&a===s-1&&a===u+1?"":o.slice(a,s)};var d="ab".substr(-1)==="b"?function(o,a,u){return o.substr(a,u)}:function(o,a,u){return a<0&&(a=o.length+a),o.substr(a,u)}}).call(this,w("_process"))},{_process:173}],171:[function(w,P,b){(function(T){(function(){"use strict";function C(O){return O=String(O),O.charAt(0).toUpperCase()+O.slice(1)}function c(O,A,D){var I={"10.0":"10",6.4:"10 Technical Preview",6.3:"8.1",6.2:"8",6.1:"Server 2008 R2 / 7","6.0":"Server 2008 / Vista",5.2:"Server 2003 / XP 64-bit",5.1:"XP",5.01:"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return A&&D&&/^Win/i.test(O)&&!/^Windows Phone /i.test(O)&&(I=I[/[\d.]+$/.exec(O)])&&(O="Windows "+I),O=String(O),A&&D&&(O=O.replace(RegExp(A,"i"),D)),O=d(O.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0])}function p(O,A){var D=-1,I=O?O.length:0;if(typeof I=="number"&&I>-1&&I<=E)for(;++D3&&"WebKit"||/\bOpera\b/.test(ze)&&(/\bOPR\b/.test(O)?"Blink":"Presto")||/\b(?:Midori|Nook|Safari)\b/i.test(O)&&!/^(?:Trident|EdgeHTML)$/.test(We)&&"WebKit"||!We&&/\bMSIE\b/i.test(O)&&(k=="Mac OS"?"Tasman":"Trident")||We=="WebKit"&&/\bPlayStation\b(?! Vita\b)/i.test(ze)&&"NetFront")&&(We=[W]),ze=="IE"&&(W=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(O)||0)[1])?(ze+=" Mobile",k="Windows Phone "+(/\+$/.test(W)?W:W+".x"),Fe.unshift("desktop mode")):/\bWPDesktop\b/i.test(O)?(ze="IE Mobile",k="Windows Phone 8.x",Fe.unshift("desktop mode"),me||(me=(/\brv:([\d.]+)/.exec(O)||0)[1])):ze!="IE"&&We=="Trident"&&(W=/\brv:([\d.]+)/.exec(O))&&(ze&&Fe.push("identifying as "+ze+(me?" "+me:"")),ze="IE",me=W[1]),be){if(u(I,"global"))if(de&&(W=de.lang.System,Ue=W.getProperty("os.arch"),k=k||W.getProperty("os.name")+" "+W.getProperty("os.version")),Ce){try{me=I.require("ringo/engine").version.join("."),ze="RingoJS"}catch(q){(W=I.system)&&W.global.system==I.system&&(ze="Narwhal",k||(k=W[0].os||null))}ze||(ze="Rhino")}else typeof I.process=="object"&&!I.process.browser&&(W=I.process)&&(typeof W.versions=="object"&&(typeof W.versions.electron=="string"?(Fe.push("Node "+W.versions.node),ze="Electron",me=W.versions.electron):typeof W.versions.nw=="string"&&(Fe.push("Chromium "+me,"Node "+W.versions.node),ze="NW.js",me=W.versions.nw)),ze||(ze="Node.js",Ue=W.arch,k=W.platform,me=/[\d.]+/.exec(W.version),me=me?me[0]:null));else a(W=I.runtime)==ne?(ze="Adobe AIR",k=W.flash.system.Capabilities.os):a(W=I.phantom)==ce?(ze="PhantomJS",me=(W=W.version||null)&&W.major+"."+W.minor+"."+W.patch):typeof ye.documentMode=="number"&&(W=/\bTrident\/(\d+)/i.exec(O))?(me=[me,ye.documentMode],(W=+W[1]+4)!=me[1]&&(Fe.push("IE "+me[1]+" mode"),We&&(We[1]=""),me[1]=W),me=ze=="IE"?String(me[1].toFixed(1)):me[0]):typeof ye.documentMode=="number"&&/^(?:Chrome|Firefox)\b/.test(ze)&&(Fe.push("masking as "+ze+" "+me),ze="IE",me="11.0",We=["Trident"],k="Windows");k=k&&d(k)}if(me&&(W=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(me)||/(?:alpha|beta)(?: ?\d)?/i.exec(O+";"+(be&&H.appMinorVersion))||/\bMinefield\b/i.test(O)&&"a")&&(He=/b/i.test(W)?"beta":"alpha",me=me.replace(RegExp(W+"\\+?$"),"")+(He=="beta"?Pe:Se)+(/\d+\+?/.exec(W)||"")),ze=="Fennec"||ze=="Firefox"&&/\b(?:Android|Firefox OS)\b/.test(k))ze="Firefox Mobile";else if(ze=="Maxthon"&&me)me=me.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(nt))nt=="Xbox 360"&&(k=null),nt=="Xbox 360"&&/\bIEMobile\b/.test(O)&&Fe.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(ze)&&(!ze||nt||/Browser|Mobi/.test(ze))||k!="Windows CE"&&!/Mobi/i.test(O))if(ze=="IE"&&be)try{I.external===null&&Fe.unshift("platform preview")}catch(q){Fe.unshift("embedded")}else(/\bBlackBerry\b/.test(nt)||/\bBB10\b/.test(O))&&(W=(RegExp(nt.replace(/ +/g," *")+"/([.\\d]+)","i").exec(O)||0)[1]||me)?(W=[W,/BB10/.test(O)],k=(W[1]?(nt=null,re="BlackBerry"):"Device Software")+" "+W[0],me=null):this!=o&&nt!="Wii"&&(be&&Ee||/Opera/.test(ze)&&/\b(?:MSIE|Firefox)\b/i.test(O)||ze=="Firefox"&&/\bOS X (?:\d+\.){2,}/.test(k)||ze=="IE"&&(k&&!/^Win/.test(k)&&me>5.5||/\bWindows XP\b/.test(k)&&me>8||me==8&&!/\bTrident\b/.test(O)))&&!g.test(W=n.call(o,O.replace(g,"")+";"))&&W.name&&(W="ing as "+W.name+((W=W.version)?" "+W:""),g.test(ze)?(/\bIE\b/.test(W)&&k=="Mac OS"&&(k=null),W="identify"+W):(W="mask"+W,ze=Ge?d(Ge.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(W)&&(k=null),be||(me=null)),We=["Presto"],Fe.push(W));else ze+=" Mobile";(W=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(O)||0)[1])&&(W=[parseFloat(W.replace(/\.(\d)$/,".0$1")),W],ze=="Safari"&&W[1].slice(-1)=="+"?(ze="WebKit Nightly",He="alpha",me=W[1].slice(0,-1)):me!=W[1]&&me!=(W[2]=(/\bSafari\/([\d.]+\+?)/i.exec(O)||0)[1])||(me=null),W[1]=(/\bChrome\/([\d.]+)/i.exec(O)||0)[1],W[0]==537.36&&W[2]==537.36&&parseFloat(W[1])>=28&&We=="WebKit"&&(We=["Blink"]),be&&(X||W[1])?(We&&(We[1]="like Chrome"),W=W[1]||(W=W[0],W<530?1:W<532?2:W<532.05?3:W<533?4:W<534.03?5:W<534.07?6:W<534.1?7:W<534.13?8:W<534.16?9:W<534.24?10:W<534.3?11:W<535.01?12:W<535.02?"13+":W<535.07?15:W<535.11?16:W<535.19?17:W<536.05?18:W<536.1?19:W<537.01?20:W<537.11?"21+":W<537.13?23:W<537.18?24:W<537.24?25:W<537.36?26:We!="Blink"?"27":"28")):(We&&(We[1]="like Safari"),W=W[0],W=W<400?1:W<500?2:W<526?3:W<533?4:W<534?"4+":W<535?5:W<537?6:W<538?7:W<601?8:"8"),We&&(We[1]+=" "+(W+=typeof W=="number"?".x":/[.+]/.test(W)?"":"+")),ze=="Safari"&&(!me||parseInt(me)>45)&&(me=W)),ze=="Opera"&&(W=/\bzbov|zvav$/.exec(k))?(ze+=" ",Fe.unshift("desktop mode"),W=="zvav"?(ze+="Mini",me=null):ze+="Mobile",k=k.replace(RegExp(" *"+W+"$"),"")):ze=="Safari"&&/\bChrome\b/.exec(We&&We[1])&&(Fe.unshift("desktop mode"),ze="Chrome Mobile",me=null,/\bOS X\b/.test(k)?(re="Apple",k="iOS 4.3+"):k=null),me&&me.indexOf(W=/[\d.]+$/.exec(k))==0&&O.indexOf("/"+W+"-")>-1&&(k=i(k.replace(W,""))),We&&!/\b(?:Avant|Nook)\b/.test(ze)&&(/Browser|Lunascape|Maxthon/.test(ze)||ze!="Safari"&&/^iOS/.test(k)&&/\bSafari\b/.test(We[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|Web)/.test(ze)&&We[1])&&(W=We[We.length-1])&&Fe.push(W),Fe.length&&(Fe=["("+Fe.join("; ")+")"]),re&&nt&&nt.indexOf(re)<0&&Fe.push("on "+re),nt&&Fe.push((/^on /.test(Fe[Fe.length-1])?"":"on ")+nt),k&&(W=/ ([\d.+]+)$/.exec(k),V=W&&k.charAt(k.length-W[0].length-1)=="/",k={architecture:32,family:W&&!V?k.replace(W[0],""):k,version:W?W[1]:null,toString:function(){var q=this.version;return this.family+(q&&!V?" "+q:"")+(this.architecture==64?" 64-bit":"")}}),(W=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(Ue))&&!/\bi686\b/i.test(Ue)?(k&&(k.architecture=64,k.family=k.family.replace(RegExp(" *"+W),"")),ze&&(/\bWOW64\b/i.test(O)||be&&/\w(?:86|32)$/.test(H.cpuClass||H.platform)&&!/\bWin64; x64\b/i.test(O))&&Fe.unshift("32-bit")):k&&/^OS X/.test(k.family)&&ze=="Chrome"&&parseFloat(me)>=39&&(k.architecture=64),O||(O=null);var U={};return U.description=O,U.layout=We&&We[0],U.manufacturer=re,U.name=ze,U.prerelease=He,U.product=nt,U.ua=O,U.version=ze&&me,U.os=k||{architecture:null,family:null,version:null,toString:function(){return"null"}},U.parse=n,U.toString=D,U.version&&Fe.unshift(me),U.name&&Fe.unshift(ze),k&&ze&&(k!=String(k).split(" ")[0]||k!=ze.split(" ")[0]&&!nt)&&Fe.push(nt?"("+k+")":"on "+k),Fe.length&&(U.description=Fe.join(" ")),U}var t={function:!0,object:!0},f=t[typeof window]&&window||this,v=t[typeof b]&&b,m=t[typeof P]&&P&&!P.nodeType&&P,_=v&&m&&typeof T=="object"&&T;!_||_.global!==_&&_.window!==_&&_.self!==_||(f=_);var E=Math.pow(2,53)-1,g=/\bOpera/,y=Object.prototype,x=y.hasOwnProperty,l=y.toString,S=n();typeof j=="function"&&typeof j.amd=="object"&&j.amd?(f.platform=S,j(function(){return S})):v&&m?o(S,function(O,A){v[A]=O}):f.platform=S}).call(this)}).call(this,typeof le!="undefined"?le:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],172:[function(w,P,b){(function(T){"use strict";function C(c,p,d,o){if(typeof c!="function")throw new TypeError('"callback" argument must be a function');var a,u,s=arguments.length;switch(s){case 0:case 1:return T.nextTick(c);case 2:return T.nextTick(function(){c.call(null,p)});case 3:return T.nextTick(function(){c.call(null,p,d)});case 4:return T.nextTick(function(){c.call(null,p,d,o)});default:for(a=new Array(s-1),u=0;u1)for(var E=1;E1&&(Ce=de[0]+"@",ee=de[1]),ee=ee.replace(W,"."),Ce+p(ee.split("."),ce).join(".")}function o(ee){for(var ce,de,Ce=[],Se=0,Pe=ee.length;Se=55296&&ce<=56319&&Se65535&&(ce-=65536,de+=Y(ce>>>10&1023|55296),ce=56320|1023&ce),de+=Y(ce)}).join("")}function u(ee){return ee-48<10?ee-22:ee-65<26?ee-65:ee-97<26?ee-97:x}function s(ee,ce){return ee+22+75*(ee<26)-((ce!=0)<<5)}function h(ee,ce,de){var Ce=0;for(ee=de?ne(ee/A):ee>>1,ee+=ne(ee/ce);ee>X*S>>1;Ce+=x)ee=ne(ee/X);return ne(Ce+(X+1)*ee/(ee+O))}function i(ee){var ce,de,Ce,Se,Pe,ye,Ee,Ge,Ue,Fe,He=[],be=ee.length,me=0,We=I,ze=D;for(de=ee.lastIndexOf(B),de<0&&(de=0),Ce=0;Ce=128&&c("not-basic"),He.push(ee.charCodeAt(Ce));for(Se=de>0?de+1:0;Se=be&&c("invalid-input"),Ge=u(ee.charCodeAt(Se++)),(Ge>=x||Ge>ne((y-me)/ye))&&c("overflow"),me+=Ge*ye,Ue=Ee<=ze?l:Ee>=ze+S?S:Ee-ze,!(Gene(y/Fe)&&c("overflow"),ye*=Fe;ce=He.length+1,ze=h(me-Pe,ce,Pe==0),ne(me/ce)>y-We&&c("overflow"),We+=ne(me/ce),me%=ce,He.splice(me++,0,We)}return a(He)}function n(ee){var ce,de,Ce,Se,Pe,ye,Ee,Ge,Ue,Fe,He,be,me,We,ze,nt=[];for(ee=o(ee),be=ee.length,ce=I,de=0,Pe=D,ye=0;ye=ce&&Hene((y-de)/me)&&c("overflow"),de+=(Ee-ce)*me,ce=Ee,ye=0;yey&&c("overflow"),He==ce){for(Ge=de,Ue=x;Fe=Ue<=Pe?l:Ue>=Pe+S?S:Ue-Pe,!(Ge= 0x80 (not a basic code point)","invalid-input":"Invalid input"},X=x-l,ne=Math.floor,Y=String.fromCharCode;if(E={version:"1.4.1",ucs2:{decode:o,encode:a},decode:i,encode:n,toASCII:f,toUnicode:t},typeof j=="function"&&typeof j.amd=="object"&&j.amd)j("punycode",function(){return E});else if(v&&m)if(P.exports==v)m.exports=E;else for(g in E)E.hasOwnProperty(g)&&(v[g]=E[g]);else C.punycode=E}(this)}).call(this,typeof le!="undefined"?le:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],175:[function(w,P,b){"use strict";function T(c,p){return Object.prototype.hasOwnProperty.call(c,p)}P.exports=function(c,p,d,o){p=p||"&",d=d||"=";var a={};if(typeof c!="string"||c.length===0)return a;var u=/\+/g;c=c.split(p);var s=1e3;o&&typeof o.maxKeys=="number"&&(s=o.maxKeys);var h=c.length;s>0&&h>s&&(h=s);for(var i=0;i=0?(n=m.substr(0,_),t=m.substr(_+1)):(n=m,t=""),f=decodeURIComponent(n),v=decodeURIComponent(t),T(a,f)?C(a[f])?a[f].push(v):a[f]=[a[f],v]:a[f]=v}return a};var C=Array.isArray||function(c){return Object.prototype.toString.call(c)==="[object Array]"}},{}],176:[function(w,P,b){"use strict";function T(d,o){if(d.map)return d.map(o);for(var a=[],u=0;u0?(typeof me=="string"||re.objectMode||(0,V.default)(me)===de.prototype||(me=c(me)),ze?re.endEmitted?be.emit("error",new Error("stream.unshift() after end event")):s(be,re,me,!0):re.ended?be.emit("error",new Error("stream.push() after EOF")):(re.reading=!1,re.decoder&&!We?(me=re.decoder.write(me),re.objectMode||me.length!==0?s(be,re,me,!1):_(be,re)):s(be,re,me,!1))):ze||(re.reading=!1)}return i(re)}function s(be,me,We,ze){me.flowing&&me.length===0&&!me.sync?(be.emit("data",We),be.read(0)):(me.length+=me.objectMode?1:We.length,ze?me.buffer.unshift(We):me.buffer.push(We),me.needReadable&&v(be)),_(be,me)}function h(be,me){var We;return p(me)||typeof me=="string"||me===void 0||be.objectMode||(We=new TypeError("Invalid non-string/buffer chunk")),We}function i(be){return!be.ended&&(be.needReadable||be.length=He?be=He:(be--,be|=be>>>1,be|=be>>>2,be|=be>>>4,be|=be>>>8,be|=be>>>16,be++),be}function t(be,me){return be<=0||me.length===0&&me.ended?0:me.objectMode?1:be!==be?me.flowing&&me.length?me.buffer.head.data.length:me.length:(be>me.highWaterMark&&(me.highWaterMark=n(be)),be<=me.length?be:me.ended?me.length:(me.needReadable=!0,0))}function f(be,me){if(!me.ended){if(me.decoder){var We=me.decoder.end();We&&We.length&&(me.buffer.push(We),me.length+=me.objectMode?1:We.length)}me.ended=!0,v(be)}}function v(be){var me=be._readableState;me.needReadable=!1,me.emittedReadable||(ye("emitReadable",me.flowing),me.emittedReadable=!0,me.sync?X.nextTick(m,be):m(be))}function m(be){ye("emit readable"),be.emit("readable"),S(be)}function _(be,me){me.readingMore||(me.readingMore=!0,X.nextTick(E,be,me))}function E(be,me){for(var We=me.length;!me.reading&&!me.flowing&&!me.ended&&me.length=me.length?(We=me.decoder?me.buffer.join(""):me.buffer.length===1?me.buffer.head.data:me.buffer.concat(me.length),me.buffer.clear()):We=A(be,me.buffer,me.decoder),We}function A(be,me,We){var ze;return bere.length?re.length:be;if(k===re.length?nt+=re:nt+=re.slice(0,be),(be-=k)===0){k===re.length?(++ze,We.next?me.head=We.next:me.head=me.tail=null):(me.head=We,We.data=re.slice(k));break}++ze}return me.length-=ze,nt}function I(be,me){var We=de.allocUnsafe(be),ze=me.head,nt=1;for(ze.data.copy(We),be-=ze.data.length;ze=ze.next;){var re=ze.data,k=be>re.length?re.length:be;if(re.copy(We,We.length-be,0,k),(be-=k)===0){k===re.length?(++nt,ze.next?me.head=ze.next:me.head=me.tail=null):(me.head=ze,ze.data=re.slice(k));break}++nt}return me.length-=nt,We}function B(be){var me=be._readableState;if(me.length>0)throw new Error('"endReadable()" called on non-empty stream');me.endEmitted||(me.ended=!0,X.nextTick(H,me,be))}function H(be,me){be.endEmitted||be.length!==0||(be.endEmitted=!0,me.readable=!1,me.emit("end"))}function te(be,me){for(var We=0,ze=be.length;We=me.highWaterMark||me.ended))return ye("read: emitReadable",me.length,me.ended),me.length===0&&me.ended?B(this):v(this),null;if((be=t(be,me))===0&&me.ended)return me.length===0&&B(this),null;var ze=me.needReadable;ye("need readable",ze),(me.length===0||me.length-be0?O(be,me):null,nt===null?(me.needReadable=!0,be=0):me.length-=be,me.length===0&&(me.ended||(me.needReadable=!0),We!==be&&me.ended&&B(this)),nt!==null&&this.emit("data",nt),nt},a.prototype._read=function(be){this.emit("error",new Error("_read() is not implemented"))},a.prototype.pipe=function(be,me){function We(mt,Qe){ye("onunpipe"),mt===J&&Qe&&Qe.hasUnpiped===!1&&(Qe.hasUnpiped=!0,nt())}function ze(){ye("onend"),be.end()}function nt(){ye("cleanup"),be.removeListener("close",U),be.removeListener("finish",q),be.removeListener("drain",Ne),be.removeListener("error",k),be.removeListener("unpipe",We),J.removeListener("end",ze),J.removeListener("end",$),J.removeListener("data",re),je=!0,!xe.awaitDrain||be._writableState&&!be._writableState.needDrain||Ne()}function re(mt){ye("ondata"),tt=!1,be.write(mt)!==!1||tt||((xe.pipesCount===1&&xe.pipes===be||xe.pipesCount>1&&te(xe.pipes,be)!==-1)&&!je&&(ye("false write response, pause",J._readableState.awaitDrain),J._readableState.awaitDrain++,tt=!0),J.pause())}function k(mt){ye("onerror",mt),$(),be.removeListener("error",k),ee(be,"error")===0&&be.emit("error",mt)}function U(){be.removeListener("finish",q),$()}function q(){ye("onfinish"),be.removeListener("close",U),$()}function $(){ye("unpipe"),J.unpipe(be)}var J=this,xe=this._readableState;switch(xe.pipesCount){case 0:xe.pipes=be;break;case 1:xe.pipes=[xe.pipes,be];break;default:xe.pipes.push(be)}xe.pipesCount+=1,ye("pipe count=%d opts=%j",xe.pipesCount,me);var ke=(!me||me.end!==!1)&&be!==T.stdout&&be!==T.stderr,dt=ke?ze:$;xe.endEmitted?X.nextTick(dt):J.once("end",dt),be.on("unpipe",We);var Ne=g(J);be.on("drain",Ne);var je=!1,tt=!1;return J.on("data",re),d(be,"error",k),be.once("close",U),be.once("finish",q),be.emit("pipe",J),xe.flowing||(ye("pipe resume"),J.resume()),be},a.prototype.unpipe=function(be){var me=this._readableState,We={hasUnpiped:!1};if(me.pipesCount===0)return this;if(me.pipesCount===1)return be&&be!==me.pipes?this:(be||(be=me.pipes),me.pipes=null,me.pipesCount=0,me.flowing=!1,be&&be.emit("unpipe",this,We),this);if(!be){var ze=me.pipes,nt=me.pipesCount;me.pipes=null,me.pipesCount=0,me.flowing=!1;for(var re=0;re-1?ne.default:Y.nextTick;s.WritableState=u;var de=w("core-util-is");de.inherits=w("inherits");var Ce={deprecate:w("util-deprecate")},Se=w("./internal/streams/stream"),Pe=w("safe-buffer").Buffer,ye=C.Uint8Array||function(){},Ee=w("./internal/streams/destroy");de.inherits(s,Se),u.prototype.getBuffer=function(){for(var Ue=this.bufferedRequest,Fe=[];Ue;)Fe.push(Ue),Ue=Ue.next;return Fe},function(){try{Object.defineProperty(u.prototype,"buffer",{get:Ce.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(Ue){}}();var Ge;typeof V.default=="function"&&te.default&&typeof Function.prototype[te.default]=="function"?(Ge=Function.prototype[te.default],(0,B.default)(s,te.default,{value:function(Ue){return!!Ge.call(this,Ue)||this===s&&Ue&&Ue._writableState instanceof u}})):Ge=function(Ue){return Ue instanceof this},s.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},s.prototype.write=function(Ue,Fe,He){var be=this._writableState,me=!1,We=!be.objectMode&&o(Ue);return We&&!Pe.isBuffer(Ue)&&(Ue=d(Ue)),typeof Fe=="function"&&(He=Fe,Fe=null),We?Fe="buffer":Fe||(Fe=be.defaultEncoding),typeof He!="function"&&(He=a),be.ended?h(this,He):(We||i(this,be,Ue,He))&&(be.pendingcb++,me=t(this,be,We,Ue,Fe,He)),me},s.prototype.cork=function(){this._writableState.corked++},s.prototype.uncork=function(){var Ue=this._writableState;Ue.corked&&(Ue.corked--,Ue.writing||Ue.corked||Ue.finished||Ue.bufferProcessing||!Ue.bufferedRequest||y(this,Ue))},s.prototype.setDefaultEncoding=function(Ue){if(typeof Ue=="string"&&(Ue=Ue.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Ue+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+Ue);return this._writableState.defaultEncoding=Ue,this},Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),s.prototype._write=function(Ue,Fe,He){He(new Error("_write() is not implemented"))},s.prototype._writev=null,s.prototype.end=function(Ue,Fe,He){var be=this._writableState;typeof Ue=="function"?(He=Ue,Ue=null,Fe=null):typeof Fe=="function"&&(He=Fe,Fe=null),Ue!=null&&this.write(Ue,Fe),be.corked&&(be.corked=1,this.uncork()),be.ending||be.finished||A(this,be,He)},Object.defineProperty(s.prototype,"destroyed",{get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(Ue){this._writableState&&(this._writableState.destroyed=Ue)}}),s.prototype.destroy=Ee.destroy,s.prototype._undestroy=Ee.undestroy,s.prototype._destroy=function(Ue,Fe){this.end(),Fe(Ue)}}).call(this,w("_process"),typeof le!="undefined"?le:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./_stream_duplex":179,"./internal/streams/destroy":185,"./internal/streams/stream":186,_process:173,"babel-runtime/core-js/object/define-property":20,"babel-runtime/core-js/set-immediate":25,"babel-runtime/core-js/symbol":27,"babel-runtime/core-js/symbol/has-instance":28,"core-util-is":153,inherits:162,"process-nextick-args":172,"safe-buffer":193,"util-deprecate":205}],184:[function(w,P,b){"use strict";function T(d,o){if(!(d instanceof o))throw new TypeError("Cannot call a class as a function")}function C(d,o,a){d.copy(o,a)}var c=w("safe-buffer").Buffer,p=w("util");P.exports=function(){function d(){T(this,d),this.head=null,this.tail=null,this.length=0}return d.prototype.push=function(o){var a={data:o,next:null};this.length>0?this.tail.next=a:this.head=a,this.tail=a,++this.length},d.prototype.unshift=function(o){var a={data:o,next:this.head};this.length===0&&(this.tail=a),this.head=a,++this.length},d.prototype.shift=function(){if(this.length!==0){var o=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,o}},d.prototype.clear=function(){this.head=this.tail=null,this.length=0},d.prototype.join=function(o){if(this.length===0)return"";for(var a=this.head,u=""+a.data;a=a.next;)u+=o+a.data;return u},d.prototype.concat=function(o){if(this.length===0)return c.alloc(0);if(this.length===1)return this.head.data;for(var a=c.allocUnsafe(o>>>0),u=this.head,s=0;u;)C(u.data,a,s),s+=u.data.length,u=u.next;return a},d}(),p&&p.inspect&&p.inspect.custom&&(P.exports.prototype[p.inspect.custom]=function(){var d=p.inspect({length:this.length});return this.constructor.name+" "+d})},{"safe-buffer":193,util:36}],185:[function(w,P,b){"use strict";function T(d,o){var a=this,u=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return u||s?(o?o(d):!d||this._writableState&&this._writableState.errorEmitted||p.nextTick(c,this,d),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(d||null,function(h){!o&&h?(p.nextTick(c,a,h),a._writableState&&(a._writableState.errorEmitted=!0)):o&&o(h)}),this)}function C(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function c(d,o){d.emit("error",o)}var p=w("process-nextick-args");P.exports={destroy:T,undestroy:C}},{"process-nextick-args":172}],186:[function(w,P,b){"use strict";P.exports=w("events").EventEmitter},{events:158}],187:[function(w,P,b){P.exports=w("./readable").PassThrough},{"./readable":188}],188:[function(w,P,b){b=P.exports=w("./lib/_stream_readable.js"),b.Stream=b,b.Readable=b,b.Writable=w("./lib/_stream_writable.js"),b.Duplex=w("./lib/_stream_duplex.js"),b.Transform=w("./lib/_stream_transform.js"),b.PassThrough=w("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":179,"./lib/_stream_passthrough.js":180,"./lib/_stream_readable.js":181,"./lib/_stream_transform.js":182,"./lib/_stream_writable.js":183}],189:[function(w,P,b){P.exports=w("./readable").Transform},{"./readable":188}],190:[function(w,P,b){P.exports=w("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":183}],191:[function(w,P,b){var T=function(){return this}()||Function("return this")(),C=T.regeneratorRuntime&&Object.getOwnPropertyNames(T).indexOf("regeneratorRuntime")>=0,c=C&&T.regeneratorRuntime;if(T.regeneratorRuntime=void 0,P.exports=w("./runtime"),C)T.regeneratorRuntime=c;else try{delete T.regeneratorRuntime}catch(p){T.regeneratorRuntime=void 0}},{"./runtime":192}],192:[function(w,P,b){!function(T){"use strict";function C(ne,Y,ee,ce){var de=Y&&Y.prototype instanceof p?Y:p,Ce=Object.create(de.prototype),Se=new t(ce||[]);return Ce._invoke=s(ne,ee,Se),Ce}function c(ne,Y,ee){try{return{type:"normal",arg:ne.call(Y,ee)}}catch(ce){return{type:"throw",arg:ce}}}function p(){}function d(){}function o(){}function a(ne){["next","throw","return"].forEach(function(Y){ne[Y]=function(ee){return this._invoke(Y,ee)}})}function u(ne){function Y(de,Ce,Se,Pe){var ye=c(ne[de],ne,Ce);if(ye.type!=="throw"){var Ee=ye.arg,Ge=Ee.value;return Ge&&typeof Ge=="object"&&E.call(Ge,"__await")?Promise.resolve(Ge.__await).then(function(Ue){Y("next",Ue,Se,Pe)},function(Ue){Y("throw",Ue,Se,Pe)}):Promise.resolve(Ge).then(function(Ue){Ee.value=Ue,Se(Ee)},Pe)}Pe(ye.arg)}function ee(de,Ce){function Se(){return new Promise(function(Pe,ye){Y(de,Ce,Pe,ye)})}return ce=ce?ce.then(Se,Se):Se()}var ce;this._invoke=ee}function s(ne,Y,ee){var ce=A;return function(de,Ce){if(ce===I)throw new Error("Generator is already running");if(ce===B){if(de==="throw")throw Ce;return v()}for(ee.method=de,ee.arg=Ce;;){var Se=ee.delegate;if(Se){var Pe=h(Se,ee);if(Pe){if(Pe===H)continue;return Pe}}if(ee.method==="next")ee.sent=ee._sent=ee.arg;else if(ee.method==="throw"){if(ce===A)throw ce=B,ee.arg;ee.dispatchException(ee.arg)}else ee.method==="return"&&ee.abrupt("return",ee.arg);ce=I;var ye=c(ne,Y,ee);if(ye.type==="normal"){if(ce=ee.done?B:D,ye.arg===H)continue;return{value:ye.arg,done:ee.done}}ye.type==="throw"&&(ce=B,ee.method="throw",ee.arg=ye.arg)}}}function h(ne,Y){var ee=ne.iterator[Y.method];if(ee===m){if(Y.delegate=null,Y.method==="throw"){if(ne.iterator.return&&(Y.method="return",Y.arg=m,h(ne,Y),Y.method==="throw"))return H;Y.method="throw",Y.arg=new TypeError("The iterator does not provide a 'throw' method")}return H}var ce=c(ee,ne.iterator,Y.arg);if(ce.type==="throw")return Y.method="throw",Y.arg=ce.arg,Y.delegate=null,H;var de=ce.arg;return de?de.done?(Y[ne.resultName]=de.value,Y.next=ne.nextLoc,Y.method!=="return"&&(Y.method="next",Y.arg=m),Y.delegate=null,H):de:(Y.method="throw",Y.arg=new TypeError("iterator result is not an object"),Y.delegate=null,H)}function i(ne){var Y={tryLoc:ne[0]};1 in ne&&(Y.catchLoc=ne[1]),2 in ne&&(Y.finallyLoc=ne[2],Y.afterLoc=ne[3]),this.tryEntries.push(Y)}function n(ne){var Y=ne.completion||{};Y.type="normal",delete Y.arg,ne.completion=Y}function t(ne){this.tryEntries=[{tryLoc:"root"}],ne.forEach(i,this),this.reset(!0)}function f(ne){if(ne){var Y=ne[y];if(Y)return Y.call(ne);if(typeof ne.next=="function")return ne;if(!isNaN(ne.length)){var ee=-1,ce=function de(){for(;++ee=0;--ce){var de=this.tryEntries[ce],Ce=de.completion;if(de.tryLoc==="root")return Y("end");if(de.tryLoc<=this.prev){var Se=E.call(de,"catchLoc"),Pe=E.call(de,"finallyLoc");if(Se&&Pe){if(this.prev=0;--ee){var ce=this.tryEntries[ee];if(ce.tryLoc<=this.prev&&E.call(ce,"finallyLoc")&&this.prev=0;--Y){var ee=this.tryEntries[Y];if(ee.finallyLoc===ne)return this.complete(ee.completion,ee.afterLoc),n(ee),H}},catch:function(ne){for(var Y=this.tryEntries.length-1;Y>=0;--Y){var ee=this.tryEntries[Y];if(ee.tryLoc===ne){var ce=ee.completion;if(ce.type==="throw"){var de=ce.arg;n(ee)}return de}}throw new Error("illegal catch attempt")},delegateYield:function(ne,Y,ee){return this.delegate={iterator:f(ne),resultName:Y,nextLoc:ee},this.method==="next"&&(this.arg=m),H}}}(function(){return this}()||Function("return this")())},{}],193:[function(w,P,b){function T(d,o){for(var a in d)o[a]=d[a]}function C(d,o,a){return p(d,o,a)}var c=w("buffer"),p=c.Buffer;p.from&&p.alloc&&p.allocUnsafe&&p.allocUnsafeSlow?P.exports=c:(T(c,b),b.Buffer=C),T(p,C),C.from=function(d,o,a){if(typeof d=="number")throw new TypeError("Argument must not be a number");return p(d,o,a)},C.alloc=function(d,o,a){if(typeof d!="number")throw new TypeError("Argument must be a number");var u=p(d);return o!==void 0?typeof a=="string"?u.fill(o,a):u.fill(o):u.fill(0),u},C.allocUnsafe=function(d){if(typeof d!="number")throw new TypeError("Argument must be a number");return p(d)},C.allocUnsafeSlow=function(d){if(typeof d!="number")throw new TypeError("Argument must be a number");return c.SlowBuffer(d)}},{buffer:38}],194:[function(w,P,b){(function(T){"use strict";function C(v){return v&&v.__esModule?v:{default:v}}var c=w("babel-runtime/core-js/string/from-code-point"),p=C(c),d=w("babel-runtime/core-js/json/stringify"),o=C(d),a=w("babel-runtime/helpers/typeof"),u=C(a),s=w("babel-runtime/core-js/object/define-property"),h=C(s),i=w("babel-runtime/core-js/object/keys"),n=C(i),t=w("babel-runtime/core-js/object/create"),f=C(t);!function(v){function m($,J){if(!(this instanceof m))return new m($,J);var xe=this;E(xe),xe.q=xe.c="",xe.bufferCheckPosition=v.MAX_BUFFER_LENGTH,xe.opt=J||{},xe.opt.lowercase=xe.opt.lowercase||xe.opt.lowercasetags,xe.looseCase=xe.opt.lowercase?"toLowerCase":"toUpperCase",xe.tags=[],xe.closed=xe.closedRoot=xe.sawRoot=!1,xe.tag=xe.error=null,xe.strict=!!$,xe.noscript=!(!$&&!xe.opt.noscript),xe.state=U.BEGIN,xe.strictEntities=xe.opt.strictEntities,xe.ENTITIES=xe.strictEntities?(0,f.default)(v.XML_ENTITIES):(0,f.default)(v.ENTITIES),xe.attribList=[],xe.opt.xmlns&&(xe.ns=(0,f.default)(We)),xe.trackPosition=xe.opt.position!==!1,xe.trackPosition&&(xe.position=xe.line=xe.column=0),I(xe,"onready")}function _($){for(var J=Math.max(v.MAX_BUFFER_LENGTH,10),xe=0,ke=0,dt=Ee.length;keJ)switch(Ee[ke]){case"textNode":H($);break;case"cdata":B($,"oncdata",$.cdata),$.cdata="";break;case"script":B($,"onscript",$.script),$.script="";break;default:W($,"Max buffer length exceeded: "+Ee[ke])}xe=Math.max(xe,Ne)}var je=v.MAX_BUFFER_LENGTH-xe;$.bufferCheckPosition=je+$.position}function E($){for(var J=0,xe=Ee.length;J"||l($)}function A($,J){return $.test(J)}function D($,J){return!A($,J)}function I($,J,xe){$[J]&&$[J](xe)}function B($,J,xe){$.textNode&&H($),I($,J,xe)}function H($){$.textNode=te($.opt,$.textNode),$.textNode&&I($,"ontext",$.textNode),$.textNode=""}function te($,J){return $.trim&&(J=J.trim()),$.normalize&&(J=J.replace(/\s+/g," ")),J}function W($,J){return H($),$.trackPosition&&(J+=`
Line: `+$.line+`
Column: `+$.column+`
Char: `+$.c),J=new Error(J),$.error=J,I($,"onerror",J),$}function V($){return $.sawRoot&&!$.closedRoot&&X($,"Unclosed root tag"),$.state!==U.BEGIN&&$.state!==U.BEGIN_WHITESPACE&&$.state!==U.TEXT&&W($,"Unexpected end"),H($),$.c="",$.closed=!0,I($,"onend"),m.call($,$.strict,$.opt),$}function X($,J){if(($===void 0?"undefined":(0,u.default)($))!=="object"||!($ instanceof m))throw new Error("bad call to strictFail");$.strict&&W($,J)}function ne($){$.strict||($.tagName=$.tagName[$.looseCase]());var J=$.tags[$.tags.length-1]||$,xe=$.tag={name:$.tagName,attributes:{}};$.opt.xmlns&&(xe.ns=J.ns),$.attribList.length=0,B($,"onopentagstart",xe)}function Y($,J){var xe=$.indexOf(":"),ke=xe<0?["",$]:$.split(":"),dt=ke[0],Ne=ke[1];return J&&$==="xmlns"&&(dt="xmlns",Ne=""),{prefix:dt,local:Ne}}function ee($){if($.strict||($.attribName=$.attribName[$.looseCase]()),$.attribList.indexOf($.attribName)!==-1||$.tag.attributes.hasOwnProperty($.attribName))return void($.attribName=$.attribValue="");if($.opt.xmlns){var J=Y($.attribName,!0),xe=J.prefix,ke=J.local;if(xe==="xmlns")if(ke==="xml"&&$.attribValue!==be)X($,"xml: prefix must be bound to "+be+`
Actual: `+$.attribValue);else if(ke==="xmlns"&&$.attribValue!==me)X($,"xmlns: prefix must be bound to "+me+`
Actual: `+$.attribValue);else{var dt=$.tag,Ne=$.tags[$.tags.length-1]||$;dt.ns===Ne.ns&&(dt.ns=(0,f.default)(Ne.ns)),dt.ns[ke]=$.attribValue}$.attribList.push([$.attribName,$.attribValue])}else $.tag.attributes[$.attribName]=$.attribValue,B($,"onattribute",{name:$.attribName,value:$.attribValue});$.attribName=$.attribValue=""}function ce($,J){if($.opt.xmlns){var xe=$.tag,ke=Y($.tagName);xe.prefix=ke.prefix,xe.local=ke.local,xe.uri=xe.ns[ke.prefix]||"",xe.prefix&&!xe.uri&&(X($,"Unbound namespace prefix: "+(0,o.default)($.tagName)),xe.uri=ke.prefix);var dt=$.tags[$.tags.length-1]||$;xe.ns&&dt.ns!==xe.ns&&(0,n.default)(xe.ns).forEach(function(Ae){B($,"onopennamespace",{prefix:Ae,uri:xe.ns[Ae]})});for(var Ne=0,je=$.attribList.length;Ne",void($.state=U.TEXT);if($.script){if($.tagName!=="script")return $.script+=""+$.tagName+">",$.tagName="",void($.state=U.SCRIPT);B($,"onscript",$.script),$.script=""}var J=$.tags.length,xe=$.tagName;$.strict||(xe=xe[$.looseCase]());for(var ke=xe;J--&&!($.tags[J].name===ke);)X($,"Unexpected close tag");if(J<0)return X($,"Unmatched closing tag: "+$.tagName),$.textNode+=""+$.tagName+">",void($.state=U.TEXT);$.tagName=xe;for(var dt=$.tags.length;dt-- >J;){var Ne=$.tag=$.tags.pop();$.tagName=$.tag.name,B($,"onclosetag",$.tagName);var je={};for(var tt in Ne.ns)je[tt]=Ne.ns[tt];var mt=$.tags[$.tags.length-1]||$;$.opt.xmlns&&Ne.ns!==mt.ns&&(0,n.default)(Ne.ns).forEach(function(Qe){var Xe=Ne.ns[Qe];B($,"onclosenamespace",{prefix:Qe,uri:Xe})})}J===0&&($.closedRoot=!0),$.tagName=$.attribValue=$.attribName="",$.attribList.length=0,$.state=U.TEXT}function Ce($){var J,xe=$.entity,ke=xe.toLowerCase(),dt="";return $.ENTITIES[xe]?$.ENTITIES[xe]:$.ENTITIES[ke]?$.ENTITIES[ke]:(xe=ke,xe.charAt(0)==="#"&&(xe.charAt(1)==="x"?(xe=xe.slice(2),J=parseInt(xe,16),dt=J.toString(16)):(xe=xe.slice(1),J=parseInt(xe,10),dt=J.toString(10))),xe=xe.replace(/^0+/,""),isNaN(J)||dt.toLowerCase()!==xe?(X($,"Invalid character entity"),"&"+$.entity+";"):(0,p.default)(J))}function Se($,J){J==="<"?($.state=U.OPEN_WAKA,$.startTagPosition=$.position):l(J)||(X($,"Non-whitespace before first tag."),$.textNode=J,$.state=U.TEXT)}function Pe($,J){var xe="";return J<$.length&&(xe=$.charAt(J)),xe}function ye($){var J=this;if(this.error)throw this.error;if(J.closed)return W(J,"Cannot write after close. Assign an onready handler.");if($===null)return V(J);($===void 0?"undefined":(0,u.default)($))==="object"&&($=$.toString());for(var xe=0,ke="";!(ke=Pe($,xe++),J.c=ke,!ke);)switch(J.trackPosition&&(J.position++,ke===`
`?(J.line++,J.column=0):J.column++),J.state){case U.BEGIN:if(J.state=U.BEGIN_WHITESPACE,ke==="\uFEFF")continue;Se(J,ke);continue;case U.BEGIN_WHITESPACE:Se(J,ke);continue;case U.TEXT:if(J.sawRoot&&!J.closedRoot){for(var dt=xe-1;ke&&ke!=="<"&&ke!=="&";)(ke=Pe($,xe++))&&J.trackPosition&&(J.position++,ke===`
`?(J.line++,J.column=0):J.column++);J.textNode+=$.substring(dt,xe-1)}ke!=="<"||J.sawRoot&&J.closedRoot&&!J.strict?(l(ke)||J.sawRoot&&!J.closedRoot||X(J,"Text data outside of root node."),ke==="&"?J.state=U.TEXT_ENTITY:J.textNode+=ke):(J.state=U.OPEN_WAKA,J.startTagPosition=J.position);continue;case U.SCRIPT:ke==="<"?J.state=U.SCRIPT_ENDING:J.script+=ke;continue;case U.SCRIPT_ENDING:ke==="/"?J.state=U.CLOSE_TAG:(J.script+="<"+ke,J.state=U.SCRIPT);continue;case U.OPEN_WAKA:if(ke==="!")J.state=U.SGML_DECL,J.sgmlDecl="";else if(!l(ke))if(A(ze,ke))J.state=U.OPEN_TAG,J.tagName=ke;else if(ke==="/")J.state=U.CLOSE_TAG,J.tagName="";else if(ke==="?")J.state=U.PROC_INST,J.procInstName=J.procInstBody="";else{if(X(J,"Unencoded <"),J.startTagPosition+1"?(B(J,"onsgmldeclaration",J.sgmlDecl),J.sgmlDecl="",J.state=U.TEXT):(S(ke)&&(J.state=U.SGML_DECL_QUOTED),J.sgmlDecl+=ke);continue;case U.SGML_DECL_QUOTED:ke===J.q&&(J.state=U.SGML_DECL,J.q=""),J.sgmlDecl+=ke;continue;case U.DOCTYPE:ke===">"?(J.state=U.TEXT,B(J,"ondoctype",J.doctype),J.doctype=!0):(J.doctype+=ke,ke==="["?J.state=U.DOCTYPE_DTD:S(ke)&&(J.state=U.DOCTYPE_QUOTED,J.q=ke));continue;case U.DOCTYPE_QUOTED:J.doctype+=ke,ke===J.q&&(J.q="",J.state=U.DOCTYPE);continue;case U.DOCTYPE_DTD:J.doctype+=ke,ke==="]"?J.state=U.DOCTYPE:S(ke)&&(J.state=U.DOCTYPE_DTD_QUOTED,J.q=ke);continue;case U.DOCTYPE_DTD_QUOTED:J.doctype+=ke,ke===J.q&&(J.state=U.DOCTYPE_DTD,J.q="");continue;case U.COMMENT:ke==="-"?J.state=U.COMMENT_ENDING:J.comment+=ke;continue;case U.COMMENT_ENDING:ke==="-"?(J.state=U.COMMENT_ENDED,J.comment=te(J.opt,J.comment),J.comment&&B(J,"oncomment",J.comment),J.comment=""):(J.comment+="-"+ke,J.state=U.COMMENT);continue;case U.COMMENT_ENDED:ke!==">"?(X(J,"Malformed comment"),J.comment+="--"+ke,J.state=U.COMMENT):J.state=U.TEXT;continue;case U.CDATA:ke==="]"?J.state=U.CDATA_ENDING:J.cdata+=ke;continue;case U.CDATA_ENDING:ke==="]"?J.state=U.CDATA_ENDING_2:(J.cdata+="]"+ke,J.state=U.CDATA);continue;case U.CDATA_ENDING_2:ke===">"?(J.cdata&&B(J,"oncdata",J.cdata),B(J,"onclosecdata"),J.cdata="",J.state=U.TEXT):ke==="]"?J.cdata+="]":(J.cdata+="]]"+ke,J.state=U.CDATA);continue;case U.PROC_INST:ke==="?"?J.state=U.PROC_INST_ENDING:l(ke)?J.state=U.PROC_INST_BODY:J.procInstName+=ke;continue;case U.PROC_INST_BODY:if(!J.procInstBody&&l(ke))continue;ke==="?"?J.state=U.PROC_INST_ENDING:J.procInstBody+=ke;continue;case U.PROC_INST_ENDING:ke===">"?(B(J,"onprocessinginstruction",{name:J.procInstName,body:J.procInstBody}),J.procInstName=J.procInstBody="",J.state=U.TEXT):(J.procInstBody+="?"+ke,J.state=U.PROC_INST_BODY);continue;case U.OPEN_TAG:A(nt,ke)?J.tagName+=ke:(ne(J),ke===">"?ce(J):ke==="/"?J.state=U.OPEN_TAG_SLASH:(l(ke)||X(J,"Invalid character in tag name"),J.state=U.ATTRIB));continue;case U.OPEN_TAG_SLASH:ke===">"?(ce(J,!0),de(J)):(X(J,"Forward-slash in opening tag not followed by >"),J.state=U.ATTRIB);continue;case U.ATTRIB:if(l(ke))continue;ke===">"?ce(J):ke==="/"?J.state=U.OPEN_TAG_SLASH:A(ze,ke)?(J.attribName=ke,J.attribValue="",J.state=U.ATTRIB_NAME):X(J,"Invalid attribute name");continue;case U.ATTRIB_NAME:ke==="="?J.state=U.ATTRIB_VALUE:ke===">"?(X(J,"Attribute without value"),J.attribValue=J.attribName,ee(J),ce(J)):l(ke)?J.state=U.ATTRIB_NAME_SAW_WHITE:A(nt,ke)?J.attribName+=ke:X(J,"Invalid attribute name");continue;case U.ATTRIB_NAME_SAW_WHITE:if(ke==="=")J.state=U.ATTRIB_VALUE;else{if(l(ke))continue;X(J,"Attribute without value"),J.tag.attributes[J.attribName]="",J.attribValue="",B(J,"onattribute",{name:J.attribName,value:""}),J.attribName="",ke===">"?ce(J):A(ze,ke)?(J.attribName=ke,J.state=U.ATTRIB_NAME):(X(J,"Invalid attribute name"),J.state=U.ATTRIB)}continue;case U.ATTRIB_VALUE:if(l(ke))continue;S(ke)?(J.q=ke,J.state=U.ATTRIB_VALUE_QUOTED):(X(J,"Unquoted attribute value"),J.state=U.ATTRIB_VALUE_UNQUOTED,J.attribValue=ke);continue;case U.ATTRIB_VALUE_QUOTED:if(ke!==J.q){ke==="&"?J.state=U.ATTRIB_VALUE_ENTITY_Q:J.attribValue+=ke;continue}ee(J),J.q="",J.state=U.ATTRIB_VALUE_CLOSED;continue;case U.ATTRIB_VALUE_CLOSED:l(ke)?J.state=U.ATTRIB:ke===">"?ce(J):ke==="/"?J.state=U.OPEN_TAG_SLASH:A(ze,ke)?(X(J,"No whitespace between attributes"),J.attribName=ke,J.attribValue="",J.state=U.ATTRIB_NAME):X(J,"Invalid attribute name");continue;case U.ATTRIB_VALUE_UNQUOTED:if(!O(ke)){ke==="&"?J.state=U.ATTRIB_VALUE_ENTITY_U:J.attribValue+=ke;continue}ee(J),ke===">"?ce(J):J.state=U.ATTRIB;continue;case U.CLOSE_TAG:if(J.tagName)ke===">"?de(J):A(nt,ke)?J.tagName+=ke:J.script?(J.script+=""+J.tagName,J.tagName="",J.state=U.SCRIPT):(l(ke)||X(J,"Invalid tagname in closing tag"),J.state=U.CLOSE_TAG_SAW_WHITE);else{if(l(ke))continue;D(ze,ke)?J.script?(J.script+=""+ke,J.state=U.SCRIPT):X(J,"Invalid tagname in closing tag."):J.tagName=ke}continue;case U.CLOSE_TAG_SAW_WHITE:if(l(ke))continue;ke===">"?de(J):X(J,"Invalid characters in closing tag");continue;case U.TEXT_ENTITY:case U.ATTRIB_VALUE_ENTITY_Q:case U.ATTRIB_VALUE_ENTITY_U:var je,tt;switch(J.state){case U.TEXT_ENTITY:je=U.TEXT,tt="textNode";break;case U.ATTRIB_VALUE_ENTITY_Q:je=U.ATTRIB_VALUE_QUOTED,tt="attribValue";break;case U.ATTRIB_VALUE_ENTITY_U:je=U.ATTRIB_VALUE_UNQUOTED,tt="attribValue"}ke===";"?(J[tt]+=Ce(J),J.entity="",J.state=je):A(J.entity.length?k:re,ke)?J.entity+=ke:(X(J,"Invalid character in entity name"),J[tt]+="&"+J.entity+ke,J.entity="",J.state=je);continue;default:throw new Error(J,"Unknown state: "+J.state)}return J.position>=J.bufferCheckPosition&&_(J),J}v.parser=function($,J){return new m($,J)},v.SAXParser=m,v.SAXStream=x,v.createStream=y,v.MAX_BUFFER_LENGTH=65536;var Ee=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];v.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],f.default||(Object.create=function($){function J(){}return J.prototype=$,new J}),n.default||(Object.keys=function($){var J=[];for(var xe in $)$.hasOwnProperty(xe)&&J.push(xe);return J}),m.prototype={end:function(){V(this)},write:ye,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){g(this)}};var Ge;try{Ge=w("stream").Stream}catch($){Ge=function(){}}var Ue=v.EVENTS.filter(function($){return $!=="error"&&$!=="end"});x.prototype=(0,f.default)(Ge.prototype,{constructor:{value:x}}),x.prototype.write=function($){if(typeof T=="function"&&typeof T.isBuffer=="function"&&T.isBuffer($)){if(!this._decoder){var J=w("string_decoder").StringDecoder;this._decoder=new J("utf8")}$=this._decoder.write($)}return this._parser.write($.toString()),this.emit("data",$),!0},x.prototype.end=function($){return $&&$.length&&this.write($),this._parser.end(),!0},x.prototype.on=function($,J){var xe=this;return xe._parser["on"+$]||Ue.indexOf($)===-1||(xe._parser["on"+$]=function(){var ke=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);ke.splice(0,0,$),xe.emit.apply(xe,ke)}),Ge.prototype.on.call(xe,$,J)};var Fe="[CDATA[",He="DOCTYPE",be="http://www.w3.org/XML/1998/namespace",me="http://www.w3.org/2000/xmlns/",We={xml:be,xmlns:me},ze=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,nt=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,re=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,k=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,U=0;v.STATE={BEGIN:U++,BEGIN_WHITESPACE:U++,TEXT:U++,TEXT_ENTITY:U++,OPEN_WAKA:U++,SGML_DECL:U++,SGML_DECL_QUOTED:U++,DOCTYPE:U++,DOCTYPE_QUOTED:U++,DOCTYPE_DTD:U++,DOCTYPE_DTD_QUOTED:U++,COMMENT_STARTING:U++,COMMENT:U++,COMMENT_ENDING:U++,COMMENT_ENDED:U++,CDATA:U++,CDATA_ENDING:U++,CDATA_ENDING_2:U++,PROC_INST:U++,PROC_INST_BODY:U++,PROC_INST_ENDING:U++,OPEN_TAG:U++,OPEN_TAG_SLASH:U++,ATTRIB:U++,ATTRIB_NAME:U++,ATTRIB_NAME_SAW_WHITE:U++,ATTRIB_VALUE:U++,ATTRIB_VALUE_QUOTED:U++,ATTRIB_VALUE_CLOSED:U++,ATTRIB_VALUE_UNQUOTED:U++,ATTRIB_VALUE_ENTITY_Q:U++,ATTRIB_VALUE_ENTITY_U:U++,CLOSE_TAG:U++,CLOSE_TAG_SAW_WHITE:U++,SCRIPT:U++,SCRIPT_ENDING:U++},v.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},v.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},(0,n.default)(v.ENTITIES).forEach(function($){var J=v.ENTITIES[$],xe=typeof J=="number"?String.fromCharCode(J):J;v.ENTITIES[$]=xe});for(var q in v.STATE)v.STATE[v.STATE[q]]=q;U=v.STATE,p.default||function(){var $=String.fromCharCode,J=Math.floor,xe=function(){var ke,dt,Ne=[],je=-1,tt=arguments.length;if(!tt)return"";for(var mt="";++je1114111||J(Qe)!==Qe)throw RangeError("Invalid code point: "+Qe);Qe<=65535?Ne.push(Qe):(Qe-=65536,ke=55296+(Qe>>10),dt=Qe%1024+56320,Ne.push(ke,dt)),(je+1===tt||Ne.length>16384)&&(mt+=$.apply(null,Ne),Ne.length=0)}return mt};h.default?Object.defineProperty(String,"fromCodePoint",{value:xe,configurable:!0,writable:!0}):String.fromCodePoint=xe}()}(b===void 0?(void 0).sax={}:b)}).call(this,w("buffer").Buffer)},{"babel-runtime/core-js/json/stringify":17,"babel-runtime/core-js/object/create":19,"babel-runtime/core-js/object/define-property":20,"babel-runtime/core-js/object/keys":23,"babel-runtime/core-js/string/from-code-point":26,"babel-runtime/helpers/typeof":32,buffer:38,stream:195,string_decoder:37}],195:[function(w,P,b){function T(){C.call(this)}P.exports=T;var C=w("events").EventEmitter;w("inherits")(T,C),T.Readable=w("readable-stream/readable.js"),T.Writable=w("readable-stream/writable.js"),T.Duplex=w("readable-stream/duplex.js"),T.Transform=w("readable-stream/transform.js"),T.PassThrough=w("readable-stream/passthrough.js"),T.Stream=T,T.prototype.pipe=function(c,p){function d(t){c.writable&&c.write(t)===!1&&i.pause&&i.pause()}function o(){i.readable&&i.resume&&i.resume()}function a(){n||(n=!0,c.end())}function u(){n||(n=!0,typeof c.destroy=="function"&&c.destroy())}function s(t){if(h(),C.listenerCount(this,"error")===0)throw t}function h(){i.removeListener("data",d),c.removeListener("drain",o),i.removeListener("end",a),i.removeListener("close",u),i.removeListener("error",s),c.removeListener("error",s),i.removeListener("end",h),i.removeListener("close",h),c.removeListener("close",h)}var i=this;i.on("data",d),c.on("drain",o),c._isStdio||p&&p.end===!1||(i.on("end",a),i.on("close",u));var n=!1;return i.on("error",s),c.on("error",s),i.on("end",h),i.on("close",h),c.on("close",h),c.emit("pipe",i),c}},{events:158,inherits:162,"readable-stream/duplex.js":178,"readable-stream/passthrough.js":187,"readable-stream/readable.js":188,"readable-stream/transform.js":189,"readable-stream/writable.js":190}],196:[function(w,P,b){(function(T){var C=w("./lib/request"),c=w("./lib/response"),p=w("xtend"),d=w("builtin-status-codes"),o=w("url"),a=b;a.request=function(u,s){u=typeof u=="string"?o.parse(u):p(u);var h=T.location.protocol.search(/^https?:$/)===-1?"http:":"",i=u.protocol||h,n=u.hostname||u.host,t=u.port,f=u.path||"/";n&&n.indexOf(":")!==-1&&(n="["+n+"]"),u.url=(n?i+"//"+n:"")+(t?":"+t:"")+f,u.method=(u.method||"GET").toUpperCase(),u.headers=u.headers||{};var v=new C(u);return s&&v.on("response",s),v},a.get=function(u,s){var h=a.request(u,s);return h.end(),h},a.ClientRequest=C,a.IncomingMessage=c.IncomingMessage,a.Agent=function(){},a.Agent.defaultMaxSockets=4,a.globalAgent=new a.Agent,a.STATUS_CODES=d,a.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,typeof le!="undefined"?le:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./lib/request":198,"./lib/response":199,"builtin-status-codes":39,url:203,xtend:236}],197:[function(w,P,b){(function(T){"use strict";function C(){if(d!==void 0)return d;if(T.XMLHttpRequest){d=new T.XMLHttpRequest;try{d.open("GET",T.XDomainRequest?"/":"https://example.com")}catch(u){d=null}}else d=null;return d}function c(u){var s=C();if(!s)return!1;try{return s.responseType=u,s.responseType===u}catch(h){}return!1}function p(u){return typeof u=="function"}b.fetch=p(T.fetch)&&p(T.ReadableStream),b.writableStream=p(T.WritableStream),b.abortController=p(T.AbortController),b.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),b.blobConstructor=!0}catch(u){}var d,o=T.ArrayBuffer!==void 0,a=o&&p(T.ArrayBuffer.prototype.slice);b.arraybuffer=b.fetch||o&&c("arraybuffer"),b.msstream=!b.fetch&&a&&c("ms-stream"),b.mozchunkedarraybuffer=!b.fetch&&o&&c("moz-chunked-arraybuffer"),b.overrideMimeType=b.fetch||!!C()&&p(C().overrideMimeType),b.vbArray=p(T.VBArray),d=null}).call(this,typeof le!="undefined"?le:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],198:[function(w,P,b){(function(T,C,c){"use strict";function p(_,E){return u.fetch&&E?"fetch":u.mozchunkedarraybuffer?"moz-chunked-arraybuffer":u.msstream?"ms-stream":u.arraybuffer&&_?"arraybuffer":u.vbArray&&_?"text:vbarray":"text"}function d(_){try{var E=_.status;return E!==null&&E!==0}catch(g){return!1}}var o=w("babel-runtime/core-js/object/keys"),a=function(_){return _&&_.__esModule?_:{default:_}}(o),u=w("./capability"),s=w("inherits"),h=w("./response"),i=w("readable-stream"),n=w("to-arraybuffer"),t=h.IncomingMessage,f=h.readyStates,v=P.exports=function(_){var E=this;i.Writable.call(E),E._opts=_,E._body=[],E._headers={},_.auth&&E.setHeader("Authorization","Basic "+new c(_.auth).toString("base64")),(0,a.default)(_.headers).forEach(function(x){E.setHeader(x,_.headers[x])});var g,y=!0;if(_.mode==="disable-fetch"||"requestTimeout"in _&&!u.abortController)y=!1,g=!0;else if(_.mode==="prefer-streaming")g=!1;else if(_.mode==="allow-wrong-content-type")g=!u.overrideMimeType;else{if(_.mode&&_.mode!=="default"&&_.mode!=="prefer-fast")throw new Error("Invalid value for opts.mode");g=!0}E._mode=p(g,y),E._fetchTimer=null,E.on("finish",function(){E._onFinish()})};s(v,i.Writable),v.prototype.setHeader=function(_,E){var g=this,y=_.toLowerCase();m.indexOf(y)===-1&&(g._headers[y]={name:_,value:E})},v.prototype.getHeader=function(_){var E=this._headers[_.toLowerCase()];return E?E.value:null},v.prototype.removeHeader=function(_){delete this._headers[_.toLowerCase()]},v.prototype._onFinish=function(){var _=this;if(!_._destroyed){var E=_._opts,g=_._headers,y=null;E.method!=="GET"&&E.method!=="HEAD"&&(y=u.arraybuffer?n(c.concat(_._body)):u.blobConstructor?new C.Blob(_._body.map(function(A){return n(A)}),{type:(g["content-type"]||{}).value||""}):c.concat(_._body).toString());var x=[];if((0,a.default)(g).forEach(function(A){var D=g[A].name,I=g[A].value;Array.isArray(I)?I.forEach(function(B){x.push([D,B])}):x.push([D,I])}),_._mode==="fetch"){var l=null;if(u.abortController){var S=new AbortController;l=S.signal,_._fetchAbortController=S,"requestTimeout"in E&&E.requestTimeout!==0&&(_._fetchTimer=C.setTimeout(function(){_.emit("requestTimeout"),_._fetchAbortController&&_._fetchAbortController.abort()},E.requestTimeout))}C.fetch(_._opts.url,{method:_._opts.method,headers:x,body:y||void 0,mode:"cors",credentials:E.withCredentials?"include":"same-origin",signal:l}).then(function(A){_._fetchResponse=A,_._connect()},function(A){C.clearTimeout(_._fetchTimer),_._destroyed||_.emit("error",A)})}else{var O=_._xhr=new C.XMLHttpRequest;try{O.open(_._opts.method,_._opts.url,!0)}catch(A){return void T.nextTick(function(){_.emit("error",A)})}"responseType"in O&&(O.responseType=_._mode.split(":")[0]),"withCredentials"in O&&(O.withCredentials=!!E.withCredentials),_._mode==="text"&&"overrideMimeType"in O&&O.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in E&&(O.timeout=E.requestTimeout,O.ontimeout=function(){_.emit("requestTimeout")}),x.forEach(function(A){O.setRequestHeader(A[0],A[1])}),_._response=null,O.onreadystatechange=function(){switch(O.readyState){case f.LOADING:case f.DONE:_._onXHRProgress()}},_._mode==="moz-chunked-arraybuffer"&&(O.onprogress=function(){_._onXHRProgress()}),O.onerror=function(){_._destroyed||_.emit("error",new Error("XHR error"))};try{O.send(y)}catch(A){return void T.nextTick(function(){_.emit("error",A)})}}}},v.prototype._onXHRProgress=function(){var _=this;d(_._xhr)&&!_._destroyed&&(_._response||_._connect(),_._response._onXHRProgress())},v.prototype._connect=function(){var _=this;_._destroyed||(_._response=new t(_._xhr,_._fetchResponse,_._mode,_._fetchTimer),_._response.on("error",function(E){_.emit("error",E)}),_.emit("response",_._response))},v.prototype._write=function(_,E,g){this._body.push(_),g()},v.prototype.abort=v.prototype.destroy=function(){var _=this;_._destroyed=!0,C.clearTimeout(_._fetchTimer),_._response&&(_._response._destroyed=!0),_._xhr?_._xhr.abort():_._fetchAbortController&&_._fetchAbortController.abort()},v.prototype.end=function(_,E,g){var y=this;typeof _=="function"&&(g=_,_=void 0),i.Writable.prototype.end.call(y,_,E,g)},v.prototype.flushHeaders=function(){},v.prototype.setTimeout=function(){},v.prototype.setNoDelay=function(){},v.prototype.setSocketKeepAlive=function(){};var m=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"]}).call(this,w("_process"),typeof le!="undefined"?le:typeof self!="undefined"?self:typeof window!="undefined"?window:{},w("buffer").Buffer)},{"./capability":197,"./response":199,_process:173,"babel-runtime/core-js/object/keys":23,buffer:38,inherits:162,"readable-stream":188,"to-arraybuffer":202}],199:[function(w,P,b){(function(T,C,c){"use strict";var p=w("babel-runtime/core-js/promise"),d=function(i){return i&&i.__esModule?i:{default:i}}(p),o=w("./capability"),a=w("inherits"),u=w("readable-stream"),s=b.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},h=b.IncomingMessage=function(i,n,t,f){var v=this;if(u.Readable.call(v),v._mode=t,v.headers={},v.rawHeaders=[],v.trailers={},v.rawTrailers=[],v.on("end",function(){T.nextTick(function(){v.emit("close")})}),t==="fetch"){if(v._fetchResponse=n,v.url=n.url,v.statusCode=n.status,v.statusMessage=n.statusText,n.headers.forEach(function(y,x){v.headers[x.toLowerCase()]=y,v.rawHeaders.push(x,y)}),o.writableStream){var m=new WritableStream({write:function(y){return new d.default(function(x,l){v._destroyed?l():v.push(new c(y))?x():v._resumeFetch=x})},close:function(){C.clearTimeout(f),v._destroyed||v.push(null)},abort:function(y){v._destroyed||v.emit("error",y)}});try{return void n.body.pipeTo(m).catch(function(y){C.clearTimeout(f),v._destroyed||v.emit("error",y)})}catch(y){}}var _=n.body.getReader();!function y(){_.read().then(function(x){if(!v._destroyed){if(x.done)return C.clearTimeout(f),void v.push(null);v.push(new c(x.value)),y()}}).catch(function(x){C.clearTimeout(f),v._destroyed||v.emit("error",x)})}()}else if(v._xhr=i,v._pos=0,v.url=i.responseURL,v.statusCode=i.status,v.statusMessage=i.statusText,i.getAllResponseHeaders().split(/\r?\n/).forEach(function(y){var x=y.match(/^([^:]+):\s*(.*)/);if(x){var l=x[1].toLowerCase();l==="set-cookie"?(v.headers[l]===void 0&&(v.headers[l]=[]),v.headers[l].push(x[2])):v.headers[l]!==void 0?v.headers[l]+=", "+x[2]:v.headers[l]=x[2],v.rawHeaders.push(x[1],x[2])}}),v._charset="x-user-defined",!o.overrideMimeType){var E=v.rawHeaders["mime-type"];if(E){var g=E.match(/;\s*charset=([^;])(;|$)/);g&&(v._charset=g[1].toLowerCase())}v._charset||(v._charset="utf-8")}};a(h,u.Readable),h.prototype._read=function(){var i=this,n=i._resumeFetch;n&&(i._resumeFetch=null,n())},h.prototype._onXHRProgress=function(){var i=this,n=i._xhr,t=null;switch(i._mode){case"text:vbarray":if(n.readyState!==s.DONE)break;try{t=new C.VBArray(n.responseBody).toArray()}catch(E){}if(t!==null){i.push(new c(t));break}case"text":try{t=n.responseText}catch(E){i._mode="text:vbarray";break}if(t.length>i._pos){var f=t.substr(i._pos);if(i._charset==="x-user-defined"){for(var v=new c(f.length),m=0;mi._pos&&(i.push(new c(new Uint8Array(_.result.slice(i._pos)))),i._pos=_.result.byteLength)},_.onload=function(){i.push(null)},_.readAsArrayBuffer(t)}i._xhr.readyState===s.DONE&&i._mode!=="ms-stream"&&i.push(null)}}).call(this,w("_process"),typeof le!="undefined"?le:typeof self!="undefined"?self:typeof window!="undefined"?window:{},w("buffer").Buffer)},{"./capability":197,_process:173,"babel-runtime/core-js/promise":24,buffer:38,inherits:162,"readable-stream":188}],200:[function(w,P,b){"use strict";function T(E){if(!E)return"utf8";for(var g;;)switch(E){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return E;default:if(g)return;E=(""+E).toLowerCase(),g=!0}}function C(E){var g=T(E);if(typeof g!="string"&&(m.isEncoding===_||!_(E)))throw new Error("Unknown encoding: "+E);return g||E}function c(E){this.encoding=C(E);var g;switch(this.encoding){case"utf16le":this.text=h,this.end=i,g=4;break;case"utf8":this.fillLast=a,g=4;break;case"base64":this.text=n,this.end=t,g=3;break;default:return this.write=f,void(this.end=v)}this.lastNeed=0,this.lastTotal=0,this.lastChar=m.allocUnsafe(g)}function p(E){return E<=127?0:E>>5==6?2:E>>4==14?3:E>>3==30?4:E>>6==2?-1:-2}function d(E,g,y){var x=g.length-1;if(x=0?(l>0&&(E.lastNeed=l-1),l):--x=0?(l>0&&(E.lastNeed=l-2),l):--x=0?(l>0&&(l===2?l=0:E.lastNeed=l-3),l):0)}function o(E,g,y){if((192&g[0])!=128)return E.lastNeed=0,"\u951F\uFFFD";if(E.lastNeed>1&&g.length>1){if((192&g[1])!=128)return E.lastNeed=1,"\u951F\uFFFD";if(E.lastNeed>2&&g.length>2&&(192&g[2])!=128)return E.lastNeed=2,"\u951F\uFFFD"}}function a(E){var g=this.lastTotal-this.lastNeed,y=o(this,E,g);return y!==void 0?y:this.lastNeed<=E.length?(E.copy(this.lastChar,g,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(E.copy(this.lastChar,g,0,E.length),void(this.lastNeed-=E.length))}function u(E,g){var y=d(this,E,g);if(!this.lastNeed)return E.toString("utf8",g);this.lastTotal=y;var x=E.length-(y-this.lastNeed);return E.copy(this.lastChar,0,x),E.toString("utf8",g,x)}function s(E){var g=E&&E.length?this.write(E):"";return this.lastNeed?g+"\u951F\uFFFD":g}function h(E,g){if((E.length-g)%2==0){var y=E.toString("utf16le",g);if(y){var x=y.charCodeAt(y.length-1);if(x>=55296&&x<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=E[E.length-2],this.lastChar[1]=E[E.length-1],y.slice(0,-1)}return y}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=E[E.length-1],E.toString("utf16le",g,E.length-1)}function i(E){var g=E&&E.length?this.write(E):"";if(this.lastNeed){var y=this.lastTotal-this.lastNeed;return g+this.lastChar.toString("utf16le",0,y)}return g}function n(E,g){var y=(E.length-g)%3;return y===0?E.toString("base64",g):(this.lastNeed=3-y,this.lastTotal=3,y===1?this.lastChar[0]=E[E.length-1]:(this.lastChar[0]=E[E.length-2],this.lastChar[1]=E[E.length-1]),E.toString("base64",g,E.length-y))}function t(E){var g=E&&E.length?this.write(E):"";return this.lastNeed?g+this.lastChar.toString("base64",0,3-this.lastNeed):g}function f(E){return E.toString(this.encoding)}function v(E){return E&&E.length?this.write(E):""}var m=w("safe-buffer").Buffer,_=m.isEncoding||function(E){switch((E=""+E)&&E.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};b.StringDecoder=c,c.prototype.write=function(E){if(E.length===0)return"";var g,y;if(this.lastNeed){if((g=this.fillLast(E))===void 0)return"";y=this.lastNeed,this.lastNeed=0}else y=0;return y=0&&(s._idleTimeoutId=setTimeout(function(){s._onTimeout&&s._onTimeout()},h))},b.setImmediate=typeof T=="function"?T:function(s){var h=u++,i=!(arguments.length<2)&&o.call(arguments,1);return a[h]=!0,p(function(){a[h]&&(i?s.apply(null,i):s.call(null),b.clearImmediate(h))}),h},b.clearImmediate=typeof C=="function"?C:function(s){delete a[s]}}).call(this,w("timers").setImmediate,w("timers").clearImmediate)},{"process/browser.js":173,timers:201}],202:[function(w,P,b){var T=w("buffer").Buffer;P.exports=function(C){if(C instanceof Uint8Array){if(C.byteOffset===0&&C.byteLength===C.buffer.byteLength)return C.buffer;if(typeof C.buffer.slice=="function")return C.buffer.slice(C.byteOffset,C.byteOffset+C.byteLength)}if(T.isBuffer(C)){for(var c=new Uint8Array(C.length),p=C.length,d=0;d",'"',"`"," ","\r",`
`," "],n=["{","}","|","\\","^","`"].concat(i),t=["'"].concat(n),f=["%","/","?",";","#"].concat(t),v=["/","?","#"],m=/^[+a-z0-9A-Z_-]{0,63}$/,_=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,E={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},x=w("querystring");T.prototype.parse=function(l,S,O){if(!a.isString(l))throw new TypeError("Parameter 'url' must be a string, not "+typeof l);var A=l.indexOf("?"),D=A!==-1&&A127?Ee+="x":Ee+=ye[Ge];if(!Ee.match(m)){var Fe=Se.slice(0,Y),He=Se.slice(Y+1),be=ye.match(_);be&&(Fe.push(be[1]),He.unshift(be[2])),He.length&&(H="/"+He.join(".")+H),this.hostname=Fe.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),Ce||(this.hostname=o.toASCII(this.hostname));var me=this.port?":"+this.port:"",We=this.hostname||"";this.host=We+me,this.href+=this.host,Ce&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),H[0]!=="/"&&(H="/"+H))}if(!E[V])for(var Y=0,Pe=t.length;Y0)&&O.host.split("@");Ee&&(O.auth=Ee.shift(),O.host=O.hostname=Ee.shift())}return O.search=l.search,O.query=l.query,a.isNull(O.pathname)&&a.isNull(O.search)||(O.path=(O.pathname?O.pathname:"")+(O.search?O.search:"")),O.href=O.format(),O}if(!Se.length)return O.pathname=null,O.search?O.path="/"+O.search:O.path=null,O.href=O.format(),O;for(var Ge=Se.slice(-1)[0],Ue=(O.host||l.host||Se.length>1)&&(Ge==="."||Ge==="..")||Ge==="",Fe=0,He=Se.length;He>=0;He--)Ge=Se[He],Ge==="."?Se.splice(He,1):Ge===".."?(Se.splice(He,1),Fe++):Fe&&(Se.splice(He,1),Fe--);if(!de&&!Ce)for(;Fe--;Fe)Se.unshift("..");!de||Se[0]===""||Se[0]&&Se[0].charAt(0)==="/"||Se.unshift(""),Ue&&Se.join("/").substr(-1)!=="/"&&Se.push("");var be=Se[0]===""||Se[0]&&Se[0].charAt(0)==="/";if(ye){O.hostname=O.host=be?"":Se.length?Se.shift():"";var Ee=!!(O.host&&O.host.indexOf("@")>0)&&O.host.split("@");Ee&&(O.auth=Ee.shift(),O.host=O.hostname=Ee.shift())}return de=de||O.host&&Se.length,de&&!be&&Se.unshift(""),Se.length?O.pathname=Se.join("/"):(O.pathname=null,O.path=null),a.isNull(O.pathname)&&a.isNull(O.search)||(O.path=(O.pathname?O.pathname:"")+(O.search?O.search:"")),O.auth=l.auth||O.auth,O.slashes=O.slashes||l.slashes,O.href=O.format(),O},T.prototype.parseHost=function(){var l=this.host,S=s.exec(l);S&&(S=S[0],S!==":"&&(this.port=S.substr(1)),l=l.substr(0,l.length-S.length)),l&&(this.hostname=l)}},{"./util":204,punycode:174,querystring:177}],204:[function(w,P,b){"use strict";P.exports={isString:function(T){return typeof T=="string"},isObject:function(T){return typeof T=="object"&&T!==null},isNull:function(T){return T===null},isNullOrUndefined:function(T){return T==null}}},{}],205:[function(w,P,b){(function(T){function C(p,d){function o(){if(!a){if(c("throwDeprecation"))throw new Error(d);c("traceDeprecation")?console.trace(d):console.warn(d),a=!0}return p.apply(this,arguments)}if(c("noDeprecation"))return p;var a=!1;return o}function c(p){try{if(!T.localStorage)return!1}catch(o){return!1}var d=T.localStorage[p];return d!=null&&String(d).toLowerCase()==="true"}P.exports=C}).call(this,typeof le!="undefined"?le:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],206:[function(w,P,b){P.exports=function(T){return T&&typeof T=="object"&&typeof T.copy=="function"&&typeof T.fill=="function"&&typeof T.readUInt8=="function"}},{}],207:[function(w,P,b){(function(T,C){function c(Y,ee){var ce={seen:[],stylize:d};return arguments.length>=3&&(ce.depth=arguments[2]),arguments.length>=4&&(ce.colors=arguments[3]),f(ee)?ce.showHidden=ee:ee&&b._extend(ce,ee),y(ce.showHidden)&&(ce.showHidden=!1),y(ce.depth)&&(ce.depth=2),y(ce.colors)&&(ce.colors=!1),y(ce.customInspect)&&(ce.customInspect=!0),ce.colors&&(ce.stylize=p),a(ce,Y,ce.depth)}function p(Y,ee){var ce=c.styles[ee];return ce?"["+c.colors[ce][0]+"m"+Y+"["+c.colors[ce][1]+"m":Y}function d(Y,ee){return Y}function o(Y){var ee={};return Y.forEach(function(ce,de){ee[ce]=!0}),ee}function a(Y,ee,ce){if(Y.customInspect&&ee&&A(ee.inspect)&&ee.inspect!==b.inspect&&(!ee.constructor||ee.constructor.prototype!==ee)){var de=ee.inspect(ce,Y);return E(de)||(de=a(Y,de,ce)),de}var Ce=u(Y,ee);if(Ce)return Ce;var Se=Object.keys(ee),Pe=o(Se);if(Y.showHidden&&(Se=Object.getOwnPropertyNames(ee)),O(ee)&&(Se.indexOf("message")>=0||Se.indexOf("description")>=0))return s(ee);if(Se.length===0){if(A(ee)){var ye=ee.name?": "+ee.name:"";return Y.stylize("[Function"+ye+"]","special")}if(x(ee))return Y.stylize(RegExp.prototype.toString.call(ee),"regexp");if(S(ee))return Y.stylize(Date.prototype.toString.call(ee),"date");if(O(ee))return s(ee)}var Ee="",Ge=!1,Ue=["{","}"];if((t(ee)&&(Ge=!0,Ue=["[","]"]),A(ee))&&(Ee=" [Function"+(ee.name?": "+ee.name:"")+"]"),x(ee)&&(Ee=" "+RegExp.prototype.toString.call(ee)),S(ee)&&(Ee=" "+Date.prototype.toUTCString.call(ee)),O(ee)&&(Ee=" "+s(ee)),Se.length===0&&(!Ge||ee.length==0))return Ue[0]+Ee+Ue[1];if(ce<0)return x(ee)?Y.stylize(RegExp.prototype.toString.call(ee),"regexp"):Y.stylize("[Object]","special");Y.seen.push(ee);var Fe;return Fe=Ge?h(Y,ee,ce,Pe,Se):Se.map(function(He){return i(Y,ee,ce,Pe,He,Ge)}),Y.seen.pop(),n(Fe,Ee,Ue)}function u(Y,ee){if(y(ee))return Y.stylize("undefined","undefined");if(E(ee)){var ce="'"+JSON.stringify(ee).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return Y.stylize(ce,"string")}return _(ee)?Y.stylize(""+ee,"number"):f(ee)?Y.stylize(""+ee,"boolean"):v(ee)?Y.stylize("null","null"):void 0}function s(Y){return"["+Error.prototype.toString.call(Y)+"]"}function h(Y,ee,ce,de,Ce){for(var Se=[],Pe=0,ye=ee.length;Pe-1&&(ye=Se?ye.split(`
`).map(function(Ge){return" "+Ge}).join(`
`).substr(2):`
`+ye.split(`
`).map(function(Ge){return" "+Ge}).join(`
`))):ye=Y.stylize("[Circular]","special")),y(Pe)){if(Se&&Ce.match(/^\d+$/))return ye;Pe=JSON.stringify(""+Ce),Pe.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(Pe=Pe.substr(1,Pe.length-2),Pe=Y.stylize(Pe,"name")):(Pe=Pe.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),Pe=Y.stylize(Pe,"string"))}return Pe+": "+ye}function n(Y,ee,ce){var de=0;return Y.reduce(function(Ce,Se){return de++,Se.indexOf(`
`)>=0&&de++,Ce+Se.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?ce[0]+(ee===""?"":ee+`
`)+" "+Y.join(`,
`)+" "+ce[1]:ce[0]+ee+" "+Y.join(", ")+" "+ce[1]}function t(Y){return Array.isArray(Y)}function f(Y){return typeof Y=="boolean"}function v(Y){return Y===null}function m(Y){return Y==null}function _(Y){return typeof Y=="number"}function E(Y){return typeof Y=="string"}function g(Y){return typeof Y=="symbol"}function y(Y){return Y===void 0}function x(Y){return l(Y)&&I(Y)==="[object RegExp]"}function l(Y){return typeof Y=="object"&&Y!==null}function S(Y){return l(Y)&&I(Y)==="[object Date]"}function O(Y){return l(Y)&&(I(Y)==="[object Error]"||Y instanceof Error)}function A(Y){return typeof Y=="function"}function D(Y){return Y===null||typeof Y=="boolean"||typeof Y=="number"||typeof Y=="string"||typeof Y=="symbol"||Y===void 0}function I(Y){return Object.prototype.toString.call(Y)}function B(Y){return Y<10?"0"+Y.toString(10):Y.toString(10)}function H(){var Y=new Date,ee=[B(Y.getHours()),B(Y.getMinutes()),B(Y.getSeconds())].join(":");return[Y.getDate(),ne[Y.getMonth()],ee].join(" ")}function te(Y,ee){return Object.prototype.hasOwnProperty.call(Y,ee)}var W=/%[sdj%]/g;b.format=function(Y){if(!E(Y)){for(var ee=[],ce=0;ce=Ce)return Ee;switch(Ee){case"%s":return String(de[ce++]);case"%d":return Number(de[ce++]);case"%j":try{return JSON.stringify(de[ce++])}catch(Ge){return"[Circular]"}default:return Ee}}),Pe=de[ce];ce=0||n.indexOf(">")>=0||n.indexOf("<")>=0)},h=function(n){return""},u=function(n){return n.replace("]]>","]]]]>")},b.Builder=function(){function n(t){var f,v,m;this.options={},v=a[.2];for(f in v)i.call(v,f)&&(m=v[f],this.options[f]=m);for(f in t)i.call(t,f)&&(m=t[f],this.options[f]=m)}return n.prototype.buildObject=function(t){var f,v,m,_,E;return f=this.options.attrkey,v=this.options.charkey,(0,d.default)(t).length===1&&this.options.rootName===a[.2].rootName?(E=(0,d.default)(t)[0],t=t[E]):E=this.options.rootName,m=function(g){return function(y,x){var l,S,O,A,D,I;if((x===void 0?"undefined":(0,c.default)(x))!=="object")g.options.cdata&&s(x)?y.raw(h(x)):y.txt(x);else if(Array.isArray(x)){for(A in x)if(i.call(x,A)){S=x[A];for(D in S)O=S[D],y=m(y.ele(D),O).up()}}else for(D in x)if(i.call(x,D))if(S=x[D],D===f){if((S===void 0?"undefined":(0,c.default)(S))==="object")for(l in S)I=S[l],y=y.att(l,I)}else if(D===v)y=g.options.cdata&&s(S)?y.raw(h(S)):y.txt(S);else if(Array.isArray(S))for(A in S)i.call(S,A)&&(O=S[A],y=typeof O=="string"?g.options.cdata&&s(O)?y.ele(D).raw(h(O)).up():y.ele(D,O).up():m(y.ele(D),O).up());else(S===void 0?"undefined":(0,c.default)(S))==="object"?y=m(y.ele(D),S).up():typeof S=="string"&&g.options.cdata&&s(S)?y=y.ele(D).raw(h(S)).up():(S==null&&(S=""),y=y.ele(D,S.toString()).up());return y}}(this),_=o.create(E,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),m(_,t).end(this.options.renderOpts)},n}()}).call(void 0)},{"./defaults":210,"babel-runtime/core-js/object/keys":23,"babel-runtime/helpers/typeof":32,xmlbuilder:235}],210:[function(w,P,b){"use strict";(function(){b.defaults={.1:{explicitCharkey:!1,trim:!0,normalize:!0,normalizeTags:!1,attrkey:"@",charkey:"#",explicitArray:!1,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!1,validator:null,xmlns:!1,explicitChildren:!1,childkey:"@@",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},.2:{explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:"$",charkey:"_",explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:null,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:null,renderOpts:{pretty:!0,indent:" ",newline:`
`},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}).call(void 0)},{}],211:[function(w,P,b){"use strict";function T(u){return u&&u.__esModule?u:{default:u}}var C=w("babel-runtime/core-js/object/get-own-property-names"),c=T(C),p=w("babel-runtime/core-js/object/keys"),d=T(p),o=w("babel-runtime/helpers/typeof"),a=T(o);(function(){var u,s,h,i,n,t,f,v,m=function(g,y){return function(){return g.apply(y,arguments)}},_=function(g,y){function x(){this.constructor=g}for(var l in y)E.call(y,l)&&(g[l]=y[l]);return x.prototype=y.prototype,g.prototype=new x,g.__super__=y.prototype,g},E={}.hasOwnProperty;f=w("sax"),h=w("events"),u=w("./bom"),t=w("./processors"),v=w("timers").setImmediate,s=w("./defaults").defaults,i=function(g){return(g===void 0?"undefined":(0,a.default)(g))==="object"&&g!=null&&(0,d.default)(g).length===0},n=function(g,y,x){var l,S,O;for(l=0,S=g.length;l0&&(H[A.options.childkey]=W),W=H;return O.length>0?A.assignOrPush(ne,te,W):(A.options.explicitRoot&&(X=W,W={},W[te]=X),A.resultObject=W,A.saxParser.ended=!0,A.emit("end",A.resultObject))}}(this),S=function(A){return function(D){var I,B;if(B=O[O.length-1])return B[l]+=D,A.options.explicitChildren&&A.options.preserveChildrenOrder&&A.options.charsAsChildren&&(A.options.includeWhiteChars||D.replace(/\\n/g,"").trim()!=="")&&(B[A.options.childkey]=B[A.options.childkey]||[],I={"#name":"__text__"},I[l]=D,A.options.normalize&&(I[l]=I[l].replace(/\s{2,}/g," ").trim()),B[A.options.childkey].push(I)),B}}(this),this.saxParser.ontext=S,this.saxParser.oncdata=function(A){return function(D){var I;if(I=S(D))return I.cdata=!0}}()},y.prototype.parseString=function(x,l){var S;l!=null&&typeof l=="function"&&(this.on("end",function(O){return this.reset(),l(null,O)}),this.on("error",function(O){return this.reset(),l(O)}));try{return x=x.toString(),x.trim()===""?(this.emit("end",null),!0):(x=u.stripBOM(x),this.options.async?(this.remaining=x,v(this.processAsync),this.saxParser):this.saxParser.write(x).close())}catch(O){if(S=O,!this.saxParser.errThrown&&!this.saxParser.ended)return this.emit("error",S),this.saxParser.errThrown=!0;if(this.saxParser.ended)throw S}},y}(h.EventEmitter),b.parseString=function(g,y,x){var l,S,O;return x!=null?(typeof x=="function"&&(l=x),(y===void 0?"undefined":(0,a.default)(y))==="object"&&(S=y)):(typeof y=="function"&&(l=y),S={}),O=new b.Parser(S),O.parseString(g,l)}}).call(void 0)},{"./bom":208,"./defaults":210,"./processors":212,"babel-runtime/core-js/object/get-own-property-names":21,"babel-runtime/core-js/object/keys":23,"babel-runtime/helpers/typeof":32,events:158,sax:194,timers:201}],212:[function(w,P,b){"use strict";(function(){var T;T=new RegExp(/(?!xmlns)^.*:/),b.normalize=function(C){return C.toLowerCase()},b.firstCharLowerCase=function(C){return C.charAt(0).toLowerCase()+C.slice(1)},b.stripPrefix=function(C){return C.replace(T,"")},b.parseNumbers=function(C){return isNaN(C)||(C=C%1==0?parseInt(C,10):parseFloat(C)),C},b.parseBooleans=function(C){return/^(?:true|false)$/i.test(C)&&(C=C.toLowerCase()==="true"),C}}).call(void 0)},{}],213:[function(w,P,b){"use strict";(function(){var T,C,c,p,d=function(a,u){function s(){this.constructor=a}for(var h in u)o.call(u,h)&&(a[h]=u[h]);return s.prototype=u.prototype,a.prototype=new s,a.__super__=u.prototype,a},o={}.hasOwnProperty;C=w("./defaults"),T=w("./builder"),c=w("./parser"),p=w("./processors"),b.defaults=C.defaults,b.processors=p,b.ValidationError=function(a){function u(s){this.message=s}return d(u,a),u}(Error),b.Builder=T.Builder,b.Parser=c.Parser,b.parseString=c.parseString}).call(void 0)},{"./builder":209,"./defaults":210,"./parser":211,"./processors":212}],214:[function(w,P,b){"use strict";function T(u){return u&&u.__esModule?u:{default:u}}var C=w("babel-runtime/core-js/object/get-prototype-of"),c=T(C),p=w("babel-runtime/helpers/typeof"),d=T(p),o=w("babel-runtime/core-js/object/assign"),a=T(o);(function(){var u,s,h,i,n,t,f=[].slice,v={}.hasOwnProperty;u=function(){var m,_,E,g,y,x;if(x=arguments[0],y=2<=arguments.length?f.call(arguments,1):[],i(a.default))a.default.apply(null,arguments);else for(m=0,E=y.length;m=0;)this.up();return this.onEnd()},x.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},x.prototype.openNode=function(l){if(!l.isOpen)return!this.root&&this.currentLevel===0&&l instanceof h&&(this.root=l),this.onData(this.writer.openNode(l,this.currentLevel)),l.isOpen=!0},x.prototype.closeNode=function(l){if(!l.isClosed)return this.onData(this.writer.closeNode(l,this.currentLevel)),l.isClosed=!0},x.prototype.onData=function(l){return this.documentStarted=!0,this.onDataCallback(l)},x.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},x.prototype.ele=function(){return this.element.apply(this,arguments)},x.prototype.nod=function(l,S,O){return this.node(l,S,O)},x.prototype.txt=function(l){return this.text(l)},x.prototype.dat=function(l){return this.cdata(l)},x.prototype.com=function(l){return this.comment(l)},x.prototype.ins=function(l,S){return this.instruction(l,S)},x.prototype.dec=function(l,S,O){return this.declaration(l,S,O)},x.prototype.dtd=function(l,S,O){return this.doctype(l,S,O)},x.prototype.e=function(l,S,O){return this.element(l,S,O)},x.prototype.n=function(l,S,O){return this.node(l,S,O)},x.prototype.t=function(l){return this.text(l)},x.prototype.d=function(l){return this.cdata(l)},x.prototype.c=function(l){return this.comment(l)},x.prototype.r=function(l){return this.raw(l)},x.prototype.i=function(l,S){return this.instruction(l,S)},x.prototype.att=function(){return this.currentNode&&this.currentNode instanceof s?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},x.prototype.a=function(){return this.currentNode&&this.currentNode instanceof s?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},x.prototype.ent=function(l,S){return this.entity(l,S)},x.prototype.pent=function(l,S){return this.pEntity(l,S)},x.prototype.not=function(l,S){return this.notation(l,S)},x}()}).call(void 0)},{"./Utility":214,"./XMLAttribute":215,"./XMLCData":216,"./XMLComment":217,"./XMLDTDAttList":218,"./XMLDTDElement":219,"./XMLDTDEntity":220,"./XMLDTDNotation":221,"./XMLDeclaration":222,"./XMLDocType":223,"./XMLElement":226,"./XMLProcessingInstruction":228,"./XMLRaw":229,"./XMLStringWriter":231,"./XMLStringifier":232,"./XMLText":233}],226:[function(w,P,b){"use strict";var T=w("babel-runtime/core-js/object/create"),C=function(c){return c&&c.__esModule?c:{default:c}}(T);(function(){var c,p,d,o,a,u=function(h,i){function n(){this.constructor=h}for(var t in i)s.call(i,t)&&(h[t]=i[t]);return n.prototype=i.prototype,h.prototype=new n,h.__super__=i.prototype,h},s={}.hasOwnProperty;a=w("./Utility"),o=a.isObject,d=a.isFunction,p=w("./XMLNode"),c=w("./XMLAttribute"),P.exports=function(h){function i(n,t,f){if(i.__super__.constructor.call(this,n),t==null)throw new Error("Missing element name");this.name=this.stringify.eleName(t),this.attributes={},f!=null&&this.attribute(f),n.isDocument&&(this.isRoot=!0,this.documentObject=n,n.rootObject=this)}return u(i,h),i.prototype.clone=function(){var n,t,f,v;f=(0,C.default)(this),f.isRoot&&(f.documentObject=null),f.attributes={},v=this.attributes;for(t in v)s.call(v,t)&&(n=v[t],f.attributes[t]=n.clone());return f.children=[],this.children.forEach(function(m){var _;return _=m.clone(),_.parent=f,f.children.push(_)}),f},i.prototype.attribute=function(n,t){var f,v;if(n!=null&&(n=n.valueOf()),o(n))for(f in n)s.call(n,f)&&(v=n[f],this.attribute(f,v));else d(t)&&(t=t.apply()),this.options.skipNullAttributes&&t==null||(this.attributes[n]=new c(this,n,t));return this},i.prototype.removeAttribute=function(n){var t,f,v;if(n==null)throw new Error("Missing attribute name");if(n=n.valueOf(),Array.isArray(n))for(f=0,v=n.length;f"+this.endline(E))},_.prototype.comment=function(E,g){return this.stream.write(this.space(g)+""+this.endline(E))},_.prototype.declaration=function(E,g){return this.stream.write(this.space(g)),this.stream.write('"),this.stream.write(this.endline(E))},_.prototype.docType=function(E,g){var y,x,l,S;if(g||(g=0),this.stream.write(this.space(g)),this.stream.write("0){for(this.stream.write(" ["),this.stream.write(this.endline(E)),S=E.children,x=0,l=S.length;x"),this.stream.write(this.endline(E))},_.prototype.element=function(E,g){var y,x,l,S,O,A,D,I;g||(g=0),I=this.space(g),this.stream.write(I+"<"+E.name),A=E.attributes;for(O in A)v.call(A,O)&&(y=A[O],this.attribute(y));if(E.children.length===0||E.children.every(function(B){return B.value===""}))this.allowEmpty?this.stream.write(">"+E.name+">"):this.stream.write(this.spacebeforeslash+"/>");else if(this.pretty&&E.children.length===1&&E.children[0].value!=null)this.stream.write(">"),this.stream.write(E.children[0].value),this.stream.write(""+E.name+">");else{for(this.stream.write(">"+this.newline),D=E.children,l=0,S=D.length;l")}return this.stream.write(this.endline(E))},_.prototype.processingInstruction=function(E,g){return this.stream.write(this.space(g)+""+E.target),E.value&&this.stream.write(" "+E.value),this.stream.write(this.spacebeforeslash+"?>"+this.endline(E))},_.prototype.raw=function(E,g){return this.stream.write(this.space(g)+E.value+this.endline(E))},_.prototype.text=function(E,g){return this.stream.write(this.space(g)+E.value+this.endline(E))},_.prototype.dtdAttList=function(E,g){return this.stream.write(this.space(g)+""+this.endline(E))},_.prototype.dtdElement=function(E,g){return this.stream.write(this.space(g)+""+this.endline(E))},_.prototype.dtdEntity=function(E,g){return this.stream.write(this.space(g)+""+this.endline(E))},_.prototype.dtdNotation=function(E,g){return this.stream.write(this.space(g)+""+this.endline(E))},_.prototype.endline=function(E){return E.isLastRootNode?"":this.newline},_}(t)}).call(void 0)},{"./XMLCData":216,"./XMLComment":217,"./XMLDTDAttList":218,"./XMLDTDElement":219,"./XMLDTDEntity":220,"./XMLDTDNotation":221,"./XMLDeclaration":222,"./XMLDocType":223,"./XMLElement":226,"./XMLProcessingInstruction":228,"./XMLRaw":229,"./XMLText":233,"./XMLWriterBase":234}],231:[function(w,P,b){"use strict";(function(){var T,C,c,p,d,o,a,u,s,h,i,n,t,f=function(m,_){function E(){this.constructor=m}for(var g in _)v.call(_,g)&&(m[g]=_[g]);return E.prototype=_.prototype,m.prototype=new E,m.__super__=_.prototype,m},v={}.hasOwnProperty;a=w("./XMLDeclaration"),u=w("./XMLDocType"),T=w("./XMLCData"),C=w("./XMLComment"),s=w("./XMLElement"),i=w("./XMLRaw"),n=w("./XMLText"),h=w("./XMLProcessingInstruction"),c=w("./XMLDTDAttList"),p=w("./XMLDTDElement"),d=w("./XMLDTDEntity"),o=w("./XMLDTDNotation"),t=w("./XMLWriterBase"),P.exports=function(m){function _(E){_.__super__.constructor.call(this,E)}return f(_,m),_.prototype.document=function(E){var g,y,x,l,S;for(this.textispresent=!1,l="",S=E.children,y=0,x=S.length;y"+this.newline},_.prototype.comment=function(E,g){return this.space(g)+""+this.newline},_.prototype.declaration=function(E,g){var y;return y=this.space(g),y+='",y+=this.newline},_.prototype.docType=function(E,g){var y,x,l,S,O;if(g||(g=0),S=this.space(g),S+="0){for(S+=" [",S+=this.newline,O=E.children,x=0,l=O.length;x",S+=this.newline},_.prototype.element=function(E,g){var y,x,l,S,O,A,D,I,B,H,te,W,V;g||(g=0),V=!1,this.textispresent?(this.newline="",this.pretty=!1):(this.newline=this.newlinedefault,this.pretty=this.prettydefault),W=this.space(g),I="",I+=W+"<"+E.name,B=E.attributes;for(D in B)v.call(B,D)&&(y=B[D],I+=this.attribute(y));if(E.children.length===0||E.children.every(function(X){return X.value===""}))this.allowEmpty?I+=">"+E.name+">"+this.newline:I+=this.spacebeforeslash+"/>"+this.newline;else if(this.pretty&&E.children.length===1&&E.children[0].value!=null)I+=">",I+=E.children[0].value,I+=""+E.name+">"+this.newline;else{if(this.dontprettytextnodes){for(H=E.children,l=0,O=H.length;l"+this.newline,te=E.children,S=0,A=te.length;S"+this.newline}return I},_.prototype.processingInstruction=function(E,g){var y;return y=this.space(g)+""+E.target,E.value&&(y+=" "+E.value),y+=this.spacebeforeslash+"?>"+this.newline},_.prototype.raw=function(E,g){return this.space(g)+E.value+this.newline},_.prototype.text=function(E,g){return this.space(g)+E.value+this.newline},_.prototype.dtdAttList=function(E,g){var y;return y=this.space(g)+""+this.newline},_.prototype.dtdElement=function(E,g){return this.space(g)+""+this.newline},_.prototype.dtdEntity=function(E,g){var y;return y=this.space(g)+""+this.newline},_.prototype.dtdNotation=function(E,g){var y;return y=this.space(g)+""+this.newline},_.prototype.openNode=function(E,g){var y,x,l,S;if(g||(g=0),E instanceof s){l=this.space(g)+"<"+E.name,S=E.attributes;for(x in S)v.call(S,x)&&(y=S[x],l+=this.attribute(y));return l+=(E.children?">":"/>")+this.newline}return l=this.space(g)+"")+this.newline},_.prototype.closeNode=function(E,g){switch(g||(g=0),!1){case!(E instanceof s):return this.space(g)+""+E.name+">"+this.newline;case!(E instanceof u):return this.space(g)+"]>"+this.newline}},_}(t)}).call(void 0)},{"./XMLCData":216,"./XMLComment":217,"./XMLDTDAttList":218,"./XMLDTDElement":219,"./XMLDTDEntity":220,"./XMLDTDNotation":221,"./XMLDeclaration":222,"./XMLDocType":223,"./XMLElement":226,"./XMLProcessingInstruction":228,"./XMLRaw":229,"./XMLText":233,"./XMLWriterBase":234}],232:[function(w,P,b){"use strict";(function(){var T=function(c,p){return function(){return c.apply(p,arguments)}},C={}.hasOwnProperty;P.exports=function(){function c(p){this.assertLegalChar=T(this.assertLegalChar,this);var d,o,a;p||(p={}),this.noDoubleEncoding=p.noDoubleEncoding,o=p.stringify||{};for(d in o)C.call(o,d)&&(a=o[d],this[d]=a)}return c.prototype.eleName=function(p){return p=""+p||"",this.assertLegalChar(p)},c.prototype.eleText=function(p){return p=""+p||"",this.assertLegalChar(this.elEscape(p))},c.prototype.cdata=function(p){return p=""+p||"",p=p.replace("]]>","]]]]>"),this.assertLegalChar(p)},c.prototype.comment=function(p){if(p=""+p||"",p.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+p);return this.assertLegalChar(p)},c.prototype.raw=function(p){return""+p||""},c.prototype.attName=function(p){return p=""+p||""},c.prototype.attValue=function(p){return p=""+p||"",this.attEscape(p)},c.prototype.insTarget=function(p){return""+p||""},c.prototype.insValue=function(p){if(p=""+p||"",p.match(/\?>/))throw new Error("Invalid processing instruction value: "+p);return p},c.prototype.xmlVersion=function(p){if(p=""+p||"",!p.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+p);return p},c.prototype.xmlEncoding=function(p){if(p=""+p||"",!p.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+p);return p},c.prototype.xmlStandalone=function(p){return p?"yes":"no"},c.prototype.dtdPubID=function(p){return""+p||""},c.prototype.dtdSysID=function(p){return""+p||""},c.prototype.dtdElementValue=function(p){return""+p||""},c.prototype.dtdAttType=function(p){return""+p||""},c.prototype.dtdAttDefault=function(p){return p!=null?""+p||"":p},c.prototype.dtdEntityValue=function(p){return""+p||""},c.prototype.dtdNData=function(p){return""+p||""},c.prototype.convertAttKey="@",c.prototype.convertPIKey="?",c.prototype.convertTextKey="#text",c.prototype.convertCDataKey="#cdata",c.prototype.convertCommentKey="#comment",c.prototype.convertRawKey="#raw",c.prototype.assertLegalChar=function(p){var d;if(d=p.match(/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/))throw new Error("Invalid character in string: "+p+" at index "+d.index);return p},c.prototype.elEscape=function(p){var d;return d=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,p.replace(d,"&").replace(//g,">").replace(/\r/g,"
")},c.prototype.attEscape=function(p){var d;return d=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,p.replace(d,"&").replace(/0?new Array(p).join(this.indent):""):""},C}()}).call(void 0)},{}],235:[function(w,P,b){"use strict";(function(){var T,C,c,p,d,o,a;a=w("./Utility"),d=a.assign,o=a.isFunction,T=w("./XMLDocument"),C=w("./XMLDocumentCB"),p=w("./XMLStringWriter"),c=w("./XMLStreamWriter"),P.exports.create=function(u,s,h,i){var n,t;if(u==null)throw new Error("Root element needs a name");return i=d({},s,h,i),n=new T(i),t=n.element(u),i.headless||(n.declaration(i),i.pubID==null&&i.sysID==null||n.doctype(i)),t},P.exports.begin=function(u,s,h){var i;return o(u)&&(i=[u,s],s=i[0],h=i[1],u={}),s?new C(u,s,h):new T(u)},P.exports.stringWriter=function(u){return new p(u)},P.exports.streamWriter=function(u,s){return new c(u,s)}}).call(void 0)},{"./Utility":214,"./XMLDocument":224,"./XMLDocumentCB":225,"./XMLStreamWriter":230,"./XMLStringWriter":231}],236:[function(w,P,b){function T(){for(var c={},p=0;ps?n=i(n):n.length>5]|=128<>>9<<4)]=i;for(var n=1732584193,t=-271733879,f=-1732584194,v=271733878,m=0;m>16)+(i>>16)+(n>>16)<<16|65535&n}function u(h,i){return h<>>32-i}var s=w("./helpers");P.exports=function(h){return s.hash(h,T,16)}},{"./helpers":238}],240:[function(w,P,b){"use strict";function T(a,u){a[u>>5]|=128<<24-u%32,a[15+(u+64>>9<<4)]=u;for(var s=Array(80),h=1732584193,i=-271733879,n=-1732584194,t=271733878,f=-1009589776,v=0;v>16)+(u>>16)+(s>>16)<<16|65535&s}function d(a,u){return a<>>32-u}var o=w("./helpers");P.exports=function(a){return o.hash(a,T,20,!0)}},{"./helpers":238}],241:[function(w,P,b){"use strict";var T=w("./helpers"),C=function(n,t){var f=(65535&n)+(65535&t);return(n>>16)+(t>>16)+(f>>16)<<16|65535&f},c=function(n,t){return n>>>t|n<<32-t},p=function(n,t){return n>>>t},d=function(n,t,f){return n&t^~n&f},o=function(n,t,f){return n&t^n&f^t&f},a=function(n){return c(n,2)^c(n,13)^c(n,22)},u=function(n){return c(n,6)^c(n,11)^c(n,25)},s=function(n){return c(n,7)^c(n,18)^p(n,3)},h=function(n){return c(n,17)^c(n,19)^p(n,10)},i=function(n,t){var f,v,m,_,E,g,y,x,l,S,O,A,D=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),I=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),B=new Array(64);n[t>>5]|=128<<24-t%32,n[15+(t+64>>9<<4)]=t;for(var l=0;l=0)return v("Request#%d %s: got digest auth header WWW-Authenticate: %s",X,x,Ae),l.headers=l.headers||{},l.headers.Authorization=digestAuthHeader(ye.method,ye.path,Ae,l.digestAuth),v("Request#%d %s: auth with digest header: %s",X,x,l.headers.Authorization),Ie.headers["set-cookie"]&&(l.headers.Cookie=Ie.headers["set-cookie"].join(";")),b.requestWithCallback(x,l,Me)}var Le=Date.now()-ee;Ne&&(Ne.contentDownload=Le),v("[%sms] done, %s bytes HTTP %s %s %s %s, keepAliveSocket: %s, timing: %j",Le,$,J,ye.method,ye.host,ye.path,q,Ne);var Te={status:J,statusCode:J,headers:_e,size:$,aborted:xe,rt:Le,keepAliveSocket:q,data:Be,requestUrls:l.requestUrls,timing:Ne,remoteAddress:ke,remotePort:dt};if(Xe){var Ze="";Se&&typeof Se.getCurrentStatus=="function"&&(Ze=", agent status: "+(0,u.default)(Se.getCurrentStatus())),Xe.message+=", "+ye.method+" "+x+" "+J+" (connected: "+U+", keepalive socket: "+q+Ze+`)
headers: `+(0,u.default)(_e),Xe.data=Be,Xe.path=ye.path,Xe.status=J,Xe.headers=_e,Xe.res=Te}Me(Xe,Be,l.streaming?Ie:Te),l.emitter&&(ne.url=x,ne.socket=Qe&&Qe.connection,ne.options=ye,ne.size=We,l.emitter.emit("response",{requestId:X,error:Xe,ctx:l.ctx,req:ne,res:Te}))}function I(Xe){var Be=null;if(l.followRedirect&&statuses.redirect[Xe.statusCode]){l._followRedirectCount=(l._followRedirectCount||0)+1;var Ie=Xe.headers.location;if(Ie){if(!(l._followRedirectCount>l.maxRedirects)){var Me=l.formatRedirectUrl?l.formatRedirectUrl(x,Ie):n.resolve(x,Ie);v("Request#%d %s: `redirected` from %s to %s",X,ye.path,x,Me),A(),l.headers&&l.headers.Host&&g.test(Ie)&&(l.headers.Host=null);var _e=S;return S=null,b.requestWithCallback(Me,l,_e),{redirect:!0,error:null}}Be=new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+x),Be.name="MaxRedirectError"}else Be=new Error("Got statusCode "+Xe.statusCode+" but cannot resolve next location from headers"),Be.name="FollowRedirectError"}return{redirect:!1,error:Be}}function B(Xe,Be,Ie){return Ie(null,Be,Xe.headers["content-encoding"])}function H(Xe){if(Ne&&(Ne.waiting=Date.now()-ee),v("Request#%d %s `req response` event emit: status %d, headers: %j",X,x,Xe.statusCode,Xe.headers),l.streaming){var Be=I(Xe);return Be.redirect?void Xe.resume():Be.error?(Xe.resume(),D(Be.error,null,Xe)):D(null,null,Xe)}if(Xe.on("close",function(){v("Request#%d %s: `res close` event emit, total size %d",X,x,$)}),Xe.on("error",function(){v("Request#%d %s: `res error` event emit, total size %d",X,x,$)}),Xe.on("aborted",function(){xe=!0,v("Request#%d %s: `res aborted` event emit, total size %d",X,x,$)}),je){var Be=I(Xe);return Be.redirect?void Xe.resume():Be.error?(Xe.resume(),je.end(),D(Be.error,null,Xe)):(l.consumeWriteStream===!1?Xe.on("end",D.bind(null,null,null,Xe)):isNode010||isNode012?first([[je,"close"],[Xe,"aborted"]],function(_e,Ae,Le){v("Request#%d %s: writeStream or res %s event emitted",X,x,Le),D(k||null,null,Xe)}):je.on("close",function(){v("Request#%d %s: writeStream close event emitted",X,x),D(k||null,null,Xe)}),Xe.pipe(je))}var Ie=[];Xe.on("data",function(Me){v("Request#%d %s: `res data` event emit, size %d",X,x,Me.length),$+=Me.length,Ie.push(Me)}),Xe.on("end",function(){var Me=C.concat(Ie,$);if(v("Request#%d %s: `res end` event emit, total size %d, _dumped: %s",X,x,$,Xe._dumped),k)return D(k,Me,Xe);var _e=I(Xe);if(_e.error)return D(_e.error,Me,Xe);_e.redirect||B(Xe,Me,function(Ae,Le,Te){if(Ae)return D(Ae,Me,Xe);if(!Te&&y.indexOf(l.dataType)>=0){try{Le=decodeBodyByCharset(Le,Xe)}catch(ut){return v("decodeBodyByCharset error: %s",ut),D(null,Le,Xe)}if(l.dataType==="json")if($===0)Le=null;else{var Ze=parseJSON(Le,Pe);Ze.error?Ae=Ze.error:Le=Ze.data}}xe&&v("Request#%d %s: Remote socket was terminated before `response.end()` was called",X,x),D(Ae,Le,Xe)})})}function te(){v("Response timer ticking, timeout: %d",mt),re=setTimeout(function(){re=null;var Xe="Response timeout for "+mt+"ms";k=new Error(Xe),k.name="ResponseTimeoutError",k.requestId=X,v("ResponseTimeout: Request#%d %s %s: %s, connected: %s",X,x,k.name,Xe,U),W()},mt)}function W(){v("Request#%d %s abort, connected: %s",X,x,U),Qe.socket||(k.noSocket=!0,D(k)),Qe.abort()}if(!x||typeof x!="string"&&(x===void 0?"undefined":(0,h.default)(x))!=="object"){var V=i.format("expect request url to be a string or a http request options, but got %j",x);throw new Error(V)}arguments.length===2&&typeof l=="function"&&(S=l,l=null),l=l||{},_>=E&&(_=0);var X=++_;l.requestUrls=l.requestUrls||[];var ne={requestId:X,url:x,args:l,ctx:l.ctx};l.emitter&&l.emitter.emit("request",ne),l.timeout=l.timeout||b.TIMEOUTS,l.maxRedirects=l.maxRedirects||10,l.streaming=l.streaming||l.customResponse;var Y,ee=Date.now();typeof x=="string"?(g.test(x)||(x="http://"+x),Y=n.parse(x)):Y=x;var ce=(l.type||l.method||Y.method||"GET").toUpperCase(),de=Y.port||80,Ce=t,Se=p(l.agent,b.agent),Pe=l.fixJSONCtlChars;Y.protocol==="https:"&&(Ce=f,Se=p(l.httpsAgent,b.httpsAgent),Y.port||(de=443));var ye={host:Y.hostname||Y.host||"localhost",path:Y.path||"/",method:ce,port:de,agent:Se,headers:l.headers||{},lookup:l.lookup};Array.isArray(l.timeout)?ye.requestTimeout=l.timeout[l.timeout.length-1]:l.timeout!==void 0&&(ye.requestTimeout=l.timeout);for(var Ee=["pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","secureProtocol","secureOptions"],Ge=0;Ge>>2]>>>24-g%4*8&255;v[_+g>>>2]|=y<<24-(_+g)%4*8}else for(var g=0;g>>2]=m[g>>>2];return this.sigBytes+=E,this},clamp:function(){var f=this.words,v=this.sigBytes;f[v>>>2]&=4294967295<<32-v%4*8,f.length=T.ceil(v/4)},clone:function(){var f=o.clone.call(this);return f.words=this.words.slice(0),f},random:function(f){for(var v,m=[],_=0;_>16)&x,g=18e3*(65535&g)+(g>>16)&x;var l=(y<<16)+g&x;return l/=4294967296,(l+=.5)*(T.random()>.5?1:-1)}}(4294967296*(v||T.random()));v=987654071*E(),m.push(4294967296*E()|0)}return new a.init(m,f)}}),u=p.enc={},s=u.Hex={stringify:function(f){for(var v=f.words,m=f.sigBytes,_=[],E=0;E>>2]>>>24-E%4*8&255;_.push((g>>>4).toString(16)),_.push((15&g).toString(16))}return _.join("")},parse:function(f){for(var v=f.length,m=[],_=0;_>>3]|=parseInt(f.substr(_,2),16)<<24-_%8*4;return new a.init(m,v/2)}},h=u.Latin1={stringify:function(f){for(var v=f.words,m=f.sigBytes,_=[],E=0;E>>2]>>>24-E%4*8&255;_.push(String.fromCharCode(g))}return _.join("")},parse:function(f){for(var v=f.length,m=[],_=0;_>>2]|=(255&f.charCodeAt(_))<<24-_%4*8;return new a.init(m,v)}},i=u.Utf8={stringify:function(f){try{return decodeURIComponent(escape(h.stringify(f)))}catch(v){throw new Error("Malformed UTF-8 data")}},parse:function(f){return h.parse(unescape(encodeURIComponent(f)))}},n=d.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(f){typeof f=="string"&&(f=i.parse(f)),this._data.concat(f),this._nDataBytes+=f.sigBytes},_process:function(f){var v=this._data,m=v.words,_=v.sigBytes,E=this.blockSize,g=4*E,y=_/g;y=f?T.ceil(y):T.max((0|y)-this._minBufferSize,0);var x=y*E,l=T.min(4*x,_);if(x){for(var S=0;S",o[0];)p++;return p>4&&p}},{key:"extend",value:function(p,d){for(var o in d)Object.prototype.hasOwnProperty.call(d,o)&&d[o]&&(p[o]=d[o])}},{key:"isArray",value:function(p){return Object.prototype.toString.call(arg)==="[object Array]"}},{key:"getFileType",value:function(p){return p=p.toLowerCase(),/.mp4|.flv|.m3u8|.avi|.rm|.rmvb|.mpeg|.mpg|.mov|.wmv|.3gp|.asf|.dat|.dv|.f4v|.gif|.m2t|.m4v|.mj2|.mjpeg|.mpe|.mts|.ogg|.qt|.swf|.ts|.vob|.wmv|.webm/.test(p)?"video":/.mp3|.wav|.ape|.cda|.au|.midi|.mac|.aac|.ac3|.acm|.amr|.caf|.flac|.m4a|.ra|.wma/.test(p)?"audio":/.bmp|.jpg|.jpeg|.png/.test(p)?"img":"other"}},{key:"isImage",value:function(p){return p=p.toLowerCase(),!!/.jpg|.jpeg|.png/.test(p)}},{key:"ISODateString",value:function(p){function d(o){return o<10?"0"+o:o}return p.getUTCFullYear()+"-"+d(p.getUTCMonth()+1)+"-"+d(p.getUTCDate())+"T"+d(p.getUTCHours())+":"+d(p.getUTCMinutes())+":"+d(p.getUTCSeconds())+"Z"}},{key:"isIntNum",value:function(p){return!!/^\d+$/.test(p)}}]),c}();w.default=C},function(j,w,P){!function(b,T){j.exports=w=T(P(0))}(0,function(b){return function(T){function C(t,f,v,m,_,E,g){var y=t+(f&v|~f&m)+_+g;return(y<>>32-E)+f}function c(t,f,v,m,_,E,g){var y=t+(f&m|v&~m)+_+g;return(y<>>32-E)+f}function p(t,f,v,m,_,E,g){var y=t+(f^v^m)+_+g;return(y<>>32-E)+f}function d(t,f,v,m,_,E,g){var y=t+(v^(f|~m))+_+g;return(y<>>32-E)+f}var o=b,a=o.lib,u=a.WordArray,s=a.Hasher,h=o.algo,i=[];!function(){for(var t=0;t<64;t++)i[t]=4294967296*T.abs(T.sin(t+1))|0}();var n=h.MD5=s.extend({_doReset:function(){this._hash=new u.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,f){for(var v=0;v<16;v++){var m=f+v,_=t[m];t[m]=16711935&(_<<8|_>>>24)|4278255360&(_<<24|_>>>8)}var E=this._hash.words,g=t[f+0],y=t[f+1],x=t[f+2],l=t[f+3],S=t[f+4],O=t[f+5],A=t[f+6],D=t[f+7],I=t[f+8],B=t[f+9],H=t[f+10],te=t[f+11],W=t[f+12],V=t[f+13],X=t[f+14],ne=t[f+15],Y=E[0],ee=E[1],ce=E[2],de=E[3];Y=C(Y,ee,ce,de,g,7,i[0]),de=C(de,Y,ee,ce,y,12,i[1]),ce=C(ce,de,Y,ee,x,17,i[2]),ee=C(ee,ce,de,Y,l,22,i[3]),Y=C(Y,ee,ce,de,S,7,i[4]),de=C(de,Y,ee,ce,O,12,i[5]),ce=C(ce,de,Y,ee,A,17,i[6]),ee=C(ee,ce,de,Y,D,22,i[7]),Y=C(Y,ee,ce,de,I,7,i[8]),de=C(de,Y,ee,ce,B,12,i[9]),ce=C(ce,de,Y,ee,H,17,i[10]),ee=C(ee,ce,de,Y,te,22,i[11]),Y=C(Y,ee,ce,de,W,7,i[12]),de=C(de,Y,ee,ce,V,12,i[13]),ce=C(ce,de,Y,ee,X,17,i[14]),ee=C(ee,ce,de,Y,ne,22,i[15]),Y=c(Y,ee,ce,de,y,5,i[16]),de=c(de,Y,ee,ce,A,9,i[17]),ce=c(ce,de,Y,ee,te,14,i[18]),ee=c(ee,ce,de,Y,g,20,i[19]),Y=c(Y,ee,ce,de,O,5,i[20]),de=c(de,Y,ee,ce,H,9,i[21]),ce=c(ce,de,Y,ee,ne,14,i[22]),ee=c(ee,ce,de,Y,S,20,i[23]),Y=c(Y,ee,ce,de,B,5,i[24]),de=c(de,Y,ee,ce,X,9,i[25]),ce=c(ce,de,Y,ee,l,14,i[26]),ee=c(ee,ce,de,Y,I,20,i[27]),Y=c(Y,ee,ce,de,V,5,i[28]),de=c(de,Y,ee,ce,x,9,i[29]),ce=c(ce,de,Y,ee,D,14,i[30]),ee=c(ee,ce,de,Y,W,20,i[31]),Y=p(Y,ee,ce,de,O,4,i[32]),de=p(de,Y,ee,ce,I,11,i[33]),ce=p(ce,de,Y,ee,te,16,i[34]),ee=p(ee,ce,de,Y,X,23,i[35]),Y=p(Y,ee,ce,de,y,4,i[36]),de=p(de,Y,ee,ce,S,11,i[37]),ce=p(ce,de,Y,ee,D,16,i[38]),ee=p(ee,ce,de,Y,H,23,i[39]),Y=p(Y,ee,ce,de,V,4,i[40]),de=p(de,Y,ee,ce,g,11,i[41]),ce=p(ce,de,Y,ee,l,16,i[42]),ee=p(ee,ce,de,Y,A,23,i[43]),Y=p(Y,ee,ce,de,B,4,i[44]),de=p(de,Y,ee,ce,W,11,i[45]),ce=p(ce,de,Y,ee,ne,16,i[46]),ee=p(ee,ce,de,Y,x,23,i[47]),Y=d(Y,ee,ce,de,g,6,i[48]),de=d(de,Y,ee,ce,D,10,i[49]),ce=d(ce,de,Y,ee,X,15,i[50]),ee=d(ee,ce,de,Y,O,21,i[51]),Y=d(Y,ee,ce,de,W,6,i[52]),de=d(de,Y,ee,ce,l,10,i[53]),ce=d(ce,de,Y,ee,H,15,i[54]),ee=d(ee,ce,de,Y,y,21,i[55]),Y=d(Y,ee,ce,de,I,6,i[56]),de=d(de,Y,ee,ce,ne,10,i[57]),ce=d(ce,de,Y,ee,A,15,i[58]),ee=d(ee,ce,de,Y,V,21,i[59]),Y=d(Y,ee,ce,de,S,6,i[60]),de=d(de,Y,ee,ce,te,10,i[61]),ce=d(ce,de,Y,ee,x,15,i[62]),ee=d(ee,ce,de,Y,B,21,i[63]),E[0]=E[0]+Y|0,E[1]=E[1]+ee|0,E[2]=E[2]+ce|0,E[3]=E[3]+de|0},_doFinalize:function(){var t=this._data,f=t.words,v=8*this._nDataBytes,m=8*t.sigBytes;f[m>>>5]|=128<<24-m%32;var _=T.floor(v/4294967296),E=v;f[15+(m+64>>>9<<4)]=16711935&(_<<8|_>>>24)|4278255360&(_<<24|_>>>8),f[14+(m+64>>>9<<4)]=16711935&(E<<8|E>>>24)|4278255360&(E<<24|E>>>8),t.sigBytes=4*(f.length+1),this._process();for(var g=this._hash,y=g.words,x=0;x<4;x++){var l=y[x];y[x]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return g},clone:function(){var t=s.clone.call(this);return t._hash=this._hash.clone(),t}});o.MD5=s._createHelper(n),o.HmacMD5=s._createHmacHelper(n)}(Math),b.MD5})},function(j,w,P){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.UPLOADSTATE={INIT:"init",UPLOADING:"uploading",COMPLETE:"complete",INTERRUPT:"interrupt"},w.UPLOADSTEP={INIT:"init",PART:"part",COMPLETE:"complete"},w.UPLOADDEFAULT={PARALLEL:5,PARTSIZE:1048576}},function(j,w,P){"use strict";function b(n){return n&&n.__esModule?n:{default:n}}function T(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var C=function(){function n(t,f){for(var v=0;v-1)return"Baiduspider";if(u.indexOf("PlayStation")>-1)return"PS4";var h=navigator.platform=="Win32"||navigator.platform=="Windows"||u.indexOf("Windows")>-1,i=navigator.platform=="Mac68K"||navigator.platform=="MacPPC"||navigator.platform=="Macintosh"||navigator.platform=="MacIntel";return i&&(s="macOS"),navigator.platform=="X11"&&!h&&!i&&(s="Unix"),String(navigator.platform).indexOf("Linux")>-1&&(s="Linux"),h?"windows":s},c=function(){var a=navigator.userAgent,u="";return(a.indexOf("Windows NT 5.0")>-1||a.indexOf("Windows 2000")>-1)&&(u="2000"),(a.indexOf("Windows NT 5.1")>-1||a.indexOf("Windows XP")>-1)&&(u="XP"),(a.indexOf("Windows NT 5.2")>-1||a.indexOf("Windows 2003")>-1)&&(u="2003"),(a.indexOf("Windows NT 6.0")>-1||a.indexOf("Windows Vista")>-1)&&(u="Vista"),(a.indexOf("Windows NT 6.1")>-1||a.indexOf("Windows 7")>-1)&&(u="7"),(a.indexOf("Windows NT 6.2")>-1||a.indexOf("Windows 8")>-1)&&(u="8"),(a.indexOf("Windows NT 6.3")>-1||a.indexOf("Windows 8.1")>-1)&&(u="8.1"),(a.indexOf("Windows NT 10")>-1||a.indexOf("Windows 10")>-1)&&(u="10"),u},p=function(a){var u=navigator.userAgent.toLowerCase();return a.chrome?"Chrome":a.firefox?"Firefox":a.safari?"Safari":a.webview?"webview":a.ie?/edge/.test(u)?"Edge":"IE":/baiduspider/.test(u)?"Baiduspider":/ucweb/.test(u)||/UCBrowser/.test(u)?"UC":/opera/.test(u)?"Opera":/ucweb/.test(u)?"UC":/360se/.test(u)?"360\u6D4F\u89C8\u5668":/bidubrowser/.test(u)?"\u767E\u5EA6\u6D4F\u89C8\u5668":/metasr/.test(u)?"\u641C\u72D7\u6D4F\u89C8\u5668":/lbbrowser/.test(u)?"\u730E\u8C79\u6D4F\u89C8\u5668":/micromessenger/.test(u)?"\u5FAE\u4FE1\u5185\u7F6E\u6D4F\u89C8\u5668":/qqbrowser/.test(u)?"QQ\u6D4F\u89C8\u5668":/playstation/.test(u)?"PS4\u6D4F\u89C8\u5668":void 0},d=function(){var a={},u={},s=navigator.userAgent,h=navigator.platform,i=s.match(/Web[kK]it[\/]{0,1}([\d.]+)/),n=s.match(/(Android);?[\s\/]+([\d.]+)?/),t=!!s.match(/\(Macintosh\; Intel /),f=s.match(/(iPad).*OS\s([\d_]+)/),v=s.match(/(iPod)(.*OS\s([\d_]+))?/),m=!f&&s.match(/(iPhone\sOS)\s([\d_]+)/),_=s.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),E=/Win\d{2}|Windows/.test(h),g=s.match(/Windows Phone ([\d.]+)/),y=_&&s.match(/TouchPad/),x=s.match(/Kindle\/([\d.]+)/),l=s.match(/Silk\/([\d._]+)/),S=s.match(/(BlackBerry).*Version\/([\d.]+)/),O=s.match(/(BB10).*Version\/([\d.]+)/),A=s.match(/(RIM\sTablet\sOS)\s([\d.]+)/),D=s.match(/PlayBook/),I=s.match(/Chrome\/([\d.]+)/)||s.match(/CriOS\/([\d.]+)/),B=s.match(/Firefox\/([\d.]+)/),H=s.match(/\((?:Mobile|Tablet); rv:([\d.]+)\).*Firefox\/[\d.]+/),te=s.match(/MSIE\s([\d.]+)/)||s.match(/Trident\/[\d](?=[^\?]+).*rv:([0-9.].)/),W=!I&&s.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/),V=W||s.match(/Version\/([\d.]+)([^S](Safari)|[^M]*(Mobile)[^S]*(Safari))/);if((u.webkit=!!i)&&(u.version=i[1]),n&&(a.android=!0,a.version=n[2]),m&&!v&&(a.ios=a.iphone=!0,a.version=m[2].replace(/_/g,".")),f&&(a.ios=a.ipad=!0,a.version=f[2].replace(/_/g,".")),v&&(a.ios=a.ipod=!0,a.version=v[3]?v[3].replace(/_/g,"."):null),g&&(a.wp=!0,a.version=g[1]),_&&(a.webos=!0,a.version=_[2]),y&&(a.touchpad=!0),S&&(a.blackberry=!0,a.version=S[2]),O&&(a.bb10=!0,a.version=O[2]),A&&(a.rimtabletos=!0,a.version=A[2]),D&&(u.playbook=!0),x&&(a.kindle=!0,a.version=x[1]),l&&(u.silk=!0,u.version=l[1]),!l&&a.android&&s.match(/Kindle Fire/)&&(u.silk=!0),I&&(u.chrome=!0,u.version=I[1]),B&&(u.firefox=!0,u.version=B[1]),H&&(a.firefoxos=!0,a.version=H[1]),te&&(u.ie=!0,u.version=te[1]),V&&(t||a.ios||E||n)&&(u.safari=!0,a.ios||(u.version=V[1])),W&&(u.webview=!0),t){var X=s.match(/[\d]*_[\d]*_[\d]*/);X&&X.length>0&&X[0]&&(a.version=X[0].replace(/_/g,"."))}return a.tablet=!!(f||D||n&&!s.match(/Mobile/)||B&&s.match(/Tablet/)||te&&!s.match(/Phone/)&&s.match(/Touch/)),a.phone=!(a.tablet||a.ipod||!(n||m||_||S||O||I&&s.match(/Android/)||I&&s.match(/CriOS\/([\d.]+)/)||B&&s.match(/Mobile/)||te&&s.match(/Touch/))),a.pc=!a.tablet&&!a.phone,t?a.name="macOS":E?(a.name="windows",a.version=c()):a.name=C(a),u.name=p(u),{os:a,browser:u}}(),o=function(){function a(){b(this,a)}return T(a,null,[{key:"getHost",value:function(u){var s="";if(u===void 0||u==null||u=="")return"";var h=u.indexOf("//"),i=u;h>-1&&(i=u.substring(h+2));var s=i,n=i.split("/");return n&&n.length>0&&(s=n[0]),n=s.split(":"),n&&n.length>0&&(s=n[0]),s}},{key:"os",get:function(){return d.os}},{key:"browser",get:function(){var u=d.browser;return u.name||(u.name=p()),u}}]),a}();w.default=o},function(j,w,P){"use strict";function b(c,p){if(!(c instanceof p))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var T=function(){function c(p,d){for(var o=0;o0){X._invalidUserId=!0;var ce=ee.Message+"\uFF0C\u6B63\u786E\u8D26\u53F7ID(userId)\u8BF7\u53C2\u8003\uFF1Ahttps://help.aliyun.com/knowledge_detail/37196.html";console.log(ce)}}catch(de){console.log(de)}})})}H&&(V.videoInfo=H?JSON.parse(H).Vod:{},V.userData=u.default.encode(H)),V.ri=m.default.create(),this._uploadList.push(V),this._reportLog("20001",V,{ql:this._uploadList.length});try{this.options.addFileSuccess&&this.options.addFileSuccess(V)}catch(ne){console.log(ne)}return!0}},{key:"deleteFile",value:function(A){return!!this.cancelFile(A)&&(this._uploadList.splice(A,1),!0)}},{key:"cleanList",value:function(){this.stopUpload(),this._uploadList.length=0,this._curIndex=-1}},{key:"cancelFile",value:function(A){if(this.options,A<0||A>=this._uploadList.length)return!1;var D=this._uploadList[A];if(A==this._curIndex&&D.state==c.UPLOADSTATE.UPLOADING){D.state=c.UPLOADSTATE.CANCELED;var I=this._getCheckoutpoint(D);I&&I.checkpoint&&(I=I.checkpoint),I&&this._ossUpload.abort(D),this._removeCheckoutpoint(D),this.nextUpload()}else D.state!=c.UPLOADSTATE.SUCCESS&&(D.state=c.UPLOADSTATE.CANCELED);return this._reportLog("20008",D),!0}},{key:"resumeFile",value:function(A){if(this.options,A<0||A>=this._uploadList.length)return!1;var D=this._uploadList[A];return D.state==c.UPLOADSTATE.CANCELED&&(D.state=c.UPLOADSTATE.INIT,!0)}},{key:"listFiles",value:function(){return this._uploadList}},{key:"getCheckpoint",value:function(A){return this._getCheckoutpoint({file:A})}},{key:"startUpload",value:function(A){if(this._retryCount=0,this.options,this._state==c.VODSTATE.START||this._state==c.VODSTATE.EXPIRE)return void console.log("already started or expired");if(this._initState(),this._curIndex=this._findUploadIndex(),this._curIndex==-1)return void(this._state=c.VODSTATE.END);var D=this._uploadList[this._curIndex];this._ossUpload=null,this._upload(D),this._state=c.VODSTATE.START}},{key:"nextUpload",value:function(){var A=this.options;if(this._state==c.VODSTATE.START)if(this._curIndex=this._findUploadIndex(),this._curIndex!=-1){var D=this._uploadList[this._curIndex];this._ossUpload=null,this._upload(D)}else{this._state=c.VODSTATE.END;try{A.onUploadEnd&&A.onUploadEnd(D)}catch(I){console.log(I)}}}},{key:"clear",value:function(A){for(var D=this.options,I=0,B=0;Bthis._curIndex&&(H=this._uploadList[this._curIndex]),H&&(this.init(A,D,I,B),this._state=c.VODSTATE.START,this._ossUpload=null,this._uploadCore(H,H.retry),H.retry=!1),!0}},{key:"resumeUploadWithSTSToken",value:function(A,D,I){if(this._curIndex==-1)return!1;if(this._state!=c.VODSTATE.EXPIRE)return!1;if(this._uploadList.length>this._curIndex){var B=this._uploadList[this._curIndex];B.object?this._refreshSTSTokenUpload(B,A,D,I):this.setSTSToken(B,A,D,I)}}},{key:"setSTSTokenDirectlyUpload",value:function(A,D,I,B,H){if(!(D&&I&&B&&H))return console.log("accessKeyId\u3001ccessKeySecret\u3001securityToken and expiration should not be empty."),!1;this._ut="oss";var te=A;this.init(D,I,B,H),te.endpoint=te._endpoint,te.bucket=te._bucket,te.object=te._object,this._ossUpload=null,this._uploadCore(te,A.retry),A.retry=!1}},{key:"setSTSToken",value:function(A,D,I,B){if(!D||!I||!B)return console.log("accessKeyId\u3001ccessKeySecret\u3001securityToken should not be empty."),!1;this._ut="vod",this._uploadWay="sts";var H=A.videoInfo,te={accessKeyId:D,securityToken:B,accessKeySecret:I,fileName:A.file.name,title:H.Title,requestId:A.ri,region:this.options.region};H.ImageType&&(te.imageType=H.ImageType),H.ImageExt&&(te.imageExt=H.ImageExt),H.FileSize&&(te.fileSize=H.FileSize),H.Description&&(te.description=H.Description),H.CateId&&(te.cateId=H.CateId),H.Tags&&(te.tags=H.Tags),H.TemplateGroupId&&(te.templateGroupId=H.TemplateGroupId),H.StorageLocation&&(te.storageLocation=H.StorageLocation),H.CoverURL&&(te.coverUrl=H.CoverURL),H.TransCodeMode&&(te.transCodeMode=H.TransCodeMode),H.UserData&&(te.userData=H.UserData);var W=this,V="getUploadAuth";A.videoId?(te.videoId=A.videoId,V="refreshUploadAuth"):A.isImage&&(V="getImageUploadAuth"),E.default[V](te,function(X){A.videoId=X.VideoId?X.VideoId:A.videoId,W.setUploadAuthAndAddress(A,X.UploadAuth,X.UploadAddress),W._state=c.VODSTATE.START},function(X){W._error(A,{name:X.Code,code:X.Code,message:X.Message,requestId:X.RequestId})})}},{key:"setUploadAuthAndAddress",value:function(A,D,I,B){if(!A||!D||!I)return!1;var H=JSON.parse(u.default.decode(D));if(!(H.AccessKeyId&&H.AccessKeySecret&&H.SecurityToken&&H.Expiration))return console.error("uploadauth is invalid"),!1;var te={},W=A;if(I){if(te=JSON.parse(u.default.decode(I)),!te.Endpoint||!te.Bucket||!te.FileName)return console.error("uploadAddress is invalid"),!1}else te.Endpoint=W.endpoint,te.Bucket=W.bucket,te.FileName=W.object;this._ut="vod",this._uploadWay="vod",this.options.region=H.Region||this.options.region,this.init(H.AccessKeyId,H.AccessKeySecret,H.SecurityToken,H.Expiration),W.endpoint=W._endpoint?W._endpoint:te.Endpoint,W.bucket=W._bucket?W._bucket:te.Bucket,W.object=W._object?W._object:te.FileName,W.region=this.options.region,B&&(W.videoId=B),this._ossUpload=null,this._uploadCore(W,A.retry),A.retry=!1}},{key:"_refreshSTSTokenUpload",value:function(A,D,I,B){if(!D||!I||!B)return console.log("accessKeyId\u3001ccessKeySecret\u3001securityToken should not be empty."),!1;var H={accessKeyId:D,securityToken:B,accessKeySecret:I,videoId:A.object,requestId:A.ri,region:this.options.region},te=this,W="refreshUploadAuth";A.isImage&&(W="getImageUploadAuth"),E.default[W](H,function(V){te.setUploadAuthAndAddress(A,V.UploadAuth,UploadAddress),te._state=c.VODSTATE.START},function(V){te._error(A,{name:V.Code,code:V.Code,message:V.Message,requestId:V.RequestId})})}},{key:"_upload",value:function(A){var D=arguments.length>1&&arguments[1]!==void 0&&arguments[1],I=this.options;if(A.retry=D,I.onUploadstarted&&!D)try{var B=this._getCheckoutpoint(A);B&&B.state!=c.UPLOADSTATE.UPLOADING&&(A.checkpoint=B,A.videoId=B.videoId),I.onUploadstarted(A)}catch(H){console.log(H)}}},{key:"_uploadCore",value:function(A){if(arguments.length>1&&arguments[1]!==void 0&&arguments[1],!this._ossCreditor.accessKeyId||!this._ossCreditor.accessKeySecret||!this._ossCreditor.securityToken)throw new Error("AccessKeyId\u3001AccessKeySecret\u3001securityToken should not be null");if(A.state=c.UPLOADSTATE.UPLOADING,!this._ossUpload){A.endpoint=A.endpoint||"http://oss-cn-hangzhou.aliyuncs.com";var D=this;this._ossUpload=new o.default({bucket:A.bucket,endpoint:A.endpoint,AccessKeyId:this._ossCreditor.accessKeyId,AccessKeySecret:this._ossCreditor.accessKeySecret,SecurityToken:this._ossCreditor.securityToken,timeout:this.options.timeout,cname:this.options.cname},{onerror:function(X,ne){D._error.call(D,X,ne)},oncomplete:function(X,ne){D._complete.call(D,X,ne)},onprogress:function(X,ne,Y){D._progress.call(D,X,ne,Y)}})}var I=f.default.getFileType(A.file.name),B=this._getCheckoutpoint(A),H="",te="";B&&B.checkpoint&&(te=B.state,H=B.videoId,B=B.checkpoint),B&&H==A.videoId&&te!=c.UPLOADSTATE.UPLOADING&&(B.file=A.file,A.checkpoint=B,B.uploadId);var W=this._adjustPartSize(A);this._reportLog("20002",A,{ft:I,fs:A.file.size,bu:A.bucket,ok:A.object,vid:A.videoId||"",fn:A.file.name,fw:null,fh:null,ps:W});var V={headers:{"x-oss-notification":A.userData?A.userData:""},partSize:W,parallel:this.options.parallel};this._ossUpload.upload(A,V)}},{key:"_findUploadIndex",value:function(){for(var A=-1,D=0;D0||D.name=="SignatureDoesNotMatchError"||D.code=="SecurityTokenExpired"||D.code=="InvalidSecurityToken.Expired"||D.code=="InvalidAccessKeyId"&&this._ossCreditor.securityToken){if(this.options.onUploadTokenExpired){this._state=c.VODSTATE.EXPIRE,A.state=c.UPLOADSTATE.FAIlURE;try{this.options.onUploadTokenExpired(A,D)}catch(B){console.log(B)}}return}if((D.name=="RequestTimeoutError"||D.name=="ConnectionTimeout"||D.name=="ConnectionTimeoutError")&&this._retryTotal>this._retryCount){var I=this;return setTimeout(function(){I._uploadCore(A,!0)},1e3*I._retryDuration),void this._retryCount++}D.name=="NoSuchUploadError"&&this._removeCheckoutpoint(A),this._handleError(A,D)}}},{key:"_handleError",value:function(A,D){var I=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],B=c.UPLOADSTATE.FAIlURE;if(A.state!=c.UPLOADSTATE.CANCELED&&(A.state=c.UPLOADSTATE.FAIlURE,this._state=c.VODSTATE.FAILURE,this.options.onUploadFailed&&D&&D.code&&D.message))try{this.options.onUploadFailed(A,D.code,D.message)}catch(te){console.log(te)}if(I&&this._changeState(A,B),this._reportLog("20006",A,{code:D.name,message:D.message,requestId:D.requestId,fs:A.file.size,bu:A.bucket,ok:A.object,fn:A.file.name}),this._reportLog("20004",A,{requestId:D.requestId,fs:A.file.size,bu:A.bucket,ok:A.object,fn:A.file.name}),A.ri=m.default.create(),this._findUploadIndex()!=-1){var H=this;this._state=c.VODSTATE.START,setTimeout(function(){H.nextUpload()},100)}}},{key:"_complete",value:function(A,D){if(A.state=c.UPLOADSTATE.SUCCESS,this.options.onUploadSucceed)try{this.options.onUploadSucceed(A)}catch(H){console.log(H)}var I=0;D&&D.res&&D.res.headers&&(I=D.res.headers["x-oss-request-id"]),this._removeCheckoutpoint(A);var B=this;setTimeout(function(){B.nextUpload()},100),this._retryCount=0,this._reportLog("20003",A,{requestId:I})}},{key:"_progress",value:function(A,D,I){if(this.options.onUploadProgress)try{A.loaded=D.loaded,this.options.onUploadProgress(A,D.total,D.loaded)}catch(ne){console.log(ne)}var B=D.checkpoint,H=0;B&&(A.checkpoint=B,this._saveCheckoutpoint(A,B,c.UPLOADSTATE.UPLOADING),H=B.uploadId),this._retryCount=0;var te=this._getPortNumber(B),W=0;if(I&&I.headers&&(W=I.headers["x-oss-request-id"]),D.loaded!=0&&this._reportLog("20007",A,{pn:te,requestId:W}),D.loaded!=1&&this._reportLog("20005",A,{UploadId:H,pn:te+1,pr:A.retry?1:0,fs:A.file.size,bu:A.bucket,ok:A.object,fn:A.file.name}),!this._invalidUserId&&!A.isImage&&this._ut=="vod"&&this.options.enableUploadProgress){var V={file:A.file,checkpoint:D,userId:this.options.userId,videoId:A.videoId,region:this.options.region,fileHash:A.fileHash};try{var X=this;y.default.upload(V,function(){},function(ne){if((ne=JSON.parse(ne))&&ne.Code=="InvalidParameter"&&ne.Message.indexOf("UserId")>0){X._invalidUserId=!0;var Y=ne.Message+"\uFF0C\u6B63\u786E\u8D26\u53F7ID(userId)\u8BF7\u53C2\u8003\uFF1Ahttps://help.aliyun.com/knowledge_detail/37196.html";console.log(Y)}})}catch(ne){console.log(ne)}}}},{key:"_getPortNumber",value:function(A){if(A){var D=A.doneParts;if(D&&D.length>0)return D[D.length-1].number}return 0}},{key:"_removeCheckoutpoint",value:function(A){var D=this._getCheckoutpointKey(A);h.default.remove(D)}},{key:"_getCheckoutpoint",value:function(A){var D=this._getCheckoutpointKey(A),I=h.default.get(D);if(I)try{return JSON.parse(I)}catch(B){}return""}},{key:"_saveCheckoutpoint",value:function(A,D,I){if(D){var B=this._getCheckoutpointKey(A),H=A.file,te={fileName:H.name,lastModified:H.lastModified,size:H.size,object:A.object,videoId:A.videoId,bucket:A.bucket,endpoint:A.endpoint,checkpoint:D,loaded:A.loaded,state:I};h.default.set(B,JSON.stringify(te))}}},{key:"_changeState",value:function(A,D){var I=this._getCheckoutpoint(A);I&&((this._onbeforeunload=!0)&&(D=c.UPLOADSTATE.STOPED),this._saveCheckoutpoint(A,I.checkpoint,D))}},{key:"_getCheckoutpointKey",value:function(A){return"upload_"+A.file.lastModified+"_"+A.file.name+"_"+A.file.size}},{key:"_getCheckoutpointFromCloud",value:function(A,D,I){var B={userId:this.options.userId,uploadInfoList:[{FileName:A.file.name,FileSize:A.file.size,FileCreateTime:A.file.lastModified,FileHash:A.fileHash}],region:this.options.region};y.default.get(B,function(H){D(H)},I)}},{key:"_reportLog",value:function(A,D,I){I||(I={}),I.ri=D.ri,this._ut&&(I.ut=this._ut),this._log.log(A,I)}},{key:"_initEvent",value:function(){var A=this;window&&(window.onbeforeunload=function(D){if(A._onbeforeunload=!0,A._curIndex!=-1&&A._uploadList.length>A._curIndex){var I=A._uploadList[A._curIndex];A._changeState(I,c.UPLOADSTATE.STOPED)}})}},{key:"_initState",value:function(){for(var A=0;A1e4?A.file.size/9999:this.options.partSize}}]),O}());w.default=S},function(j,w,P){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.UPLOADSTATE={INIT:"Ready",UPLOADING:"Uploading",SUCCESS:"Success",FAIlURE:"Failure",CANCELED:"Canceled",STOPED:"Stoped"},w.VODSTATE={INIT:"Init",START:"Start",STOP:"Stop",FAILURE:"Failure",EXPIRE:"Expire",END:"End"}},function(j,w,P){"use strict";function b(a){return a&&a.__esModule?a:{default:a}}function T(a,u){if(!(a instanceof u))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var C=function(){function a(u,s){for(var h=0;h=T())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+T().toString(16)+" bytes");return 0|re}function t(re){return+re!=re&&(re=0),c.alloc(+re)}function f(re,k){if(c.isBuffer(re))return re.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(re)||re instanceof ArrayBuffer))return re.byteLength;typeof re!="string"&&(re=""+re);var U=re.length;if(U===0)return 0;for(var q=!1;;)switch(k){case"ascii":case"latin1":case"binary":return U;case"utf8":case"utf-8":case void 0:return ye(re).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*U;case"hex":return U>>>1;case"base64":return Ue(re).length;default:if(q)return ye(re).length;k=(""+k).toLowerCase(),q=!0}}function v(re,k,U){var q=!1;if((k===void 0||k<0)&&(k=0),k>this.length)return"";if((U===void 0||U>this.length)&&(U=this.length),U<=0)return"";if(U>>>=0,k>>>=0,U<=k)return"";for(re||(re="utf8");;)switch(re){case"hex":return te(this,k,U);case"utf8":case"utf-8":return D(this,k,U);case"ascii":return B(this,k,U);case"latin1":case"binary":return H(this,k,U);case"base64":return A(this,k,U);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return W(this,k,U);default:if(q)throw new TypeError("Unknown encoding: "+re);re=(re+"").toLowerCase(),q=!0}}function m(re,k,U){var q=re[k];re[k]=re[U],re[U]=q}function _(re,k,U,q,$){if(re.length===0)return-1;if(typeof U=="string"?(q=U,U=0):U>2147483647?U=2147483647:U<-2147483648&&(U=-2147483648),U=+U,isNaN(U)&&(U=$?0:re.length-1),U<0&&(U=re.length+U),U>=re.length){if($)return-1;U=re.length-1}else if(U<0){if(!$)return-1;U=0}if(typeof k=="string"&&(k=c.from(k,q)),c.isBuffer(k))return k.length===0?-1:E(re,k,U,q,$);if(typeof k=="number")return k&=255,c.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?$?Uint8Array.prototype.indexOf.call(re,k,U):Uint8Array.prototype.lastIndexOf.call(re,k,U):E(re,[k],U,q,$);throw new TypeError("val must be string, number or Buffer")}function E(re,k,U,q,$){function J(Qe,Xe){return xe===1?Qe[Xe]:Qe.readUInt16BE(Xe*xe)}var xe=1,ke=re.length,dt=k.length;if(q!==void 0&&((q=String(q).toLowerCase())==="ucs2"||q==="ucs-2"||q==="utf16le"||q==="utf-16le")){if(re.length<2||k.length<2)return-1;xe=2,ke/=2,dt/=2,U/=2}var Ne;if($){var je=-1;for(Ne=U;Neke&&(U=ke-dt),Ne=U;Ne>=0;Ne--){for(var tt=!0,mt=0;mt$&&(q=$):q=$;var J=k.length;if(J%2!=0)throw new TypeError("Invalid hex string");q>J/2&&(q=J/2);for(var xe=0;xe239?4:J>223?3:J>191?2:1;if($+ke<=U){var dt,Ne,je,tt;switch(ke){case 1:J<128&&(xe=J);break;case 2:dt=re[$+1],(192&dt)==128&&(tt=(31&J)<<6|63&dt)>127&&(xe=tt);break;case 3:dt=re[$+1],Ne=re[$+2],(192&dt)==128&&(192&Ne)==128&&(tt=(15&J)<<12|(63&dt)<<6|63&Ne)>2047&&(tt<55296||tt>57343)&&(xe=tt);break;case 4:dt=re[$+1],Ne=re[$+2],je=re[$+3],(192&dt)==128&&(192&Ne)==128&&(192&je)==128&&(tt=(15&J)<<18|(63&dt)<<12|(63&Ne)<<6|63&je)>65535&&tt<1114112&&(xe=tt)}}xe===null?(xe=65533,ke=1):xe>65535&&(xe-=65536,q.push(xe>>>10&1023|55296),xe=56320|1023&xe),q.push(xe),$+=ke}return I(q)}function I(re){var k=re.length;if(k<=ze)return String.fromCharCode.apply(String,re);for(var U="",q=0;qq)&&(U=q);for(var $="",J=k;JU)throw new RangeError("Trying to access beyond buffer length")}function X(re,k,U,q,$,J){if(!c.isBuffer(re))throw new TypeError('"buffer" argument must be a Buffer instance');if(k>$||kre.length)throw new RangeError("Index out of range")}function ne(re,k,U,q){k<0&&(k=65535+k+1);for(var $=0,J=Math.min(re.length-U,2);$>>8*(q?$:1-$)}function Y(re,k,U,q){k<0&&(k=4294967295+k+1);for(var $=0,J=Math.min(re.length-U,4);$>>8*(q?$:3-$)&255}function ee(re,k,U,q,$,J){if(U+q>re.length)throw new RangeError("Index out of range");if(U<0)throw new RangeError("Index out of range")}function ce(re,k,U,q,$){return $||ee(re,k,U,4,34028234663852886e22,-34028234663852886e22),me.write(re,k,U,q,23,4),U+4}function de(re,k,U,q,$){return $||ee(re,k,U,8,17976931348623157e292,-17976931348623157e292),me.write(re,k,U,q,52,8),U+8}function Ce(re){if(re=Se(re).replace(nt,""),re.length<2)return"";for(;re.length%4!=0;)re+="=";return re}function Se(re){return re.trim?re.trim():re.replace(/^\s+|\s+$/g,"")}function Pe(re){return re<16?"0"+re.toString(16):re.toString(16)}function ye(re,k){k=k||1/0;for(var U,q=re.length,$=null,J=[],xe=0;xe55295&&U<57344){if(!$){if(U>56319){(k-=3)>-1&&J.push(239,191,189);continue}if(xe+1===q){(k-=3)>-1&&J.push(239,191,189);continue}$=U;continue}if(U<56320){(k-=3)>-1&&J.push(239,191,189),$=U;continue}U=65536+($-55296<<10|U-56320)}else $&&(k-=3)>-1&&J.push(239,191,189);if($=null,U<128){if((k-=1)<0)break;J.push(U)}else if(U<2048){if((k-=2)<0)break;J.push(U>>6|192,63&U|128)}else if(U<65536){if((k-=3)<0)break;J.push(U>>12|224,U>>6&63|128,63&U|128)}else{if(!(U<1114112))throw new Error("Invalid code point");if((k-=4)<0)break;J.push(U>>18|240,U>>12&63|128,U>>6&63|128,63&U|128)}}return J}function Ee(re){for(var k=[],U=0;U>8,$=U%256,J.push($),J.push(q);return J}function Ue(re){return be.toByteArray(Ce(re))}function Fe(re,k,U,q){for(var $=0;$=k.length||$>=re.length);++$)k[$+U]=re[$];return $}function He(re){return re!==re}/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh
* @license MIT
*/var be=P(21),me=P(22),We=P(23);w.Buffer=c,w.SlowBuffer=t,w.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=b.TYPED_ARRAY_SUPPORT!==void 0?b.TYPED_ARRAY_SUPPORT:function(){try{var re=new Uint8Array(1);return re.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},re.foo()===42&&typeof re.subarray=="function"&&re.subarray(1,1).byteLength===0}catch(k){return!1}}(),w.kMaxLength=T(),c.poolSize=8192,c._augment=function(re){return re.__proto__=c.prototype,re},c.from=function(re,k,U){return p(null,re,k,U)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(re,k,U){return o(null,re,k,U)},c.allocUnsafe=function(re){return a(null,re)},c.allocUnsafeSlow=function(re){return a(null,re)},c.isBuffer=function(re){return!(re==null||!re._isBuffer)},c.compare=function(re,k){if(!c.isBuffer(re)||!c.isBuffer(k))throw new TypeError("Arguments must be Buffers");if(re===k)return 0;for(var U=re.length,q=k.length,$=0,J=Math.min(U,q);$0&&(re=this.toString("hex",0,k).match(/.{2}/g).join(" "),this.length>k&&(re+=" ... ")),""},c.prototype.compare=function(re,k,U,q,$){if(!c.isBuffer(re))throw new TypeError("Argument must be a Buffer");if(k===void 0&&(k=0),U===void 0&&(U=re?re.length:0),q===void 0&&(q=0),$===void 0&&($=this.length),k<0||U>re.length||q<0||$>this.length)throw new RangeError("out of range index");if(q>=$&&k>=U)return 0;if(q>=$)return-1;if(k>=U)return 1;if(k>>>=0,U>>>=0,q>>>=0,$>>>=0,this===re)return 0;for(var J=$-q,xe=U-k,ke=Math.min(J,xe),dt=this.slice(q,$),Ne=re.slice(k,U),je=0;je$)&&(U=$),re.length>0&&(U<0||k<0)||k>this.length)throw new RangeError("Attempt to write outside buffer bounds");q||(q="utf8");for(var J=!1;;)switch(q){case"hex":return g(this,re,k,U);case"utf8":case"utf-8":return y(this,re,k,U);case"ascii":return x(this,re,k,U);case"latin1":case"binary":return l(this,re,k,U);case"base64":return S(this,re,k,U);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,re,k,U);default:if(J)throw new TypeError("Unknown encoding: "+q);q=(""+q).toLowerCase(),J=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var ze=4096;c.prototype.slice=function(re,k){var U=this.length;re=~~re,k=k===void 0?U:~~k,re<0?(re+=U)<0&&(re=0):re>U&&(re=U),k<0?(k+=U)<0&&(k=0):k>U&&(k=U),k0&&($*=256);)q+=this[re+--k]*$;return q},c.prototype.readUInt8=function(re,k){return k||V(re,1,this.length),this[re]},c.prototype.readUInt16LE=function(re,k){return k||V(re,2,this.length),this[re]|this[re+1]<<8},c.prototype.readUInt16BE=function(re,k){return k||V(re,2,this.length),this[re]<<8|this[re+1]},c.prototype.readUInt32LE=function(re,k){return k||V(re,4,this.length),(this[re]|this[re+1]<<8|this[re+2]<<16)+16777216*this[re+3]},c.prototype.readUInt32BE=function(re,k){return k||V(re,4,this.length),16777216*this[re]+(this[re+1]<<16|this[re+2]<<8|this[re+3])},c.prototype.readIntLE=function(re,k,U){re|=0,k|=0,U||V(re,k,this.length);for(var q=this[re],$=1,J=0;++J=$&&(q-=Math.pow(2,8*k)),q},c.prototype.readIntBE=function(re,k,U){re|=0,k|=0,U||V(re,k,this.length);for(var q=k,$=1,J=this[re+--q];q>0&&($*=256);)J+=this[re+--q]*$;return $*=128,J>=$&&(J-=Math.pow(2,8*k)),J},c.prototype.readInt8=function(re,k){return k||V(re,1,this.length),128&this[re]?-1*(255-this[re]+1):this[re]},c.prototype.readInt16LE=function(re,k){k||V(re,2,this.length);var U=this[re]|this[re+1]<<8;return 32768&U?4294901760|U:U},c.prototype.readInt16BE=function(re,k){k||V(re,2,this.length);var U=this[re+1]|this[re]<<8;return 32768&U?4294901760|U:U},c.prototype.readInt32LE=function(re,k){return k||V(re,4,this.length),this[re]|this[re+1]<<8|this[re+2]<<16|this[re+3]<<24},c.prototype.readInt32BE=function(re,k){return k||V(re,4,this.length),this[re]<<24|this[re+1]<<16|this[re+2]<<8|this[re+3]},c.prototype.readFloatLE=function(re,k){return k||V(re,4,this.length),me.read(this,re,!0,23,4)},c.prototype.readFloatBE=function(re,k){return k||V(re,4,this.length),me.read(this,re,!1,23,4)},c.prototype.readDoubleLE=function(re,k){return k||V(re,8,this.length),me.read(this,re,!0,52,8)},c.prototype.readDoubleBE=function(re,k){return k||V(re,8,this.length),me.read(this,re,!1,52,8)},c.prototype.writeUIntLE=function(re,k,U,q){(re=+re,k|=0,U|=0,!q)&&X(this,re,k,U,Math.pow(2,8*U)-1,0);var $=1,J=0;for(this[k]=255&re;++J=0&&(J*=256);)this[k+$]=re/J&255;return k+U},c.prototype.writeUInt8=function(re,k,U){return re=+re,k|=0,U||X(this,re,k,1,255,0),c.TYPED_ARRAY_SUPPORT||(re=Math.floor(re)),this[k]=255&re,k+1},c.prototype.writeUInt16LE=function(re,k,U){return re=+re,k|=0,U||X(this,re,k,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[k]=255&re,this[k+1]=re>>>8):ne(this,re,k,!0),k+2},c.prototype.writeUInt16BE=function(re,k,U){return re=+re,k|=0,U||X(this,re,k,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[k]=re>>>8,this[k+1]=255&re):ne(this,re,k,!1),k+2},c.prototype.writeUInt32LE=function(re,k,U){return re=+re,k|=0,U||X(this,re,k,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[k+3]=re>>>24,this[k+2]=re>>>16,this[k+1]=re>>>8,this[k]=255&re):Y(this,re,k,!0),k+4},c.prototype.writeUInt32BE=function(re,k,U){return re=+re,k|=0,U||X(this,re,k,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[k]=re>>>24,this[k+1]=re>>>16,this[k+2]=re>>>8,this[k+3]=255&re):Y(this,re,k,!1),k+4},c.prototype.writeIntLE=function(re,k,U,q){if(re=+re,k|=0,!q){var $=Math.pow(2,8*U-1);X(this,re,k,U,$-1,-$)}var J=0,xe=1,ke=0;for(this[k]=255&re;++J>0)-ke&255;return k+U},c.prototype.writeIntBE=function(re,k,U,q){if(re=+re,k|=0,!q){var $=Math.pow(2,8*U-1);X(this,re,k,U,$-1,-$)}var J=U-1,xe=1,ke=0;for(this[k+J]=255&re;--J>=0&&(xe*=256);)re<0&&ke===0&&this[k+J+1]!==0&&(ke=1),this[k+J]=(re/xe>>0)-ke&255;return k+U},c.prototype.writeInt8=function(re,k,U){return re=+re,k|=0,U||X(this,re,k,1,127,-128),c.TYPED_ARRAY_SUPPORT||(re=Math.floor(re)),re<0&&(re=255+re+1),this[k]=255&re,k+1},c.prototype.writeInt16LE=function(re,k,U){return re=+re,k|=0,U||X(this,re,k,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[k]=255&re,this[k+1]=re>>>8):ne(this,re,k,!0),k+2},c.prototype.writeInt16BE=function(re,k,U){return re=+re,k|=0,U||X(this,re,k,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[k]=re>>>8,this[k+1]=255&re):ne(this,re,k,!1),k+2},c.prototype.writeInt32LE=function(re,k,U){return re=+re,k|=0,U||X(this,re,k,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[k]=255&re,this[k+1]=re>>>8,this[k+2]=re>>>16,this[k+3]=re>>>24):Y(this,re,k,!0),k+4},c.prototype.writeInt32BE=function(re,k,U){return re=+re,k|=0,U||X(this,re,k,4,2147483647,-2147483648),re<0&&(re=4294967295+re+1),c.TYPED_ARRAY_SUPPORT?(this[k]=re>>>24,this[k+1]=re>>>16,this[k+2]=re>>>8,this[k+3]=255&re):Y(this,re,k,!1),k+4},c.prototype.writeFloatLE=function(re,k,U){return ce(this,re,k,!0,U)},c.prototype.writeFloatBE=function(re,k,U){return ce(this,re,k,!1,U)},c.prototype.writeDoubleLE=function(re,k,U){return de(this,re,k,!0,U)},c.prototype.writeDoubleBE=function(re,k,U){return de(this,re,k,!1,U)},c.prototype.copy=function(re,k,U,q){if(U||(U=0),q||q===0||(q=this.length),k>=re.length&&(k=re.length),k||(k=0),q>0&&q=this.length)throw new RangeError("sourceStart out of bounds");if(q<0)throw new RangeError("sourceEnd out of bounds");q>this.length&&(q=this.length),re.length-k=0;--$)re[$+k]=this[$+U];else if(J<1e3||!c.TYPED_ARRAY_SUPPORT)for($=0;$>>=0,U=U===void 0?this.length:U>>>0,re||(re=0);var J;if(typeof re=="number")for(J=k;J0)throw new Error("Invalid string. Length must be a multiple of 4");return n[t-2]==="="?2:n[t-1]==="="?1:0}function T(n){return 3*n.length/4-b(n)}function C(n){var t,f,v,m,_,E=n.length;m=b(n),_=new u(3*E/4-m),f=m>0?E-4:E;var g=0;for(t=0;t>16&255,_[g++]=v>>8&255,_[g++]=255&v;return m===2?(v=a[n.charCodeAt(t)]<<2|a[n.charCodeAt(t+1)]>>4,_[g++]=255&v):m===1&&(v=a[n.charCodeAt(t)]<<10|a[n.charCodeAt(t+1)]<<4|a[n.charCodeAt(t+2)]>>2,_[g++]=v>>8&255,_[g++]=255&v),_}function c(n){return o[n>>18&63]+o[n>>12&63]+o[n>>6&63]+o[63&n]}function p(n,t,f){for(var v,m=[],_=t;_g?g:E+16383));return v===1?(t=n[f-1],m+=o[t>>2],m+=o[t<<4&63],m+="=="):v===2&&(t=(n[f-2]<<8)+n[f-1],m+=o[t>>10],m+=o[t>>4&63],m+=o[t<<2&63],m+="="),_.push(m),_.join("")}w.byteLength=T,w.toByteArray=C,w.fromByteArray=d;for(var o=[],a=[],u=typeof Uint8Array!="undefined"?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,i=s.length;h>1,s=-7,h=T?c-1:0,i=T?-1:1,n=P[b+h];for(h+=i,p=n&(1<<-s)-1,n>>=-s,s+=o;s>0;p=256*p+P[b+h],h+=i,s-=8);for(d=p&(1<<-s)-1,p>>=-s,s+=C;s>0;d=256*d+P[b+h],h+=i,s-=8);if(p===0)p=1-u;else{if(p===a)return d?NaN:1/0*(n?-1:1);d+=Math.pow(2,C),p-=u}return(n?-1:1)*d*Math.pow(2,p-C)},w.write=function(P,b,T,C,c,p){var d,o,a,u=8*p-c-1,s=(1<>1,i=c===23?Math.pow(2,-24)-Math.pow(2,-77):0,n=C?0:p-1,t=C?1:-1,f=b<0||b===0&&1/b<0?1:0;for(b=Math.abs(b),isNaN(b)||b===1/0?(o=isNaN(b)?1:0,d=s):(d=Math.floor(Math.log(b)/Math.LN2),b*(a=Math.pow(2,-d))<1&&(d--,a*=2),b+=d+h>=1?i/a:i*Math.pow(2,1-h),b*a>=2&&(d++,a/=2),d+h>=s?(o=0,d=s):d+h>=1?(o=(b*a-1)*Math.pow(2,c),d+=h):(o=b*Math.pow(2,h-1)*Math.pow(2,c),d=0));c>=8;P[T+n]=255&o,n+=t,o/=256,c-=8);for(d=d<0;P[T+n]=255&d,n+=t,d/=256,u-=8);P[T+n-t]|=128*f}},function(j,w){var P={}.toString;j.exports=Array.isArray||function(b){return P.call(b)=="[object Array]"}},function(j,w,P){"use strict";function b(c,p){if(!(c instanceof p))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var T=function(){function c(p,d){for(var o=0;o>>31}var E=(i<<5|i>>>27)+v+o[m];E+=m<20?1518500249+(n&t|~n&f):m<40?1859775393+(n^t^f):m<60?(n&t|n&f|t&f)-1894007588:(n^t^f)-899497514,v=f,f=t,t=n<<30|n>>>2,n=i,i=E}h[0]=h[0]+i|0,h[1]=h[1]+n|0,h[2]=h[2]+t|0,h[3]=h[3]+f|0,h[4]=h[4]+v|0},_doFinalize:function(){var u=this._data,s=u.words,h=8*this._nDataBytes,i=8*u.sigBytes;return s[i>>>5]|=128<<24-i%32,s[14+(i+64>>>9<<4)]=Math.floor(h/4294967296),s[15+(i+64>>>9<<4)]=h,u.sigBytes=4*s.length,this._process(),this._hash},clone:function(){var u=p.clone.call(this);return u._hash=this._hash.clone(),u}});T.SHA1=p._createHelper(a),T.HmacSHA1=p._createHmacHelper(a)}(),b.SHA1})},function(j,w,P){!function(b,T){j.exports=w=T(P(0))}(0,function(b){!function(){var T=b,C=T.lib,c=C.Base,p=T.enc,d=p.Utf8,o=T.algo;o.HMAC=c.extend({init:function(a,u){a=this._hasher=new a.init,typeof u=="string"&&(u=d.parse(u));var s=a.blockSize,h=4*s;u.sigBytes>h&&(u=a.finalize(u)),u.clamp();for(var i=this._oKey=u.clone(),n=this._iKey=u.clone(),t=i.words,f=n.words,v=0;v>>6-i%4*2;s[h>>>2]|=(n|t)<<24-h%4*8,h++}return p.create(s,h)}var C=b,c=C.lib,p=c.WordArray,d=C.enc;d.Base64={stringify:function(o){var a=o.words,u=o.sigBytes,s=this._map;o.clamp();for(var h=[],i=0;i>>2]>>>24-i%4*8&255,t=a[i+1>>>2]>>>24-(i+1)%4*8&255,f=a[i+2>>>2]>>>24-(i+2)%4*8&255,v=n<<16|t<<8|f,m=0;m<4&&i+.75*m>>6*(3-m)&63));var _=s.charAt(64);if(_)for(;h.length%4;)h.push(_);return h.join("")},parse:function(o){var a=o.length,u=this._map,s=this._reverseMap;if(!s){s=this._reverseMap=[];for(var h=0;h0&&(V=W.UploadProgress.UploadProgressList[0],X=V.ClientId),u.default.setClientId(X),x&&x(V)},function(W){W&&(l(W),console.log(W))})}}]),g}();w.default=E},function(j,w,P){"use strict";function b(d,o){if(!(d instanceof o))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var T=function(){function d(o,a){for(var u=0;u=j.length?{done:!0}:{done:!1,value:j[b++]}},e:function(o){throw o},f:T}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var C=!0,c=!1,p;return{s:function(){P=j[Symbol.iterator]()},n:function(){var o=P.next();return C=o.done,o},e:function(o){c=!0,p=o},f:function(){try{!C&&P.return!=null&&P.return()}finally{if(c)throw p}}}}},rHrb:function(et,Ve,z){"use strict";Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.CopyToClipboard=void 0;var le=j(z("q1tI")),Q=j(z("+QRC"));function j(t){return t&&t.__esModule?t:{default:t}}function w(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?w=function(v){return typeof v}:w=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},w(t)}function P(t,f){var v=Object.keys(t);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(t);f&&(m=m.filter(function(_){return Object.getOwnPropertyDescriptor(t,_).enumerable})),v.push.apply(v,m)}return v}function b(t){for(var f=1;f=0)continue;if(!Object.prototype.propertyIsEnumerable.call(t,m))continue;v[m]=t[m]}}return v}function C(t,f){if(t==null)return{};var v={},m=Object.keys(t),_,E;for(E=0;E=0)continue;v[_]=t[_]}return v}function c(t,f){if(!(t instanceof f))throw new TypeError("Cannot call a class as a function")}function p(t,f){for(var v=0;v"']/,le=/[&<>"']/g,Q=/[<>"']|&(?!#?\w+;)/,j=/[<>"']|&(?!#?\w+;)/g,w={"&":"&","<":"<",">":">",'"':""","'":"'"},P=g=>w[g];function b(g,y){if(y){if(z.test(g))return g.replace(le,P)}else if(Q.test(g))return g.replace(j,P);return g}const T=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function C(g){return g.replace(T,(y,x)=>(x=x.toLowerCase(),x==="colon"?":":x.charAt(0)==="#"?x.charAt(1)==="x"?String.fromCharCode(parseInt(x.substring(2),16)):String.fromCharCode(+x.substring(1)):""))}const c=/(^|[^\[])\^/g;function p(g,y){g=g.source||g,y=y||"";const x={replace:(l,S)=>(S=S.source||S,S=S.replace(c,"$1"),g=g.replace(l,S),x),getRegex:()=>new RegExp(g,y)};return x}const d=/[^\w:]/g,o=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function a(g,y,x){if(g){let l;try{l=decodeURIComponent(C(x)).replace(d,"").toLowerCase()}catch(S){return null}if(l.indexOf("javascript:")===0||l.indexOf("vbscript:")===0||l.indexOf("data:")===0)return null}y&&!o.test(x)&&(x=n(y,x));try{x=encodeURI(x).replace(/%25/g,"%")}catch(l){return null}return x}const u={},s=/^[^:]+:\/*[^/]*$/,h=/^([^:]+:)[\s\S]*$/,i=/^([^:]+:\/*[^/]*)[\s\S]*$/;function n(g,y){u[" "+g]||(s.test(g)?u[" "+g]=g+"/":u[" "+g]=m(g,"/",!0)),g=u[" "+g];const x=g.indexOf(":")===-1;return y.substring(0,2)==="//"?x?y:g.replace(h,"$1")+y:y.charAt(0)==="/"?x?y:g.replace(i,"$1")+y:g+y}const t={exec:function(){}};function f(g){let y=1,x,l;for(;y{let I=!1,B=A;for(;--B>=0&&D[B]==="\\";)I=!I;return I?"|":" |"}),l=x.split(/ \|/);let S=0;if(l.length>y)l.splice(y);else for(;l.length=0;p--){var d=j().key(p);c(w(d),d)}}function T(c){return j().removeItem(c)}function C(){return j().clear()}},"s8/Y":function(et,Ve,z){et.exports=z.p+"static/jx.6713fc81.svg"},"sB/4":function(et,Ve,z){et.exports=z.p+"static/b.7405990c.svg"},sNtx:function(et,Ve,z){},sR1s:function(et,Ve,z){"use strict";z.d(Ve,"b",function(){return w}),z.d(Ve,"a",function(){return P}),z.d(Ve,"c",function(){return b}),z.d(Ve,"d",function(){return T});var le=z("U8pU"),Q="RC_TABLE_KEY";function j(C){return C==null?[]:Array.isArray(C)?C:[C]}function w(C,c){if(!c&&typeof c!="number")return C;for(var p=j(c),d=C,o=0;o1)Object(p.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(f.length===0)return Object(p.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var v=f[0];if(b.isValidElement(v)&&Object(d.c)(v)){var m=v.ref;f[0]=b.cloneElement(v,{ref:Object(d.a)(m,this.setChildNode)})}return f.length===1?f[0]:f.map(function(_,E){return!b.isValidElement(_)||"key"in _&&_.key!==null?_:b.cloneElement(_,{key:"".concat(a,"-").concat(E)})})}}]),i}(b.Component);u.displayName="ResizeObserver",Ve.a=u},twBr:function(et,Ve,z){et.exports=z.p+"static/s.1f286590.svg"},uMZB:function(et,Ve,z){et.exports={header:"header___3a50V",checkboxs:"checkboxs___3TnBC",field:"field___SHW6f","oj-form-container":"oj-form-container___36KBv","oj-left-panel":"oj-left-panel___3Fdj5","oj-form-info":"oj-form-info___dilPb",footer:"footer___1Ie9U","test-case-name":"test-case-name___356US","btn-remove-case":"btn-remove-case___1Z5cd","icon-tag":"icon-tag___3zUaP",btn_back:"btn_back___2UBbR",testJi:"testJi___1dyLk",upBtn:"upBtn___1I0SJ"}},uQRt:function(et,Ve,z){et.exports=le;function le(){return z("gaXo"),{}}},ulZh:function(et,Ve,z){typeof window!="undefined"&&function(Q,j){et.exports=j()}(this,function(){return function(le){var Q={};function j(w){if(Q[w])return Q[w].exports;var P=Q[w]={i:w,l:!1,exports:{}};return le[w].call(P.exports,P,P.exports,j),P.l=!0,P.exports}return j.m=le,j.c=Q,j.d=function(w,P,b){j.o(w,P)||Object.defineProperty(w,P,{enumerable:!0,get:b})},j.r=function(w){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(w,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(w,"__esModule",{value:!0})},j.t=function(w,P){if(P&1&&(w=j(w)),P&8)return w;if(P&4&&typeof w=="object"&&w&&w.__esModule)return w;var b=Object.create(null);if(j.r(b),Object.defineProperty(b,"default",{enumerable:!0,value:w}),P&2&&typeof w!="string")for(var T in w)j.d(b,T,function(C){return w[C]}.bind(null,T));return b},j.n=function(w){var P=w&&w.__esModule?function(){return w.default}:function(){return w};return j.d(P,"a",P),P},j.o=function(w,P){return Object.prototype.hasOwnProperty.call(w,P)},j.p="/dist/",j(j.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(le,Q,j){"use strict";var w=Object.prototype.hasOwnProperty,P="~";function b(){}Object.create&&(b.prototype=Object.create(null),new b().__proto__||(P=!1));function T(d,o,a){this.fn=d,this.context=o,this.once=a||!1}function C(d,o,a,u,s){if(typeof a!="function")throw new TypeError("The listener must be a function");var h=new T(a,u||d,s),i=P?P+o:o;return d._events[i]?d._events[i].fn?d._events[i]=[d._events[i],h]:d._events[i].push(h):(d._events[i]=h,d._eventsCount++),d}function c(d,o){--d._eventsCount===0?d._events=new b:delete d._events[o]}function p(){this._events=new b,this._eventsCount=0}p.prototype.eventNames=function(){var o=[],a,u;if(this._eventsCount===0)return o;for(u in a=this._events)w.call(a,u)&&o.push(P?u.slice(1):u);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(a)):o},p.prototype.listeners=function(o){var a=P?P+o:o,u=this._events[a];if(!u)return[];if(u.fn)return[u.fn];for(var s=0,h=u.length,i=new Array(h);s0},!1)}function d(o,a){for(var u={main:[a]},s={main:[]},h={main:{}};p(u);)for(var i=Object.keys(u),n=0;n=2*E/y||D<=B)return;var H=Number.POSITIVE_INFINITY,te;for(te=i.level-1;te>l;te--){var W=x[te].maxBitrate;if(H=E*W/(8*.8*A),H=D)return;var V=this.bwEstimator.getEstimate();p.logger.warn("Fragment "+i.sn+(n?" part "+n.index:"")+" of level "+i.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+te+`
Current BW estimate: `+(Object(w.isFiniteNumber)(V)?(V/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+D.toFixed(3)+` s
Estimated load time for the next fragment: `+H.toFixed(3)+` s
Time to underbuffer: `+B.toFixed(3)+" s"),t.nextLoadLevel=te,this.bwEstimator.sample(g,_.loaded),this.clearTimer(),i.loader&&(this.fragCurrent=this.partCurrent=null,i.loader.abort()),t.trigger(b.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:n,stats:_})},s.onFragLoaded=function(i,n){var t=n.frag,f=n.part;if(t.type===c.PlaylistLevelType.MAIN&&Object(w.isFiniteNumber)(t.sn)){var v=f?f.stats:t.stats,m=f?f.duration:t.duration;if(this.clearTimer(),this.lastLoadedFragLevel=t.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var _=this.hls.levels[t.level],E=(_.loaded?_.loaded.bytes:0)+v.loaded,g=(_.loaded?_.loaded.duration:0)+m;_.loaded={bytes:E,duration:g},_.realBitrate=Math.round(8*E/g)}if(t.bitrateTest){var y={stats:v,frag:t,part:f,id:t.type};this.onFragBuffered(b.Events.FRAG_BUFFERED,y),t.bitrateTest=!1}}},s.onFragBuffered=function(i,n){var t=n.frag,f=n.part,v=f?f.stats:t.stats;if(v.aborted)return;if(t.type!==c.PlaylistLevelType.MAIN||t.sn==="initSegment")return;var m=v.parsing.end-v.loading.start;this.bwEstimator.sample(m,v.loaded),v.bwEstimate=this.bwEstimator.getEstimate(),t.bitrateTest?this.bitrateTestDelay=m/1e3:this.bitrateTestDelay=0},s.onError=function(i,n){switch(n.details){case C.ErrorDetails.FRAG_LOAD_ERROR:case C.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},s.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},s.getNextABRAutoLevel=function(){var i=this.fragCurrent,n=this.partCurrent,t=this.hls,f=t.maxAutoLevel,v=t.config,m=t.minAutoLevel,_=t.media,E=n?n.duration:i?i.duration:0,g=_?_.currentTime:0,y=_&&_.playbackRate!==0?Math.abs(_.playbackRate):1,x=this.bwEstimator?this.bwEstimator.getEstimate():v.abrEwmaDefaultEstimate,l=(T.BufferHelper.bufferInfo(_,g,v.maxBufferHole).end-g)/y,S=this.findBestLevel(x,m,f,l,v.abrBandWidthFactor,v.abrBandWidthUpFactor);if(S>=0)return S;p.logger.trace((l?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var O=E?Math.min(E,v.maxStarvationDelay):v.maxStarvationDelay,A=v.abrBandWidthFactor,D=v.abrBandWidthUpFactor;if(!l){var I=this.bitrateTestDelay;if(I){var B=E?Math.min(E,v.maxLoadingDelay):v.maxLoadingDelay;O=B-I,p.logger.trace("bitrate test took "+Math.round(1e3*I)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*O)+" ms"),A=D=1}}return S=this.findBestLevel(x,m,f,l+O,A,D),Math.max(S,0)},s.findBestLevel=function(i,n,t,f,v,m){for(var _,E=this.fragCurrent,g=this.partCurrent,y=this.lastLoadedFragLevel,x=this.hls.levels,l=x[y],S=!!(l!=null&&(_=l.details)!==null&&_!==void 0&&_.live),O=l==null?void 0:l.codecSet,A=g?g.duration:E?E.duration:0,D=t;D>=n;D--){var I=x[D];if(!I||O&&I.codecSet!==O)continue;var B=I.details,H=(g?B==null?void 0:B.partTarget:B==null?void 0:B.averagetargetduration)||A,te=void 0;D<=y?te=v*i:te=m*i;var W=x[D].maxBitrate,V=W*H/te;if(p.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+D+"/"+Math.round(te)+"/"+W+"/"+H+"/"+f+"/"+V),te>W&&(!V||S&&!this.bitrateTestDelay||V0&&l===-1?(this.log("Override startPosition with lastCurrentTime @"+S.toFixed(3)),this.state=P.State.IDLE):(this.loadedmetadata=!1,this.state=P.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=l,this.tick()},y.doTick=function(){switch(this.state){case P.State.IDLE:this.doTickIdle();break;case P.State.WAITING_TRACK:{var l,S=this.levels,O=this.trackId,A=S==null||((l=S[O])===null||l===void 0)?void 0:l.details;if(A){if(this.waitForCdnTuneIn(A))break;this.state=P.State.WAITING_INIT_PTS}break}case P.State.FRAG_LOADING_WAITING_RETRY:{var D,I=performance.now(),B=this.retryDate;(!B||I>=B||(D=this.media)!==null&&D!==void 0&&D.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=P.State.IDLE);break}case P.State.WAITING_INIT_PTS:{var H=this.waitingData;if(H){var te=H.frag,W=H.part,V=H.cache,X=H.complete;if(this.initPTS[te.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=P.State.FRAG_LOADING;var ne=V.flush(),Y={frag:te,part:W,payload:ne,networkDetails:null};this._handleFragmentLoadProgress(Y),X&&E.prototype._handleFragmentLoadComplete.call(this,Y)}else if(this.videoTrackCC!==this.waitingVideoCC)n.logger.log("Waiting fragment cc ("+te.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ee=this.getLoadPosition(),ce=T.BufferHelper.bufferInfo(this.mediaBuffer,ee,this.config.maxBufferHole),de=Object(s.fragmentWithinToleranceTest)(ce.end,this.config.maxFragLookUpTolerance,te);de<0&&(n.logger.log("Waiting fragment cc ("+te.cc+") @ "+te.start+" cancelled because another fragment at "+ce.end+" is needed"),this.clearWaitingFragment())}}else this.state=P.State.IDLE}}this.onTickEnd()},y.clearWaitingFragment=function(){var l=this.waitingData;l&&(this.fragmentTracker.removeFragment(l.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=P.State.IDLE)},y.onTickEnd=function(){var l=this.media;if(!l||!l.readyState)return;var S=this.mediaBuffer?this.mediaBuffer:l,O=S.buffered;!this.loadedmetadata&&O.length&&(this.loadedmetadata=!0),this.lastCurrentTime=l.currentTime},y.doTickIdle=function(){var l,S,O=this.hls,A=this.levels,D=this.media,I=this.trackId,B=O.config;if(!A||!A[I])return;if(!D&&(this.startFragRequested||!B.startFragPrefetch))return;var H=A[I],te=H.details;if(!te||te.live&&this.levelLastLoaded!==I||this.waitForCdnTuneIn(te)){this.state=P.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,d.ElementaryStreamTypes.AUDIO,p.PlaylistLevelType.AUDIO));var W=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,p.PlaylistLevelType.AUDIO);if(W===null)return;var V=W.len,X=this.getMaxBufferLength(),ne=this.audioSwitch;if(V>=X&&!ne)return;if(!ne&&this._streamEnded(W,te)){O.trigger(b.Events.BUFFER_EOS,{type:"audio"}),this.state=P.State.ENDED;return}var Y=te.fragments,ee=Y[0].start,ce=W.end;if(ne){var de=this.getLoadPosition();ce=de,te.PTSKnown&&deee||W.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),D.currentTime=ee+.05))}var Ce=this.getNextFragment(ce,te);if(!Ce){this.bufferFlushed=!0;return}((l=Ce.decryptdata)===null||l===void 0?void 0:l.keyFormat)==="identity"&&!((S=Ce.decryptdata)!==null&&S!==void 0&&S.key)?this.loadKey(Ce,te):this.loadFragment(Ce,te,ce)},y.getMaxBufferLength=function(){var l=E.prototype.getMaxBufferLength.call(this),S=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,p.PlaylistLevelType.MAIN);return S===null?l:Math.max(l,S.len)},y.onMediaDetaching=function(){this.videoBuffer=null,E.prototype.onMediaDetaching.call(this)},y.onAudioTracksUpdated=function(l,S){var O=S.audioTracks;this.resetTransmuxer(),this.levels=O.map(function(A){return new c.Level(A)})},y.onAudioTrackSwitching=function(l,S){var O=!!S.url;this.trackId=S.id;var A=this.fragCurrent;A!=null&&A.loader&&A.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),O?this.setInterval(m):this.resetTransmuxer(),O?(this.audioSwitch=!0,this.state=P.State.IDLE):this.state=P.State.STOPPED,this.tick()},y.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},y.onLevelLoaded=function(l,S){this.mainDetails=S.details},y.onAudioTrackLoaded=function(l,S){var O,A=this.levels,D=S.details,I=S.id;if(!A){this.warn("Audio tracks were reset while loading level "+I);return}this.log("Track "+I+" loaded ["+D.startSN+","+D.endSN+"],duration:"+D.totalduration);var B=A[I],H=0;if(D.live||(O=B.details)!==null&&O!==void 0&&O.live){var te=this.mainDetails;if(D.fragments[0]||(D.deltaUpdateFailed=!0),D.deltaUpdateFailed||!te)return;!B.details&&D.hasProgramDateTime&&te.hasProgramDateTime?(Object(h.alignMediaPlaylistByPDT)(D,te),H=D.fragments[0].start):H=this.alignPlaylists(D,B.details)}B.details=D,this.levelLastLoaded=I,!this.startFragRequested&&(this.mainDetails||!D.live)&&this.setStartPosition(B.details,H),this.state===P.State.WAITING_TRACK&&!this.waitForCdnTuneIn(D)&&(this.state=P.State.IDLE),this.tick()},y._handleFragmentLoadProgress=function(l){var S,O=l.frag,A=l.part,D=l.payload,I=this.config,B=this.trackId,H=this.levels;if(!H){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+O.sn+" of level "+O.level+" will not be buffered");return}var te=H[B];console.assert(te,"Audio track is defined on fragment load progress");var W=te.details;console.assert(W,"Audio track details are defined on fragment load progress");var V=I.defaultAudioCodec||te.audioCodec||"mp4a.40.2",X=this.transmuxer;X||(X=this.transmuxer=new a.default(this.hls,p.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var ne=this.initPTS[O.cc],Y=(S=O.initSegment)===null||S===void 0?void 0:S.data;if(ne!==void 0){var ee=!1,ce=A?A.index:-1,de=ce!==-1,Ce=new u.ChunkMetadata(O.level,O.sn,O.stats.chunkCount,D.byteLength,ce,de);X.push(D,Y,V,"",O,A,W.totalduration,ee,Ce,ne)}else{n.logger.log("Unknown video PTS for cc "+O.cc+", waiting for video PTS before demuxing audio frag "+O.sn+" of ["+W.startSN+" ,"+W.endSN+"],track "+B);var Se=this.waitingData=this.waitingData||{frag:O,part:A,cache:new o.default,complete:!1},Pe=Se.cache;Pe.push(new Uint8Array(D)),this.waitingVideoCC=this.videoTrackCC,this.state=P.State.WAITING_INIT_PTS}},y._handleFragmentLoadComplete=function(l){if(this.waitingData){this.waitingData.complete=!0;return}E.prototype._handleFragmentLoadComplete.call(this,l)},y.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},y.onBufferCreated=function(l,S){var O=S.tracks.audio;O&&(this.mediaBuffer=O.buffer),S.tracks.video&&(this.videoBuffer=S.tracks.video.buffer)},y.onFragBuffered=function(l,S){var O=S.frag,A=S.part;if(O.type!==p.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(O)){this.warn("Fragment "+O.sn+(A?" p: "+A.index:"")+" of level "+O.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}O.sn!=="initSegment"&&(this.fragPrevious=O,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(b.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(O,A)},y.onError=function(l,S){switch(S.details){case i.ErrorDetails.FRAG_LOAD_ERROR:case i.ErrorDetails.FRAG_LOAD_TIMEOUT:case i.ErrorDetails.KEY_LOAD_ERROR:case i.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(p.PlaylistLevelType.AUDIO,S);break;case i.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case i.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==P.State.ERROR&&this.state!==P.State.STOPPED&&(this.state=S.fatal?P.State.ERROR:P.State.IDLE,this.warn(S.details+" while loading frag, switching to "+this.state+" state"));break;case i.ErrorDetails.BUFFER_FULL_ERROR:if(S.parent==="audio"&&(this.state===P.State.PARSING||this.state===P.State.PARSED)){var O=!0,A=this.getFwdBufferInfo(this.mediaBuffer,p.PlaylistLevelType.AUDIO);A&&A.len>.5&&(O=!this.reduceMaxBufferLength(A.len)),O&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,E.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},y.onBufferFlushed=function(l,S){var O=S.type;O===d.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},y._handleTransmuxComplete=function(l){var S,O="audio",A=this.hls,D=l.remuxResult,I=l.chunkMeta,B=this.getCurrentContext(I);if(!B){this.warn("The loading context changed while buffering fragment "+I.sn+" of level "+I.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(I.level);return}var H=B.frag,te=B.part,W=D.audio,V=D.text,X=D.id3,ne=D.initSegment;if(this.fragContextChanged(H))return;if(this.state=P.State.PARSING,this.audioSwitch&&W&&this.completeAudioSwitch(),ne!=null&&ne.tracks&&(this._bufferInitSegment(ne.tracks,H,I),A.trigger(b.Events.FRAG_PARSING_INIT_SEGMENT,{frag:H,id:O,tracks:ne.tracks})),W){var Y=W.startPTS,ee=W.endPTS,ce=W.startDTS,de=W.endDTS;te&&(te.elementaryStreams[d.ElementaryStreamTypes.AUDIO]={startPTS:Y,endPTS:ee,startDTS:ce,endDTS:de}),H.setElementaryStreamInfo(d.ElementaryStreamTypes.AUDIO,Y,ee,ce,de),this.bufferFragmentData(W,H,te,I)}if(X!=null&&(S=X.samples)!==null&&S!==void 0&&S.length){var Ce=t({frag:H,id:O},X);A.trigger(b.Events.FRAG_PARSING_METADATA,Ce)}if(V){var Se=t({frag:H,id:O},V);A.trigger(b.Events.FRAG_PARSING_USERDATA,Se)}},y._bufferInitSegment=function(l,S,O){if(this.state!==P.State.PARSING)return;l.video&&delete l.video;var A=l.audio;if(!A)return;A.levelCodec=A.codec,A.id="audio",this.log("Init audio buffer, container:"+A.container+", codecs[parsed]=["+A.codec+"]"),this.hls.trigger(b.Events.BUFFER_CODECS,l);var D=A.initSegment;if(D!=null&&D.byteLength){var I={type:"audio",frag:S,part:null,chunkMeta:O,parent:S.type,data:D};this.hls.trigger(b.Events.BUFFER_APPENDING,I)}this.tick()},y.loadFragment=function(l,S,O){var A=this.fragmentTracker.getState(l);this.fragCurrent=l,(this.audioSwitch||A===C.FragmentState.NOT_LOADED||A===C.FragmentState.PARTIAL)&&(l.sn==="initSegment"?this._loadInitSegment(l):S.live&&!Object(w.isFiniteNumber)(this.initPTS[l.cc])?(this.log("Waiting for video PTS in continuity counter "+l.cc+" of live stream before loading audio fragment "+l.sn+" of level "+this.trackId),this.state=P.State.WAITING_INIT_PTS):(this.startFragRequested=!0,E.prototype.loadFragment.call(this,l,S,O)))},y.completeAudioSwitch=function(){var l=this.hls,S=this.media,O=this.trackId;S&&(this.log("Switching audio track : flushing all audio"),E.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,l.trigger(b.Events.AUDIO_TRACK_SWITCHED,{id:O})},g}(P.default);Q.default=_},"./src/controller/audio-track-controller.ts":function(le,Q,j){"use strict";j.r(Q);var w=j("./src/events.ts"),P=j("./src/errors.ts"),b=j("./src/controller/base-playlist-controller.ts"),T=j("./src/types/loader.ts");function C(a,u){for(var s=0;s=n.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var t=n[this.trackId];this.log("Now switching to audio-track index "+i);var f=n[i],v=f.id,m=f.groupId,_=m===void 0?"":m,E=f.name,g=f.type,y=f.url;if(this.trackId=i,this.trackName=E,this.selectDefaultTrack=!1,this.hls.trigger(w.Events.AUDIO_TRACK_SWITCHING,{id:v,groupId:_,name:E,type:g,url:y}),f.details&&!f.details.live)return;var x=this.switchParams(f.url,t==null?void 0:t.details);this.loadPlaylist(x)},s.selectInitialTrack=function(){var i=this.tracksInGroup;console.assert(i.length,"Initial audio track should be selected when tracks are known");var n=this.trackName,t=this.findTrackId(n)||this.findTrackId();t!==-1?this.setAudioTrack(t):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(w.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},s.findTrackId=function(i){for(var n=this.tracksInGroup,t=0;tu.partTarget&&(f+=1)}if(Object(w.isFiniteNumber)(t))return new P.HlsUrlParameters(t,Object(w.isFiniteNumber)(f)?f:void 0,P.HlsSkip.No)}}},d.loadPlaylist=function(a){},d.shouldLoadTrack=function(a){return this.canLoad&&a&&!!a.url&&(!a.details||a.details.live)},d.playlistLoaded=function(a,u,s){var h=this,i=u.details,n=u.stats,t=n.loading.end?Math.max(0,self.performance.now()-n.loading.end):0;if(i.advancedDateTime=Date.now()-t,i.live||s!=null&&s.live){if(i.reloaded(s),s&&this.log("live playlist "+a+" "+(i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:"MISSED")),s&&i.fragments.length>0&&Object(b.mergeDetails)(s,i),!this.canLoad||!i.live)return;var f,v=void 0,m=void 0;if(i.canBlockReload&&i.endSN&&i.advanced){var _=this.hls.config.lowLatencyMode,E=i.lastPartSn,g=i.endSN,y=i.lastPartIndex,x=y!==-1,l=E===g,S=_?0:y;x?(v=l?g+1:E,m=l?S:y+1):v=g+1;var O=i.age,A=O+i.ageHeader,D=Math.min(A-i.partTarget,i.targetduration*1.5);if(D>0){if(s&&D>s.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+s.tuneInGoal+" to: "+D+" with playlist age: "+i.age),D=0;else{var I=Math.floor(D/i.targetduration);if(v+=I,m!==void 0){var B=Math.round(D%i.targetduration/i.partTarget);m+=B}this.log("CDN Tune-in age: "+i.ageHeader+"s last advanced "+O.toFixed(2)+"s goal: "+D+" skip sn "+I+" to part "+m)}i.tuneInGoal=D}if(f=this.getDeliveryDirectives(i,u.deliveryDirectives,v,m),_||!l){this.loadPlaylist(f);return}}else f=this.getDeliveryDirectives(i,u.deliveryDirectives,v,m);var H=Object(b.computeReloadInterval)(i,n);v!==void 0&&i.canBlockReload&&(H-=i.partTarget||1),this.log("reload live playlist "+a+" in "+Math.round(H)+" ms"),this.timer=self.setTimeout(function(){return h.loadPlaylist(f)},H)}else this.clearTimer()},d.getDeliveryDirectives=function(a,u,s,h){var i=Object(P.getSkipValue)(a,s);return u!=null&&u.skip&&a.deltaUpdateFailed&&(s=u.msn,h=u.part,i=P.HlsSkip.No),new P.HlsUrlParameters(s,h,i)},d.retryLoadingOrFail=function(a){var u=this,s=this.hls.config,h=this.retryCount-1&&(i=a.context)!==null&&i!==void 0&&i.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+a.details+'"'),this.loadPlaylist();else{var n=Math.min(Math.pow(2,this.retryCount)*s.levelLoadingRetryDelay,s.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return u.loadPlaylist()},n),this.warn("retry playlist loading #"+this.retryCount+" in "+n+' ms after "'+a.details+'"')}}else this.warn('cannot recover from error "'+a.details+'"'),this.clearTimer(),a.fatal=!0;return h},p}()},"./src/controller/base-stream-controller.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"State",function(){return g}),j.d(Q,"default",function(){return y});var w=j("./src/polyfills/number.ts"),P=j("./src/task-loop.ts"),b=j("./src/controller/fragment-tracker.ts"),T=j("./src/utils/buffer-helper.ts"),C=j("./src/utils/logger.ts"),c=j("./src/events.ts"),p=j("./src/errors.ts"),d=j("./src/types/transmuxer.ts"),o=j("./src/utils/mp4-tools.ts"),a=j("./src/utils/discontinuities.ts"),u=j("./src/controller/fragment-finders.ts"),s=j("./src/controller/level-helper.ts"),h=j("./src/loader/fragment-loader.ts"),i=j("./src/crypt/decrypter.ts"),n=j("./src/utils/time-ranges.ts"),t=j("./src/types/loader.ts");function f(x,l){for(var S=0;Sne;(te0&&te&&te.key&&te.iv&&te.method==="AES-128"){var W=self.performance.now();return D.decrypter.webCryptoDecrypt(new Uint8Array(H),te.key.buffer,te.iv.buffer).then(function(V){var X=self.performance.now();return B.trigger(c.Events.FRAG_DECRYPTED,{frag:A,payload:V,stats:{tstart:W,tdecrypt:X}}),I.payload=V,I})}return I}).then(function(I){var B=D.fragCurrent,H=D.hls,te=D.levels;if(!te)throw new Error("init load aborted, missing levels");var W=te[A.level].details;console.assert(W,"Level details are defined when init segment is loaded");var V=A.stats;D.state=g.IDLE,D.fragLoadError=0,A.data=new Uint8Array(I.payload),V.parsing.start=V.buffering.start=self.performance.now(),V.parsing.end=V.buffering.end=self.performance.now(),I.frag===B&&H.trigger(c.Events.FRAG_BUFFERED,{stats:V,frag:B,part:null,id:A.type}),D.tick()}).catch(function(I){D.warn(I),D.resetFragmentLoading(A)})},S.fragContextChanged=function(A){var D=this.fragCurrent;return!A||!D||A.level!==D.level||A.sn!==D.sn||A.urlId!==D.urlId},S.fragBufferedComplete=function(A,D){var I=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+A.type+" sn: "+A.sn+(D?" part: "+D.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+A.level+" "+n.default.toString(T.BufferHelper.getBuffered(I))),this.state=g.IDLE,this.tick()},S._handleFragmentLoadComplete=function(A){var D=this.transmuxer;if(!D)return;var I=A.frag,B=A.part,H=A.partsLoaded,te=!H||H.length===0||H.some(function(V){return!V}),W=new d.ChunkMetadata(I.level,I.sn,I.stats.chunkCount+1,0,B?B.index:-1,!te);D.flush(W)},S._handleFragmentLoadProgress=function(A){},S._doFragLoad=function(A,D,I,B){var H=this;if(I===void 0&&(I=null),!this.levels)throw new Error("frag load aborted, missing levels");if(I=Math.max(A.start,I||0),this.config.lowLatencyMode&&D){var te=D.partList;if(te&&B){I>A.end&&D.fragmentHint&&(A=D.fragmentHint);var W=this.getNextPart(te,A,I);if(W>-1){var V=te[W];return this.log("Loading part sn: "+A.sn+" p: "+V.index+" cc: "+A.cc+" of playlist ["+D.startSN+"-"+D.endSN+"] parts [0-"+W+"-"+(te.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+A.level+", target: "+parseFloat(I.toFixed(3))),this.nextLoadPosition=V.start+V.duration,this.state=g.FRAG_LOADING,this.hls.trigger(c.Events.FRAG_LOADING,{frag:A,part:te[W],targetBufferTime:I}),this.doFragPartsLoad(A,te,W,B).catch(function(X){return H.handleFragLoadError(X)})}else if(!A.url||this.loadedEndOfParts(te,I))return Promise.resolve(null)}}return this.log("Loading fragment "+A.sn+" cc: "+A.cc+" "+(D?"of ["+D.startSN+"-"+D.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+A.level+", target: "+parseFloat(I.toFixed(3))),Object(w.isFiniteNumber)(A.sn)&&!this.bitrateTest&&(this.nextLoadPosition=A.start+A.duration),this.state=g.FRAG_LOADING,this.hls.trigger(c.Events.FRAG_LOADING,{frag:A,targetBufferTime:I}),this.fragmentLoader.load(A,B).catch(function(X){return H.handleFragLoadError(X)})},S.doFragPartsLoad=function(A,D,I,B){var H=this;return new Promise(function(te,W){var V=[],X=function ne(Y){var ee=D[Y];H.fragmentLoader.loadPart(A,ee,B).then(function(ce){V[ee.index]=ce;var de=ce.part;H.hls.trigger(c.Events.FRAG_LOADED,ce);var Ce=D[Y+1];if(Ce&&Ce.fragment===A)ne(Y+1);else return te({frag:A,part:de,partsLoaded:V})}).catch(W)};X(I)})},S.handleFragLoadError=function(A){var D=A.data;return D&&D.details===p.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(D.frag,D.part):this.hls.trigger(c.Events.ERROR,D),null},S._handleTransmuxerFlush=function(A){var D=this.getCurrentContext(A);if(!D||this.state!==g.PARSING){this.fragCurrent||(this.state=g.IDLE);return}var I=D.frag,B=D.part,H=D.level,te=self.performance.now();I.stats.parsing.end=te,B&&(B.stats.parsing.end=te),this.updateLevelTiming(I,B,H,A.partial)},S.getCurrentContext=function(A){var D=this.levels,I=A.level,B=A.sn,H=A.part;if(!D||!D[I])return this.warn("Levels object was unset while buffering fragment "+B+" of level "+I+". The current chunk will not be buffered."),null;var te=D[I],W=H>-1?Object(s.getPartWith)(te,B,H):null,V=W?W.fragment:Object(s.getFragmentWithSN)(te,B,this.fragCurrent);return V?{frag:V,part:W,level:te}:null},S.bufferFragmentData=function(A,D,I,B){if(!A||this.state!==g.PARSING)return;var H=A.data1,te=A.data2,W=H;if(H&&te&&(W=Object(o.appendUint8Array)(H,te)),!W||!W.length)return;var V={type:A.type,frag:D,part:I,chunkMeta:B,parent:D.type,data:W};this.hls.trigger(c.Events.BUFFER_APPENDING,V),A.dropped&&A.independent&&!I&&this.flushBufferGap(D)},S.flushBufferGap=function(A){var D=this.media;if(!D)return;if(!T.BufferHelper.isBuffered(D,D.currentTime)){this.flushMainBuffer(0,A.start);return}var I=D.currentTime,B=T.BufferHelper.bufferInfo(D,I,0),H=A.duration,te=Math.min(this.config.maxFragLookUpTolerance*2,H*.25),W=Math.max(Math.min(A.start-te,B.end-te),I+te);A.start-W>te&&this.flushMainBuffer(W,A.start)},S.getFwdBufferInfo=function(A,D){var I=this.config,B=this.getLoadPosition();if(!Object(w.isFiniteNumber)(B))return null;var H=T.BufferHelper.bufferInfo(A,B,I.maxBufferHole);if(H.len===0&&H.nextStart!==void 0){var te=this.fragmentTracker.getBufferedFrag(B,D);if(te&&H.nextStart=I?(D.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+D.maxMaxBufferLength+"s"),!0):!1},S.getNextFragment=function(A,D){var I,B,H=D.fragments,te=H.length;if(!te)return null;var W=this.config,V=H[0].start,X;if(D.live){var ne=W.initialLiveManifestSize;if(te-1&&II.start&&I.loaded},S.getInitialLiveFragment=function(A,D){var I=this.fragPrevious,B=null;if(I){if(A.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+I.programDateTime),B=Object(u.findFragmentByPDT)(D,I.endProgramDateTime,this.config.maxFragLookUpTolerance)),!B){var H=I.sn+1;if(H>=A.startSN&&H<=A.endSN){var te=D[H-A.startSN];I.cc===te.cc&&(B=te,this.log("Live playlist, switching playlist, load frag with next SN: "+B.sn))}B||(B=Object(u.findFragWithCC)(D,I.cc),B&&this.log("Live playlist, switching playlist, load frag with same CC: "+B.sn))}}else{var W=this.hls.liveSyncPosition;W!==null&&(B=this.getFragmentAtPosition(W,this.bitrateTest?A.fragmentEnd:A.edge,A))}return B},S.getFragmentAtPosition=function(A,D,I){var B=this.config,H=this.fragPrevious,te=I.fragments,W=I.endSN,V=I.fragmentHint,X=B.maxFragLookUpTolerance,ne=!!(B.lowLatencyMode&&I.partList&&V);ne&&V&&!this.bitrateTest&&(te=te.concat(V),W=V.sn);var Y;if(AD-X?0:X;Y=Object(u.findFragmentByPTS)(H,te,A,ee)}else Y=te[te.length-1];if(Y){var ce=Y.sn-I.startSN,de=H&&Y.level===H.level,Ce=te[ce+1],Se=this.fragmentTracker.getState(Y);if(Se===b.FragmentState.BACKTRACKED){Y=null;for(var Pe=ce;te[Pe]&&this.fragmentTracker.getState(te[Pe])===b.FragmentState.BACKTRACKED;)H?Y=te[Pe--]:Y=te[--Pe];Y||(Y=Ce)}else H&&Y.sn===H.sn&&!ne&&(de&&(Y.sn=te-D.maxFragLookUpTolerance&&H<=W;if(B!==null&&I.duration>B&&(H"+A.startSN+" prev-sn: "+(H?H.sn:"na")+" fragments: "+W),Y}return V},S.waitForCdnTuneIn=function(A){var D=3;return A.live&&A.canBlockReload&&A.tuneInGoal>Math.max(A.partHoldBack,A.partTarget*D)},S.setStartPosition=function(A,D){var I=this.startPosition;if(I"+A))}}]),l}(P.default)},"./src/controller/buffer-controller.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return u});var w=j("./src/polyfills/number.ts"),P=j("./src/events.ts"),b=j("./src/utils/logger.ts"),T=j("./src/errors.ts"),C=j("./src/utils/buffer-helper.ts"),c=j("./src/utils/mediasource-helper.ts"),p=j("./src/loader/fragment.ts"),d=j("./src/controller/buffer-operation-queue.ts"),o=Object(c.getMediaSource)(),a=/([ha]vc.)(?:\.[^.,]+)+/,u=function(){function s(i){var n=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var t=n.hls,f=n.media,v=n.mediaSource;b.logger.log("[buffer-controller]: Media source opened"),f&&(n.updateMediaElementDuration(),t.trigger(P.Events.MEDIA_ATTACHED,{media:f})),v&&v.removeEventListener("sourceopen",n._onMediaSourceOpen),n.checkPendingTracks()},this._onMediaSourceClose=function(){b.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){b.logger.log("[buffer-controller]: Media source ended")},this.hls=i,this._initSourceBuffer(),this.registerListeners()}var h=s.prototype;return h.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},h.destroy=function(){this.unregisterListeners(),this.details=null},h.registerListeners=function(){var n=this.hls;n.on(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(P.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.on(P.Events.BUFFER_RESET,this.onBufferReset,this),n.on(P.Events.BUFFER_APPENDING,this.onBufferAppending,this),n.on(P.Events.BUFFER_CODECS,this.onBufferCodecs,this),n.on(P.Events.BUFFER_EOS,this.onBufferEos,this),n.on(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),n.on(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),n.on(P.Events.FRAG_PARSED,this.onFragParsed,this),n.on(P.Events.FRAG_CHANGED,this.onFragChanged,this)},h.unregisterListeners=function(){var n=this.hls;n.off(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(P.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.off(P.Events.BUFFER_RESET,this.onBufferReset,this),n.off(P.Events.BUFFER_APPENDING,this.onBufferAppending,this),n.off(P.Events.BUFFER_CODECS,this.onBufferCodecs,this),n.off(P.Events.BUFFER_EOS,this.onBufferEos,this),n.off(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),n.off(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),n.off(P.Events.FRAG_PARSED,this.onFragParsed,this),n.off(P.Events.FRAG_CHANGED,this.onFragChanged,this)},h._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new d.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},h.onManifestParsed=function(n,t){var f=2;(t.audio&&!t.video||!t.altAudio)&&(f=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=f,this.details=null,b.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},h.onMediaAttaching=function(n,t){var f=this.media=t.media;if(f&&o){var v=this.mediaSource=new o;v.addEventListener("sourceopen",this._onMediaSourceOpen),v.addEventListener("sourceended",this._onMediaSourceEnded),v.addEventListener("sourceclose",this._onMediaSourceClose),f.src=self.URL.createObjectURL(v),this._objectUrl=f.src}},h.onMediaDetaching=function(){var n=this.media,t=this.mediaSource,f=this._objectUrl;if(t){if(b.logger.log("[buffer-controller]: media source detaching"),t.readyState==="open")try{t.endOfStream()}catch(v){b.logger.warn("[buffer-controller]: onMediaDetaching: "+v.message+" while calling endOfStream")}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),n&&(f&&self.URL.revokeObjectURL(f),n.src===f?(n.removeAttribute("src"),n.load()):b.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(P.Events.MEDIA_DETACHED,void 0)},h.onBufferReset=function(){var n=this;this.getSourceBufferTypes().forEach(function(t){var f=n.sourceBuffer[t];try{f&&(n.removeBufferListeners(t),n.mediaSource&&n.mediaSource.removeSourceBuffer(f),n.sourceBuffer[t]=void 0)}catch(v){b.logger.warn("[buffer-controller]: Failed to reset the "+t+" buffer",v)}}),this._initSourceBuffer()},h.onBufferCodecs=function(n,t){var f=this,v=this.getSourceBufferTypes().length;if(Object.keys(t).forEach(function(m){if(v){var _=f.tracks[m];if(_&&typeof _.buffer.changeType=="function"){var E=t[m],g=E.codec,y=E.levelCodec,x=E.container,l=(_.levelCodec||_.codec).replace(a,"$1"),S=(y||g).replace(a,"$1");if(l!==S){var O=x+";codecs="+(y||g);f.appendChangeType(m,O)}}}else f.pendingTracks[m]=t[m]}),v)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},h.appendChangeType=function(n,t){var f=this,v=this.operationQueue,m={execute:function(){var E=f.sourceBuffer[n];E&&(b.logger.log("[buffer-controller]: changing "+n+" sourceBuffer type to "+t),E.changeType(t)),v.shiftAndExecuteNext(n)},onStart:function(){},onComplete:function(){},onError:function(E){b.logger.warn("[buffer-controller]: Failed to change "+n+" SourceBuffer type",E)}};v.append(m,n)},h.onBufferAppending=function(n,t){var f=this,v=this.hls,m=this.operationQueue,_=this.tracks,E=t.data,g=t.type,y=t.frag,x=t.part,l=t.chunkMeta,S=l.buffering[g],O=self.performance.now();S.start=O;var A=y.stats.buffering,D=x?x.stats.buffering:null;A.start===0&&(A.start=O),D&&D.start===0&&(D.start=O);var I=_.audio,B=g==="audio"&&l.id===1&&(I==null?void 0:I.container)==="audio/mpeg",H={execute:function(){if(S.executeStart=self.performance.now(),B){var W=f.sourceBuffer[g];if(W){var V=y.start-W.timestampOffset;Math.abs(V)>=.1&&(b.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+y.start+" (delta: "+V+") sn: "+y.sn+")"),W.timestampOffset=y.start)}}f.appendExecutor(E,g)},onStart:function(){},onComplete:function(){var W=self.performance.now();S.executeEnd=S.end=W,A.first===0&&(A.first=W),D&&D.first===0&&(D.first=W);var V=f.sourceBuffer,X={};for(var ne in V)X[ne]=C.BufferHelper.getBuffered(V[ne]);f.appendError=0,f.hls.trigger(P.Events.BUFFER_APPENDED,{type:g,frag:y,part:x,chunkMeta:l,parent:y.type,timeRanges:X})},onError:function(W){b.logger.error("[buffer-controller]: Error encountered while trying to append to the "+g+" SourceBuffer",W);var V={type:T.ErrorTypes.MEDIA_ERROR,parent:y.type,details:T.ErrorDetails.BUFFER_APPEND_ERROR,err:W,fatal:!1};W.code===DOMException.QUOTA_EXCEEDED_ERR?V.details=T.ErrorDetails.BUFFER_FULL_ERROR:(f.appendError++,V.details=T.ErrorDetails.BUFFER_APPEND_ERROR,f.appendError>v.config.appendErrorMaxRetry&&(b.logger.error("[buffer-controller]: Failed "+v.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),V.fatal=!0)),v.trigger(P.Events.ERROR,V)}};m.append(H,g)},h.onBufferFlushing=function(n,t){var f=this,v=this.operationQueue,m=function(E){return{execute:f.removeExecutor.bind(f,E,t.startOffset,t.endOffset),onStart:function(){},onComplete:function(){f.hls.trigger(P.Events.BUFFER_FLUSHED,{type:E})},onError:function(y){b.logger.warn("[buffer-controller]: Failed to remove from "+E+" SourceBuffer",y)}}};t.type?v.append(m(t.type),t.type):this.getSourceBufferTypes().forEach(function(_){v.append(m(_),_)})},h.onFragParsed=function(n,t){var f=this,v=t.frag,m=t.part,_=[],E=m?m.elementaryStreams:v.elementaryStreams;E[p.ElementaryStreamTypes.AUDIOVIDEO]?_.push("audiovideo"):(E[p.ElementaryStreamTypes.AUDIO]&&_.push("audio"),E[p.ElementaryStreamTypes.VIDEO]&&_.push("video"));var g=function(){var x=self.performance.now();v.stats.buffering.end=x,m&&(m.stats.buffering.end=x);var l=m?m.stats:v.stats;f.hls.trigger(P.Events.FRAG_BUFFERED,{frag:v,part:m,stats:l,id:v.type})};_.length===0&&b.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+v.type+" level: "+v.level+" sn: "+v.sn),this.blockBuffers(g,_)},h.onFragChanged=function(n,t){this.flushBackBuffer()},h.onBufferEos=function(n,t){var f=this,v=this.getSourceBufferTypes().reduce(function(m,_){var E=f.sourceBuffer[_];return(!t.type||t.type===_)&&(E&&!E.ended&&(E.ended=!0,b.logger.log("[buffer-controller]: "+_+" sourceBuffer now EOS"))),m&&!!(!E||E.ended)},!0);v&&this.blockBuffers(function(){var m=f.mediaSource;if(!m||m.readyState!=="open")return;m.endOfStream()})},h.onLevelUpdated=function(n,t){var f=t.details;if(!f.fragments.length)return;this.details=f,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},h.flushBackBuffer=function(){var n=this.hls,t=this.details,f=this.media,v=this.sourceBuffer;if(!f||t===null)return;var m=this.getSourceBufferTypes();if(!m.length)return;var _=t.live&&n.config.liveBackBufferLength!==null?n.config.liveBackBufferLength:n.config.backBufferLength;if(!Object(w.isFiniteNumber)(_)||_<0)return;var E=f.currentTime,g=t.levelTargetDuration,y=Math.max(_,g),x=Math.floor(E/g)*g-y;m.forEach(function(l){var S=v[l];if(S){var O=C.BufferHelper.getBuffered(S);O.length>0&&x>O.start(0)&&(n.trigger(P.Events.BACK_BUFFER_REACHED,{bufferEnd:x}),t.live&&n.trigger(P.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:x}),n.trigger(P.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:x,type:l}))}})},h.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var n=this.details,t=this.hls,f=this.media,v=this.mediaSource,m=n.fragments[0].start+n.totalduration,_=f.duration,E=Object(w.isFiniteNumber)(v.duration)?v.duration:0;n.live&&t.config.liveDurationInfinity?(b.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),v.duration=Infinity,this.updateSeekableRange(n)):(m>E&&m>_||!Object(w.isFiniteNumber)(_))&&(b.logger.log("[buffer-controller]: Updating Media Source duration to "+m.toFixed(3)),v.duration=m)},h.updateSeekableRange=function(n){var t=this.mediaSource,f=n.fragments,v=f.length;if(v&&n.live&&t!==null&&t!==void 0&&t.setLiveSeekableRange){var m=Math.max(0,f[0].start),_=Math.max(m,m+n.totalduration);t.setLiveSeekableRange(m,_)}},h.checkPendingTracks=function(){var n=this.bufferCodecEventsExpected,t=this.operationQueue,f=this.pendingTracks,v=Object.keys(f).length;if(v&&!n||v===2){this.createSourceBuffers(f),this.pendingTracks={};var m=this.getSourceBufferTypes();if(m.length===0){this.hls.trigger(P.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}m.forEach(function(_){t.executeNext(_)})}},h.createSourceBuffers=function(n){var t=this.sourceBuffer,f=this.mediaSource;if(!f)throw Error("createSourceBuffers called when mediaSource was null");var v=0;for(var m in n)if(!t[m]){var _=n[m];if(!_)throw Error("source buffer exists for track "+m+", however track does not");var E=_.levelCodec||_.codec,g=_.container+";codecs="+E;b.logger.log("[buffer-controller]: creating sourceBuffer("+g+")");try{var y=t[m]=f.addSourceBuffer(g),x=m;this.addBufferListener(x,"updatestart",this._onSBUpdateStart),this.addBufferListener(x,"updateend",this._onSBUpdateEnd),this.addBufferListener(x,"error",this._onSBUpdateError),this.tracks[m]={buffer:y,codec:E,container:_.container,levelCodec:_.levelCodec,id:_.id},v++}catch(l){b.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+l.message),this.hls.trigger(P.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:l,mimeType:g})}}v&&this.hls.trigger(P.Events.BUFFER_CREATED,{tracks:this.tracks})},h._onSBUpdateStart=function(n){var t=this.operationQueue,f=t.current(n);f.onStart()},h._onSBUpdateEnd=function(n){var t=this.operationQueue,f=t.current(n);f.onComplete(),t.shiftAndExecuteNext(n)},h._onSBUpdateError=function(n,t){b.logger.error("[buffer-controller]: "+n+" SourceBuffer error",t),this.hls.trigger(P.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var f=this.operationQueue.current(n);f&&f.onError(t)},h.removeExecutor=function(n,t,f){var v=this.media,m=this.mediaSource,_=this.operationQueue,E=this.sourceBuffer,g=E[n];if(!v||!m||!g){b.logger.warn("[buffer-controller]: Attempting to remove from the "+n+" SourceBuffer, but it does not exist"),_.shiftAndExecuteNext(n);return}var y=Object(w.isFiniteNumber)(v.duration)?v.duration:Infinity,x=Object(w.isFiniteNumber)(m.duration)?m.duration:Infinity,l=Math.max(0,t),S=Math.min(f,y,x);S>l?(b.logger.log("[buffer-controller]: Removing ["+l+","+S+"] from the "+n+" SourceBuffer"),console.assert(!g.updating,n+" sourceBuffer must not be updating"),g.remove(l,S)):_.shiftAndExecuteNext(n)},h.appendExecutor=function(n,t){var f=this.operationQueue,v=this.sourceBuffer,m=v[t];if(!m){b.logger.warn("[buffer-controller]: Attempting to append to the "+t+" SourceBuffer, but it does not exist"),f.shiftAndExecuteNext(t);return}m.ended=!1,console.assert(!m.updating,t+" sourceBuffer must not be updating"),m.appendBuffer(n)},h.blockBuffers=function(n,t){var f=this;if(t===void 0&&(t=this.getSourceBufferTypes()),!t.length){b.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(n);return}var v=this.operationQueue,m=t.map(function(_){return v.appendBlocker(_)});Promise.all(m).then(function(){n(),t.forEach(function(_){var E=f.sourceBuffer[_];(!E||!E.updating)&&v.shiftAndExecuteNext(_)})})},h.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},h.addBufferListener=function(n,t,f){var v=this.sourceBuffer[n];if(!v)return;var m=f.bind(this,n);this.listeners[n].push({event:t,listener:m}),v.addEventListener(t,m)},h.removeBufferListeners=function(n){var t=this.sourceBuffer[n];if(!t)return;this.listeners[n].forEach(function(f){t.removeEventListener(f.event,f.listener)})},s}()},"./src/controller/buffer-operation-queue.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return P});var w=j("./src/utils/logger.ts"),P=function(){function b(C){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=C}var T=b.prototype;return T.append=function(c,p){var d=this.queues[p];d.push(c),d.length===1&&this.buffers[p]&&this.executeNext(p)},T.insertAbort=function(c,p){var d=this.queues[p];d.unshift(c),this.executeNext(p)},T.appendBlocker=function(c){var p,d=new Promise(function(a){p=a}),o={execute:p,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(o,c),d},T.executeNext=function(c){var p=this.buffers,d=this.queues,o=p[c],a=d[c];if(a.length){var u=a[0];try{u.execute()}catch(s){w.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),u.onError(s),(!o||!o.updating)&&(a.shift(),this.executeNext(c))}}},T.shiftAndExecuteNext=function(c){this.queues[c].shift(),this.executeNext(c)},T.current=function(c){return this.queues[c][0]},b}()},"./src/controller/cap-level-controller.ts":function(le,Q,j){"use strict";j.r(Q);var w=j("./src/events.ts");function P(C,c){for(var p=0;p0&&this.mediaWidth>0){var d=this.hls.levels;if(d.length){var o=this.hls;o.autoLevelCapping=this.getMaxLevel(d.length-1),o.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=o.autoLevelCapping}}},c.getMaxLevel=function(d){var o=this,a=this.hls.levels;if(!a.length)return-1;var u=a.filter(function(s,h){return C.isLevelAllowed(h,o.restrictedLevels)&&h<=d});return this.clientRect=null,C.getMaxLevelByMediaSize(u,this.mediaWidth,this.mediaHeight)},c.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},c.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},c.getDimensions=function(){if(this.clientRect)return this.clientRect;var d=this.media,o={width:0,height:0};if(d){var a=d.getBoundingClientRect();o.width=a.width,o.height=a.height,!o.width&&!o.height&&(o.width=a.right-a.left||d.width||0,o.height=a.bottom-a.top||d.height||0)}return this.clientRect=o,o},C.isLevelAllowed=function(d,o){return o===void 0&&(o=[]),o.indexOf(d)===-1},C.getMaxLevelByMediaSize=function(d,o,a){if(!d||!d.length)return-1;for(var u=function(t,f){return f?t.width!==f.width||t.height!==f.height:!0},s=d.length-1,h=0;h=o||i.height>=a)&&u(i,d[h+1])){s=h;break}}return s},b(C,[{key:"mediaWidth",get:function(){return this.getDimensions().width*C.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*C.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var d=1;try{d=self.devicePixelRatio}catch(o){}return d}}]),C}();Q.default=T},"./src/controller/cmcd-controller.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return u});var w=j("./src/events.ts"),P=j("./src/types/cmcd.ts"),b=j("./src/utils/buffer-helper.ts"),T=j("./src/utils/logger.ts");function C(s,h){for(var i=0;i=s.length?{done:!0}:{done:!1,value:s[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d(s,h){if(!s)return;if(typeof s=="string")return o(s,h);var i=Object.prototype.toString.call(s).slice(8,-1);if(i==="Object"&&s.constructor&&(i=s.constructor.name),i==="Map"||i==="Set")return Array.from(s);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return o(s,h)}function o(s,h){(h==null||h>s.length)&&(h=s.length);for(var i=0,n=new Array(h);it&&(t=_.bitrate)}return t>0?t:NaN},h.getBufferLength=function(n){var t=this.hls.media,f=n===P.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!f||!t)return NaN;var v=b.BufferHelper.bufferInfo(f,t.currentTime,this.config.maxBufferHole);return v.len*1e3},h.createPlaylistLoader=function(){var n=this.config.pLoader,t=this.applyPlaylistData,f=n||this.config.loader;return function(){function v(_){this.loader=void 0,this.loader=new f(_)}var m=v.prototype;return m.destroy=function(){this.loader.destroy()},m.abort=function(){this.loader.abort()},m.load=function(E,g,y){t(E),this.loader.load(E,g,y)},c(v,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),v}()},h.createFragmentLoader=function(){var n=this.config.fLoader,t=this.applyFragmentData,f=n||this.config.loader;return function(){function v(_){this.loader=void 0,this.loader=new f(_)}var m=v.prototype;return m.destroy=function(){this.loader.destroy()},m.abort=function(){this.loader.abort()},m.load=function(E,g,y){t(E),this.loader.load(E,g,y)},c(v,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),v}()},s.uuid=function(){var n=URL.createObjectURL(new Blob),t=n.toString();return URL.revokeObjectURL(n),t.substr(t.lastIndexOf("/")+1)},s.serialize=function(n){for(var t=[],f=function(B){return!Number.isNaN(B)&&B!=null&&B!==""&&B!==!1},v=function(B){return Math.round(B)},m=function(B){return v(B/100)*100},_=function(B){return encodeURIComponent(B)},E={br:v,d:v,bl:m,dl:m,mtp:m,nor:_,rtp:m,tb:v},g=Object.keys(n||{}).sort(),y=p(g),x;!(x=y()).done;){var l=x.value,S=n[l];if(!f(S))continue;if(l==="v"&&S===1)continue;if(l=="pr"&&S===1)continue;var O=E[l];O&&(S=O(S));var A=typeof S,D=void 0;l==="ot"||l==="sf"||l==="st"?D=l+"="+S:A==="boolean"?D=l:A==="number"?D=l+"="+S:D=l+"="+JSON.stringify(S),t.push(D)}return t.join(",")},s.toHeaders=function(n){for(var t=Object.keys(n),f={},v=["Object","Request","Session","Status"],m=[{},{},{},{}],_={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},E=0,g=t;Ep){this.hls.trigger(w.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var _=p-this._requestLicenseFailureCount+1;b.logger.warn("Retrying license request, "+_+" attempts left"),this._requestLicense(t,f)}break}},s._generateLicenseRequestChallenge=function(i,n){switch(i.mediaKeySystemDomain){case T.KeySystems.WIDEVINE:return n}throw new Error("unsupported key-system: "+i.mediaKeySystemDomain)},s._requestLicense=function(i,n){b.logger.log("Requesting content license for key-system");var t=this._mediaKeysList[0];if(!t){b.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(w.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var f=this.getLicenseServerUrl(t.mediaKeySystemDomain),v=this._createLicenseXhr(f,i,n);b.logger.log("Sending license request to URL: "+f);var m=this._generateLicenseRequestChallenge(t,i);v.send(m)}catch(_){b.logger.error("Failure requesting DRM license: "+_),this.hls.trigger(w.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},s.onMediaAttached=function(i,n){if(!this._emeEnabled)return;var t=n.media;this._media=t,t.addEventListener("encrypted",this._onMediaEncrypted)},s.onMediaDetached=function(){var i=this._media,n=this._mediaKeysList;if(!i)return;i.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(n.map(function(t){if(t.mediaKeysSession)return t.mediaKeysSession.close().catch(function(){})})).then(function(){return i.setMediaKeys(null)}).catch(function(){})},s.onManifestParsed=function(i,n){if(!this._emeEnabled)return;var t=n.levels.map(function(v){return v.audioCodec}).filter(function(v){return!!v}),f=n.levels.map(function(v){return v.videoCodec}).filter(function(v){return!!v});this._attemptKeySystemAccess(T.KeySystems.WIDEVINE,t,f)},c(u,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),u}();Q.default=a},"./src/controller/fps-controller.ts":function(le,Q,j){"use strict";j.r(Q);var w=j("./src/events.ts"),P=j("./src/utils/logger.ts"),b=function(){function T(c){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=c,this.registerListeners()}var C=T.prototype;return C.setStreamController=function(p){this.streamController=p},C.registerListeners=function(){this.hls.on(w.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},C.unregisterListeners=function(){this.hls.off(w.Events.MEDIA_ATTACHING,this.onMediaAttaching)},C.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},C.onMediaAttaching=function(p,d){var o=this.hls.config;if(o.capLevelOnFPSDrop){var a=d.media instanceof self.HTMLVideoElement?d.media:null;this.media=a,a&&typeof a.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),o.fpsDroppedMonitoringPeriod)}},C.checkFPS=function(p,d,o){var a=performance.now();if(d){if(this.lastTime){var u=a-this.lastTime,s=o-this.lastDroppedFrames,h=d-this.lastDecodedFrames,i=1e3*s/u,n=this.hls;if(n.trigger(w.Events.FPS_DROP,{currentDropped:s,currentDecoded:h,totalDroppedFrames:o}),i>0&&s>n.config.fpsDroppedMonitoringThreshold*h){var t=n.currentLevel;P.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+t),t>0&&(n.autoLevelCapping===-1||n.autoLevelCapping>=t)&&(t=t-1,n.trigger(w.Events.FPS_DROP_LEVEL_CAPPING,{level:t,droppedLevel:n.currentLevel}),n.autoLevelCapping=t,this.streamController.nextLevelSwitch())}}this.lastTime=a,this.lastDroppedFrames=o,this.lastDecodedFrames=d}},C.checkFPSInterval=function(){var p=this.media;if(p)if(this.isVideoPlaybackQualityAvailable){var d=p.getVideoPlaybackQuality();this.checkFPS(p,d.totalVideoFrames,d.droppedVideoFrames)}else this.checkFPS(p,p.webkitDecodedFrameCount,p.webkitDroppedFrameCount)},T}();Q.default=b},"./src/controller/fragment-finders.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"findFragmentByPDT",function(){return b}),j.d(Q,"findFragmentByPTS",function(){return T}),j.d(Q,"fragmentWithinToleranceTest",function(){return C}),j.d(Q,"pdtWithinToleranceTest",function(){return c}),j.d(Q,"findFragWithCC",function(){return p});var w=j("./src/polyfills/number.ts"),P=j("./src/utils/binary-search.ts");function b(d,o,a){if(o===null||!Array.isArray(d)||!d.length||!Object(w.isFiniteNumber)(o))return null;var u=d[0].programDateTime;if(o<(u||0))return null;var s=d[d.length-1].endProgramDateTime;if(o>=(s||0))return null;a=a||0;for(var h=0;hd&&a.start?-1:0}function c(d,o,a){var u=Math.min(o,a.duration+(a.deltaPTS?a.deltaPTS:0))*1e3,s=a.endProgramDateTime||0;return s-u>d}function p(d,o){return P.default.search(d,function(a){return a.cco?-1:0})}},"./src/controller/fragment-tracker.ts":function(le,Q,j){"use strict";j.r(Q),j.d(Q,"FragmentState",function(){return b}),j.d(Q,"FragmentTracker",function(){return T});var w=j("./src/events.ts"),P=j("./src/types/loader.ts"),b;(function(p){p.NOT_LOADED="NOT_LOADED",p.BACKTRACKED="BACKTRACKED",p.APPENDING="APPENDING",p.PARTIAL="PARTIAL",p.OK="OK"})(b||(b={}));var T=function(){function p(o){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=o,this._registerListeners()}var d=p.prototype;return d._registerListeners=function(){var a=this.hls;a.on(w.Events.BUFFER_APPENDED,this.onBufferAppended,this),a.on(w.Events.FRAG_BUFFERED,this.onFragBuffered,this),a.on(w.Events.FRAG_LOADED,this.onFragLoaded,this)},d._unregisterListeners=function(){var a=this.hls;a.off(w.Events.BUFFER_APPENDED,this.onBufferAppended,this),a.off(w.Events.FRAG_BUFFERED,this.onFragBuffered,this),a.off(w.Events.FRAG_LOADED,this.onFragLoaded,this)},d.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},d.getAppendedFrag=function(a,u){if(u===P.PlaylistLevelType.MAIN){var s=this.activeFragment,h=this.activeParts;if(!s)return null;if(h)for(var i=h.length;i--;){var n=h[i],t=n?n.end:s.appendedPTS;if(n.start<=a&&t!==void 0&&a<=t)return i>9&&(this.activeParts=h.slice(i-9)),n}else if(s.start<=a&&s.appendedPTS!==void 0&&a<=s.appendedPTS)return s}return this.getBufferedFrag(a,u)},d.getBufferedFrag=function(a,u){for(var s=this.fragments,h=Object.keys(s),i=h.length;i--;){var n=s[h[i]];if((n==null?void 0:n.body.type)===u&&n.buffered){var t=n.body;if(t.start<=a&&a<=t.end)return t}}return null},d.detectEvictedFragments=function(a,u,s){var h=this;Object.keys(this.fragments).forEach(function(i){var n=h.fragments[i];if(!n)return;if(!n.buffered){n.body.type===s&&h.removeFragment(n.body);return}var t=n.range[a];if(!t)return;t.time.some(function(f){var v=!h.isTimeBuffered(f.startPTS,f.endPTS,u);return v&&h.removeFragment(n.body),v})})},d.detectPartialFragments=function(a){var u=this,s=this.timeRanges,h=a.frag,i=a.part;if(!s||h.sn==="initSegment")return;var n=c(h),t=this.fragments[n];if(!t)return;Object.keys(s).forEach(function(f){var v=h.elementaryStreams[f];if(!v)return;var m=s[f],_=i!==null||v.partial===!0;t.range[f]=u.getBufferedTimes(h,i,_,m)}),t.backtrack=t.loaded=null,Object.keys(t.range).length?t.buffered=!0:this.removeFragment(t.body)},d.fragBuffered=function(a){var u=c(a),s=this.fragments[u];s&&(s.backtrack=s.loaded=null,s.buffered=!0)},d.getBufferedTimes=function(a,u,s,h){for(var i={time:[],partial:s},n=u?u.start:a.start,t=u?u.end:a.end,f=a.minEndPTS||t,v=a.maxStartPTS||n,m=0;m