(window.webpackJsonp=window.webpackJsonp||[]).push([[214,3,5,7,8,19],{"++UQ":function(Be,we,k){},"+NIl":function(Be,we,k){(function(ee){ee(k("VrN/"))})(function(ee){"use strict";ee.defineMode("stex",function(V,P){"use strict";function Y(h,s){h.cmdState.push(s)}function W(h){return h.cmdState.length>0?h.cmdState[h.cmdState.length-1]:null}function R(h){var s=h.cmdState.pop();s&&s.closeBracket()}function B(h){for(var s=h.cmdState,l=s.length-1;l>=0;l--){var i=s[l];if(i.name=="DEFAULT")continue;return i}return{styleIdentifier:function(){return null}}}function M(h,s,l){return function(){this.name=h,this.bracketNo=0,this.style=s,this.styles=l,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var L={};L.importmodule=M("importmodule","tag",["string","builtin"]),L.documentclass=M("documentclass","tag",["","atom"]),L.usepackage=M("usepackage","tag",["atom"]),L.begin=M("begin","tag",["atom"]),L.end=M("end","tag",["atom"]),L.label=M("label","tag",["atom"]),L.ref=M("ref","tag",["atom"]),L.eqref=M("eqref","tag",["atom"]),L.cite=M("cite","tag",["atom"]),L.bibitem=M("bibitem","tag",["atom"]),L.Bibitem=M("Bibitem","tag",["atom"]),L.RBibitem=M("RBibitem","tag",["atom"]),L.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function I(h,s){h.f=s}function p(h,s){var l;if(h.match(/^\\[a-zA-Z@]+/)){var i=h.current().slice(1);return l=L.hasOwnProperty(i)?L[i]:L.DEFAULT,l=new l,Y(s,l),I(s,u),l.style}if(h.match(/^\\[$&%#{}_]/))return"tag";if(h.match(/^\\[,;!\/\\]/))return"tag";if(h.match("\\["))return I(s,function(n,d){return m(n,d,"\\]")}),"keyword";if(h.match("\\("))return I(s,function(n,d){return m(n,d,"\\)")}),"keyword";if(h.match("$$"))return I(s,function(n,d){return m(n,d,"$$")}),"keyword";if(h.match("$"))return I(s,function(n,d){return m(n,d,"$")}),"keyword";var r=h.next();if(r=="%")return h.skipToEnd(),"comment";if(r=="}"||r=="]"){if(l=W(s),l)l.closeBracket(r),I(s,u);else return"error";return"bracket"}else return r=="{"||r=="["?(l=L.DEFAULT,l=new l,Y(s,l),"bracket"):/\d/.test(r)?(h.eatWhile(/[\w.%]/),"atom"):(h.eatWhile(/[\w\-_]/),l=B(s),l.name=="begin"&&(l.argument=h.current()),l.styleIdentifier())}function m(h,s,l){if(h.eatSpace())return null;if(l&&h.match(l))return I(s,p),"keyword";if(h.match(/^\\[a-zA-Z@]+/))return"tag";if(h.match(/^[a-zA-Z]+/))return"variable-2";if(h.match(/^\\[$&%#{}_]/))return"tag";if(h.match(/^\\[,;!\/]/))return"tag";if(h.match(/^[\^_&]/))return"tag";if(h.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(h.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var i=h.next();return i=="{"||i=="}"||i=="["||i=="]"||i=="("||i==")"?"bracket":i=="%"?(h.skipToEnd(),"comment"):"error"}function u(h,s){var l=h.peek(),i;return l=="{"||l=="["?(i=W(s),i.openBracket(l),h.eat(l),I(s,p),"bracket"):/[ \t\r]/.test(l)?(h.eat(l),null):(I(s,p),R(s),p(h,s))}return{startState:function(){var h=P.inMathMode?function(s,l){return m(s,l)}:p;return{cmdState:[],f:h}},copyState:function(h){return{cmdState:h.cmdState.slice(),f:h.f}},token:function(h,s){return s.f(h,s)},blankLine:function(h){h.f=p,h.cmdState.length=0},lineComment:"%"}}),ee.defineMIME("text/x-stex","stex"),ee.defineMIME("text/x-latex","stex")})},"+QRC":function(Be,we,k){"use strict";var ee=k("E9nw"),V={"text/plain":"Text","text/html":"Url",default:"Text"},P="Copy to clipboard: #{key}, Enter";function Y(R){var B=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return R.replace(/#{\s*key\s*}/g,B)}function W(R,B){var M,L,I,p,m,u,h=!1;B||(B={}),M=B.debug||!1;try{I=ee(),p=document.createRange(),m=document.getSelection(),u=document.createElement("span"),u.textContent=R,u.style.all="unset",u.style.position="fixed",u.style.top=0,u.style.clip="rect(0, 0, 0, 0)",u.style.whiteSpace="pre",u.style.webkitUserSelect="text",u.style.MozUserSelect="text",u.style.msUserSelect="text",u.style.userSelect="text",u.addEventListener("copy",function(l){if(l.stopPropagation(),B.format)if(l.preventDefault(),typeof l.clipboardData=="undefined"){M&&console.warn("unable to use e.clipboardData"),M&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var i=V[B.format]||V.default;window.clipboardData.setData(i,R)}else l.clipboardData.clearData(),l.clipboardData.setData(B.format,R);B.onCopy&&(l.preventDefault(),B.onCopy(l.clipboardData))}),document.body.appendChild(u),p.selectNodeContents(u),m.addRange(p);var s=document.execCommand("copy");if(!s)throw new Error("copy command was unsuccessful");h=!0}catch(l){M&&console.error("unable to copy using execCommand: ",l),M&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(B.format||"text",R),B.onCopy&&B.onCopy(window.clipboardData),h=!0}catch(i){M&&console.error("unable to copy using clipboardData: ",i),M&&console.error("falling back to prompt"),L=Y("message"in B?B.message:P),window.prompt(L,R)}}finally{m&&(typeof m.removeRange=="function"?m.removeRange(p):m.removeAllRanges()),u&&document.body.removeChild(u),I()}return h}Be.exports=W},"+aKw":function(Be,we,k){"use strict";var ee=k("tJVT"),V=k("q1tI"),P=k.n(V),Y=function(B){return String(B).length===1?"0".concat(B):B},W=function(B){var M=B.className,L=M===void 0?"":M,I=B.onChange,p=B.defaultValue,m=p===void 0?0:p,u=Object(V.useState)(m),h=Object(ee.a)(u,2),s=h[0],l=h[1];Object(V.useEffect)(function(){var d=setTimeout(function(){l(s+1e3)},1e3);return I(s+1e3),function(){clearInterval(d)}},[s]);var i=parseInt(s/(60*6e4))||"00",r=parseInt(s%(60*6e4)/6e4)||"00",n=parseInt(s%6e4/1e3)||"00";return P.a.createElement("div",{className:L},Y(i),":",Y(r),":",Y(n))};we.a=W},"+ua5":function(Be,we,k){},"07cG":function(Be,we,k){Be.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},"0r65":function(Be,we){var k=arguments[3],ee=arguments[4],V=arguments[5],P=JSON.stringify;Be.exports=function(Y,W){for(var R,B=Object.keys(V),M=0,L=B.length;M")):null:c.match("--")?y(s("comment","-->")):c.match("DOCTYPE",!0,!0)?(c.eatWhile(/[\w\._\-]/),y(l(1))):null:c.eat("?")?(c.eatWhile(/[\w\._\-]/),S.tokenize=s("meta","?>"),"meta"):(I=c.eat("/")?"closeTag":"openTag",S.tokenize=u,"tag bracket");if(b=="&"){var N;return c.eat("#")?c.eat("x")?N=c.eatWhile(/[a-fA-F\d]/)&&c.eat(";"):N=c.eatWhile(/[\d]/)&&c.eat(";"):N=c.eatWhile(/[\w\.\-:]/)&&c.eat(";"),N?"atom":"error"}else return c.eatWhile(/[^&<]/),null}m.isInText=!0;function u(c,S){var y=c.next();if(y==">"||y=="/"&&c.eat(">"))return S.tokenize=m,I=y==">"?"endTag":"selfcloseTag","tag bracket";if(y=="=")return I="equals",null;if(y=="<"){S.tokenize=m,S.state=d,S.tagName=S.tagStart=null;var b=S.tokenize(c,S);return b?b+" tag error":"tag error"}else return/[\'\"]/.test(y)?(S.tokenize=h(y),S.stringStartCol=c.column(),S.tokenize(c,S)):(c.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function h(c){var S=function(y,b){for(;!y.eol();)if(y.next()==c){b.tokenize=u;break}return"string"};return S.isInAttribute=!0,S}function s(c,S){return function(y,b){for(;!y.eol();){if(y.match(S)){b.tokenize=m;break}y.next()}return c}}function l(c){return function(S,y){for(var b;(b=S.next())!=null;){if(b=="<")return y.tokenize=l(c+1),y.tokenize(S,y);if(b==">")if(c==1){y.tokenize=m;break}else return y.tokenize=l(c-1),y.tokenize(S,y)}return"meta"}}function i(c,S,y){this.prev=c.context,this.tagName=S,this.indent=c.indented,this.startOfLine=y,(B.doNotIndent.hasOwnProperty(S)||c.context&&c.context.noIndent)&&(this.noIndent=!0)}function r(c){c.context&&(c.context=c.context.prev)}function n(c,S){for(var y;;){if(!c.context)return;if(y=c.context.tagName,!B.contextGrabbers.hasOwnProperty(y)||!B.contextGrabbers[y].hasOwnProperty(S))return;r(c)}}function d(c,S,y){return c=="openTag"?(y.tagStart=S.column(),w):c=="closeTag"?T:d}function w(c,S,y){return c=="word"?(y.tagName=S.current(),p="tag",E):B.allowMissingTagName&&c=="endTag"?(p="tag bracket",E(c,S,y)):(p="error",w)}function T(c,S,y){if(c=="word"){var b=S.current();return y.context&&y.context.tagName!=b&&B.implicitlyClosed.hasOwnProperty(y.context.tagName)&&r(y),y.context&&y.context.tagName==b||B.matchClosing===!1?(p="tag",x):(p="tag error",O)}else return B.allowMissingTagName&&c=="endTag"?(p="tag bracket",x(c,S,y)):(p="error",O)}function x(c,S,y){return c!="endTag"?(p="error",x):(r(y),d)}function O(c,S,y){return p="error",x(c,S,y)}function E(c,S,y){if(c=="word")return p="attribute",v;if(c=="endTag"||c=="selfcloseTag"){var b=y.tagName,N=y.tagStart;return y.tagName=y.tagStart=null,c=="selfcloseTag"||B.autoSelfClosers.hasOwnProperty(b)?n(y,b):(n(y,b),y.context=new i(y,b,N==y.indented)),d}return p="error",E}function v(c,S,y){return c=="equals"?_:(B.allowMissing||(p="error"),E(c,S,y))}function _(c,S,y){return c=="string"?f:c=="word"&&B.allowUnquoted?(p="string",E):(p="error",E(c,S,y))}function f(c,S,y){return c=="string"?f:E(c,S,y)}return{startState:function(c){var S={tokenize:m,state:d,indented:c||0,tagName:null,tagStart:null,context:null};return c!=null&&(S.baseIndent=c),S},token:function(c,S){if(!S.tagName&&c.sol()&&(S.indented=c.indentation()),c.eatSpace())return null;I=null;var y=S.tokenize(c,S);return(y||I)&&y!="comment"&&(p=null,S.state=S.state(I||y,c,S),p&&(y=p=="error"?y+" error":p)),y},indent:function(c,S,y){var b=c.context;if(c.tokenize.isInAttribute)return c.tagStart==c.indented?c.stringStartCol+1:c.indented+R;if(b&&b.noIndent)return ee.Pass;if(c.tokenize!=u&&c.tokenize!=m)return y?y.match(/^(\s*)/)[0].length:0;if(c.tagName)return B.multilineTagIndentPastTag!==!1?c.tagStart+c.tagName.length+2:c.tagStart+R*(B.multilineTagIndentFactor||1);if(B.alignCDATA&&/$/,blockCommentStart:"",configuration:B.htmlMode?"html":"xml",helperType:B.htmlMode?"html":"xml",skipAttribute:function(c){c.state==_&&(c.state=E)},xmlCurrentTag:function(c){return c.tagName?{name:c.tagName,close:c.type=="closeTag"}:null},xmlCurrentContext:function(c){for(var S=[],y=c.context;y;y=y.prev)y.tagName&&S.push(y.tagName);return S.reverse()}}}),ee.defineMIME("text/xml","xml"),ee.defineMIME("application/xml","xml"),ee.mimeModes.hasOwnProperty("text/html")||ee.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1j5w":function(Be,we,k){"use strict";k.d(we,"d",function(){return $e}),k.d(we,"b",function(){return Ce}),k.d(we,"c",function(){return st}),k.d(we,"a",function(){return Ft});var ee=k("VTBJ"),V=k("1OyB"),P=k("vuIU"),Y=k("JX7q"),W=k("Ji7U"),R=k("LK+K"),B=k("q1tI"),M=k("I8Z2"),L=k("BGR+"),I=k("wx14"),p=k("rePB"),m=k("4IlW"),u=k("2GS6"),h=k("Gytx"),s=k.n(h),l=k("TSYQ"),i=k.n(l),r=k("U8pU"),n=k("ODXe"),d=/iPhone/i,w=/iPod/i,T=/iPad/i,x=/\bAndroid(?:.+)Mobile\b/i,O=/Android/i,E=/\bAndroid(?:.+)SD4930UR\b/i,v=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,_=/Windows Phone/i,f=/\bWindows(?:.+)ARM\b/i,c=/BlackBerry/i,S=/BB10/i,y=/Opera Mini/i,b=/\b(CriOS|Chrome)(?:.+)Mobile/i,N=/Mobile(?:.+)Firefox\b/i;function F(wt,Qe){return wt.test(Qe)}function X(wt){var Qe=wt||(typeof navigator!="undefined"?navigator.userAgent:""),it=Qe.split("[FBAN");if(typeof it[1]!="undefined"){var We=it,ce=Object(n.a)(We,1);Qe=ce[0]}if(it=Qe.split("Twitter"),typeof it[1]!="undefined"){var Se=it,ot=Object(n.a)(Se,1);Qe=ot[0]}var ze={apple:{phone:F(d,Qe)&&!F(_,Qe),ipod:F(w,Qe),tablet:!F(d,Qe)&&F(T,Qe)&&!F(_,Qe),device:(F(d,Qe)||F(w,Qe)||F(T,Qe))&&!F(_,Qe)},amazon:{phone:F(E,Qe),tablet:!F(E,Qe)&&F(v,Qe),device:F(E,Qe)||F(v,Qe)},android:{phone:!F(_,Qe)&&F(E,Qe)||!F(_,Qe)&&F(x,Qe),tablet:!F(_,Qe)&&!F(E,Qe)&&!F(x,Qe)&&(F(v,Qe)||F(O,Qe)),device:!F(_,Qe)&&(F(E,Qe)||F(v,Qe)||F(x,Qe)||F(O,Qe))||F(/\bokhttp\b/i,Qe)},windows:{phone:F(_,Qe),tablet:F(f,Qe),device:F(_,Qe)||F(f,Qe)},other:{blackberry:F(c,Qe),blackberry10:F(S,Qe),opera:F(y,Qe),firefox:F(N,Qe),chrome:F(b,Qe),device:F(c,Qe)||F(S,Qe)||F(y,Qe)||F(N,Qe)||F(b,Qe)},any:null,phone:null,tablet:null};return ze.any=ze.apple.device||ze.android.device||ze.windows.device||ze.other.device,ze.phone=ze.apple.phone||ze.android.phone||ze.windows.phone,ze.tablet=ze.apple.tablet||ze.android.tablet||ze.windows.tablet,ze}var Z=Object(ee.a)(Object(ee.a)({},X()),{},{isMobile:X}),H=Z;function A(){}function z(wt,Qe,it){var We=Qe||"";return wt.key||"".concat(We,"item_").concat(it)}function ne(wt){return"".concat(wt,"-menu-")}function ae(wt,Qe){var it=-1;B.Children.forEach(wt,function(We){it+=1,We&&We.type&&We.type.isMenuItemGroup?B.Children.forEach(We.props.children,function(ce){it+=1,Qe(ce,it)}):Qe(We,it)})}function me(wt,Qe,it){if(!wt||it.find)return;B.Children.forEach(wt,function(We){if(We){var ce=We.type;if(!ce||!(ce.isSubMenu||ce.isMenuItem||ce.isMenuItemGroup))return;Qe.indexOf(We.key)!==-1?it.find=!0:We.props.children&&me(We.props.children,Qe,it)}})}var xe=["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"],Te=function(Qe){var it=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,We=Qe&&typeof Qe.getBoundingClientRect=="function"&&Qe.getBoundingClientRect().width;if(We){if(it){var ce=getComputedStyle(Qe),Se=ce.marginLeft,ot=ce.marginRight;We+=+Se.replace("px","")+ +ot.replace("px","")}We=+We.toFixed(6)}return We||0},Oe=function(Qe,it,We){Qe&&Object(r.a)(Qe.style)==="object"&&(Qe.style[it]=We)},Ue=function(){return H.any},De=k("KQm4"),be=k("Ff2n"),ge=k("i8i4"),He=k("bdgK"),ct=k("uciX"),vt=k("8XRh"),_t={adjustX:1,adjustY:1},yt={topLeft:{points:["bl","tl"],overflow:_t,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:_t,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:_t,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:_t,offset:[4,0]}},et={topLeft:{points:["bl","tl"],overflow:_t,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:_t,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:_t,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:_t,offset:[4,0]}},ht=yt,xt=0,Tt={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},mt=function(Qe,it,We){var ce=ne(it),Se=Qe.getState();Qe.setState({defaultActiveFirst:Object(ee.a)(Object(ee.a)({},Se.defaultActiveFirst),{},Object(p.a)({},ce,We))})},Ie=function(wt){Object(W.a)(it,wt);var Qe=Object(R.a)(it);function it(We){var ce;Object(V.a)(this,it),ce=Qe.call(this,We),ce.onDestroy=function(ke){ce.props.onDestroy(ke)},ce.onKeyDown=function(ke){var qe=ke.keyCode,Rt=ce.menuInstance,Pt=ce.props,$t=Pt.isOpen,fe=Pt.store;if(qe===m.a.ENTER)return ce.onTitleClick(ke),mt(fe,ce.props.eventKey,!0),!0;if(qe===m.a.RIGHT)return $t?Rt.onKeyDown(ke):(ce.triggerOpenChange(!0),mt(fe,ce.props.eventKey,!0)),!0;if(qe===m.a.LEFT){var se;if($t)se=Rt.onKeyDown(ke);else return;return se||(ce.triggerOpenChange(!1),se=!0),se}return $t&&(qe===m.a.UP||qe===m.a.DOWN)?Rt.onKeyDown(ke):void 0},ce.onOpenChange=function(ke){ce.props.onOpenChange(ke)},ce.onPopupVisibleChange=function(ke){ce.triggerOpenChange(ke,ke?"mouseenter":"mouseleave")},ce.onMouseEnter=function(ke){var qe=ce.props,Rt=qe.eventKey,Pt=qe.onMouseEnter,$t=qe.store;mt($t,ce.props.eventKey,!1),Pt({key:Rt,domEvent:ke})},ce.onMouseLeave=function(ke){var qe=ce.props,Rt=qe.parentMenu,Pt=qe.eventKey,$t=qe.onMouseLeave;Rt.subMenuInstance=Object(Y.a)(ce),$t({key:Pt,domEvent:ke})},ce.onTitleMouseEnter=function(ke){var qe=ce.props,Rt=qe.eventKey,Pt=qe.onItemHover,$t=qe.onTitleMouseEnter;Pt({key:Rt,hover:!0}),$t({key:Rt,domEvent:ke})},ce.onTitleMouseLeave=function(ke){var qe=ce.props,Rt=qe.parentMenu,Pt=qe.eventKey,$t=qe.onItemHover,fe=qe.onTitleMouseLeave;Rt.subMenuInstance=Object(Y.a)(ce),$t({key:Pt,hover:!1}),fe({key:Pt,domEvent:ke})},ce.onTitleClick=function(ke){var qe=Object(Y.a)(ce),Rt=qe.props;if(Rt.onTitleClick({key:Rt.eventKey,domEvent:ke}),Rt.triggerSubMenuAction==="hover")return;ce.triggerOpenChange(!Rt.isOpen,"click"),mt(Rt.store,ce.props.eventKey,!1)},ce.onSubMenuClick=function(ke){typeof ce.props.onClick=="function"&&ce.props.onClick(ce.addKeyPath(ke))},ce.onSelect=function(ke){ce.props.onSelect(ke)},ce.onDeselect=function(ke){ce.props.onDeselect(ke)},ce.getPrefixCls=function(){return"".concat(ce.props.rootPrefixCls,"-submenu")},ce.getActiveClassName=function(){return"".concat(ce.getPrefixCls(),"-active")},ce.getDisabledClassName=function(){return"".concat(ce.getPrefixCls(),"-disabled")},ce.getSelectedClassName=function(){return"".concat(ce.getPrefixCls(),"-selected")},ce.getOpenClassName=function(){return"".concat(ce.props.rootPrefixCls,"-submenu-open")},ce.saveMenuInstance=function(ke){ce.menuInstance=ke},ce.addKeyPath=function(ke){return Object(ee.a)(Object(ee.a)({},ke),{},{keyPath:(ke.keyPath||[]).concat(ce.props.eventKey)})},ce.triggerOpenChange=function(ke,qe){var Rt=ce.props.eventKey,Pt=function(){ce.onOpenChange({key:Rt,item:Object(Y.a)(ce),trigger:qe,open:ke})};qe==="mouseenter"?ce.mouseenterTimeout=setTimeout(function(){Pt()},0):Pt()},ce.isChildrenSelected=function(){var ke={find:!1};return me(ce.props.children,ce.props.selectedKeys,ke),ke.find},ce.isOpen=function(){return ce.props.openKeys.indexOf(ce.props.eventKey)!==-1},ce.adjustWidth=function(){if(!ce.subMenuTitle||!ce.menuInstance)return;var ke=ge.findDOMNode(ce.menuInstance);if(ke.offsetWidth>=ce.subMenuTitle.offsetWidth)return;ke.style.minWidth="".concat(ce.subMenuTitle.offsetWidth,"px")},ce.saveSubMenuTitle=function(ke){ce.subMenuTitle=ke},ce.getBaseProps=function(){var ke=Object(Y.a)(ce),qe=ke.props;return{mode:qe.mode==="horizontal"?"vertical":qe.mode,visible:ce.props.isOpen,level:qe.level+1,inlineIndent:qe.inlineIndent,focusable:!1,onClick:ce.onSubMenuClick,onSelect:ce.onSelect,onDeselect:ce.onDeselect,onDestroy:ce.onDestroy,selectedKeys:qe.selectedKeys,eventKey:"".concat(qe.eventKey,"-menu-"),openKeys:qe.openKeys,motion:qe.motion,onOpenChange:ce.onOpenChange,subMenuOpenDelay:qe.subMenuOpenDelay,parentMenu:Object(Y.a)(ce),subMenuCloseDelay:qe.subMenuCloseDelay,forceSubMenuRender:qe.forceSubMenuRender,triggerSubMenuAction:qe.triggerSubMenuAction,builtinPlacements:qe.builtinPlacements,defaultActiveFirst:qe.store.getState().defaultActiveFirst[ne(qe.eventKey)],multiple:qe.multiple,prefixCls:qe.rootPrefixCls,id:ce.internalMenuId,manualRef:ce.saveMenuInstance,itemIcon:qe.itemIcon,expandIcon:qe.expandIcon,direction:qe.direction}},ce.getMotion=function(ke,qe){var Rt=Object(Y.a)(ce),Pt=Rt.haveRendered,$t=ce.props,fe=$t.motion,se=$t.rootPrefixCls,U=Object(ee.a)(Object(ee.a)({},fe),{},{leavedClassName:"".concat(se,"-hidden"),removeOnLeave:!1,motionAppear:Pt||!qe||ke!=="inline"});return U};var Se=We.store,ot=We.eventKey,ze=Se.getState(),Lt=ze.defaultActiveFirst;ce.isRootMenu=!1;var Dt=!1;return Lt&&(Dt=Lt[ot]),mt(Se,ot,Dt),ce}return Object(P.a)(it,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ce=this,Se=this.props,ot=Se.mode,ze=Se.parentMenu,Lt=Se.manualRef;if(Lt&&Lt(this),ot!=="horizontal"||!ze.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return ce.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var ce=this.props,Se=ce.onDestroy,ot=ce.eventKey;Se&&Se(ot),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(ce){var Se=this,ot=this.getBaseProps(),ze=this.getMotion(ot.mode,ot.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||ot.visible||ot.forceSubMenuRender,!this.haveOpened)return B.createElement("div",null);var Lt=ot.direction;return B.createElement(vt.default,Object.assign({visible:ot.visible},ze),function(Dt){var ke=Dt.className,qe=Dt.style,Rt=i()("".concat(ot.prefixCls,"-sub"),ke,Object(p.a)({},"".concat(ot.prefixCls,"-rtl"),Lt==="rtl"));return B.createElement(Ee,Object.assign({},ot,{id:Se.internalMenuId,className:Rt,style:qe}),ce)})}},{key:"render",value:function(){var ce,Se=Object(ee.a)({},this.props),ot=Se.isOpen,ze=this.getPrefixCls(),Lt=Se.mode==="inline",Dt=i()(ze,"".concat(ze,"-").concat(Se.mode),(ce={},Object(p.a)(ce,Se.className,!!Se.className),Object(p.a)(ce,this.getOpenClassName(),ot),Object(p.a)(ce,this.getActiveClassName(),Se.active||ot&&!Lt),Object(p.a)(ce,this.getDisabledClassName(),Se.disabled),Object(p.a)(ce,this.getSelectedClassName(),this.isChildrenSelected()),ce));this.internalMenuId||(Se.eventKey?this.internalMenuId="".concat(Se.eventKey,"$Menu"):(xt+=1,this.internalMenuId="$__$".concat(xt,"$Menu")));var ke={},qe={},Rt={};Se.disabled||(ke={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},qe={onClick:this.onTitleClick},Rt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Pt={},$t=Se.direction;Lt&&($t==="rtl"?Pt.paddingRight=Se.inlineIndent*Se.level:Pt.paddingLeft=Se.inlineIndent*Se.level);var fe={};this.props.isOpen&&(fe={"aria-owns":this.internalMenuId});var se=null;Se.mode!=="horizontal"&&(se=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(se=B.createElement(this.props.expandIcon,Object(ee.a)({},this.props))));var U=B.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:Pt,className:"".concat(ze,"-title"),role:"button"},Rt,qe,{"aria-expanded":ot},fe,{"aria-haspopup":"true",title:typeof Se.title=="string"?Se.title:void 0}),Se.title,se||B.createElement("i",{className:"".concat(ze,"-arrow")})),G=this.renderChildren(Se.children),Q=Se.parentMenu.isRootMenu?Se.parentMenu.props.getPopupContainer:function(pn){return pn.parentNode},te=Tt[Se.mode],he=Se.popupOffset?{offset:Se.popupOffset}:{},Le=Se.mode==="inline"?"":Se.popupClassName;Le+=$t==="rtl"?" ".concat(ze,"-rtl"):"";var Ge=Se.disabled,Ot=Se.triggerSubMenuAction,Nt=Se.subMenuOpenDelay,Xe=Se.forceSubMenuRender,It=Se.subMenuCloseDelay,an=Se.builtinPlacements;xe.forEach(function(pn){return delete Se[pn]}),delete Se.onClick;var Ct=$t==="rtl"?Object.assign({},et,an):Object.assign({},yt,an);return delete Se.direction,B.createElement("li",Object.assign({},Se,ke,{className:Dt,role:"menuitem"}),Lt&&U,Lt&&G,!Lt&&B.createElement(ct.a,{prefixCls:ze,popupClassName:i()("".concat(ze,"-popup"),Le),getPopupContainer:Q,builtinPlacements:Ct,popupPlacement:te,popupVisible:ot,popupAlign:he,popup:G,action:Ge?[]:[Ot],mouseEnterDelay:Nt,mouseLeaveDelay:It,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:Xe},U))}}]),it}(B.Component);Ie.defaultProps={onMouseEnter:A,onMouseLeave:A,onTitleMouseEnter:A,onTitleMouseLeave:A,onTitleClick:A,manualRef:A,mode:"vertical",title:""};var je=Object(M.b)(function(wt,Qe){var it=wt.openKeys,We=wt.activeKey,ce=wt.selectedKeys,Se=Qe.eventKey,ot=Qe.subMenuKey;return{isOpen:it.indexOf(Se)>-1,active:We[ot]===Se,selectedKeys:ce}})(Ie);je.isSubMenu=!0;var $e=je,at="menuitem-overflowed",lt=.5,bt=function(wt){Object(W.a)(it,wt);var Qe=Object(R.a)(it);function it(){var We;return Object(V.a)(this,it),We=Qe.apply(this,arguments),We.resizeObserver=null,We.mutationObserver=null,We.originalTotalWidth=0,We.overflowedItems=[],We.menuItemSizes=[],We.cancelFrameId=null,We.state={lastVisibleIndex:void 0},We.getMenuItemNodes=function(){var ce=We.props.prefixCls,Se=ge.findDOMNode(Object(Y.a)(We));return Se?[].slice.call(Se.children).filter(function(ot){return ot.className.split(" ").indexOf("".concat(ce,"-overflowed-submenu"))<0}):[]},We.getOverflowedSubMenuItem=function(ce,Se,ot){var ze=We.props,Lt=ze.overflowedIndicator,Dt=ze.level,ke=ze.mode,qe=ze.prefixCls,Rt=ze.theme;if(Dt!==1||ke!=="horizontal")return null;var Pt=We.props.children[0],$t=Pt.props,fe=$t.children,se=$t.title,U=$t.style,G=Object(be.a)($t,["children","title","style"]),Q=Object(ee.a)({},U),te="".concat(ce,"-overflowed-indicator"),he="".concat(ce,"-overflowed-indicator");Se.length===0&&ot!==!0?Q=Object(ee.a)(Object(ee.a)({},Q),{},{display:"none"}):ot&&(Q=Object(ee.a)(Object(ee.a)({},Q),{},{visibility:"hidden",position:"absolute"}),te="".concat(te,"-placeholder"),he="".concat(he,"-placeholder"));var Le=Rt?"".concat(qe,"-").concat(Rt):"",Ge={};return xe.forEach(function(Ot){G[Ot]!==void 0&&(Ge[Ot]=G[Ot])}),B.createElement($e,Object.assign({title:Lt,className:"".concat(qe,"-overflowed-submenu"),popupClassName:Le},Ge,{key:te,eventKey:he,disabled:!1,style:Q}),Se)},We.setChildrenWidthAndResize=function(){if(We.props.mode!=="horizontal")return;var ce=ge.findDOMNode(Object(Y.a)(We));if(!ce)return;var Se=ce.children;if(!Se||Se.length===0)return;var ot=ce.children[Se.length-1];Oe(ot,"display","inline-block");var ze=We.getMenuItemNodes(),Lt=ze.filter(function(Dt){return Dt.className.split(" ").indexOf(at)>=0});Lt.forEach(function(Dt){Oe(Dt,"display","inline-block")}),We.menuItemSizes=ze.map(function(Dt){return Te(Dt,!0)}),Lt.forEach(function(Dt){Oe(Dt,"display","none")}),We.overflowedIndicatorWidth=Te(ce.children[ce.children.length-1],!0),We.originalTotalWidth=We.menuItemSizes.reduce(function(Dt,ke){return Dt+ke},0),We.handleResize(),Oe(ot,"display","none")},We.handleResize=function(){if(We.props.mode!=="horizontal")return;var ce=ge.findDOMNode(Object(Y.a)(We));if(!ce)return;var Se=Te(ce);We.overflowedItems=[];var ot=0,ze;We.originalTotalWidth>Se+lt&&(ze=-1,We.menuItemSizes.forEach(function(Lt){ot+=Lt,ot+We.overflowedIndicatorWidth<=Se&&(ze+=1)})),We.setState({lastVisibleIndex:ze})},We}return Object(P.a)(it,[{key:"componentDidMount",value:function(){var ce=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var Se=ge.findDOMNode(this);if(!Se)return;this.resizeObserver=new He.default(function(ot){ot.forEach(function(){var ze=ce.cancelFrameId;cancelAnimationFrame(ze),ce.cancelFrameId=requestAnimationFrame(ce.setChildrenWidthAndResize)})}),[].slice.call(Se.children).concat(Se).forEach(function(ot){ce.resizeObserver.observe(ot)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){ce.resizeObserver.disconnect(),[].slice.call(Se.children).concat(Se).forEach(function(ot){ce.resizeObserver.observe(ot)}),ce.setChildrenWidthAndResize()}),this.mutationObserver.observe(Se,{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(ce){var Se=this,ot=this.state.lastVisibleIndex;return(ce||[]).reduce(function(ze,Lt,Dt){var ke=Lt;if(Se.props.mode==="horizontal"){var qe=Se.getOverflowedSubMenuItem(Lt.props.eventKey,[]);ot!==void 0&&Se.props.className.indexOf("".concat(Se.props.prefixCls,"-root"))!==-1&&(Dt>ot&&(ke=B.cloneElement(Lt,{style:{display:"none"},eventKey:"".concat(Lt.props.eventKey,"-hidden"),className:"".concat(at)})),Dt===ot+1&&(Se.overflowedItems=ce.slice(ot+1).map(function(Pt){return B.cloneElement(Pt,{key:Pt.props.eventKey,mode:"vertical-left"})}),qe=Se.getOverflowedSubMenuItem(Lt.props.eventKey,Se.overflowedItems)));var Rt=[].concat(Object(De.a)(ze),[qe,ke]);return Dt===ce.length-1&&Rt.push(Se.getOverflowedSubMenuItem(Lt.props.eventKey,[],!0)),Rt}return[].concat(Object(De.a)(ze),[ke])},[])}},{key:"render",value:function(){var ce=this.props,Se=ce.visible,ot=ce.prefixCls,ze=ce.overflowedIndicator,Lt=ce.mode,Dt=ce.level,ke=ce.tag,qe=ce.children,Rt=ce.theme,Pt=Object(be.a)(ce,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),$t=ke;return B.createElement($t,Object.assign({},Pt),this.renderChildren(qe))}}]),it}(B.Component);bt.defaultProps={tag:"div",className:""};var Mt=bt;function jt(wt){return wt.length?wt.every(function(Qe){return!!Qe.props.disabled}):!0}function Me(wt,Qe,it){var We=wt.getState();wt.setState({activeKey:Object(ee.a)(Object(ee.a)({},We.activeKey),{},Object(p.a)({},Qe,it))})}function Pe(wt){return wt.eventKey||"0-menu-"}function tt(wt,Qe){var it=Qe,We=wt.children,ce=wt.eventKey;if(it){var Se;if(ae(We,function(ot,ze){ot&&ot.props&&!ot.props.disabled&&it===z(ot,ce,ze)&&(Se=!0)}),Se)return it}return it=null,wt.defaultActiveFirst&&ae(We,function(ot,ze){!it&&ot&&!ot.props.disabled&&(it=z(ot,ce,ze))}),it}function rt(wt){if(wt){var Qe=this.instanceArray.indexOf(wt);Qe!==-1?this.instanceArray[Qe]=wt:this.instanceArray.push(wt)}}var Fe=function(wt){Object(W.a)(it,wt);var Qe=Object(R.a)(it);function it(We){var ce;return Object(V.a)(this,it),ce=Qe.call(this,We),ce.onKeyDown=function(Se,ot){var ze=Se.keyCode,Lt;if(ce.getFlatInstanceArray().forEach(function(ke){ke&&ke.props.active&&ke.onKeyDown&&(Lt=ke.onKeyDown(Se))}),Lt)return 1;var Dt=null;return(ze===m.a.UP||ze===m.a.DOWN)&&(Dt=ce.step(ze===m.a.UP?-1:1)),Dt?(Se.preventDefault(),Me(ce.props.store,Pe(ce.props),Dt.props.eventKey),typeof ot=="function"&&ot(Dt),1):void 0},ce.onItemHover=function(Se){var ot=Se.key,ze=Se.hover;Me(ce.props.store,Pe(ce.props),ze?ot:null)},ce.onDeselect=function(Se){ce.props.onDeselect(Se)},ce.onSelect=function(Se){ce.props.onSelect(Se)},ce.onClick=function(Se){ce.props.onClick(Se)},ce.onOpenChange=function(Se){ce.props.onOpenChange(Se)},ce.onDestroy=function(Se){ce.props.onDestroy(Se)},ce.getFlatInstanceArray=function(){return ce.instanceArray},ce.step=function(Se){var ot=ce.getFlatInstanceArray(),ze=ce.props.store.getState().activeKey[Pe(ce.props)],Lt=ot.length;if(!Lt)return null;Se<0&&(ot=ot.concat().reverse());var Dt=-1;if(ot.every(function(Pt,$t){return Pt&&Pt.props.eventKey===ze?(Dt=$t,!1):!0}),!ce.props.defaultActiveFirst&&Dt!==-1&&jt(ot.slice(Dt,Lt-1)))return;var ke=(Dt+1)%Lt,qe=ke;do{var Rt=ot[qe];if(!Rt||Rt.props.disabled)qe=(qe+1)%Lt;else return Rt}while(qe!==ke);return null},ce.renderCommonMenuItem=function(Se,ot,ze){var Lt=ce.props.store.getState(),Dt=Object(Y.a)(ce),ke=Dt.props,qe=z(Se,ke.eventKey,ot),Rt=Se.props;if(!Rt||typeof Se.type=="string")return Se;var Pt=qe===Lt.activeKey,$t=Object(ee.a)(Object(ee.a)({mode:Rt.mode||ke.mode,level:ke.level,inlineIndent:ke.inlineIndent,renderMenuItem:ce.renderMenuItem,rootPrefixCls:ke.prefixCls,index:ot,parentMenu:ke.parentMenu,manualRef:Rt.disabled?void 0:Object(u.a)(Se.ref,rt.bind(Object(Y.a)(ce))),eventKey:qe,active:!Rt.disabled&&Pt,multiple:ke.multiple,onClick:function(se){(Rt.onClick||A)(se),ce.onClick(se)},onItemHover:ce.onItemHover,motion:ke.motion,subMenuOpenDelay:ke.subMenuOpenDelay,subMenuCloseDelay:ke.subMenuCloseDelay,forceSubMenuRender:ke.forceSubMenuRender,onOpenChange:ce.onOpenChange,onDeselect:ce.onDeselect,onSelect:ce.onSelect,builtinPlacements:ke.builtinPlacements,itemIcon:Rt.itemIcon||ce.props.itemIcon,expandIcon:Rt.expandIcon||ce.props.expandIcon},ze),{},{direction:ke.direction});return(ke.mode==="inline"||Ue())&&($t.triggerSubMenuAction="click"),B.cloneElement(Se,$t)},ce.renderMenuItem=function(Se,ot,ze){if(!Se)return null;var Lt=ce.props.store.getState(),Dt={openKeys:Lt.openKeys,selectedKeys:Lt.selectedKeys,triggerSubMenuAction:ce.props.triggerSubMenuAction,subMenuKey:ze};return ce.renderCommonMenuItem(Se,ot,Dt)},We.store.setState({activeKey:Object(ee.a)(Object(ee.a)({},We.store.getState().activeKey),{},Object(p.a)({},We.eventKey,tt(We,We.activeKey)))}),ce.instanceArray=[],ce}return Object(P.a)(it,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(ce){return this.props.visible||ce.visible||this.props.className!==ce.className||!s()(this.props.style,ce.style)}},{key:"componentDidUpdate",value:function(ce){var Se=this.props,ot="activeKey"in Se?Se.activeKey:Se.store.getState().activeKey[Pe(Se)],ze=tt(Se,ot);if(ze!==ot)Me(Se.store,Pe(Se),ze);else if("activeKey"in ce){var Lt=tt(ce,ce.activeKey);ze!==Lt&&Me(Se.store,Pe(Se),ze)}}},{key:"render",value:function(){var ce=this,Se=Object(I.a)({},this.props);this.instanceArray=[];var ot=i()(Se.prefixCls,Se.className,"".concat(Se.prefixCls,"-").concat(Se.mode)),ze={className:ot,role:Se.role||"menu"};Se.id&&(ze.id=Se.id),Se.focusable&&(ze.tabIndex=0,ze.onKeyDown=this.onKeyDown);var Lt=Se.prefixCls,Dt=Se.eventKey,ke=Se.visible,qe=Se.level,Rt=Se.mode,Pt=Se.overflowedIndicator,$t=Se.theme;return xe.forEach(function(fe){return delete Se[fe]}),delete Se.onClick,B.createElement(Mt,Object.assign({},Se,{prefixCls:Lt,mode:Rt,tag:"ul",level:qe,theme:$t,visible:ke,overflowedIndicator:Pt},ze),B.Children.map(Se.children,function(fe,se){return ce.renderMenuItem(fe,se,Dt||"0-menu-")}))}}]),it}(B.Component);Fe.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:A};var Je=Object(M.b)()(Fe),Ee=Je,ye=k("Kwbf");function _e(wt,Qe,it){var We=wt.prefixCls,ce=wt.motion,Se=wt.defaultMotions,ot=Se===void 0?{}:Se,ze=wt.openAnimation,Lt=wt.openTransitionName,Dt=Qe.switchingModeFromInline;if(ce)return ce;if(Object(r.a)(ze)==="object"&&ze)Object(ye.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof ze=="string")return{motionName:"".concat(We,"-open-").concat(ze)};if(Lt)return{motionName:Lt};var ke=ot[it];return ke||(Dt?null:ot.other)}var le=function(wt){Object(W.a)(it,wt);var Qe=Object(R.a)(it);function it(We){var ce;Object(V.a)(this,it),ce=Qe.call(this,We),ce.inlineOpenKeys=[],ce.onSelect=function(ze){var Lt=Object(Y.a)(ce),Dt=Lt.props;if(Dt.selectable){var ke=ce.store.getState(),qe=ke.selectedKeys,Rt=ze.key;Dt.multiple?qe=qe.concat([Rt]):qe=[Rt],"selectedKeys"in Dt||ce.store.setState({selectedKeys:qe}),Dt.onSelect(Object(ee.a)(Object(ee.a)({},ze),{},{selectedKeys:qe}))}},ce.onClick=function(ze){var Lt=ce.getRealMenuMode(),Dt=Object(Y.a)(ce),ke=Dt.store,qe=Dt.props.onOpenChange;Lt!=="inline"&&!("openKeys"in ce.props)&&(ke.setState({openKeys:[]}),qe([])),ce.props.onClick(ze)},ce.onKeyDown=function(ze,Lt){ce.innerMenu.getWrappedInstance().onKeyDown(ze,Lt)},ce.onOpenChange=function(ze){var Lt=Object(Y.a)(ce),Dt=Lt.props,ke=ce.store.getState().openKeys.concat(),qe=!1,Rt=function($t){var fe=!1;if($t.open)fe=ke.indexOf($t.key)===-1,fe&&ke.push($t.key);else{var se=ke.indexOf($t.key);fe=se!==-1,fe&&ke.splice(se,1)}qe=qe||fe};Array.isArray(ze)?ze.forEach(Rt):Rt(ze),qe&&("openKeys"in ce.props||ce.store.setState({openKeys:ke}),Dt.onOpenChange(ke))},ce.onDeselect=function(ze){var Lt=Object(Y.a)(ce),Dt=Lt.props;if(Dt.selectable){var ke=ce.store.getState().selectedKeys.concat(),qe=ze.key,Rt=ke.indexOf(qe);Rt!==-1&&ke.splice(Rt,1),"selectedKeys"in Dt||ce.store.setState({selectedKeys:ke}),Dt.onDeselect(Object(ee.a)(Object(ee.a)({},ze),{},{selectedKeys:ke}))}},ce.onMouseEnter=function(ze){ce.restoreModeVerticalFromInline();var Lt=ce.props.onMouseEnter;Lt&&Lt(ze)},ce.onTransitionEnd=function(ze){var Lt=ze.propertyName==="width"&&ze.target===ze.currentTarget,Dt=ze.target.className,ke=Object.prototype.toString.call(Dt)==="[object SVGAnimatedString]"?Dt.animVal:Dt,qe=ze.propertyName==="font-size"&&ke.indexOf("anticon")>=0;(Lt||qe)&&ce.restoreModeVerticalFromInline()},ce.setInnerMenu=function(ze){ce.innerMenu=ze},ce.isRootMenu=!0;var Se=We.defaultSelectedKeys,ot=We.defaultOpenKeys;return"selectedKeys"in We&&(Se=We.selectedKeys||[]),"openKeys"in We&&(ot=We.openKeys||[]),ce.store=Object(M.c)({selectedKeys:Se,openKeys:ot,activeKey:{"0-menu-":tt(We,We.activeKey)}}),ce.state={switchingModeFromInline:!1},ce}return Object(P.a)(it,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(ce){this.updateOpentKeysWhenSwitchMode(ce),this.updateMiniStore();var Se=this.props,ot=Se.siderCollapsed,ze=Se.inlineCollapsed,Lt=Se.onOpenChange;(!ce.inlineCollapsed&&ze||!ce.siderCollapsed&&ot)&&Lt([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(ce){var Se=this.props,ot=this.store,ze=this.inlineOpenKeys,Lt=ot.getState(),Dt={};ce.mode==="inline"&&Se.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in Se||((Se.inlineCollapsed&&!ce.inlineCollapsed||Se.siderCollapsed&&!ce.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=Lt.openKeys.concat(),Dt.openKeys=[]),(!Se.inlineCollapsed&&ce.inlineCollapsed||!Se.siderCollapsed&&ce.siderCollapsed)&&(Dt.openKeys=ze,this.inlineOpenKeys=[])),Object.keys(Dt).length&&ot.setState(Dt)}},{key:"updateMenuDisplay",value:function(){var ce=this.props.collapsedWidth,Se=this.store,ot=this.prevOpenKeys,ze=this.getInlineCollapsed()&&(ce===0||ce==="0"||ce==="0px");ze?(this.prevOpenKeys=Se.getState().openKeys.concat(),this.store.setState({openKeys:[]})):ot&&(this.store.setState({openKeys:ot}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var ce=this.props.mode,Se=this.state.switchingModeFromInline,ot=this.getInlineCollapsed();return Se&&ot?"inline":ot?"vertical":ce}},{key:"getInlineCollapsed",value:function(){var ce=this.props,Se=ce.inlineCollapsed,ot=ce.siderCollapsed;return ot!==void 0?ot:Se}},{key:"restoreModeVerticalFromInline",value:function(){var ce=this.state.switchingModeFromInline;ce&&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 ce=Object(ee.a)({},Object(L.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),Se=this.getRealMenuMode();return ce.className+=" ".concat(ce.prefixCls,"-root"),ce.direction==="rtl"&&(ce.className+=" ".concat(ce.prefixCls,"-rtl")),ce=Object(ee.a)(Object(ee.a)({},ce),{},{mode:Se,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:_e(this.props,this.state,Se)}),delete ce.openAnimation,delete ce.openTransitionName,B.createElement(M.a,{store:this.store},B.createElement(Ee,Object.assign({},ce,{ref:this.setInnerMenu}),this.props.children))}}]),it}(B.Component);le.defaultProps={selectable:!0,onClick:A,onSelect:A,onOpenChange:A,onDeselect:A,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:B.createElement("span",null,"\xB7\xB7\xB7")};var de=le,ve=function(wt){Object(W.a)(it,wt);var Qe=Object(R.a)(it);function it(){var We;return Object(V.a)(this,it),We=Qe.apply(this,arguments),We.onKeyDown=function(ce){var Se=ce.keyCode;return Se===m.a.ENTER?(We.onClick(ce),!0):void 0},We.onMouseLeave=function(ce){var Se=We.props,ot=Se.eventKey,ze=Se.onItemHover,Lt=Se.onMouseLeave;ze({key:ot,hover:!1}),Lt({key:ot,domEvent:ce})},We.onMouseEnter=function(ce){var Se=We.props,ot=Se.eventKey,ze=Se.onItemHover,Lt=Se.onMouseEnter;ze({key:ot,hover:!0}),Lt({key:ot,domEvent:ce})},We.onClick=function(ce){var Se=We.props,ot=Se.eventKey,ze=Se.multiple,Lt=Se.onClick,Dt=Se.onSelect,ke=Se.onDeselect,qe=Se.isSelected,Rt={key:ot,keyPath:[ot],item:Object(Y.a)(We),domEvent:ce};Lt(Rt),ze?qe?ke(Rt):Dt(Rt):qe||Dt(Rt)},We.saveNode=function(ce){We.node=ce},We}return Object(P.a)(it,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var ce=this.props;ce.onDestroy&&ce.onDestroy(ce.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 ce,Se=Object(ee.a)({},this.props),ot=i()(this.getPrefixCls(),Se.className,(ce={},Object(p.a)(ce,this.getActiveClassName(),!Se.disabled&&Se.active),Object(p.a)(ce,this.getSelectedClassName(),Se.isSelected),Object(p.a)(ce,this.getDisabledClassName(),Se.disabled),ce)),ze=Object(ee.a)(Object(ee.a)({},Se.attribute),{},{title:typeof Se.title=="string"?Se.title:void 0,className:ot,role:Se.role||"menuitem","aria-disabled":Se.disabled});Se.role==="option"?ze=Object(ee.a)(Object(ee.a)({},ze),{},{role:"option","aria-selected":Se.isSelected}):(Se.role===null||Se.role==="none")&&(ze.role="none");var Lt={onClick:Se.disabled?null:this.onClick,onMouseLeave:Se.disabled?null:this.onMouseLeave,onMouseEnter:Se.disabled?null:this.onMouseEnter},Dt=Object(ee.a)({},Se.style);Se.mode==="inline"&&(Se.direction==="rtl"?Dt.paddingRight=Se.inlineIndent*Se.level:Dt.paddingLeft=Se.inlineIndent*Se.level),xe.forEach(function(qe){return delete Se[qe]}),delete Se.direction;var ke=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(ke=B.createElement(this.props.itemIcon,this.props)),B.createElement("li",Object.assign({},Object(L.default)(Se,["onClick","onMouseEnter","onMouseLeave","onSelect"]),ze,Lt,{style:Dt,ref:this.saveNode}),Se.children,ke)}}]),it}(B.Component);ve.isMenuItem=!0,ve.defaultProps={onSelect:A,onMouseEnter:A,onMouseLeave:A,manualRef:A};var pe=Object(M.b)(function(wt,Qe){var it=wt.activeKey,We=wt.selectedKeys,ce=Qe.eventKey,Se=Qe.subMenuKey;return{active:it[Se]===ce,isSelected:We.indexOf(ce)!==-1}})(ve),Ce=pe,Ke=function(wt){Object(W.a)(it,wt);var Qe=Object(R.a)(it);function it(){var We;return Object(V.a)(this,it),We=Qe.apply(this,arguments),We.renderInnerMenuItem=function(ce){var Se=We.props,ot=Se.renderMenuItem,ze=Se.index;return ot(ce,ze,We.props.subMenuKey)},We}return Object(P.a)(it,[{key:"render",value:function(){var ce=Object(I.a)({},this.props),Se=ce.className,ot=Se===void 0?"":Se,ze=ce.rootPrefixCls,Lt="".concat(ze,"-item-group-title"),Dt="".concat(ze,"-item-group-list"),ke=ce.title,qe=ce.children;return xe.forEach(function(Rt){return delete ce[Rt]}),delete ce.onClick,delete ce.direction,B.createElement("li",Object.assign({},ce,{className:"".concat(ot," ").concat(ze,"-item-group")}),B.createElement("div",{className:Lt,title:typeof ke=="string"?ke:void 0},ke),B.createElement("ul",{className:Dt},B.Children.map(qe,this.renderInnerMenuItem)))}}]),it}(B.Component);Ke.isMenuItemGroup=!0,Ke.defaultProps={disabled:!0};var st=Ke,At=function(Qe){var it=Qe.className,We=Qe.rootPrefixCls,ce=Qe.style;return B.createElement("li",{className:"".concat(it," ").concat(We,"-item-divider"),style:ce})};At.defaultProps={disabled:!0,className:"",style:{}};var Ft=At,kt=we.e=de},"3tLw":function(Be,we,k){Be.exports=k.p+"static/a.39070d50.svg"},"4xil":function(Be,we,k){Be.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","right-controls":"right-controls___3oxDi","volume-controls":"volume-controls___QLaWH","fullscreen-button":"fullscreen-button___2nHzc","fullscreen-button1":"fullscreen-button1___1murk","pip-button":"pip-button___18qQG","playback-animation":"playback-animation___gCL6X",volume:"volume___10eUe",hidden:"hidden___2JBJW"}},"55Ip":function(Be,we,k){"use strict";k.d(we,"a",function(){return n});var ee=k("Ty5D"),V=k("dI71"),P=k("q1tI"),Y=k.n(P),W=k("YS25"),R=k("17x9"),B=k.n(R),M=k("wx14"),L=k("zLVn"),I=k("9R94"),p=function(_){Object(V.a)(f,_);function f(){for(var S,y=arguments.length,b=new Array(y),N=0;N=0||y.relatedTarget.className.indexOf("".concat(X,"-next"))>=0))return;_.setState({goInputText:""}),F(_.getValidValue())},_.go=function(y){var b=_.state.goInputText;if(b==="")return;(y.keyCode===h.ENTER||y.type==="click")&&(_.setState({goInputText:""}),_.props.quickGo(_.getValidValue()))},_}return Object(W.a)(v,[{key:"getValidValue",value:function(){var f=this.state,c=f.goInputText,S=f.current;return!c||isNaN(c)?S:Number(c)}},{key:"getPageSizeOptions",value:function(){var f=this.props,c=f.pageSize,S=f.pageSizeOptions;return S.some(function(y){return y.toString()===c.toString()})?S:S.concat([c.toString()]).sort(function(y,b){var N=isNaN(Number(y))?0:Number(y),F=isNaN(Number(b))?0:Number(b);return N-F})}},{key:"render",value:function(){var f=this,c=this.props,S=c.pageSize,y=c.locale,b=c.rootPrefixCls,N=c.changeSize,F=c.quickGo,X=c.goButton,Z=c.selectComponentClass,H=c.buildOptionText,A=c.selectPrefixCls,z=c.disabled,ne=this.state.goInputText,ae="".concat(b,"-options"),me=Z,xe=null,Te=null,Oe=null;if(!N&&!F)return null;var Ue=this.getPageSizeOptions();if(N&&me){var De=Ue.map(function(be,ge){return L.a.createElement(me.Option,{key:ge,value:be.toString()},(H||f.buildOptionText)(be))});xe=L.a.createElement(me,{disabled:z,prefixCls:A,showSearch:!1,className:"".concat(ae,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(S||Ue[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ge){return ge.parentNode}},De)}return F&&(X&&(Oe=typeof X=="boolean"?L.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:z,className:"".concat(ae,"-quick-jumper-button")},y.jump_to_confirm):L.a.createElement("span",{onClick:this.go,onKeyUp:this.go},X)),Te=L.a.createElement("div",{className:"".concat(ae,"-quick-jumper")},y.jump_to,L.a.createElement("input",{disabled:z,type:"text",value:ne,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),y.page,Oe)),L.a.createElement("li",{className:"".concat(ae)},xe,Te)}}]),v}(L.a.Component);s.defaultProps={pageSizeOptions:["10","20","50","100"]};var l=s,i=k("N2Kk");function r(){}function n(O){return typeof O=="number"&&isFinite(O)&&Math.floor(O)===O}function d(O,E,v){return v}function w(O,E,v){var _=typeof O=="undefined"?E.pageSize:O;return Math.floor((v.total-1)/_)+1}var T=function(O){Object(R.a)(v,O);var E=Object(B.a)(v);function v(_){var f;Object(Y.a)(this,v),f=E.call(this,_),f.getJumpPrevPage=function(){return Math.max(1,f.state.current-(f.props.showLessItems?3:5))},f.getJumpNextPage=function(){return Math.min(w(void 0,f.state,f.props),f.state.current+(f.props.showLessItems?3:5))},f.getItemIcon=function(N,F){var X=f.props.prefixCls,Z=N||L.a.createElement("button",{type:"button","aria-label":F,className:"".concat(X,"-item-link")});return typeof N=="function"&&(Z=L.a.createElement(N,Object(P.a)({},f.props))),Z},f.savePaginationNode=function(N){f.paginationNode=N},f.isValid=function(N){return n(N)&&N!==f.state.current},f.shouldDisplayQuickJumper=function(){var N=f.props,F=N.showQuickJumper,X=N.pageSize,Z=N.total;return Z<=X?!1:F},f.handleKeyDown=function(N){(N.keyCode===h.ARROW_UP||N.keyCode===h.ARROW_DOWN)&&N.preventDefault()},f.handleKeyUp=function(N){var F=f.getValidValue(N),X=f.state.currentInputValue;F!==X&&f.setState({currentInputValue:F}),N.keyCode===h.ENTER?f.handleChange(F):N.keyCode===h.ARROW_UP?f.handleChange(F-1):N.keyCode===h.ARROW_DOWN&&f.handleChange(F+1)},f.changePageSize=function(N){var F=f.state.current,X=w(N,f.state,f.props);F=F>X?X:F,X===0&&(F=f.state.current),typeof N=="number"&&("pageSize"in f.props||f.setState({pageSize:N}),"current"in f.props||f.setState({current:F,currentInputValue:F})),f.props.onShowSizeChange(F,N),"onChange"in f.props&&f.props.onChange&&f.props.onChange(F,N)},f.handleChange=function(N){var F=f.props.disabled,X=N;if(f.isValid(X)&&!F){var Z=w(void 0,f.state,f.props);X>Z?X=Z:X<1&&(X=1),"current"in f.props||f.setState({current:X,currentInputValue:X});var H=f.state.pageSize;return f.props.onChange(X,H),X}return f.state.current},f.prev=function(){f.hasPrev()&&f.handleChange(f.state.current-1)},f.next=function(){f.hasNext()&&f.handleChange(f.state.current+1)},f.jumpPrev=function(){f.handleChange(f.getJumpPrevPage())},f.jumpNext=function(){f.handleChange(f.getJumpNextPage())},f.hasPrev=function(){return f.state.current>1},f.hasNext=function(){return f.state.current2?X-2:0),H=2;H=S?b=S:b=Number(c),b}},{key:"getShowSizeChanger",value:function(){var f=this.props,c=f.showSizeChanger,S=f.total,y=f.totalBoundaryShowSizeChanger;return typeof c!="undefined"?c:S>y}},{key:"renderPrev",value:function(f){var c=this.props,S=c.prevIcon,y=c.itemRender,b=y(f,"prev",this.getItemIcon(S,"prev page")),N=!this.hasPrev();return Object(M.isValidElement)(b)?Object(M.cloneElement)(b,{disabled:N}):b}},{key:"renderNext",value:function(f){var c=this.props,S=c.nextIcon,y=c.itemRender,b=y(f,"next",this.getItemIcon(S,"next page")),N=!this.hasNext();return Object(M.isValidElement)(b)?Object(M.cloneElement)(b,{disabled:N}):b}},{key:"render",value:function(){var f=this,c=this.props,S=c.prefixCls,y=c.className,b=c.style,N=c.disabled,F=c.hideOnSinglePage,X=c.total,Z=c.locale,H=c.showQuickJumper,A=c.showLessItems,z=c.showTitle,ne=c.showTotal,ae=c.simple,me=c.itemRender,xe=c.showPrevNextJumpers,Te=c.jumpPrevIcon,Oe=c.jumpNextIcon,Ue=c.selectComponentClass,De=c.selectPrefixCls,be=c.pageSizeOptions,ge=this.state,He=ge.current,ct=ge.pageSize,vt=ge.currentInputValue;if(F===!0&&X<=ct)return null;var _t=w(void 0,this.state,this.props),yt=[],et=null,ht=null,xt=null,Tt=null,mt=null,Ie=H&&H.goButton,je=A?1:2,$e=He-1>0?He-1:0,at=He+1<_t?He+1:_t,lt=Object.keys(this.props).reduce(function(le,de){return(de.substr(0,5)==="data-"||de.substr(0,5)==="aria-"||de==="role")&&(le[de]=f.props[de]),le},{});if(ae)return Ie&&(typeof Ie=="boolean"?mt=L.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Z.jump_to_confirm):mt=L.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Ie),mt=L.a.createElement("li",{title:z?"".concat(Z.jump_to).concat(He,"/").concat(_t):null,className:"".concat(S,"-simple-pager")},mt)),L.a.createElement("ul",Object(ee.a)({className:p()(S,"".concat(S,"-simple"),Object(V.a)({},"".concat(S,"-disabled"),N),y),style:b,ref:this.savePaginationNode},lt),L.a.createElement("li",{title:z?Z.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:p()("".concat(S,"-prev"),Object(V.a)({},"".concat(S,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev($e)),L.a.createElement("li",{title:z?"".concat(He,"/").concat(_t):null,className:"".concat(S,"-simple-pager")},L.a.createElement("input",{type:"text",value:vt,disabled:N,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),L.a.createElement("span",{className:"".concat(S,"-slash")},"/"),_t),L.a.createElement("li",{title:z?Z.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:p()("".concat(S,"-next"),Object(V.a)({},"".concat(S,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(at)),mt);if(_t<=3+je*2){var bt={locale:Z,rootPrefixCls:S,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:z,itemRender:me};_t||yt.push(L.a.createElement(u,Object(ee.a)({},bt,{key:"noPager",page:_t,className:"".concat(S,"-disabled")})));for(var Mt=1;Mt<=_t;Mt+=1){var jt=He===Mt;yt.push(L.a.createElement(u,Object(ee.a)({},bt,{key:Mt,page:Mt,active:jt})))}}else{var Me=A?Z.prev_3:Z.prev_5,Pe=A?Z.next_3:Z.next_5;xe&&(et=L.a.createElement("li",{title:z?Me:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:p()("".concat(S,"-jump-prev"),Object(V.a)({},"".concat(S,"-jump-prev-custom-icon"),!!Te))},me(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(Te,"prev page"))),ht=L.a.createElement("li",{title:z?Pe:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:p()("".concat(S,"-jump-next"),Object(V.a)({},"".concat(S,"-jump-next-custom-icon"),!!Oe))},me(this.getJumpNextPage(),"jump-next",this.getItemIcon(Oe,"next page")))),Tt=L.a.createElement(u,{locale:Z,last:!0,rootPrefixCls:S,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:_t,page:_t,active:!1,showTitle:z,itemRender:me}),xt=L.a.createElement(u,{locale:Z,rootPrefixCls:S,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:z,itemRender:me});var tt=Math.max(1,He-je),rt=Math.min(He+je,_t);He-1<=je&&(rt=1+je*2),_t-He<=je&&(tt=_t-je*2);for(var Fe=tt;Fe<=rt;Fe+=1){var Je=He===Fe;yt.push(L.a.createElement(u,{locale:Z,rootPrefixCls:S,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Fe,page:Fe,active:Je,showTitle:z,itemRender:me}))}He-1>=je*2&&He!==1+2&&(yt[0]=Object(M.cloneElement)(yt[0],{className:"".concat(S,"-item-after-jump-prev")}),yt.unshift(et)),_t-He>=je*2&&He!==_t-2&&(yt[yt.length-1]=Object(M.cloneElement)(yt[yt.length-1],{className:"".concat(S,"-item-before-jump-next")}),yt.push(ht)),tt!==1&&yt.unshift(xt),rt!==_t&&yt.push(Tt)}var Ee=null;ne&&(Ee=L.a.createElement("li",{className:"".concat(S,"-total-text")},ne(X,[X===0?0:(He-1)*ct+1,He*ct>X?X:He*ct])));var ye=!this.hasPrev()||!_t,_e=!this.hasNext()||!_t;return L.a.createElement("ul",Object(ee.a)({className:p()(S,y,Object(V.a)({},"".concat(S,"-disabled"),N)),style:b,unselectable:"unselectable",ref:this.savePaginationNode},lt),Ee,L.a.createElement("li",{title:z?Z.prev_page:null,onClick:this.prev,tabIndex:ye?null:0,onKeyPress:this.runIfEnterPrev,className:p()("".concat(S,"-prev"),Object(V.a)({},"".concat(S,"-disabled"),ye)),"aria-disabled":ye},this.renderPrev($e)),yt,L.a.createElement("li",{title:z?Z.next_page:null,onClick:this.next,tabIndex:_e?null:0,onKeyPress:this.runIfEnterNext,className:p()("".concat(S,"-next"),Object(V.a)({},"".concat(S,"-disabled"),_e)),"aria-disabled":_e},this.renderNext(at)),L.a.createElement(l,{disabled:N,locale:Z,rootPrefixCls:S,selectComponentClass:Ue,selectPrefixCls:De,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:He,pageSize:ct,pageSizeOptions:be,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Ie}))}}],[{key:"getDerivedStateFromProps",value:function(f,c){var S={};if("current"in f&&(S.current=f.current,f.current!==c.current&&(S.currentInputValue=S.current)),"pageSize"in f&&f.pageSize!==c.pageSize){var y=c.current,b=w(f.pageSize,c,f);y=y>b?b:y,"current"in f||(S.current=y,S.currentInputValue=y),S.pageSize=f.pageSize}return S}}]),v}(L.a.Component);T.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:r,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:r,locale:i.a,style:{},itemRender:d,totalBoundaryShowSizeChanger:50};var x=T},"6RRn":function(Be,we,k){"use strict";var ee=k("wCXF"),V=k("n6Qo");k.d(we,"b",function(){return V.a});var P=k("IBYe"),Y=k("6eGT"),W=k("hW8S");k.d(we,"a",function(){return W.a}),we.c=ee.b},"6UM0":function(Be,we,k){var ee,V;(function(){var P;(function(){"use strict";var W=[function(L,I,p){var m=p(1).Beautifier,u=p(5).Options;function h(s,l){var i=new m(s,l);return i.beautify()}L.exports=h,L.exports.defaultOptions=function(){return new u}},function(L,I,p){var m=p(2).Output,u=p(3).Token,h=p(4),s=p(5).Options,l=p(7).Tokenizer,i=p(7).line_starters,r=p(7).positionable_operators,n=p(7).TOKEN;function d(A,z){return z.indexOf(A)!==-1}function w(A){return A.replace(/^\s+/g,"")}function T(A){for(var z={},ne=0;nene&&(ne=A.line_indent_level));var ae={mode:z,parent:A,last_token:A?A.last_token:new u(n.START_BLOCK,""),last_word:A?A.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:ne,alignment:0,line_indent_level:A?A.line_indent_level:ne,start_line_index:this._output.get_line_number(),ternary_depth:0};return ae},Z.prototype._reset=function(A){var z=A.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new m(this._options,z),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(c.BlockStatement);var ne=new l(A,this._options);return this._tokens=ne.tokenize(),A},Z.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var A,z=this._reset(this._source_text),ne=this._options.eol;this._options.eol==="auto"&&(ne=` `,z&&h.lineBreak.test(z||"")&&(ne=z.match(h.lineBreak)[0]));for(var ae=this._tokens.next();ae;)this.handle_token(ae),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ae,ae=this._tokens.next();return A=this._output.get_code(ne),A},Z.prototype.handle_token=function(A,z){A.type===n.START_EXPR?this.handle_start_expr(A):A.type===n.END_EXPR?this.handle_end_expr(A):A.type===n.START_BLOCK?this.handle_start_block(A):A.type===n.END_BLOCK?this.handle_end_block(A):A.type===n.WORD?this.handle_word(A):A.type===n.RESERVED?this.handle_word(A):A.type===n.SEMICOLON?this.handle_semicolon(A):A.type===n.STRING?this.handle_string(A):A.type===n.EQUALS?this.handle_equals(A):A.type===n.OPERATOR?this.handle_operator(A):A.type===n.COMMA?this.handle_comma(A):A.type===n.BLOCK_COMMENT?this.handle_block_comment(A,z):A.type===n.COMMENT?this.handle_comment(A,z):A.type===n.DOT?this.handle_dot(A):A.type===n.EOF?this.handle_eof(A):A.type===n.UNKNOWN?this.handle_unknown(A,z):this.handle_unknown(A,z)},Z.prototype.handle_whitespace_and_comments=function(A,z){var ne=A.newlines,ae=this._options.keep_array_indentation&&b(this._flags.mode);if(A.comments_before)for(var me=A.comments_before.next();me;)this.handle_whitespace_and_comments(me,z),this.handle_token(me,z),me=A.comments_before.next();if(ae)for(var xe=0;xe0,z);else if(this._options.max_preserve_newlines&&ne>this._options.max_preserve_newlines&&(ne=this._options.max_preserve_newlines),this._options.preserve_newlines&&ne>1){this.print_newline(!1,z);for(var Te=1;Te0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},Z.prototype.set_mode=function(A){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,A),this._flags=this.create_flags(this._previous_flags,A),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},Z.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===c.Statement&&S(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},Z.prototype.start_of_object_property=function(){return this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||O(this._flags.last_token,["get","set"]))},Z.prototype.start_of_statement=function(A){var z=!1;return z=z||O(this._flags.last_token,["var","let","const"])&&A.type===n.WORD,z=z||x(this._flags.last_token,"do"),z=z||!(this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement)&&O(this._flags.last_token,H)&&!A.newlines,z=z||x(this._flags.last_token,"else")&&!(x(A,"if")&&!A.comments_before),z=z||this._flags.last_token.type===n.END_EXPR&&(this._previous_flags.mode===c.ForInitializer||this._previous_flags.mode===c.Conditional),z=z||this._flags.last_token.type===n.WORD&&this._flags.mode===c.BlockStatement&&!this._flags.in_case&&!(A.text==="--"||A.text==="++")&&this._last_last_text!=="function"&&A.type!==n.WORD&&A.type!==n.RESERVED,z=z||this._flags.mode===c.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||O(this._flags.last_token,["get","set"])),z?(this.set_mode(c.Statement),this.indent(),this.handle_whitespace_and_comments(A,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(A,O(A,["do","for","if","while"])),!0):!1},Z.prototype.handle_start_expr=function(A){this.start_of_statement(A)||this.handle_whitespace_and_comments(A);var z=c.Expression;if(A.text==="["){if(this._flags.last_token.type===n.WORD||this._flags.last_token.text===")"){O(this._flags.last_token,i)&&(this._output.space_before_token=!0),this.print_token(A),this.set_mode(z),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}z=c.ArrayLiteral,b(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),d(this._flags.last_token.type,[n.START_EXPR,n.END_EXPR,n.WORD,n.OPERATOR,n.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===n.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,z=c.ForInitializer):d(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,z=c.Conditional):d(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&A.whitespace_before===""?this._output.space_before_token=!1:(d(this._flags.last_token.text,i)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===n.EQUALS||this._flags.last_token.type===n.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(A);else if(this._flags.last_token.type===n.WORD){this._output.space_before_token=!1;var ne=this._tokens.peek(-3);if(this._options.space_after_named_function&&ne){var ae=this._tokens.peek(-4);O(ne,["async","function"])||ne.text==="*"&&O(ae,["async","function"])?this._output.space_before_token=!0:this._flags.mode===c.ObjectLiteral?(ne.text==="{"||ne.text===","||ne.text==="*"&&(ae.text==="{"||ae.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(A);(this._flags.last_token.type===n.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(d(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&d(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===n.START_BLOCK?this.print_newline():(this._flags.last_token.type===n.END_EXPR||this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===n.COMMA)&&this.allow_wrap_or_preserved_newline(A,A.newlines),this.print_token(A),this.set_mode(z),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},Z.prototype.handle_end_expr=function(A){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(A),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(A,A.text==="]"&&b(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===n.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(A),this.restore_mode(),S(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===c.Conditional&&(this._previous_flags.mode=c.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},Z.prototype.handle_start_block=function(A){this.handle_whitespace_and_comments(A);var z=this._tokens.peek(),ne=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===n.END_EXPR?(this.set_mode(c.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(c.BlockStatement):ne&&(d(ne.text,[":",","])&&d(z.type,[n.STRING,n.WORD,n.RESERVED])||d(z.text,["get","set","..."])&&d(ne.type,[n.WORD,n.RESERVED]))?d(this._last_last_text,["class","interface"])&&!d(ne.text,[":",","])?this.set_mode(c.BlockStatement):this.set_mode(c.ObjectLiteral):this._flags.last_token.type===n.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(c.BlockStatement):d(this._flags.last_token.type,[n.EQUALS,n.START_EXPR,n.COMMA,n.OPERATOR])||O(this._flags.last_token,["return","throw","import","default"])?this.set_mode(c.ObjectLiteral):this.set_mode(c.BlockStatement),this._flags.last_token&&(O(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ae=!z.comments_before&&z.text==="}",me=ae&&this._flags.last_word==="function"&&this._flags.last_token.type===n.END_EXPR;if(this._options.brace_preserve_inline){var xe=0,Te=null;this._flags.inline_frame=!0;do if(xe+=1,Te=this._tokens.peek(xe-1),Te.newlines){this._flags.inline_frame=!1;break}while(Te.type!==n.EOF&&!(Te.type===n.END_BLOCK&&Te.opened===A))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&A.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==n.OPERATOR&&(me||this._flags.last_token.type===n.EQUALS||O(this._flags.last_token,E)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(b(this._previous_flags.mode)&&(this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.COMMA)&&((this._flags.last_token.type===n.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(A),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==n.OPERATOR&&this._flags.last_token.type!==n.START_EXPR&&(this._flags.last_token.type===n.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(A),this.indent(),!ae&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},Z.prototype.handle_end_block=function(A){for(this.handle_whitespace_and_comments(A);this._flags.mode===c.Statement;)this.restore_mode();var z=this._flags.last_token.type===n.START_BLOCK;this._flags.inline_frame&&!z?this._output.space_before_token=!0:this._options.brace_style==="expand"?z||this.print_newline():z||(b(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(A)},Z.prototype.handle_word=function(A){if(A.type===n.RESERVED){if(d(A.text,["set","get"])&&this._flags.mode!==c.ObjectLiteral)A.type=n.WORD;else if(A.text==="import"&&d(this._tokens.peek().text,["(","."]))A.type=n.WORD;else if(d(A.text,["as","from"])&&!this._flags.import_block)A.type=n.WORD;else if(this._flags.mode===c.ObjectLiteral){var z=this._tokens.peek();z.text===":"&&(A.type=n.WORD)}}if(this.start_of_statement(A)?O(this._flags.last_token,["var","let","const"])&&A.type===n.WORD&&(this._flags.declaration_statement=!0):A.newlines&&!N(this._flags.mode)&&(this._flags.last_token.type!==n.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==n.EQUALS&&(this._options.preserve_newlines||!O(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(A),this.print_newline()):this.handle_whitespace_and_comments(A),this._flags.do_block&&!this._flags.do_while)if(x(A,"while")){this._output.space_before_token=!0,this.print_token(A),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&x(A,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===c.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&O(A,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(A),this._flags.in_case=!0;return}if((this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.EQUALS||this._flags.last_token.type===n.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(A)),x(A,"function")){(d(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(d(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===n.OPERATOR))&&(!this._output.just_added_blankline()&&!A.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===n.RESERVED||this._flags.last_token.type===n.WORD?O(this._flags.last_token,["get","set","new","export"])||O(this._flags.last_token,H)?this._output.space_before_token=!0:x(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===n.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(N(this._flags.mode)||b(this._flags.mode))||this.print_newline(),this.print_token(A),this._flags.last_word=A.text;return}var ne="NONE";if(this._flags.last_token.type===n.END_BLOCK?this._previous_flags.inline_frame?ne="SPACE":O(A,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&A.newlines?ne="NEWLINE":(ne="SPACE",this._output.space_before_token=!0):ne="NEWLINE":this._flags.last_token.type===n.SEMICOLON&&this._flags.mode===c.BlockStatement?ne="NEWLINE":this._flags.last_token.type===n.SEMICOLON&&N(this._flags.mode)?ne="SPACE":this._flags.last_token.type===n.STRING?ne="NEWLINE":this._flags.last_token.type===n.RESERVED||this._flags.last_token.type===n.WORD||this._flags.last_token.text==="*"&&(d(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&d(this._last_last_text,["{",","]))?ne="SPACE":this._flags.last_token.type===n.START_BLOCK?this._flags.inline_frame?ne="SPACE":ne="NEWLINE":this._flags.last_token.type===n.END_EXPR&&(this._output.space_before_token=!0,ne="NEWLINE"),O(A,i)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?ne="SPACE":ne="NEWLINE"),O(A,["else","catch","finally"]))if((!(this._flags.last_token.type===n.END_BLOCK&&this._previous_flags.mode===c.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&A.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ae=this._output.current_line;ae.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else ne==="NEWLINE"?O(this._flags.last_token,E)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&O(A,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==n.END_EXPR?(this._flags.last_token.type!==n.START_EXPR||!O(A,["var","let","const"]))&&this._flags.last_token.text!==":"&&(x(A,"if")&&x(A.previous,"else")?this._output.space_before_token=!0:this.print_newline()):O(A,i)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&b(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():ne==="SPACE"&&(this._output.space_before_token=!0);A.previous&&(A.previous.type===n.WORD||A.previous.type===n.RESERVED)&&(this._output.space_before_token=!0),this.print_token(A),this._flags.last_word=A.text,A.type===n.RESERVED&&(A.text==="do"?this._flags.do_block=!0:A.text==="if"?this._flags.if_block=!0:A.text==="import"?this._flags.import_block=!0:this._flags.import_block&&x(A,"from")&&(this._flags.import_block=!1))},Z.prototype.handle_semicolon=function(A){this.start_of_statement(A)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(A);for(var z=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&x(z,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(A)},Z.prototype.handle_string=function(A){A.text.startsWith("`")&&A.newlines===0&&A.whitespace_before===""&&(A.previous.text===")"||this._flags.last_token.type===n.WORD)||(this.start_of_statement(A)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(A),this._flags.last_token.type===n.RESERVED||this._flags.last_token.type===n.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.EQUALS||this._flags.last_token.type===n.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(A):A.text.startsWith("`")&&this._flags.last_token.type===n.END_EXPR&&(A.previous.text==="]"||A.previous.text===")")&&A.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(A)},Z.prototype.handle_equals=function(A){this.start_of_statement(A)||this.handle_whitespace_and_comments(A),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(A),this._output.space_before_token=!0},Z.prototype.handle_comma=function(A){this.handle_whitespace_and_comments(A,!0),this.print_token(A),this._output.space_before_token=!0,this._flags.declaration_statement?(N(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(A)):this._flags.mode===c.ObjectLiteral||this._flags.mode===c.Statement&&this._flags.parent.mode===c.ObjectLiteral?(this._flags.mode===c.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(A)},Z.prototype.handle_operator=function(A){var z=A.text==="*"&&(O(this._flags.last_token,["function","yield"])||d(this._flags.last_token.type,[n.START_BLOCK,n.COMMA,n.END_BLOCK,n.SEMICOLON])),ne=d(A.text,["-","+"])&&(d(this._flags.last_token.type,[n.START_BLOCK,n.START_EXPR,n.EQUALS,n.OPERATOR])||d(this._flags.last_token.text,i)||this._flags.last_token.text===",");if(!this.start_of_statement(A)){var ae=!z;this.handle_whitespace_and_comments(A,ae)}if(A.text==="*"&&this._flags.last_token.type===n.DOT){this.print_token(A);return}if(A.text==="::"){this.print_token(A);return}if(this._flags.last_token.type===n.OPERATOR&&d(this._options.operator_position,f)&&this.allow_wrap_or_preserved_newline(A),A.text===":"&&this._flags.in_case){this.print_token(A),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==n.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var me=!0,xe=!0,Te=!1;if(A.text===":"?this._flags.ternary_depth===0?me=!1:(this._flags.ternary_depth-=1,Te=!0):A.text==="?"&&(this._flags.ternary_depth+=1),!ne&&!z&&this._options.preserve_newlines&&d(A.text,r)){var Oe=A.text===":",Ue=Oe&&Te,De=Oe&&!Te;switch(this._options.operator_position){case _.before_newline:this._output.space_before_token=!De,this.print_token(A),(!Oe||Ue)&&this.allow_wrap_or_preserved_newline(A),this._output.space_before_token=!0;return;case _.after_newline:this._output.space_before_token=!0,!Oe||Ue?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(A):this._output.space_before_token=!1,this.print_token(A),this._output.space_before_token=!0;return;case _.preserve_newline:De||this.allow_wrap_or_preserved_newline(A),me=!(this._output.just_added_newline()||De),this._output.space_before_token=me,this.print_token(A),this._output.space_before_token=!0;return}}if(z){this.allow_wrap_or_preserved_newline(A),me=!1;var be=this._tokens.peek();xe=be&&d(be.type,[n.WORD,n.RESERVED])}else if(A.text==="...")this.allow_wrap_or_preserved_newline(A),me=this._flags.last_token.type===n.START_BLOCK,xe=!1;else if(d(A.text,["--","++","!","~"])||ne){if((this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR)&&this.allow_wrap_or_preserved_newline(A),me=!1,xe=!1,A.newlines&&(A.text==="--"||A.text==="++"||A.text==="~")){var ge=O(this._flags.last_token,E)&&A.newlines;ge&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ge,!0)}this._flags.last_token.text===";"&&N(this._flags.mode)&&(me=!0),this._flags.last_token.type===n.RESERVED?me=!0:this._flags.last_token.type===n.END_EXPR?me=!(this._flags.last_token.text==="]"&&(A.text==="--"||A.text==="++")):this._flags.last_token.type===n.OPERATOR&&(me=d(A.text,["--","-","++","+"])&&d(this._flags.last_token.text,["--","-","++","+"]),d(A.text,["+","-"])&&d(this._flags.last_token.text,["--","++"])&&(xe=!0)),(this._flags.mode===c.BlockStatement&&!this._flags.inline_frame||this._flags.mode===c.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||me,this.print_token(A),this._output.space_before_token=xe},Z.prototype.handle_block_comment=function(A,z){if(this._output.raw){this._output.add_raw_token(A),A.directives&&A.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(A.directives){this.print_newline(!1,z),this.print_token(A),A.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!h.newline.test(A.text)&&!A.newlines){this._output.space_before_token=!0,this.print_token(A),this._output.space_before_token=!0;return}else this.print_block_commment(A,z)},Z.prototype.print_block_commment=function(A,z){var ne=y(A.text),ae,me=!1,xe=!1,Te=A.whitespace_before,Oe=Te.length;if(this.print_newline(!1,z),this.print_token_line_indentation(A),this._output.add_token(ne[0]),this.print_newline(!1,z),ne.length>1){for(ne=ne.slice(1),me=F(ne,"*"),xe=X(ne,Te),me&&(this._flags.alignment=1),ae=0;ae=0;h--)if(this.__items[h].match(u))return!0;return!1},I.prototype.set_indent=function(u,h){this.is_empty()&&(this.__indent_count=u||0,this.__alignment_count=h||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},I.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},I.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},I.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var u=this.__parent.current_line;return u.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),u.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),u.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,u.__items[0]===" "&&(u.__items.splice(0,1),u.__character_count-=1),!0}return!1},I.prototype.is_empty=function(){return this.__items.length===0},I.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},I.prototype.push=function(u){this.__items.push(u);var h=u.lastIndexOf(` `);h!==-1?this.__character_count=u.length-h:this.__character_count+=u.length},I.prototype.pop=function(){var u=null;return this.is_empty()||(u=this.__items.pop(),this.__character_count-=u.length),u},I.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},I.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},I.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},I.prototype.toString=function(){var u="";return this.is_empty()?this.__parent.indent_empty_lines&&(u=this.__parent.get_indent_string(this.__indent_count)):(u=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),u+=this.__items.join("")),u};function p(u,h){this.__cache=[""],this.__indent_size=u.indent_size,this.__indent_string=u.indent_char,u.indent_with_tabs||(this.__indent_string=new Array(u.indent_size+1).join(u.indent_char)),h=h||"",u.indent_level>0&&(h=new Array(u.indent_level+1).join(this.__indent_string)),this.__base_string=h,this.__base_string_length=h.length}p.prototype.get_indent_size=function(u,h){var s=this.__base_string_length;return h=h||0,u<0&&(s=0),s+=u*this.__indent_size,s+=h,s},p.prototype.get_indent_string=function(u,h){var s=this.__base_string;return h=h||0,u<0&&(u=0,s=""),h+=u*this.__indent_size,this.__ensure_cache(h),s+=this.__cache[h],s},p.prototype.__ensure_cache=function(u){for(;u>=this.__cache.length;)this.__add_column()},p.prototype.__add_column=function(){var u=this.__cache.length,h=0,s="";this.__indent_size&&u>=this.__indent_size&&(h=Math.floor(u/this.__indent_size),u-=h*this.__indent_size,s=new Array(h+1).join(this.__indent_string)),u&&(s+=new Array(u+1).join(" ")),this.__cache.push(s)};function m(u,h){this.__indent_cache=new p(u,h),this.raw=!1,this._end_with_newline=u.end_with_newline,this.indent_size=u.indent_size,this.wrap_line_length=u.wrap_line_length,this.indent_empty_lines=u.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new I(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(u,h){return this.__indent_cache.get_indent_string(u,h)},m.prototype.get_indent_size=function(u,h){return this.__indent_cache.get_indent_size(u,h)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(u){return this.is_empty()||!u&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(u){this.trim(!0);var h=this.current_line.pop();h&&(h[h.length-1]===` `&&(h=h.replace(/\n+$/g,"")),this.current_line.push(h)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(` `);return u!==` `&&(s=s.replace(/[\n]/g,u)),s},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(u,h){return u=u||0,h=h||0,this.next_line.set_indent(u,h),this.__lines.length>1?(this.current_line.set_indent(u,h),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(u){for(var h=0;h1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(u,h){for(var s=this.__lines.length-2;s>=0;){var l=this.__lines[s];if(l.is_empty())break;if(l.item(0).indexOf(u)!==0&&l.item(-1)!==h){this.__lines.splice(s+1,0,new I(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},L.exports.Output=m},function(L){function I(p,m,u,h){this.type=p,this.text=m,this.comments_before=null,this.newlines=u||0,this.whitespace_before=h||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}L.exports.Token=I},function(L,I){var p="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",u="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",h="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",s="(?:\\\\u[0-9a-fA-F]{4}|["+p+u+"])",l="(?:\\\\u[0-9a-fA-F]{4}|["+m+u+h+"])*";I.identifier=new RegExp(s+l,"g"),I.identifierStart=new RegExp(s),I.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+m+u+h+"])+");var i=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;I.newline=/[\n\r\u2028\u2029]/,I.lineBreak=new RegExp(`\r |`+I.newline.source),I.allLineBreaks=new RegExp(I.lineBreak.source,"g")},function(L,I,p){var m=p(6).Options,u=["before-newline","after-newline","preserve-newline"];function h(s){m.call(this,s,"js");var l=this.raw_options.brace_style||null;l==="expand-strict"?this.raw_options.brace_style="expand":l==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var r=0;r>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),v=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";v=v.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),v="\\?\\.(?!\\d) "+v,v=v.replace(/ /g,"|");var _=new RegExp(v),f="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),c=f.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),S=new RegExp("^(?:"+c.join("|")+")$"),y,b=function(F,X){u.call(this,F,X),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var Z=new i(this._input),H=new r(this._input).read_options(this._options);this.__patterns={template:H,identifier:H.starting_with(l.identifier).matching(l.identifierMatch),number:Z.matching(T),punct:Z.matching(_),comment:Z.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:Z.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:Z.matching(//),include:Z.starting_with(/#include/).until_after(l.lineBreak),shebang:Z.starting_with(/#!/).until_after(l.lineBreak),xml:Z.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:H.until(/['\\\n\r\u2028\u2029]/),double_quote:H.until(/["\\\n\r\u2028\u2029]/),template_text:H.until(/[`\\$]/),template_expression:H.until(/[`}\\]/)}};b.prototype=new u,b.prototype._is_comment=function(F){return F.type===d.COMMENT||F.type===d.BLOCK_COMMENT||F.type===d.UNKNOWN},b.prototype._is_opening=function(F){return F.type===d.START_BLOCK||F.type===d.START_EXPR},b.prototype._is_closing=function(F,X){return(F.type===d.END_BLOCK||F.type===d.END_EXPR)&&X&&(F.text==="]"&&X.text==="["||F.text===")"&&X.text==="("||F.text==="}"&&X.text==="{")},b.prototype._reset=function(){y=!1},b.prototype._get_next_token=function(F,X){var Z=null;this._readWhitespace();var H=this._input.peek();return H===null?this._create_token(d.EOF,""):(Z=Z||this._read_non_javascript(H),Z=Z||this._read_string(H),Z=Z||this._read_word(F),Z=Z||this._read_singles(H),Z=Z||this._read_comment(H),Z=Z||this._read_regexp(H,F),Z=Z||this._read_xml(H,F),Z=Z||this._read_punctuation(),Z=Z||this._create_token(d.UNKNOWN,this._input.next()),Z)},b.prototype._read_word=function(F){var X;if(X=this.__patterns.identifier.read(),X!=="")return X=X.replace(l.allLineBreaks,` `),!(F.type===d.DOT||F.type===d.RESERVED&&(F.text==="set"||F.text==="get"))&&S.test(X)?(X==="in"||X==="of")&&(F.type===d.WORD||F.type===d.STRING)?this._create_token(d.OPERATOR,X):this._create_token(d.RESERVED,X):this._create_token(d.WORD,X);if(X=this.__patterns.number.read(),X!=="")return this._create_token(d.WORD,X)},b.prototype._read_singles=function(F){var X=null;return F==="("||F==="["?X=this._create_token(d.START_EXPR,F):F===")"||F==="]"?X=this._create_token(d.END_EXPR,F):F==="{"?X=this._create_token(d.START_BLOCK,F):F==="}"?X=this._create_token(d.END_BLOCK,F):F===";"?X=this._create_token(d.SEMICOLON,F):F==="."&&O.test(this._input.peek(1))?X=this._create_token(d.DOT,F):F===","&&(X=this._create_token(d.COMMA,F)),X&&this._input.next(),X},b.prototype._read_punctuation=function(){var F=this.__patterns.punct.read();if(F!=="")return F==="="?this._create_token(d.EQUALS,F):F==="?."?this._create_token(d.DOT,F):this._create_token(d.OPERATOR,F)},b.prototype._read_non_javascript=function(F){var X="";if(F==="#"){if(this._is_first_token()&&(X=this.__patterns.shebang.read(),X))return this._create_token(d.UNKNOWN,X.trim()+` `);if(X=this.__patterns.include.read(),X)return this._create_token(d.UNKNOWN,X.trim()+` `);F=this._input.next();var Z="#";if(this._input.hasNext()&&this._input.testChar(x)){do F=this._input.next(),Z+=F;while(this._input.hasNext()&&F!=="#"&&F!=="=");return F==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(Z+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(Z+="{}",this._input.next(),this._input.next())),this._create_token(d.WORD,Z)}this._input.back()}else if(F==="<"&&this._is_first_token()){if(X=this.__patterns.html_comment_start.read(),X){for(;this._input.hasNext()&&!this._input.testChar(l.newline);)X+=this._input.next();return y=!0,this._create_token(d.COMMENT,X)}}else if(y&&F==="-"&&(X=this.__patterns.html_comment_end.read(),X))return y=!1,this._create_token(d.COMMENT,X);return null},b.prototype._read_comment=function(F){var X=null;if(F==="/"){var Z="";if(this._input.peek(1)==="*"){Z=this.__patterns.block_comment.read();var H=w.get_directives(Z);H&&H.ignore==="start"&&(Z+=w.readIgnored(this._input)),Z=Z.replace(l.allLineBreaks,` `),X=this._create_token(d.BLOCK_COMMENT,Z),X.directives=H}else this._input.peek(1)==="/"&&(Z=this.__patterns.comment.read(),X=this._create_token(d.COMMENT,Z))}return X},b.prototype._read_string=function(F){if(F==="`"||F==="'"||F==='"'){var X=this._input.next();return this.has_char_escapes=!1,F==="`"?X+=this._read_string_recursive("`",!0,"${"):X+=this._read_string_recursive(F),this.has_char_escapes&&this._options.unescape_strings&&(X=N(X)),this._input.peek()===F&&(X+=this._input.next()),X=X.replace(l.allLineBreaks,` `),this._create_token(d.STRING,X)}return null},b.prototype._allow_regexp_or_xml=function(F){return F.type===d.RESERVED&&n(F.text,["return","case","throw","else","do","typeof","yield"])||F.type===d.END_EXPR&&F.text===")"&&F.opened.previous.type===d.RESERVED&&n(F.opened.previous.text,["if","while","for"])||n(F.type,[d.COMMENT,d.START_EXPR,d.START_BLOCK,d.START,d.END_BLOCK,d.OPERATOR,d.EQUALS,d.EOF,d.SEMICOLON,d.COMMA])},b.prototype._read_regexp=function(F,X){if(F==="/"&&this._allow_regexp_or_xml(X)){for(var Z=this._input.next(),H=!1,A=!1;this._input.hasNext()&&(H||A||this._input.peek()!==F)&&!this._input.testChar(l.newline);)Z+=this._input.peek(),H?H=!1:(H=this._input.peek()==="\\",this._input.peek()==="["?A=!0:this._input.peek()==="]"&&(A=!1)),this._input.next();return this._input.peek()===F&&(Z+=this._input.next(),Z+=this._input.read(l.identifier)),this._create_token(d.STRING,Z)}return null},b.prototype._read_xml=function(F,X){if(this._options.e4x&&F==="<"&&this._allow_regexp_or_xml(X)){var Z="",H=this.__patterns.xml.read_match();if(H){for(var A=H[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),z=A.indexOf("{")===0,ne=0;H;){var ae=!!H[1],me=H[2],xe=!!H[H.length-1]||me.slice(0,8)==="![CDATA[";if(!xe&&(me===A||z&&me.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ae?--ne:++ne),Z+=H[0],ne<=0)break;H=this.__patterns.xml.read_match()}return H||(Z+=this._input.match(/[\s\S]*/g)[0]),Z=Z.replace(l.allLineBreaks,` `),this._create_token(d.STRING,Z)}}return null};function N(F){for(var X="",Z=0,H=new m(F),A=null;H.hasNext();)if(A=H.match(/([\s]|[^\\]|\\\\)+/g),A&&(X+=A[0]),H.peek()==="\\"){if(H.next(),H.peek()==="x")A=H.match(/x([0-9A-Fa-f]{2})/g);else if(H.peek()==="u")A=H.match(/u([0-9A-Fa-f]{4})/g);else{X+="\\",H.hasNext()&&(X+=H.next());continue}if(!A)return F;if(Z=parseInt(A[1],16),Z>126&&Z<=255&&A[0].indexOf("x")===0)return F;if(Z>=0&&Z<32){X+="\\"+A[0];continue}else Z===34||Z===39||Z===92?X+="\\"+String.fromCharCode(Z):X+=String.fromCharCode(Z)}return X}b.prototype._read_string_recursive=function(F,X,Z){var H,A;F==="'"?A=this.__patterns.single_quote:F==='"'?A=this.__patterns.double_quote:F==="`"?A=this.__patterns.template_text:F==="}"&&(A=this.__patterns.template_expression);for(var z=A.read(),ne="";this._input.hasNext();){if(ne=this._input.next(),ne===F||!X&&l.newline.test(ne)){this._input.back();break}else ne==="\\"&&this._input.hasNext()?(H=this._input.peek(),H==="x"||H==="u"?this.has_char_escapes=!0:H==="\r"&&this._input.peek(1)===` `&&this._input.next(),ne+=this._input.next()):Z&&(Z==="${"&&ne==="$"&&this._input.peek()==="{"&&(ne+=this._input.next()),Z===ne&&(F==="`"?ne+=this._read_string_recursive("}",X,"`"):ne+=this._read_string_recursive("`",X,"${"),this._input.hasNext()&&(ne+=this._input.next())));ne+=A.read(),z+=ne}return z},L.exports.Tokenizer=b,L.exports.TOKEN=d,L.exports.positionable_operators=E.slice(),L.exports.line_starters=f.slice()},function(L){var I=RegExp.prototype.hasOwnProperty("sticky");function p(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}p.prototype.restart=function(){this.__position=0},p.prototype.back=function(){this.__position>0&&(this.__position-=1)},p.prototype.hasNext=function(){return this.__position=0&&m=0&&u=m.length&&this.__input.substring(u-m.length,u).toLowerCase()===m},L.exports.InputScanner=p},function(L,I,p){var m=p(8).InputScanner,u=p(3).Token,h=p(10).TokenStream,s=p(11).WhitespacePattern,l={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},i=function(r,n){this._input=new m(r),this._options=n||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};i.prototype.tokenize=function(){this._input.restart(),this.__tokens=new h,this._reset();for(var r,n=new u(l.START,""),d=null,w=[],T=new h;n.type!==l.EOF;){for(r=this._get_next_token(n,d);this._is_comment(r);)T.add(r),r=this._get_next_token(n,d);T.isEmpty()||(r.comments_before=T,T=new h),r.parent=d,this._is_opening(r)?(w.push(d),d=r):d&&this._is_closing(r,d)&&(r.opened=d,d.closed=r,d=w.pop(),r.parent=d),r.previous=n,n.next=r,this.__tokens.add(r),n=r}return this.__tokens},i.prototype._is_first_token=function(){return this.__tokens.isEmpty()},i.prototype._reset=function(){},i.prototype._get_next_token=function(r,n){this._readWhitespace();var d=this._input.read(/.+/g);return d?this._create_token(l.RAW,d):this._create_token(l.EOF,"")},i.prototype._is_comment=function(r){return!1},i.prototype._is_opening=function(r){return!1},i.prototype._is_closing=function(r,n){return!1},i.prototype._create_token=function(r,n){var d=new u(r,n,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return d},i.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},L.exports.Tokenizer=i,L.exports.TOKEN=l},function(L){function I(p){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=p}I.prototype.restart=function(){this.__position=0},I.prototype.isEmpty=function(){return this.__tokens_length===0},I.prototype.hasNext=function(){return this.__position=0&&p/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}h.prototype=new m,h.prototype._create=function(){return new h(this._input,this)},h.prototype._update=function(){this.__set_templated_pattern()},h.prototype.disable=function(s){var l=this._create();return l._disabled[s]=!0,l._update(),l},h.prototype.read_options=function(s){var l=this._create();for(var i in u)l._disabled[i]=s.templating.indexOf(i)===-1;return l._update(),l},h.prototype.exclude=function(s){var l=this._create();return l._excluded[s]=!0,l._update(),l},h.prototype.read=function(){var s="";this._match_pattern?s=this._input.read(this._starting_pattern):s=this._input.read(this._starting_pattern,this.__template_pattern);for(var l=this._read_template();l;)this._match_pattern?l+=this._input.read(this._match_pattern):l+=this._input.readUntil(this.__template_pattern),s+=l,l=this._read_template();return this._until_after&&(s+=this._input.readUntilAfter(this._until_pattern)),s},h.prototype.__set_templated_pattern=function(){var s=[];this._disabled.php||s.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||s.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||s.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(s.push(this.__patterns.django._starting_pattern.source),s.push(this.__patterns.django_value._starting_pattern.source),s.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||s.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&s.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+s.join("|")+")")},h.prototype._read_template=function(){var s="",l=this._input.peek();if(l==="<"){var i=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&i==="?"&&(s=s||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&i==="%"&&(s=s||this.__patterns.erb.read())}else l==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(s=s||this.__patterns.handlebars_comment.read(),s=s||this.__patterns.handlebars_unescaped.read(),s=s||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(s=s||this.__patterns.django_value.read()),this._excluded.django||(s=s||this.__patterns.django_comment.read(),s=s||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(s=s||this.__patterns.smarty_comment.read(),s=s||this.__patterns.smarty_literal.read(),s=s||this.__patterns.smarty.read()));return s},L.exports.TemplatablePattern=h}],R={};function B(L){var I=R[L];if(I!==void 0)return I.exports;var p=R[L]={exports:{}};return W[L](p,p.exports,B),p.exports}var M=B(0);P=M})();var Y=P;!(ee=[],V=function(){return{js_beautify:Y}}.apply(we,ee),V!==void 0&&(Be.exports=V))})()},"6eGT":function(Be,we,k){"use strict";function ee(V){return null}we.a=ee},"7+5b":function(Be,we,k){Be.exports=k.p+"static/v.e7f297d6.svg"},"7Cbv":function(Be,we,k){"use strict";var ee=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),V=new Uint8Array(16);function P(){if(!ee)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ee(V)}var Y=/^(?:[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 W(u){return typeof u=="string"&&Y.test(u)}for(var R=W,B=[],M=0;M<256;++M)B.push((M+256).toString(16).substr(1));function L(u){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=(B[u[h+0]]+B[u[h+1]]+B[u[h+2]]+B[u[h+3]]+"-"+B[u[h+4]]+B[u[h+5]]+"-"+B[u[h+6]]+B[u[h+7]]+"-"+B[u[h+8]]+B[u[h+9]]+"-"+B[u[h+10]]+B[u[h+11]]+B[u[h+12]]+B[u[h+13]]+B[u[h+14]]+B[u[h+15]]).toLowerCase();if(!R(s))throw TypeError("Stringified UUID is invalid");return s}var I=L;function p(u,h,s){u=u||{};var l=u.random||(u.rng||P)();if(l[6]=l[6]&15|64,l[8]=l[8]&63|128,h){s=s||0;for(var i=0;i<16;++i)h[s+i]=l[i];return h}return I(l)}var m=we.a=p},"7ahc":function(Be,we,k){"use strict";k.d(we,"a",function(){return w});var ee=k("k1fw"),V=k("0Owb"),P=k("+L6B"),Y=k("2/Rp"),W=k("y8nQ"),R=k("Vl3Y"),B=k("tJVT"),M=k("OaEy"),L=k("2fM7"),I=k("q1tI"),p=k.n(I),m=k("VrN/"),u=k.n(m),h=k("p77/"),s=k.n(h),l=k("c5Ni"),i=k.n(l),r=L.a.Option,n={labelCol:{span:4},wrapperCol:{span:20}},d={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"]};we.b=function(T){var x=T.callback,O=T.onCancel,E=Object(I.useState)("python"),v=Object(B.a)(E,2),_=v[0],f=v[1];function c(y){f(d[y][1])}function S(y){x(y)}return p.a.createElement(R.a,Object(V.a)({},n,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:S}),p.a.createElement(R.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},p.a.createElement(L.a,{onChange:c},Object.keys(d).map(function(y){return p.a.createElement(r,{key:y,value:y},d[y][0])}))),p.a.createElement(R.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},p.a.createElement(w,{mode:_})),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(Y.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(Y.a,{type:"ghost",onClick:O},"\u53D6\u6D88")))};function w(T){var x=T.value,O=T.onChange,E=T.mode,v=T.options,_=v===void 0?{}:v,f=Object(I.useRef)(),c=Object(I.useState)(),S=Object(B.a)(c,2),y=S[0],b=S[1];return Object(I.useEffect)(function(){if(y){function N(F){var X=F.getValue();O&&O(X)}return y.on("change",N),function(){y.off("change",N)}}},[y,O]),Object(I.useEffect)(function(){y&&y.setOption("mode",E)},[y,E]),Object(I.useEffect)(function(){y&&((x!==y.getValue()||x==="")&&setTimeout(function(){y.setValue(x||" ")},300))},[y,x]),Object(I.useEffect)(function(){if(f.current&&!y){var N=u.a.fromTextArea(f.current,Object(ee.a)({mode:E,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},_));b(N)}},[f.current,y]),p.a.createElement("div",{className:"my-codemirror-container"},p.a.createElement("textarea",{ref:f}))}},"7ixt":function(Be,we,k){"use strict";k.d(we,"a",function(){return P});var ee={adjustX:1,adjustY:1},V=[0,0],P={left:{points:["cr","cl"],overflow:ee,offset:[-4,0],targetOffset:V},right:{points:["cl","cr"],overflow:ee,offset:[4,0],targetOffset:V},top:{points:["bc","tc"],overflow:ee,offset:[0,-4],targetOffset:V},bottom:{points:["tc","bc"],overflow:ee,offset:[0,4],targetOffset:V},topLeft:{points:["bl","tl"],overflow:ee,offset:[0,-4],targetOffset:V},leftTop:{points:["tr","tl"],overflow:ee,offset:[-4,0],targetOffset:V},topRight:{points:["br","tr"],overflow:ee,offset:[0,-4],targetOffset:V},rightTop:{points:["tl","tr"],overflow:ee,offset:[4,0],targetOffset:V},bottomRight:{points:["tr","br"],overflow:ee,offset:[0,4],targetOffset:V},rightBottom:{points:["bl","br"],overflow:ee,offset:[4,0],targetOffset:V},bottomLeft:{points:["tl","bl"],overflow:ee,offset:[0,4],targetOffset:V},leftBottom:{points:["br","bl"],overflow:ee,offset:[-4,0],targetOffset:V}},Y=P},"7qur":function(Be,we,k){"use strict";k.d(we,"m",function(){return V}),k.d(we,"s",function(){return P}),k.d(we,"h",function(){return Y}),k.d(we,"o",function(){return W}),k.d(we,"n",function(){return R}),k.d(we,"l",function(){return B}),k.d(we,"b",function(){return M}),k.d(we,"q",function(){return L}),k.d(we,"t",function(){return I}),k.d(we,"v",function(){return p}),k.d(we,"w",function(){return m}),k.d(we,"u",function(){return u}),k.d(we,"p",function(){return h}),k.d(we,"f",function(){return s}),k.d(we,"a",function(){return l}),k.d(we,"j",function(){return i}),k.d(we,"k",function(){return r}),k.d(we,"d",function(){return n}),k.d(we,"g",function(){return d}),k.d(we,"c",function(){return w}),k.d(we,"e",function(){return T}),k.d(we,"i",function(){return x}),k.d(we,"r",function(){return O});var ee=k("ErOA");function V(E){return Object(ee.c)("mypractices/".concat(E,".json"),{hidePopLogin:!0})}function P(E,v){return Object(ee.f)("mypractices/".concat(E,"/code_submit.json"),v)}function Y(E,v){return Object(ee.c)("mypractices/".concat(E,"/code_debug.json"),v)}function W(E,v){return Object(ee.c)("mypractices/".concat(E,"/submit_records.json"),v)}function R(E){return Object(ee.c)("mypractices/record_detail.json",{id:E})}function B(E,v){return Object(ee.c)("mypractices/".concat(E,"/result.json"),{mode:v})}function M(E,v){return Object(ee.f)("mypractices/".concat(E,"/add_notes.json"),v)}function L(E,v){return Object(ee.f)("mypractices/".concat(E,"/restore_initial_code.json"),v)}function I(E,v){return Object(ee.f)("mypractices/".concat(E,"/sync_code.json"),v)}function p(E,v){return Object(ee.f)("mypractices/".concat(E,"/update_code.json"),v)}function m(E){return Object(ee.f)("mypractices/".concat(E,"/initial_codes.json"))}function u(E,v){return Object(ee.f)("discusses/".concat(E,"/plus.json"),v)}function h(E){return Object(ee.c)("practices/practices_list.json",E)}function s(E,v){return Object(ee.c)("practices/".concat(E,"/question_solution_articles"),v)}function l(E,v){return Object(ee.f)("practices/".concat(E,"/question_solution_articles"),v)}function i(E,v){return Object(ee.g)("practices/".concat(E,"/question_solution_articles/").concat(v==null?void 0:v.active),v)}function r(E,v){return Object(ee.c)("practices/".concat(E,"/question_solution_articles/").concat(v==null?void 0:v.active,"/edit"),v)}function n(E,v){return Object(ee.c)("practices/".concat(E,"/question_solution_articles/").concat(v==null?void 0:v.active),v)}function d(E,v){return Object(ee.f)("practices/".concat(E,"/question_solution_articles/").concat(v==null?void 0:v.active,"/set_authority_or_excellent"),v)}function w(E,v){return Object(ee.f)("practices/".concat(E,"/question_solution_articles/").concat(v==null?void 0:v.active,"/praise_or_treads"),v)}function T(E,v){return Object(ee.f)("practices/".concat(E,"/question_solution_articles/").concat(v==null?void 0:v.active,"/hide"))}function x(E,v){return Object(ee.b)("practices/".concat(E,"/question_solution_articles/").concat(v==null?void 0:v.active),v)}function O(E,v){return Object(ee.f)("mypractices/".concat(E,"/update_practice_time_sum"),v)}},"815F":function(Be,we,k){"use strict";k.d(we,"e",function(){return B}),k.d(we,"c",function(){return L}),k.d(we,"d",function(){return I}),k.d(we,"a",function(){return m}),k.d(we,"f",function(){return u}),k.d(we,"b",function(){return h});var ee=k("KQm4"),V=k("VTBJ"),P=k("Ff2n"),Y=k("Zm9Q"),W=k("Kwbf"),R=k("OZM5");function B(s,l){return s!=null?s:l}function M(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],l=new Map;function i(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(r||[]).forEach(function(d){var w=d.key,T=d.children;Object(W.a)(w!=null,"Tree node must have a certain key: [".concat(n).concat(w,"]"));var x=String(w);Object(W.a)(!l.has(x)||w===null||w===void 0,"Same 'key' exist in the Tree: ".concat(x)),l.set(x,!0),i(T,"".concat(n).concat(x," > "))})}i(s)}function L(s){function l(i){var r=Object(Y.a)(i);return r.map(function(n){if(!Object(R.i)(n))return Object(W.a)(!n,"Tree/TreeNode can only accept TreeNode as children."),null;var d=n.key,w=n.props,T=w.children,x=Object(P.a)(w,["children"]),O=Object(V.a)({key:d},x),E=l(T);return E.length&&(O.children=E),O}).filter(function(n){return n})}return l(s)}function I(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=new Set(l===!0?[]:l),r=[];function n(d){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return d.map(function(T,x){var O=Object(R.h)(w?w.pos:"0",x),E=B(T.key,O),v=Object(V.a)(Object(V.a)({},T),{},{parent:w,pos:O,children:null,data:T,isStart:[].concat(Object(ee.a)(w?w.isStart:[]),[x===0]),isEnd:[].concat(Object(ee.a)(w?w.isEnd:[]),[x===d.length-1])});return r.push(v),l===!0||i.has(E)?v.children=n(T.children||[],v):v.children=[],v})}return n(s),r}function p(s,l,i){var r;i?typeof i=="string"?r=function(w){return w[i]}:typeof i=="function"&&(r=function(w){return i(w)}):r=function(w,T){return B(w.key,T)};function n(d,w,T){var x=d?d.children:s,O=d?Object(R.h)(T.pos,w):"0";if(d){var E=r(d,O),v={node:d,index:w,pos:O,key:E,parentPos:T.node?T.pos:null,level:T.level+1};l(v)}x&&x.forEach(function(_,f){n(_,f,{node:d,pos:O,level:T?T.level+1:-1})})}n(null)}function m(s){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=l.initWrapper,r=l.processEntity,n=l.onProcessFinished,d=arguments.length>2?arguments[2]:void 0,w={},T={},x={posEntities:w,keyEntities:T};return i&&(x=i(x)||x),p(s,function(O){var E=O.node,v=O.index,_=O.pos,f=O.key,c=O.parentPos,S=O.level,y={node:E,index:v,key:f,pos:_,level:S},b=B(f,_);w[_]=y,T[b]=y,y.parent=w[c],y.parent&&(y.parent.children=y.parent.children||[],y.parent.children.push(y)),r&&r(y,x)},d),n&&n(x),x}function u(s,l){var i=l.expandedKeys,r=l.selectedKeys,n=l.loadedKeys,d=l.loadingKeys,w=l.checkedKeys,T=l.halfCheckedKeys,x=l.dragOverNodeKey,O=l.dropPosition,E=l.keyEntities,v=E[s],_={eventKey:s,expanded:i.indexOf(s)!==-1,selected:r.indexOf(s)!==-1,loaded:n.indexOf(s)!==-1,loading:d.indexOf(s)!==-1,checked:w.indexOf(s)!==-1,halfChecked:T.indexOf(s)!==-1,pos:String(v?v.pos:""),dragOver:x===s&&O===0,dragOverGapTop:x===s&&O===-1,dragOverGapBottom:x===s&&O===1};return _}function h(s){var l=s.data,i=s.expanded,r=s.selected,n=s.checked,d=s.loaded,w=s.loading,T=s.halfChecked,x=s.dragOver,O=s.dragOverGapTop,E=s.dragOverGapBottom,v=s.pos,_=s.active,f=Object(V.a)(Object(V.a)({},l),{},{expanded:i,selected:r,checked:n,loaded:d,loading:w,halfChecked:T,dragOver:x,dragOverGapTop:O,dragOverGapBottom:E,pos:v,active:_});return"props"in f||Object.defineProperty(f,"props",{get:function(){return Object(W.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),s}}),f}},"8EBN":function(Be,we,k){(function(ee){ee(k("VrN/"))})(function(ee){"use strict";ee.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 V=0;V-1&&Y.substring(B+1,Y.length);if(M)return ee.findModeByExtension(M)},ee.findModeByName=function(Y){Y=Y.toLowerCase();for(var W=0;W0)){ve.next=20;break}return ve.next=18,Promise.all(ye);case 18:_e=ve.sent,Fe+=Je;case 20:ve.next=13;break;case 22:return ve.next=24,Object(M.a)("/api/attachments/multipart_upload_end",{method:"POST",body:Object(ee.a)({fileName:Ie.name,chunkCount:$e,uploadId:jt},w)});case 24:le=ve.sent,le.object?(A("success"),yt(),x&&x(Object(ee.a)(Object(ee.a)({},le),{},{file:Ie,percent:100}))):(A("error"),Ue("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"),yt(),O&&O(Ie.name));case 26:case"end":return ve.stop()}},bt)})(),"t0",11);case 11:lt.next=19;break;case 13:lt.prev=13,lt.t1=lt.catch(9),A("error"),Ue("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"),yt(),O&&O(Ie.name);case 19:case"end":return lt.stop()}},mt,null,[[9,13]])}));return function(Ie){return Tt.apply(this,arguments)}}(),ht=Object(R.useCallback)(function(){_t.current=!0,ct.current&&(ct.current.abort(),T&&T())},[T]),xt=function(mt){var Ie,je,$e=mt==null||((Ie=mt.target)===null||Ie===void 0||((je=Ie.files)===null||je===void 0))?void 0:je[0];if(He($e),H="ready",!$e)return;if(v){var at=v($e);at||et($e),yt();return}et($e)};return B.a.createElement(R.Fragment,null,B.a.createElement("input",{type:"file",id:vt.current,style:{display:"none"},onChange:xt,accept:c}),B.a.createElement("label",{className:p()(u.a.upload,S),htmlFor:vt.current,style:b},f))};we.a=Object(R.forwardRef)(h)},"9Bee":function(Be,we,k){"use strict";var ee=k("DYRE"),V=k("zeV3"),P=k("+L6B"),Y=k("2/Rp"),W=k("k1fw"),R=k("9og8"),B=k("tJVT"),M=k("WmNS"),L=k.n(M),I=k("q1tI"),p=k.n(I),m=k("vg9a"),u=k("DlQD"),h=k.n(u),s=k("rUJ1");function l($,C){var D=$.match(/^(\s+)(?:```)/);if(D===null)return C;var K=D[1];return C.split(` `).map(function(re){var J=re.match(/^\s+/);if(J===null)return re;var Re=Object(B.a)(J,1),ut=Re[0];return ut.length>=K.length?re.slice(K.length):re}).join(` `)}var i=[],r=["
    "],n=new h.a.Renderer,d=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function w(){i.length=0,r=["
      "]}var T={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function x($,C,D,K){if(C>=$.length||$[C].level<=D)return C;var re=$[C];K.push("
    • "+re.text+""),C++;var J=[];return C=x($,C,re.level,J),J.length>0&&(K.push("
        "),J.forEach(function(Re){K.push(Re)}),K.push("
      ")),K.push("
    • "),C=x($,C,D,K),C}function O(){return x(i,0,0,r),r.push("
    "),r.join("")}var E={heading:function(C){var D=d.exec(C);if(D)return{type:"heading",raw:D[0],depth:D[1].length,text:D[2]}},fences:function(C){var D=this.rules.block.fences.exec(C);if(D){var K=D[0],re=l(K,D[3]||""),J=D[2]?D[2].trim():D[2];if(["latex","katex","math"].indexOf(J)>=0){var Re=f(),ut=re;re=Re,c[Re]={type:"block",expression:ut}}return{type:"code",raw:K,lang:J,text:re}}}},v=/(?:\${2})([^\n`]+?)(?:\${2})/gi,_=0,f=function(){return"__special_katext_id_".concat(_++,"__")},c={};function S(){return c}function y(){_=0,c={}}function b($){return $=$.replace(v,function(C,D){var K=f();return c[K]={type:"inline",expression:D},K}),$}var N=n.listitem;n.listitem=function($){return N(b($))};var F=n.paragraph;n.paragraph=function($){return F(b($))};var X=n.tablecell;n.tablecell=function($,C){return X(b($),C)},n.code=function($,C,D){var K=(C||"").match(/\S*/)[0];return K?["latex","katex","math"].indexOf(K)>=0?"

    ".concat($,"

    "):'
    ').concat(D?$:Object(s.escape)($,!0),`
    `):'
    '+(D?$:Object(s.escape)($,!0))+"
    "},n.heading=function($,C,D){var K=this.options.headerPrefix+D.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return i.push({anchor:K,level:C,text:$}),"'+$+""},h.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),h.a.use({tokenizer:E,renderer:n});var Z=h.a,H=k("SJMd"),A=k("ulZh"),z=k.n(A),ne=k("m3rI"),ae=k("Oy/b"),me=k("p5ED"),xe=k("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 Te=function($,C){return(Te=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(D,K){D.__proto__=K}||function(D,K){for(var re in K)Object.prototype.hasOwnProperty.call(K,re)&&(D[re]=K[re])})($,C)};function Oe($,C){function D(){this.constructor=$}Te($,C),$.prototype=C===null?Object.create(C):(D.prototype=C.prototype,new D)}function Ue($,C,D,K){return new(D||(D=Promise))(function(re,J){function Re(Yt){try{St(K.next(Yt))}catch(dt){J(dt)}}function ut(Yt){try{St(K.throw(Yt))}catch(dt){J(dt)}}function St(Yt){var dt;Yt.done?re(Yt.value):(dt=Yt.value,dt instanceof D?dt:new D(function(Gt){Gt(dt)})).then(Re,ut)}St((K=K.apply($,C||[])).next())})}function De($,C){var D,K,re,J,Re={label:0,sent:function(){if(1&re[0])throw re[1];return re[1]},trys:[],ops:[]};return J={next:ut(0),throw:ut(1),return:ut(2)},typeof Symbol=="function"&&(J[Symbol.iterator]=function(){return this}),J;function ut(St){return function(Yt){return function(dt){if(D)throw new TypeError("Generator is already executing.");for(;Re;)try{if(D=1,K&&(re=2&dt[0]?K.return:dt[0]?K.throw||((re=K.return)&&re.call(K),0):K.next)&&!(re=re.call(K,dt[1])).done)return re;switch(K=0,re&&(dt=[2&dt[0],re.value]),dt[0]){case 0:case 1:re=dt;break;case 4:return Re.label++,{value:dt[1],done:!1};case 5:Re.label++,K=dt[1],dt=[0];continue;case 7:dt=Re.ops.pop(),Re.trys.pop();continue;default:if(!(re=Re.trys,(re=re.length>0&&re[re.length-1])||dt[0]!==6&&dt[0]!==2)){Re=0;continue}if(dt[0]===3&&(!re||dt[1]>re[0]&&dt[1]',"select"),this.addActionButton(K,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(K,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(K,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(K,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(K,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(K,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(K,'',"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(J){var Re=document.createElement("div");Re.className=""+D.toolbarButtonStyleClass.name,Re.setAttribute("data-type-name",J.typeName),Re.innerHTML=J.icon,Re.addEventListener("click",function(){D.markerToolbarButtonClicked(Re,J)}),D.buttons.push(Re),D.markerButtons.push(Re)}),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 re=document.createElement("div");re.className=this.toolbarBlockStyleClass.name,re.style.whiteSpace="nowrap",re.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(re),this.addActionButton(re,'',"render"),this.addActionButton(re,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},$.prototype.addButtonClickListener=function(C){this.buttonClickListeners.push(C)},$.prototype.removeButtonClickListener=function(C){this.buttonClickListeners.indexOf(C)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(C),1)},$.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},$.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var C=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var D=0;D0&&this.buttonClickListeners.forEach(function(K){return K("marker",D)}),this.markerButtonOverflowBlock.style.display="none"},$.prototype.actionToolbarButtonClicked=function(C,D){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(K){return K("action",D)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},$.prototype.setActiveButton=function(C){this.resetButtonStyles(),C.className=C.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),C.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},$.prototype.setActiveMarkerButton=function(C){var D=this.markerButtons.find(function(K){return K.getAttribute("data-type-name")===C});D&&this.setActiveButton(D)},$.prototype.setCurrentMarker=function(C){var D=this;this.currentMarker=C,this.buttons.filter(function(K){return/delete|notes/.test(K.getAttribute("data-action"))}).forEach(function(K){D.currentMarker===void 0?(K.style.fillOpacity="0.4",K.style.pointerEvents="none"):(K.style.fillOpacity="1",K.style.pointerEvents="all")})},$}(),xt=function(){function $(C,D,K,re){this.panels=[],this.panelButtons=[],this.markerjsContainer=C,this.displayMode=D,this.uiStyleSettings=K,this.styles=re,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return $.prototype.addStyles=function(){var C;this.toolboxStyleClass=this.styles.addClass(new et("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 et("toolbox_colors",` color: `+this.uiStyleSettings.toolboxColor+`; `));var D=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new et("toolbox-button-row",` display: flex; cursor: default; box-sizing: content-box; `)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new et("toolbox-button-row_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`; `)),this.toolboxPanelRowStyleClass=this.styles.addClass(new et("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 et("toolbox-panel-row_colors",` background-color: `+((C=this.uiStyleSettings.toolboxBackgroundColor)!==null&&C!==void 0?C:this.uiStyleSettings.toolbarBackgroundHoverColor)+`; `)),this.toolboxButtonStyleClass=this.styles.addClass(new et("toolbox_button",` display: inline-block; width: `+(this.uiStyleSettings.toolbarHeight-2*D)+`px; height: `+(this.uiStyleSettings.toolbarHeight-2*D)+`px; padding: `+D+`px; box-sizing: content-box; `)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new et("toolbox-button_colors",` fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new et("toolbox-active-button_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`; fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.styles.addRule(new yt("."+this.toolboxButtonStyleColorsClass.name+":hover",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+` `)),this.styles.addRule(new yt("."+this.toolboxButtonStyleClass.name+" svg",` height: `+this.uiStyleSettings.toolbarHeight/2+`px; `))},$.prototype.show=function(C){var D;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=C,this.uiContainer.className=this.toolboxStyleClass.name+" "+((D=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&D!==void 0?D:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},$.prototype.setPanelButtons=function(C){var D,K,re=this;this.panels=C,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((D=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&D!==void 0?D:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((K=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&K!==void 0?K:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(J){var Re;J.uiStyleSettings=re.uiStyleSettings;var ut=document.createElement("div");ut.className=re.toolboxButtonStyleClass.name+" "+((Re=re.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Re!==void 0?Re:re.toolboxButtonStyleColorsClass.name),ut.innerHTML=J.icon,ut.title=J.title,ut.addEventListener("click",function(){re.panelButtonClick(J)}),re.panelButtons.push(ut),re.buttonRow.appendChild(ut)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},$.prototype.panelButtonClick=function(C){var D=this,K=-1;if(C!==this.activePanel){K=this.panels.indexOf(C),this.panelRow.innerHTML="";var re=C.getUi();re.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(re),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=C}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){D.displayMode==="inline"?D.panelRow.style.display="none":D.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(J,Re){var ut,St;J.className=D.toolboxButtonStyleClass.name+" "+(Re===K?""+((ut=D.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&ut!==void 0?ut:D.toolboxActiveButtonStyleColorsClass.name):""+((St=D.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&St!==void 0?St:D.toolboxButtonStyleColorsClass.name))})},$}(),Tt=function($,C){this.title=$,this.icon=C},mt=function($){function C(D,K,re,J){var Re=$.call(this,D,J||'')||this;return Re.colors=[],Re.addTransparent=!1,Re.colorBoxes=[],Re.colors=K,Re.currentColor=re,Re.setCurrentColor=Re.setCurrentColor.bind(Re),Re.getColorBox=Re.getColorBox.bind(Re),Re}return Oe(C,$),C.prototype.getUi=function(){var D=this,K=document.createElement("div");return K.style.overflow="hidden",K.style.whiteSpace="nowrap",this.colors.forEach(function(re){var J=D.getColorBox(re);K.appendChild(J),D.colorBoxes.push(J)}),K},C.prototype.getColorBox=function(D){var K=this,re=this.uiStyleSettings.toolbarHeight/4,J=this.uiStyleSettings.toolbarHeight-re,Re=document.createElement("div");Re.style.display="inline-block",Re.style.boxSizing="content-box",Re.style.width=J-2+"px",Re.style.height=J-2+"px",Re.style.padding="1px",Re.style.marginRight="2px",Re.style.marginBottom="2px",Re.style.borderWidth="2px",Re.style.borderStyle="solid",Re.style.borderRadius=(J+2)/2+"px",Re.style.borderColor=D===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Re.addEventListener("click",function(){K.setCurrentColor(D,Re)});var ut=document.createElement("div");return ut.style.display="inline-block",ut.style.width=J-2+"px",ut.style.height=J-2+"px",ut.style.backgroundColor=D,ut.style.borderRadius=J/2+"px",D==="transparent"&&(ut.style.fill=this.uiStyleSettings.toolboxAccentColor,ut.innerHTML=` `),Re.appendChild(ut),Re},C.prototype.setCurrentColor=function(D,K){var re=this;this.currentColor=D,this.colorBoxes.forEach(function(J){J.style.borderColor=J===K?re.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(D)},C}(Tt),Ie=function(){function $(C,D,K){this._state="new",this._isSelected=!1,this._container=C,this._overlayContainer=D,this.globalSettings=K,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty($.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),$.prototype.ownsTarget=function(C){return!1},Object.defineProperty($.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),$.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},$.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},$.prototype.pointerDown=function(C,D){},$.prototype.dblClick=function(C,D){},$.prototype.manipulate=function(C){},$.prototype.pointerUp=function(C){this.stateChanged()},$.prototype.dispose=function(){},$.prototype.addMarkerVisualToContainer=function(C){this.container.childNodes.length>0?this.container.insertBefore(C,this.container.childNodes[0]):this.container.appendChild(C)},$.prototype.getState=function(){return{typeName:$.typeName,state:this.state,notes:this.notes}},$.prototype.restoreState=function(C){this._state=C.state,this.notes=C.notes},$.prototype.scale=function(C,D){},$.prototype.colorChanged=function(C){this.onColorChanged&&this.onColorChanged(C),this.stateChanged()},$.prototype.fillColorChanged=function(C){this.onFillColorChanged&&this.onFillColorChanged(C),this.stateChanged()},$.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var C=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),C.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(C)&&this.onStateChanged(this)}},$.typeName="MarkerBase",$}(),je=function(){function $(){this.findGripByVisual=this.findGripByVisual.bind(this)}return $.prototype.findGripByVisual=function(C){return this.topLeft.ownsTarget(C)?this.topLeft:this.topCenter.ownsTarget(C)?this.topCenter:this.topRight.ownsTarget(C)?this.topRight:this.centerLeft.ownsTarget(C)?this.centerLeft:this.centerRight.ownsTarget(C)?this.centerRight:this.bottomLeft.ownsTarget(C)?this.bottomLeft:this.bottomCenter.ownsTarget(C)?this.bottomCenter:this.bottomRight.ownsTarget(C)?this.bottomRight:void 0},$}(),$e=function(){function $(){this.GRIP_SIZE=10,this.visual=ge.createGroup(),this.visual.appendChild(ge.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ge.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return $.prototype.ownsTarget=function(C){return C===this.visual||C===this.visual.childNodes[0]||C===this.visual.childNodes[1]},$}(),at=function(){function $(){}return $.toITransformMatrix=function(C){return{a:C.a,b:C.b,c:C.c,d:C.d,e:C.e,f:C.f}},$.toSVGMatrix=function(C,D){return C.a=D.a,C.b=D.b,C.c=D.c,C.d=D.d,C.e=D.e,C.f=D.f,C},$}(),lt=function($){function C(D,K,re){var J=$.call(this,D,K,re)||this;return J.left=0,J.top=0,J.width=0,J.height=0,J.defaultSize={x:50,y:20},J.offsetX=0,J.offsetY=0,J.rotationAngle=0,J.CB_DISTANCE=10,J._suppressMarkerCreateEvent=!1,J.container.transform.baseVal.appendItem(ge.createTransform()),J.setupControlBox(),J}return Oe(C,$),Object.defineProperty(C.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"visual",{get:function(){return this._visual},set:function(D){this._visual=D;var K=ge.createTransform();this._visual.transform.baseVal.appendItem(K)},enumerable:!1,configurable:!0}),C.prototype.ownsTarget=function(D){return!!$.prototype.ownsTarget.call(this,D)||!!(this.controlGrips.findGripByVisual(D)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(D))},C.prototype.pointerDown=function(D,K){$.prototype.pointerDown.call(this,D,K),this.state==="new"&&(this.left=D.x,this.top=D.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var re=this.unrotatePoint(D);if(this.manipulationStartX=re.x,this.manipulationStartY=re.y,this.offsetX=re.x-this.left,this.offsetY=re.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(K),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(K)){this.activeGrip=this.rotatorGrip;var J=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=J.x-this.width/2,this.top=J.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Re=this.container.transform.baseVal.getItem(0);Re.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Re,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},C.prototype.pointerUp=function(D){var K=this.state;$.prototype.pointerUp.call(this,D),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(D),this._state="select",K==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},C.prototype.moveVisual=function(D){this.visual.style.transform="translate("+D.x+"px, "+D.y+"px)"},C.prototype.manipulate=function(D){var K=this.unrotatePoint(D);this.state==="creating"?this.resize(D):this.state==="move"?(this.left=this.manipulationStartLeft+(K.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(K.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(K):this.state==="rotate"&&this.rotate(D)},C.prototype.resize=function(D){var K=this.manipulationStartLeft,re=this.manipulationStartWidth,J=this.manipulationStartTop,Re=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:K=this.manipulationStartLeft+D.x-this.manipulationStartX,re=this.manipulationStartWidth+this.manipulationStartLeft-K;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:re=this.manipulationStartWidth+D.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:J=this.manipulationStartTop+D.y-this.manipulationStartY,Re=this.manipulationStartHeight+this.manipulationStartTop-J;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Re=this.manipulationStartHeight+D.y-this.manipulationStartY}re>=0?(this.left=K,this.width=re):(this.left=K+re,this.width=-re),Re>=0?(this.top=J,this.height=Re):(this.top=J+Re,this.height=-Re),this.setSize()},C.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},C.prototype.rotate=function(D){if(Math.abs(D.x-this.centerX)>.1){var K=Math.sign(D.x-this.centerX);this.rotationAngle=180*Math.atan((D.y-this.centerY)/(D.x-this.centerX))/Math.PI+90*K,this.applyRotation()}},C.prototype.applyRotation=function(){var D=this.container.transform.baseVal.getItem(0);D.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(D,0)},C.prototype.rotatePoint=function(D){if(this.rotationAngle===0)return D;var K=this.container.getCTM(),re=ge.createPoint(D.x,D.y);return{x:(re=re.matrixTransform(K)).x,y:re.y}},C.prototype.unrotatePoint=function(D){if(this.rotationAngle===0)return D;var K=this.container.getCTM();K=K.inverse();var re=ge.createPoint(D.x,D.y);return{x:(re=re.matrixTransform(K)).x,y:re.y}},C.prototype.select=function(){$.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},C.prototype.deselect=function(){$.prototype.deselect.call(this),this.controlBox.style.display="none"},C.prototype.setupControlBox=function(){this.controlBox=ge.createGroup();var D=ge.createTransform();D.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(D),this.container.appendChild(this.controlBox),this.controlRect=ge.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=ge.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 je,this.addControlGrips(),this.controlBox.style.display="none"},C.prototype.adjustControlBox=function(){var D=this.controlBox.transform.baseVal.getItem(0);D.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(D,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()},C.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()},C.prototype.createGrip=function(){var D=new $e;return D.visual.transform.baseVal.appendItem(ge.createTransform()),this.controlBox.appendChild(D.visual),D},C.prototype.positionGrips=function(){var D=this.controlGrips.topLeft.GRIP_SIZE,K=-D/2,re=K,J=(this.width+this.CB_DISTANCE)/2-D/2,Re=(this.height+this.CB_DISTANCE)/2-D/2,ut=this.height+this.CB_DISTANCE-D/2,St=this.width+this.CB_DISTANCE-D/2;this.positionGrip(this.controlGrips.topLeft.visual,K,re),this.positionGrip(this.controlGrips.topCenter.visual,J,re),this.positionGrip(this.controlGrips.topRight.visual,St,re),this.positionGrip(this.controlGrips.centerLeft.visual,K,Re),this.positionGrip(this.controlGrips.centerRight.visual,St,Re),this.positionGrip(this.controlGrips.bottomLeft.visual,K,ut),this.positionGrip(this.controlGrips.bottomCenter.visual,J,ut),this.positionGrip(this.controlGrips.bottomRight.visual,St,ut),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,J,re-3*this.CB_DISTANCE)},C.prototype.positionGrip=function(D,K,re){var J=D.transform.baseVal.getItem(0);J.setTranslate(K,re),D.transform.baseVal.replaceItem(J,0)},C.prototype.hideControlBox=function(){this.controlBox.style.display="none"},C.prototype.showControlBox=function(){this.controlBox.style.display=""},C.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:at.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:at.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},$.prototype.getState.call(this))},C.prototype.restoreState=function(D){$.prototype.restoreState.call(this,D);var K=D;this.left=K.left,this.top=K.top,this.width=K.width,this.height=K.height,this.rotationAngle=K.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(at.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,K.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(at.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,K.containerTransformMatrix))},C.prototype.scale=function(D,K){$.prototype.scale.call(this,D,K);var re=this.rotatePoint({x:this.left,y:this.top}),J=this.unrotatePoint({x:re.x*D,y:re.y*K});this.left=J.x,this.top=J.y,this.width=this.width*D,this.height=this.height*K,this.adjustControlBox()},C}(Ie),bt=function($){function C(D,K,re){var J=$.call(this,D,K,re)||this;return J.fillColor="transparent",J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.opacity=1,J.setStrokeColor=J.setStrokeColor.bind(J),J.setFillColor=J.setFillColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.createVisual=J.createVisual.bind(J),J}return Oe(C,$),C.prototype.ownsTarget=function(D){return!(!$.prototype.ownsTarget.call(this,D)&&D!==this.visual)},C.prototype.createVisual=function(){this.visual=ge.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)},C.prototype.pointerDown=function(D,K){$.prototype.pointerDown.call(this,D,K),this.state==="new"&&(this.createVisual(),this.moveVisual(D),this._state="creating")},C.prototype.manipulate=function(D){$.prototype.manipulate.call(this,D)},C.prototype.resize=function(D){$.prototype.resize.call(this,D),this.setSize()},C.prototype.setSize=function(){$.prototype.setSize.call(this),ge.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},C.prototype.pointerUp=function(D){$.prototype.pointerUp.call(this,D),this.setSize()},C.prototype.setStrokeColor=function(D){this.strokeColor=D,this.visual&&ge.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(D),this.stateChanged()},C.prototype.setFillColor=function(D){this.fillColor=D,this.visual&&ge.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},C.prototype.setStrokeWidth=function(D){this.strokeWidth=D,this.visual&&ge.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},C.prototype.setStrokeDasharray=function(D){this.strokeDasharray=D,this.visual&&ge.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},C.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},$.prototype.getState.call(this))},C.prototype.restoreState=function(D){var K=D;this.fillColor=K.fillColor,this.strokeColor=K.strokeColor,this.strokeWidth=K.strokeWidth,this.strokeDasharray=K.strokeDasharray,this.opacity=K.opacity,this.createVisual(),$.prototype.restoreState.call(this,D),this.setSize()},C.prototype.scale=function(D,K){$.prototype.scale.call(this,D,K),this.setSize()},C.title="Rectangle marker",C}(lt),Mt=function($){function C(D,K,re,J){var Re=$.call(this,D,J||'')||this;return Re.widths=[],Re.widthBoxes=[],Re.widths=K,Re.currentWidth=re,Re.setCurrentWidth=Re.setCurrentWidth.bind(Re),Re}return Oe(C,$),C.prototype.getUi=function(){var D=this,K=document.createElement("div");return K.style.display="flex",K.style.overflow="hidden",K.style.flexGrow="2",this.widths.forEach(function(re){var J=document.createElement("div");J.style.display="flex",J.style.flexGrow="2",J.style.alignItems="center",J.style.justifyContent="space-between",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.borderColor=re===D.currentWidth?D.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){D.setCurrentWidth(re,J)}),K.appendChild(J);var Re=document.createElement("div");Re.innerText=re.toString(),Re.style.marginRight="5px",J.appendChild(Re);var ut=document.createElement("div");ut.style.minHeight="20px",ut.style.flexGrow="2",ut.style.display="flex",ut.style.alignItems="center";var St=document.createElement("hr");St.style.minWidth="20px",St.style.border="0px",St.style.borderTop=re+"px solid "+D.uiStyleSettings.toolboxColor,St.style.flexGrow="2",ut.appendChild(St),J.appendChild(ut),D.widthBoxes.push(J)}),K},C.prototype.setCurrentWidth=function(D,K){var re=this;this.currentWidth=D,this.widthBoxes.forEach(function(J){J.style.borderColor=J===K?re.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},C}(Tt),jt=function($){function C(D,K,re,J){var Re=$.call(this,D,J||'')||this;return Re.styles=[],Re.styleBoxes=[],Re.styles=K,Re.currentStyle=re,Re.setCurrentStyle=Re.setCurrentStyle.bind(Re),Re}return Oe(C,$),C.prototype.getUi=function(){var D=this,K=document.createElement("div");return K.style.display="flex",K.style.overflow="hidden",K.style.flexGrow="2",this.styles.forEach(function(re){var J=document.createElement("div");J.style.display="flex",J.style.alignItems="center",J.style.justifyContent="space-between",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.overflow="hidden",J.style.maxWidth=100/D.styles.length-5+"%",J.style.borderColor=re===D.currentStyle?D.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){D.setCurrentStyle(re,J)}),K.appendChild(J);var Re=document.createElement("div");Re.style.minHeight="20px",Re.style.flexGrow="2",Re.style.overflow="hidden";var ut=` `;Re.innerHTML=ut,J.appendChild(Re),D.styleBoxes.push(J)}),K},C.prototype.setCurrentStyle=function(D,K){var re=this;this.currentStyle=D,this.styleBoxes.forEach(function(J){J.style.borderColor=J===K?re.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},C}(Tt),Me=function($){function C(D,K,re){var J=$.call(this,D,K,re)||this;return J.strokeColor=re.defaultColor,J.strokeWidth=re.defaultStrokeWidth,J.strokeDasharray=re.defaultStrokeDasharray,J.strokePanel=new mt("Line color",re.defaultColorSet,re.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.strokeWidthPanel=new Mt("Line width",re.defaultStrokeWidths,re.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new jt("Line style",re.defaultStrokeDasharrays,re.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J}return Oe(C,$),Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var D=$.prototype.getState.call(this);return D.typeName=C.typeName,D},C.typeName="FrameMarker",C.title="Frame marker",C.icon='',C}(bt),Pe=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($){function C(D,K,re){var J=$.call(this,D,K,re)||this;return J.x1=0,J.y1=0,J.x2=0,J.y2=0,J.defaultLength=50,J.manipulationStartX=0,J.manipulationStartY=0,J.manipulationStartX1=0,J.manipulationStartY1=0,J.manipulationStartX2=0,J.manipulationStartY2=0,J.setupControlBox(),J}return Oe(C,$),C.prototype.ownsTarget=function(D){return!!$.prototype.ownsTarget.call(this,D)||!(!this.grip1.ownsTarget(D)&&!this.grip2.ownsTarget(D))},C.prototype.pointerDown=function(D,K){$.prototype.pointerDown.call(this,D,K),this.manipulationStartX=D.x,this.manipulationStartY=D.y,this.state==="new"&&(this.x1=D.x,this.y1=D.y,this.x2=D.x,this.y2=D.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(K)?this.activeGrip=this.grip1:this.grip2.ownsTarget(K)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},C.prototype.pointerUp=function(D){var K=this.state;$.prototype.pointerUp.call(this,D),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(D),this._state="select",K==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},C.prototype.adjustVisual=function(){},C.prototype.manipulate=function(D){this.state==="creating"?this.resize(D):this.state==="move"?(this.x1=this.manipulationStartX1+D.x-this.manipulationStartX,this.y1=this.manipulationStartY1+D.y-this.manipulationStartY,this.x2=this.manipulationStartX2+D.x-this.manipulationStartX,this.y2=this.manipulationStartY2+D.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(D)},C.prototype.resize=function(D){switch(this.activeGrip){case this.grip1:this.x1=D.x,this.y1=D.y;break;case this.grip2:case void 0:this.x2=D.x,this.y2=D.y}this.adjustVisual(),this.adjustControlBox()},C.prototype.select=function(){$.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},C.prototype.deselect=function(){$.prototype.deselect.call(this),this.controlBox.style.display="none"},C.prototype.setupControlBox=function(){this.controlBox=ge.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},C.prototype.adjustControlBox=function(){this.positionGrips()},C.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},C.prototype.createGrip=function(){var D=new $e;return D.visual.transform.baseVal.appendItem(ge.createTransform()),this.controlBox.appendChild(D.visual),D},C.prototype.positionGrips=function(){var D=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-D/2,this.y1-D/2),this.positionGrip(this.grip2.visual,this.x2-D/2,this.y2-D/2)},C.prototype.positionGrip=function(D,K,re){var J=D.transform.baseVal.getItem(0);J.setTranslate(K,re),D.transform.baseVal.replaceItem(J,0)},C.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},$.prototype.getState.call(this))},C.prototype.restoreState=function(D){$.prototype.restoreState.call(this,D);var K=D;this.x1=K.x1,this.y1=K.y1,this.x2=K.x2,this.y2=K.y2},C.prototype.scale=function(D,K){$.prototype.scale.call(this,D,K),this.x1=this.x1*D,this.y1=this.y1*K,this.x2=this.x2*D,this.y2=this.y2*K,this.adjustVisual(),this.adjustControlBox()},C}(Ie),rt=function($){function C(D,K,re){var J=$.call(this,D,K,re)||this;return J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.setStrokeColor=J.setStrokeColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.strokeColor=re.defaultColor,J.strokeWidth=re.defaultStrokeWidth,J.strokeDasharray=re.defaultStrokeDasharray,J.strokePanel=new mt("Line color",re.defaultColorSet,re.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.strokeWidthPanel=new Mt("Line width",re.defaultStrokeWidths,re.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new jt("Line style",re.defaultStrokeDasharrays,re.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J}return Oe(C,$),C.prototype.ownsTarget=function(D){return!(!$.prototype.ownsTarget.call(this,D)&&D!==this.visual&&D!==this.selectorLine&&D!==this.visibleLine)},C.prototype.createVisual=function(){this.visual=ge.createGroup(),this.selectorLine=ge.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ge.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)},C.prototype.pointerDown=function(D,K){$.prototype.pointerDown.call(this,D,K),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},C.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()),ge.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ge.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ge.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},C.prototype.setStrokeColor=function(D){this.strokeColor=D,this.adjustVisual(),this.colorChanged(D)},C.prototype.setStrokeWidth=function(D){this.strokeWidth=D,this.adjustVisual()},C.prototype.setStrokeDasharray=function(D){this.strokeDasharray=D,this.adjustVisual(),this.stateChanged()},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var D=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},$.prototype.getState.call(this));return D.typeName=C.typeName,D},C.prototype.restoreState=function(D){$.prototype.restoreState.call(this,D);var K=D;this.strokeColor=K.strokeColor,this.strokeWidth=K.strokeWidth,this.strokeDasharray=K.strokeDasharray,this.createVisual(),this.adjustVisual()},C.typeName="LineMarker",C.title="Line marker",C.icon='',C}(tt),Fe=function($){function C(D,K,re,J){var Re=$.call(this,D,J||'')||this;return Re.fonts=[],Re.fontBoxes=[],Re.fonts=K,Re.currentFont=re,Re.setCurrentFont=Re.setCurrentFont.bind(Re),Re}return Oe(C,$),C.prototype.getUi=function(){var D=this,K=document.createElement("div");return K.style.overflow="hidden",K.style.flexGrow="2",this.fonts.forEach(function(re){var J=document.createElement("div");J.style.display="inline-block",J.style.alignItems="center",J.style.justifyContent="space-between",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.overflow="hidden",J.style.maxWidth=100/D.fonts.length-5+"%",J.style.borderColor=re===D.currentFont?D.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){D.setCurrentFont(re,J)}),K.appendChild(J);var Re=document.createElement("div");Re.style.display="flex",Re.style.minHeight="20px",Re.style.flexGrow="2",Re.style.fontFamily=re,Re.style.overflow="hidden";var ut=document.createElement("div");ut.style.whiteSpace="nowrap",ut.style.overflow="hidden",ut.style.textOverflow="ellipsis",ut.innerHTML="The quick brown fox jumps over the lazy dog",Re.appendChild(ut),J.appendChild(Re),D.fontBoxes.push(J)}),K},C.prototype.setCurrentFont=function(D,K){var re=this;this.currentFont=D,this.fontBoxes.forEach(function(J){J.style.borderColor=J===K?re.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},C}(Tt),Je=function($){function C(D,K,re){var J=$.call(this,D,K,re)||this;return J.color="transparent",J.padding=5,J.DEFAULT_TEXT="your text here",J.text=J.DEFAULT_TEXT,J.isMoved=!1,J.color=re.defaultColor,J.fontFamily=re.defaultFontFamily,J.defaultSize={x:100,y:30},J.setColor=J.setColor.bind(J),J.setFont=J.setFont.bind(J),J.renderText=J.renderText.bind(J),J.sizeText=J.sizeText.bind(J),J.textEditDivClicked=J.textEditDivClicked.bind(J),J.showTextEditor=J.showTextEditor.bind(J),J.setSize=J.setSize.bind(J),J.positionTextEditor=J.positionTextEditor.bind(J),J.colorPanel=new mt("Color",re.defaultColorSet,re.defaultColor),J.colorPanel.onColorChanged=J.setColor,J.fontFamilyPanel=new Fe("Font",re.defaultFontFamilies,re.defaultFontFamily),J.fontFamilyPanel.onFontChanged=J.setFont,J}return Oe(C,$),C.prototype.ownsTarget=function(D){if($.prototype.ownsTarget.call(this,D)||D===this.visual||D===this.textElement||D===this.bgRectangle)return!0;var K=!1;return this.textElement.childNodes.forEach(function(re){re===D&&(K=!0)}),K},C.prototype.createVisual=function(){this.visual=ge.createGroup(),this.bgRectangle=ge.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ge.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ge.createTransform()),this.textElement.transform.baseVal.appendItem(ge.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},C.prototype.pointerDown=function(D,K){$.prototype.pointerDown.call(this,D,K),this.isMoved=!1,this.pointerDownPoint=D,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(D),this._state="creating")},C.prototype.renderText=function(){var D=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(K){D.textElement.appendChild(ge.createTSpan(K.trim()===""?" ":K.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},C.prototype.getTextScale=function(){var D=this.textElement.getBBox(),K=1;if(D.width>0&&D.height>0){var re=(1*this.width-this.width*this.padding*2/100)/D.width,J=(1*this.height-this.height*this.padding*2/100)/D.height;K=Math.min(re,J)}return K},C.prototype.getTextPosition=function(D){var K=this.textElement.getBBox(),re=0,J=0;return K.width>0&&K.height>0&&(re=(this.width-K.width*D)/2,J=this.height/2-K.height*D/2),{x:re,y:J}},C.prototype.sizeText=function(){var D=this.textElement.getBBox(),K=this.getTextScale(),re=this.getTextPosition(K);re.y-=D.y*K,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+re.x+"px, "+re.y+"px) scale("+K+", "+K+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(re.x,re.y),this.textElement.transform.baseVal.getItem(1).setScale(K,K))},C.prototype.manipulate=function(D){$.prototype.manipulate.call(this,D),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(D.x-this.pointerDownPoint.x)>5||Math.abs(D.y-this.pointerDownPoint.y)>5)},C.prototype.resize=function(D){$.prototype.resize.call(this,D),this.isMoved=!0,this.setSize(),this.sizeText()},C.prototype.setSize=function(){$.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ge.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ge.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},C.prototype.pointerUp=function(D){var K=this.state;K==="creating"&&(this._suppressMarkerCreateEvent=!0),$.prototype.pointerUp.call(this,D),this.setSize(),(K==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},C.prototype.showTextEditor=function(){var D=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(K){K.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var K=Number.parseFloat(D.textEditor.style.fontSize);D.textEditor.clientWidth>=Number.parseInt(D.textEditor.style.maxWidth)&&K>.9;)K-=.1,D.textEditor.style.fontSize=Math.max(K,.9)+"em"}),this.textEditor.addEventListener("keyup",function(K){K.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(K){if(K.clipboardData){var re=K.clipboardData.getData("text"),J=window.getSelection();if(!J.rangeCount)return!1;J.deleteFromDocument(),J.getRangeAt(0).insertNode(document.createTextNode(re)),K.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){D.textEditDivClicked(D.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},C.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var D=this.getTextScale(),K=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),re=this.textElement.getBBox(),J={x:re.width*D,y:re.height*D};K.x-=J.x/2,K.y-=J.y/2,this.textEditor.style.top=K.y+"px",this.textEditor.style.left=K.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-K.x+"px",this.textEditor.style.fontSize=Math.max(16*D,12)+"px",this.textElement.style.display="none"}},C.prototype.textEditDivClicked=function(D){this.text=D.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},C.prototype.select=function(){$.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},C.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),$.prototype.deselect.call(this)},C.prototype.dblClick=function(D,K){$.prototype.dblClick.call(this,D,K),this.showTextEditor()},C.prototype.setColor=function(D){this.textElement&&ge.setAttributes(this.textElement,[["fill",D]]),this.color=D,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(D)},C.prototype.setFont=function(D){this.textElement&&ge.setAttributes(this.textElement,[["font-family",D]]),this.fontFamily=D,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},C.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},C.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var D=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},$.prototype.getState.call(this));return D.typeName=C.typeName,D},C.prototype.restoreState=function(D){var K=D;this.color=K.color,this.fontFamily=K.fontFamily,this.padding=K.padding,this.text=K.text,this.createVisual(),$.prototype.restoreState.call(this,D),this.setSize()},C.prototype.scale=function(D,K){$.prototype.scale.call(this,D,K),this.setSize(),this.sizeText(),this.positionTextEditor()},C.typeName="TextMarker",C.title="Text marker",C.icon='',C}(lt),Ee=function($){function C(D,K,re){var J=$.call(this,D,K,re)||this;return J.color="transparent",J.lineWidth=3,J.drawing=!1,J.pixelRatio=1,J.color=re.defaultColor,J.lineWidth=re.defaultStrokeWidth,J.pixelRatio=re.freehandPixelRatio,J.setColor=J.setColor.bind(J),J.addCanvas=J.addCanvas.bind(J),J.finishCreation=J.finishCreation.bind(J),J.setLineWidth=J.setLineWidth.bind(J),J.colorPanel=new mt("Color",re.defaultColorSet,re.defaultColor),J.colorPanel.onColorChanged=J.setColor,J.lineWidthPanel=new Mt("Line width",re.defaultStrokeWidths,re.defaultStrokeWidth),J.lineWidthPanel.onWidthChanged=J.setLineWidth,J}return Oe(C,$),C.prototype.ownsTarget=function(D){return!(!$.prototype.ownsTarget.call(this,D)&&D!==this.visual&&D!==this.drawingImage)},C.prototype.createVisual=function(){this.visual=ge.createGroup(),this.drawingImage=ge.createImage(),this.visual.appendChild(this.drawingImage);var D=ge.createTransform();this.visual.transform.baseVal.appendItem(D),this.addMarkerVisualToContainer(this.visual)},C.prototype.pointerDown=function(D,K){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(D.x,D.y),this.drawing=!0):$.prototype.pointerDown.call(this,D,K)},C.prototype.manipulate=function(D){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(D.x,D.y),this.canvasContext.stroke()):$.prototype.manipulate.call(this,D)},C.prototype.resize=function(D){$.prototype.resize.call(this,D),ge.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ge.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},C.prototype.pointerUp=function(D){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):$.prototype.pointerUp.call(this,D)},C.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)},C.prototype.select=function(){this.state==="creating"&&this.finishCreation(),$.prototype.select.call(this)},C.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),$.prototype.deselect.call(this)},C.prototype.finishCreation=function(){for(var D=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),K=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],re=K[0],J=K[1],Re=K[2],ut=K[3],St=!1,Yt=0;Yt0&&(St=!0,Ytut&&(ut=Yt),dt>Re&&(Re=dt));if(St){this.left=re/this.pixelRatio,this.top=J/this.pixelRatio,this.width=(Re-re)/this.pixelRatio,this.height=(ut-J)/this.pixelRatio;var Gt=document.createElement("canvas");Gt.width=Re-re,Gt.height=ut-J,Gt.getContext("2d").putImageData(this.canvasContext.getImageData(re,J,Re-re,ut-J),0,0),this.drawingImgUrl=Gt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},C.prototype.setDrawingImage=function(){ge.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ge.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},C.prototype.setColor=function(D){this.color=D,this.colorChanged(D)},C.prototype.setLineWidth=function(D){this.lineWidth=D},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var D=Object.assign({drawingImgUrl:this.drawingImgUrl},$.prototype.getState.call(this));return D.typeName=C.typeName,D},C.prototype.restoreState=function(D){this.createVisual(),$.prototype.restoreState.call(this,D),this.drawingImgUrl=D.drawingImgUrl,this.setDrawingImage()},C.prototype.scale=function(D,K){$.prototype.scale.call(this,D,K),this.setDrawingImage()},C.typeName="FreehandMarker",C.title="Freehand marker",C.icon='',C}(lt),ye=function($){function C(D,K,re){var J=$.call(this,D,re||'')||this;return J.typeBoxes=[],J.currentType=K,J.setCurrentType=J.setCurrentType.bind(J),J}return Oe(C,$),C.prototype.getUi=function(){var D=this,K=document.createElement("div");K.style.display="flex",K.style.overflow="hidden",K.style.flexGrow="2";for(var re=function(ut){var St="both";switch(ut){case 0:St="both";break;case 1:St="start";break;case 2:St="end";break;case 3:St="none"}var Yt=document.createElement("div");if(Yt.style.display="flex",Yt.style.flexGrow="2",Yt.style.alignItems="center",Yt.style.justifyContent="space-between",Yt.style.padding="5px",Yt.style.borderWidth="2px",Yt.style.borderStyle="solid",Yt.style.borderColor=St===J.currentType?J.uiStyleSettings.toolboxAccentColor:"transparent",Yt.addEventListener("click",function(){D.setCurrentType(St,Yt)}),K.appendChild(Yt),St==="both"||St==="start"){var dt=document.createElement("div");dt.style.display="flex",dt.style.alignItems="center",dt.style.minHeight="20px",dt.innerHTML=` `,dt.style.marginLeft="5px",Yt.appendChild(dt)}var Gt=document.createElement("div");Gt.style.display="flex",Gt.style.alignItems="center",Gt.style.minHeight="20px",Gt.style.flexGrow="2";var sn=document.createElement("hr");if(sn.style.minWidth="20px",sn.style.border="0px",sn.style.borderTop="3px solid "+(J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxColor:"#eeeeee"),sn.style.flexGrow="2",Gt.appendChild(sn),Yt.appendChild(Gt),St==="both"||St==="end"){var Wn=document.createElement("div");Wn.style.display="flex",Wn.style.alignItems="center",Wn.style.minHeight="20px",Wn.innerHTML=` `,Wn.style.marginRight="5px",Yt.appendChild(Wn)}J.typeBoxes.push(Yt)},J=this,Re=0;Re<4;Re++)re(Re);return K},C.prototype.setCurrentType=function(D,K){var re=this;this.currentType=D,this.typeBoxes.forEach(function(J){J.style.borderColor=J===K?re.uiStyleSettings!==void 0?re.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},C}(Tt),_e=function($){function C(D,K,re){var J=$.call(this,D,K,re)||this;return J.arrowType="end",J.arrowBaseHeight=10,J.arrowBaseWidth=10,J.getArrowPoints=J.getArrowPoints.bind(J),J.setArrowType=J.setArrowType.bind(J),J.arrowTypePanel=new ye("Arrow type","end"),J.arrowTypePanel.onArrowTypeChanged=J.setArrowType,J}return Oe(C,$),C.prototype.ownsTarget=function(D){return!(!$.prototype.ownsTarget.call(this,D)&&D!==this.arrow1&&D!==this.arrow2)},C.prototype.getArrowPoints=function(D,K){var re=this.arrowBaseWidth+2*this.strokeWidth,J=this.arrowBaseHeight+2*this.strokeWidth;return D-re/2+","+(K+J/2)+" "+D+","+(K-J/2)+" "+(D+re/2)+","+(K+J/2)},C.prototype.createTips=function(){this.arrow1=ge.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ge.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ge.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ge.createTransform()),this.visual.appendChild(this.arrow2)},C.prototype.pointerDown=function(D,K){$.prototype.pointerDown.call(this,D,K),this.state==="creating"&&this.createTips()},C.prototype.adjustVisual=function(){if($.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",ge.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ge.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var D=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),K=this.arrow1.transform.baseVal.getItem(0);K.setRotate(D,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(K,0);var re=this.arrow2.transform.baseVal.getItem(0);re.setRotate(D+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(re,0)}},C.prototype.setArrowType=function(D){this.arrowType=D,this.adjustVisual(),this.stateChanged()},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var D=Object.assign({arrowType:this.arrowType},$.prototype.getState.call(this));return D.typeName=C.typeName,D},C.prototype.restoreState=function(D){$.prototype.restoreState.call(this,D);var K=D;this.arrowType=K.arrowType,this.createTips(),this.adjustVisual()},C.typeName="ArrowMarker",C.title="Arrow marker",C.icon='',C}(rt),le=function($){function C(D,K,re){var J=$.call(this,D,K,re)||this;return J.fillColor=re.defaultFillColor,J.strokeWidth=0,J.fillPanel=new mt("Color",re.defaultColorSet,re.defaultFillColor),J.fillPanel.onColorChanged=J.setFillColor,J}return Oe(C,$),Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var D=$.prototype.getState.call(this);return D.typeName=C.typeName,D},C.typeName="CoverMarker",C.title="Cover marker",C.icon='',C}(bt),de=function($){function C(D,K,re,J){var Re=$.call(this,D,J||'')||this;return Re.opacities=[],Re.opacityBoxes=[],Re.opacities=K,Re.currentOpacity=re,Re.setCurrentOpacity=Re.setCurrentOpacity.bind(Re),Re}return Oe(C,$),C.prototype.getUi=function(){var D=this,K=document.createElement("div");return K.style.display="flex",K.style.overflow="hidden",K.style.flexGrow="2",K.style.justifyContent="space-between",this.opacities.forEach(function(re){var J=document.createElement("div");J.style.display="flex",J.style.alignItems="center",J.style.justifyContent="center",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.borderColor=re===D.currentOpacity?D.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){D.setCurrentOpacity(re,J)}),K.appendChild(J);var Re=document.createElement("div");Re.innerText=100*re+"%",J.appendChild(Re),D.opacityBoxes.push(J)}),K},C.prototype.setCurrentOpacity=function(D,K){var re=this;this.currentOpacity=D,this.opacityBoxes.forEach(function(J){J.style.borderColor=J===K?re.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},C}(Tt),ve=function($){function C(D,K,re){var J=$.call(this,D,K,re)||this;return J.setOpacity=J.setOpacity.bind(J),J.fillColor=re.defaultHighlightColor,J.strokeWidth=0,J.opacity=re.defaultHighlightOpacity,J.fillPanel=new mt("Color",re.defaultColorSet,J.fillColor),J.fillPanel.onColorChanged=J.setFillColor,J.opacityPanel=new de("Opacity",re.defaultOpacitySteps,J.opacity),J.opacityPanel.onOpacityChanged=J.setOpacity,J}return Oe(C,$),C.prototype.setOpacity=function(D){this.opacity=D,this.visual&&ge.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var D=$.prototype.getState.call(this);return D.typeName=C.typeName,D},C.typeName="HighlightMarker",C.title="Highlight marker",C.icon='',C}(le),pe='',Ce=function($){function C(D,K,re){var J=$.call(this,D,K,re)||this;return J.bgColor="transparent",J.tipPosition={x:0,y:0},J.tipBase1Position={x:0,y:0},J.tipBase2Position={x:0,y:0},J.tipMoving=!1,J.color=re.defaultStrokeColor,J.bgColor=re.defaultFillColor,J.fontFamily=re.defaultFontFamily,J.defaultSize={x:100,y:30},J.setBgColor=J.setBgColor.bind(J),J.getTipPoints=J.getTipPoints.bind(J),J.positionTip=J.positionTip.bind(J),J.setTipPoints=J.setTipPoints.bind(J),J.colorPanel=new mt("Text color",re.defaultColorSet,J.color,''),J.colorPanel.onColorChanged=J.setColor,J.bgColorPanel=new mt("Fill color",re.defaultColorSet,J.bgColor,pe),J.bgColorPanel.onColorChanged=J.setBgColor,J.fontFamilyPanel=new Fe("Font",re.defaultFontFamilies,re.defaultFontFamily),J.fontFamilyPanel.onFontChanged=J.setFont,J.tipGrip=new $e,J.tipGrip.visual.transform.baseVal.appendItem(ge.createTransform()),J.controlBox.appendChild(J.tipGrip.visual),J}return Oe(C,$),C.prototype.ownsTarget=function(D){return $.prototype.ownsTarget.call(this,D)||this.tipGrip.ownsTarget(D)||this.tip===D},C.prototype.createTip=function(){ge.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ge.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},C.prototype.pointerDown=function(D,K){this.state==="new"&&$.prototype.pointerDown.call(this,D,K),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(K)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):$.prototype.pointerDown.call(this,D,K)},C.prototype.pointerUp=function(D){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,$.prototype.pointerUp.call(this,D);else{var K=this.state==="creating";$.prototype.pointerUp.call(this,D),this.setTipPoints(K),this.positionTip()}},C.prototype.manipulate=function(D){if(this.tipMoving){var K=this.unrotatePoint(D);this.tipPosition={x:K.x-this.manipulationStartLeft,y:K.y-this.manipulationStartTop},this.positionTip()}else $.prototype.manipulate.call(this,D)},C.prototype.setBgColor=function(D){this.bgRectangle&&this.tip&&(ge.setAttributes(this.bgRectangle,[["fill",D]]),ge.setAttributes(this.tip,[["fill",D]])),this.bgColor=D,this.fillColorChanged(D)},C.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},C.prototype.setTipPoints=function(D){D===void 0&&(D=!1);var K=Math.min(this.height/2,15),re=this.height/5;D&&(this.tipPosition={x:K+re/2,y:this.height+20});var J=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?J.1)){var D=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),K=this.tip1.transform.baseVal.getItem(0);K.setRotate(D,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(K,0);var re=this.tip2.transform.baseVal.getItem(0);re.setRotate(D+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(re,0)}},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var D=$.prototype.getState.call(this);return D.typeName=C.typeName,D},C.prototype.restoreState=function(D){$.prototype.restoreState.call(this,D),this.createTips(),this.adjustVisual()},C.typeName="MeasurementMarker",C.title="Measurement marker",C.icon='',C}(rt),At=function($){function C(D,K,re){var J=$.call(this,D,K,re)||this;return J.strokePanel.colors=re.defaultColorSet,J.fillColor="transparent",J}return Oe(C,$),Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var D=$.prototype.getState.call(this);return D.typeName=C.typeName,D},C.typeName="EllipseFrameMarker",C.title="Ellipse frame marker",C.icon='',C}(Ke),Ft=function(){function $(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty($.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),$.prototype.addUndoStep=function(C){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(C)||(this.undoStack.push(C),JSON.stringify(this.lastRedoStep)!==JSON.stringify(C)&&this.redoStack.splice(0,this.redoStack.length))},$.prototype.replaceLastUndoStep=function(C){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=C)},$.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},$.prototype.undo=function(){if(this.undoStack.length>1){var C=this.undoStack.pop();return C!==void 0&&this.redoStack.push(C),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},$.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},$}(),kt=function($){function C(D,K,re){var J=$.call(this,D,K,re)||this;return J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.curveX=0,J.curveY=0,J.manipulationStartCurveX=0,J.manipulationStartCurveY=0,J.setStrokeColor=J.setStrokeColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.positionGrips=J.positionGrips.bind(J),J.addControlGrips=J.addControlGrips.bind(J),J.adjustVisual=J.adjustVisual.bind(J),J.setupControlBox=J.setupControlBox.bind(J),J.resize=J.resize.bind(J),J.strokeColor=re.defaultColor,J.strokeWidth=re.defaultStrokeWidth,J.strokeDasharray=re.defaultStrokeDasharray,J.strokePanel=new mt("Line color",re.defaultColorSet,re.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.strokeWidthPanel=new Mt("Line width",re.defaultStrokeWidths,re.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new jt("Line style",re.defaultStrokeDasharrays,re.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J}return Oe(C,$),C.prototype.ownsTarget=function(D){return!(!$.prototype.ownsTarget.call(this,D)&&D!==this.visual&&D!==this.selectorCurve&&D!==this.visibleCurve&&!this.curveGrip.ownsTarget(D))},C.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},C.prototype.createVisual=function(){this.visual=ge.createGroup(),this.selectorCurve=ge.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ge.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)},C.prototype.pointerDown=function(D,K){$.prototype.pointerDown.call(this,D,K),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=D.x,this.curveY=D.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(K)&&(this.activeGrip=this.curveGrip,this._state="resize")},C.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ge.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ge.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ge.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},C.prototype.setupControlBox=function(){$.prototype.setupControlBox.call(this),this.curveControlLine1=ge.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ge.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)},C.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,$.prototype.addControlGrips.call(this)},C.prototype.positionGrips=function(){$.prototype.positionGrips.call(this);var D=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-D/2,this.curveY-D/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()))},C.prototype.manipulate=function(D){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+D.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+D.y-this.manipulationStartY),$.prototype.manipulate.call(this,D)},C.prototype.resize=function(D){this.activeGrip===this.curveGrip&&(this.curveX=D.x,this.curveY=D.y),$.prototype.resize.call(this,D),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},C.prototype.setStrokeColor=function(D){this.strokeColor=D,this.adjustVisual(),this.colorChanged(D)},C.prototype.setStrokeWidth=function(D){this.strokeWidth=D,this.adjustVisual()},C.prototype.setStrokeDasharray=function(D){this.strokeDasharray=D,this.adjustVisual()},C.prototype.scale=function(D,K){this.curveX=this.curveX*D,this.curveY=this.curveY*K,$.prototype.scale.call(this,D,K)},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var D=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},$.prototype.getState.call(this));return D.typeName=C.typeName,D},C.prototype.restoreState=function(D){$.prototype.restoreState.call(this,D);var K=D;this.strokeColor=K.strokeColor,this.strokeWidth=K.strokeWidth,this.strokeDasharray=K.strokeDasharray,this.curveX=K.curveX,this.curveY=K.curveY,this.createVisual(),this.adjustVisual()},C.typeName="CurveMarker",C.title="Curve marker",C.icon='',C}(tt),wt=function(){function $(C,D){D===void 0&&(D=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=C,this.cancelable=D}return Object.defineProperty($.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),$.prototype.preventDefault=function(){this._defaultPrevented=!0},$}(),Qe=function($){function C(D,K,re){var J=$.call(this,D,!1)||this;return J.dataUrl=K,J.state=re,J}return Oe(C,$),C}(wt),it=function($){function C(D,K,re){re===void 0&&(re=!1);var J=$.call(this,D,re)||this;return J.marker=K,J}return Oe(C,$),C}(wt),We=function(){function $(){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 $.prototype.addEventListener=function(C,D){this[C].push(D)},$.prototype.removeEventListener=function(C,D){var K=this[C].indexOf(D);K>-1&&this[C].splice(K,1)},$}(),ce=function(){function $(C){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Pe,this._isOpen=!1,this.undoRedoManager=new Ft,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 We,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=$.instanceCounter++,this.styles=new _t(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=C,this.targetRoot=document.body,this.width=C.clientWidth,this.height=C.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($.prototype,"ALL_MARKER_TYPES",{get:function(){return[Me,Ee,_e,Je,At,Ke,ve,Ce,st,le,rt,kt]},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Me,Ee,_e,Je,Ke,ve,Ce]},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Me,Ee,_e,Je,ve]},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(C){var D=this;this._availableMarkerTypes.splice(0),C.forEach(function(K){if(typeof K=="string"){var re=D.ALL_MARKER_TYPES.find(function(J){return J.typeName===K});re!==void 0&&D._availableMarkerTypes.push(re)}else D._availableMarkerTypes.push(K)})},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(C){this._zoomLevel=C,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($.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),$.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),He.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},$.prototype.show=function(){var C=this;this.styles.styleSheetRoot===void 0&&vt.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=vt.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(D){return D(new wt(C))})},$.prototype.render=function(){return Ue(this,void 0,void 0,function(){var C;return De(this,function(D){switch(D.label){case 0:return this.setCurrentMarker(),(C=new ct).naturalSize=this.renderAtNaturalSize,C.imageType=this.renderImageType,C.imageQuality=this.renderImageQuality,C.markersOnly=this.renderMarkersOnly,C.width=this.renderWidth,C.height=this.renderHeight,[4,C.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return D.sent(),[4,C.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,D.sent()]}})})},$.prototype.close=function(C){var D=this;if(C===void 0&&(C=!1),this.isOpen){var K=!1;C||this.eventListeners.beforeclose.forEach(function(re){var J=new wt(D,!0);re(J),J.defaultPrevented&&(K=!0)}),K||(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(re){return re(new wt(D))}),this.detachEvents(),this._isOpen=!1)}},$.prototype.addMarkersToToolbar=function(){for(var C,D=[],K=0;Kthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*C:this.editorCanvas.clientWidth,K=D',C.title="Powered by marker.js",C.style.display="grid",C.style.alignItems="center",C.style.justifyItems="center",C.style.padding="3px",C.style.width="20px",C.style.height="20px",this.logoUI.appendChild(C),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},$.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")},$.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"},$.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},$.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 C=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=C+"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 ht(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(C),1),C.dispose()},$.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())},$.prototype.toolbarButtonClicked=function(C,D){if(C==="marker"&&D!==void 0)this.createNewMarker(D);else if(C==="action")switch(D){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()}},$.prototype.deleteSelectedMarker=function(){var C=this;if(this._currentMarker!==void 0){var D=!1;if(this.eventListeners.markerbeforedelete.forEach(function(re){var J=new it(C,C._currentMarker,!0);re(J),J.defaultPrevented&&(D=!0)}),!D){var K=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(re){return re(new it(C,K))})}}},$.prototype.clear=function(){var C=this,D=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Re){var ut=new it(C,void 0,!0);Re(ut),ut.defaultPrevented&&(D=!0)}),!D)){this.setCurrentMarker();for(var K=function(Re){var ut=re.markers[Re];re.setCurrentMarker(re.markers[Re]),re._currentMarker.dispose(),re.markerImage.removeChild(re._currentMarker.container),re.markers.splice(re.markers.indexOf(re._currentMarker),1),re.eventListeners.markerdelete.forEach(function(St){return St(new it(C,ut))})},re=this,J=this.markers.length-1;J>=0;J--)K(J);this.addUndoStep()}},Object.defineProperty($.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),$.prototype.showNotesEditor=function(){var C;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=(C=this._currentMarker.notes)!==null&&C!==void 0?C:"",this.overlayContainer.appendChild(this.notesArea))},$.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)},$.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},$.prototype.addUndoStep=function(){var C=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var D=this.getState(),K=this.undoRedoManager.getLastUndoStep();if(!K||K.width===D.width&&K.height===D.height){var re=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(D),re1&&this.panTo({x:C.clientX,y:C.clientY}))},$.prototype.onPointerUp=function(C){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(C.clientX,C.clientY)),this.isDragging=!1,this.addUndoStep()},$.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},$.prototype.onKeyUp=function(C){this._currentMarker===void 0||this.notesArea!==void 0||C.key!=="Delete"&&C.key!=="Backspace"||this.deleteSelectedMarker()},$.prototype.clientToLocalCoordinates=function(C,D){var K=this.markerImage.getBoundingClientRect();return{x:(C-K.left)/this.zoomLevel,y:(D-K.top)/this.zoomLevel}},$.prototype.onWindowResize=function(){this.positionUI()},$.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var C=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=C+"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()},$.prototype.addLicenseKey=function(C){He.addKey(C)},$.prototype.addEventListener=function(C,D){this.eventListeners.addEventListener(C,D)},$.prototype.removeEventListener=function(C,D){this.eventListeners.removeEventListener(C,D)},$.prototype.renderState=function(C){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(C),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty($.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),$.prototype.focus=function(){var C=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(D){return D(new wt(C))}))},$.prototype.blur=function(){var C=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(D){return D(new wt(C))}))},$.instanceCounter=0,$}();/* ********************************** 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 Se=function($,C){return(Se=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(D,K){D.__proto__=K}||function(D,K){for(var re in K)Object.prototype.hasOwnProperty.call(K,re)&&(D[re]=K[re])})($,C)};function ot($,C){if(typeof C!="function"&&C!==null)throw new TypeError("Class extends value "+String(C)+" is not a constructor or null");function D(){this.constructor=$}Se($,C),$.prototype=C===null?Object.create(C):(D.prototype=C.prototype,new D)}function ze($,C,D,K){return new(D||(D=Promise))(function(re,J){function Re(Yt){try{St(K.next(Yt))}catch(dt){J(dt)}}function ut(Yt){try{St(K.throw(Yt))}catch(dt){J(dt)}}function St(Yt){var dt;Yt.done?re(Yt.value):(dt=Yt.value,dt instanceof D?dt:new D(function(Gt){Gt(dt)})).then(Re,ut)}St((K=K.apply($,C||[])).next())})}function Lt($,C){var D,K,re,J,Re={label:0,sent:function(){if(1&re[0])throw re[1];return re[1]},trys:[],ops:[]};return J={next:ut(0),throw:ut(1),return:ut(2)},typeof Symbol=="function"&&(J[Symbol.iterator]=function(){return this}),J;function ut(St){return function(Yt){return function(dt){if(D)throw new TypeError("Generator is already executing.");for(;Re;)try{if(D=1,K&&(re=2&dt[0]?K.return:dt[0]?K.throw||((re=K.return)&&re.call(K),0):K.next)&&!(re=re.call(K,dt[1])).done)return re;switch(K=0,re&&(dt=[2&dt[0],re.value]),dt[0]){case 0:case 1:re=dt;break;case 4:return Re.label++,{value:dt[1],done:!1};case 5:Re.label++,K=dt[1],dt=[0];continue;case 7:dt=Re.ops.pop(),Re.trys.pop();continue;default:if(!(re=Re.trys,(re=re.length>0&&re[re.length-1])||dt[0]!==6&&dt[0]!==2)){Re=0;continue}if(dt[0]===3&&(!re||dt[1]>re[0]&&dt[1]0&&D>0){var K=new Q(C,D),re=K.ratio>=1?20:K.getHorizontalLength(20),J=K.ratio<1?20:K.getVerticalLength(20),Re=document.createElementNS("http://www.w3.org/2000/svg","svg");Re.setAttribute("xmlns","http://www.w3.org/2000/svg"),Re.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Re);var ut=ke.createDefs();Re.appendChild(ut);var St=ke.createElement("clipPath",[["id","text-bg-clip"]]);ut.appendChild(St);var Yt=ke.createPath(ke.getHollowRectanglePath((24-re)/2,(24-J)/2,re,J,(24-re)/2+2,(24-J)/2+2,re-4,J-4));Re.appendChild(Yt);var dt=ke.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);dt.appendChild(ke.createTSpan(C+":"+D)),Re.appendChild(dt);var Gt=dt.getBBox();ke.setAttributes(dt,[["x",((24-Gt.width)/2).toString()],["y",((24-Gt.height)/2-Gt.y).toString()]]);var sn=ke.createPath(ke.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Gt.width))/2,(24-Math.ceil(Gt.height))/2,Math.ceil(Gt.width),Math.ceil(Gt.height)));return St.appendChild(sn),ke.setAttributes(Yt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Re),Re.outerHTML}return''},$}(),he=function($){function C(D,K,re){var J=$.call(this,D,K)||this;return J.isDropdownOpen=!1,J.onClick=J.dropdownButtonClicked,J.dropdownButtons=re,J}return ot(C,$),C.prototype.setupDropdown=function(){var D=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(K){K.className=D.className,K.colorsClassName=D.colorsClassName,D.dropdownBlock.appendChild(K.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},C.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},C.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},C.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},C.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},C.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},C}(U),Le=function(){function $(C,D){this.GRIP_SIZE=10,this.color=C,this.fillColor=D,this.visual=ke.createGroup(),this.visual.appendChild(ke.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ke.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return $.prototype.ownsTarget=function(C){return C===this.visual||C===this.visual.childNodes[0]||C===this.visual.childNodes[1]},$.prototype.setCenter=function(C,D){this.visual.childNodes.forEach(function(K){return ke.setAttributes(K,[["cx",C.toString()],["cy",D.toString()]])})},$}(),Ge=function(){function $(C,D,K,re){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=C,this.canvasHeight=D,this.margin=K,this.container=re,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($.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(C){this._aspectRatio=C,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(C){this._isGridVisible=C,this.gridContainer&&ke.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(C){this._zoomFactor=C,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),$.prototype.open=function(){var C=this;this.cropShadeElement=ke.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=ke.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var D=0;Dthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-D.height/2),ke.setAttributes(this.cropRectElement,[["x",D.x.toString()],["y",D.y.toString()],["width",D.width.toString()],["height",D.height.toString()]]);var K=D.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(J,Re){var ut=D.y+K*(Re+1);ke.setAttributes(J,[["x1",""+D.x],["y1",""+ut],["x2",""+(D.x+D.width)],["y2",""+ut]])});var re=D.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(J,Re){var ut=D.x+re*(Re+1);ke.setAttributes(J,[["x1",""+ut],["y1",""+D.y],["x2",""+ut],["y2",""+(D.y+D.height)]])}),ke.setAttributes(this.cropShadeElement,[["d",ke.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,D.x,D.y,D.width,D.height)]]),this.topLeftGrip.setCenter(D.x,D.y),this.topRightGrip.setCenter(D.x+D.width,D.y),this.bottomLeftGrip.setCenter(D.x,D.y+D.height),this.bottomRightGrip.setCenter(D.x+D.width,D.y+D.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},$.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)},$.prototype.clientToLocalCoordinates=function(C,D){var K=this.container.getBoundingClientRect();return{x:C-K.left+this.margin,y:D-K.top+this.margin}},$.prototype.onPointerDown=function(C){this.container.setPointerCapture(C.pointerId),this.previousPoint=this.clientToLocalCoordinates(C.clientX,C.clientY),this.cropRectElement===C.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(C.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(C.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(C.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(C.target)&&(this.activeGrip=this.bottomRightGrip)},$.prototype.onPointerMove=function(C){if(this.isMoving)this.move(this.clientToLocalCoordinates(C.clientX,C.clientY));else if(this.activeGrip){var D=this.clientToLocalCoordinates(C.clientX,C.clientY);this.resize(D)}C.preventDefault()},$.prototype.onPointerUp=function(C){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(C.pointerId)},$.prototype.move=function(C){var D=C.x-this.previousPoint.x,K=C.y-this.previousPoint.y;this.zoomFactor!==1&&(D=-D/this.zoomFactor,K=-K/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+D),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+K),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=C},$.prototype.resize=function(C){var D=Object.assign({},this.cropRect),K=C.x-this.previousPoint.x,re=C.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:D.x+Kthis.canvasWidth*this.zoomFactor&&(K=this.canvasWidth*this.zoomFactor-D.width),D.width+=K}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(D.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(K),D.height=this.aspectRatio.getVerticalLength(D.width)):(D.y+=re,D.height=this.cropRect.y+this.cropRect.height-D.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?D.height=this.aspectRatio.getVerticalLength(D.width):D.height+=re}D.width<10&&(D.x=this.cropRect.x,D.width=10),D.height<10&&(D.y=this.cropRect.y,D.height=10),this.previousPoint=C,D.x>=this.margin&&D.y>=this.margin&&D.x-this.margin+D.width<=this.canvasWidth&&D.y-this.margin+D.height<=this.canvasHeight&&(this.cropRect=D,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},$.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var C=this.cropRect.x+this.cropRect.width/2,D=this.cropRect.y+this.cropRect.height/2,K=this.aspectRatio.getHorizontalLength(this.cropRect.height),re=this.aspectRatio.getVerticalLength(this.cropRect.width);K/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=C-this.cropRect.width/2,this.cropRect.y=D-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)}},$.prototype.getRescaledRect=function(C,D,K,re,J,Re){var ut=K/C,St=re/D;return{x:(J.x-Re)*ut+Re,y:(J.y-Re)*St+Re,width:J.width*ut,height:J.height*St}},$.prototype.scaleCanvas=function(C,D){var K=this.getRescaledRect(this.canvasWidth,this.canvasHeight,C,D,this.cropRect,this.margin);this.canvasWidth=C,this.canvasHeight=D,this.onCropChange&&this.onCropChange(K),this.setCropRectangle(K)},$}(),Ot=function(){function $(C){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=C,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($.prototype,"angle",{get:function(){return this._angle},set:function(C){this._angle=C,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),$.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},$.prototype.onPointerDown=function(C){this.controlContainer.setPointerCapture(C.pointerId),this.isDragging=!0,this.previousPoint={x:C.clientX,y:C.clientY}},$.prototype.onPointerMove=function(C){this.isDragging&&(this.onAngleChange&&this.onAngleChange((C.clientX-this.previousPoint.x)/5),this.previousPoint.x=C.clientX)},$.prototype.onPointerUp=function(C){this.isDragging&&this.onAngleChange&&this.onAngleChange((C.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(C.pointerId)},$.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var C=this.angleLabelText.getBBox();ke.setAttributes(this.angleLabelElement,[["x",((this.width-C.width)/2).toString()],["y",(this.height/2).toString()]])}},$.prototype.positionScaleShape=function(){if(this.scaleShape){var C=this.scaleShape.transform.baseVal.getItem(0);C.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(C,0)}},$.prototype.getVisual=function(){var C=document.createElementNS("http://www.w3.org/2000/svg","svg");C.setAttribute("xmlns","http://www.w3.org/2000/svg"),C.setAttribute("width",this.width+"px"),C.setAttribute("height",this.height+"px"),C.setAttribute("viewBox","0 0 "+this.width+" "+this.height),C.style.flexShrink="0",document.body.appendChild(C);for(var D="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,K=1;K<=this.width/5+10;K++){var re=K%5==0?this.height/3:this.height/6;D+="h4v"+-re+"h1v"+re}D+="v1H0Z",this.scaleShape=ke.createPath(D);var J=ke.createTransform();this.scaleShape.transform.baseVal.appendItem(J),C.appendChild(this.scaleShape),this.angleLabelElement=ke.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=ke.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Re=ke.createTSpan("");return Re.innerHTML="°",this.angleLabelElement.appendChild(Re),C.appendChild(this.angleLabelElement),document.body.removeChild(C),C},$}(),Nt=function(){function $(){this.naturalSize=!1,this.imageType="image/png"}return $.prototype.rasterize=function(C,D,K,re,J,Re,ut){var St=this;return new Promise(function(Yt){var dt=document.createElement("canvas");dt.width=C.width.baseVal.value-2*re,dt.height=C.height.baseVal.value-2*re;var Gt=1,sn=1;St.naturalSize===!0?(Gt=D.naturalWidth/(C.width.baseVal.value-2*re)/Re,sn=D.naturalHeight/(C.height.baseVal.value-2*re)/ut,dt.width=D.naturalWidth/Re,dt.height=D.naturalHeight/ut):St.width!==void 0&&St.height!==void 0&&(Gt=St.width/K.width,sn=St.height/K.height,dt.width*=Gt,dt.height*=sn);var Wn=dt.getContext("2d");Wn.translate(dt.width/2,dt.height/2),Wn.rotate(J*Math.PI/180),Wn.scale(Re,ut),Wn.translate(-dt.width/2,-dt.height/2),Wn.drawImage(D,0,0,dt.width,dt.height);var Si=document.createElement("canvas");Si.width=K.width*Gt,Si.height=K.height*sn,Si.getContext("2d").putImageData(Wn.getImageData((K.x-re)*Gt,(K.y-re)*sn,K.width*Gt,K.height*sn),0,0),Yt(Si.toDataURL(St.imageType,St.imageQuality))})},$}(),Xe=function(){function $(C){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=$.instanceCounter++,this.styles=new qe(this.instanceNo),this.target=C,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($.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(C){this._zoomToCropEnabled=C,C?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(C){this._isGridVisible=C,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"gridLines",{get:function(){return this._gridLines},set:function(C){this._gridLines=C,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(C){this._rotationAngle=C,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"aspectRatio",{get:function(){var C;return(C=this._aspectRatio)!==null&&C!==void 0?C:this.aspectRatios[0]},set:function(C){this._aspectRatio=C},enumerable:!1,configurable:!0}),$.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},$.prototype.show=function(){this.showUI(),this.open()},$.prototype.close=function(C){C===void 0&&(C=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),C||this.closeEventListeners.forEach(function(D){return D()}),this._isOpen=!1)},$.prototype.addRenderEventListener=function(C){this.renderEventListeners.push(C)},$.prototype.removeRenderEventListener=function(C){this.renderEventListeners.indexOf(C)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(C),1)},$.prototype.addCloseEventListener=function(C){this.closeEventListeners.push(C)},$.prototype.removeCloseEventListener=function(C){this.closeEventListeners.indexOf(C)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(C),1)},$.prototype.setupResizeObserver=function(){var C=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){C.resize(C.target.clientWidth,C.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))},$.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var C=1*this.target.clientWidth/this.target.clientHeight,D=this.contentDiv.clientWidth/C>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*C:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,K=D+2*this.CANVAS_MARGINC+this.CANVAS_MARGIN?this.target.offsetTop-(C+this.CANVAS_MARGIN):0;this.coverDiv.style.top=D+"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},$.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},$.prototype.addTopToolbar=function(){var C=this;this.topToolbar=new $t,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 D=new se;D.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(D);var K=[];this.aspectRatios.forEach(function(sn){var Wn=new U(te.getIcon(sn.horizontal,sn.vertical),sn.horizontal===0&&sn.vertical===0?"FREE":sn.horizontal+":"+sn.vertical);Wn.onClick=function(){return C.ratioButtonClicked(sn)},K.push(Wn)}),this.aspectRatioButton=new he(te.getIcon(0,0),"Aspect ratio",K),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,D.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var re=new U('',"Toggle grid");re.isActive=this.isGridVisible,re.onClick=function(){C.isGridVisible=!C.isGridVisible,re.isActive=C.isGridVisible},D.addButton(re);var J=new U('',"Zoom to selection");if(J.isActive=this.zoomToCropEnabled,J.onClick=function(){C.zoomToCropEnabled=!C.zoomToCropEnabled,J.isActive=C.zoomToCropEnabled},D.addButton(J),!Dt.isLicensed){var Re=new G;this.topToolbar.addElementBlock(Re);var ut=document.createElement("div");ut.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var St=document.createElement("a");St.style.color="currentColor",St.href="https://markerjs.com/products/cropro",St.target="_blank",St.innerHTML='',ut.appendChild(St),Re.addElement(ut)}var Yt=new se;Yt.minWidth=3*this.toolbarHeight+"px",Yt.contentAlign="end",this.topToolbar.addButtonBlock(Yt);var dt=new U('',"OK");dt.onClick=this.startRenderAndClose,Yt.addButton(dt),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(dt.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Gt=new U('',"Close");Gt.onClick=this.close,Yt.addButton(Gt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Gt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},$.prototype.addBottomToolbar=function(){var C=this;this.bottomToolbar=new $t,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 D=new se;D.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(D);var K=new U('',"Rotate left");K.onClick=this.rotateLeftButtonClicked,D.addButton(K);var re=new U('',"Rotate right");re.onClick=this.rotateRightButtonClicked,D.addButton(re);var J=new G;J.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(J),this.straightener=new Ot("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(Yt){C.rotateBy(Yt),C.straightener.angle=C.rotationAngle},J.addElement(this.straightener.getUI());var Re=new se;Re.minWidth=2*this.toolbarHeight+"px",Re.contentAlign="end",this.bottomToolbar.addButtonBlock(Re);var ut=new U('',"Flip horizontal");ut.onClick=this.flipHorizontallyButtonClicked,Re.addButton(ut);var St=new U('',"Flip vertical");St.onClick=this.flipVerticallyButtonClicked,Re.addButton(St)},$.prototype.ratioButtonClicked=function(C){this.aspectRatio=C,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},$.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=te.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},$.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Q(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},$.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},$.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},$.prototype.restoreState=function(C){if(C){var D=this.cropLayer.getRescaledRect(C.width,C.height,this.imageWidth,this.imageHeight,C.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(D),this.cropRectChanged(D),this.flippedHorizontally=C.flippedHorizontally,this.flippedVertically=C.flippedVertically,this.applyFlip(),this.rotationAngle=C.rotationAngle,this.applyRotation()}},$.prototype.clientToLocalCoordinates=function(C,D){var K=this.cropImage.getBoundingClientRect();return{x:C-K.left,y:D-K.top}},$.prototype.onWindowResize=function(){this.positionUI()},$.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var C=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=C+"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()},$.prototype.rotateLeftButtonClicked=function(){var C=this.rotationAngle-90;this.rotationAngle%90!=0&&(C+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(C)},$.prototype.rotateRightButtonClicked=function(){var C=this.rotationAngle+90;this.rotationAngle%90!=0&&(C-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(C)},$.prototype.rotateTo=function(C){C=(C=C>180?C-360:C)<=-180?C+360:C,this.rotationAngle=C,this.applyRotation()},$.prototype.rotateBy=function(C){this.rotateTo((this.rotationAngle+C)%360)},$.prototype.applyRotation=function(){var C=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var D=this.editingTargetRotationContainer.transform.baseVal.getItem(0);D.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(D,0);var K=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/K.width,this.imageHeight/K.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=C},$.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},$.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},$.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},$.prototype.startRenderAndClose=function(){return ze(this,void 0,void 0,function(){var C,D;return Lt(this,function(K){switch(K.label){case 0:return[4,this.render()];case 1:return C=K.sent(),D=this.getState(),this.renderEventListeners.forEach(function(re){return re(C,D)}),this.close(!0),[2]}})})},$.prototype.render=function(){return ze(this,void 0,void 0,function(){var C;return Lt(this,function(D){switch(D.label){case 0:return(C=new Nt).naturalSize=this.renderAtNaturalSize,C.imageType=this.renderImageType,C.imageQuality=this.renderImageQuality,C.width=this.renderWidth,C.height=this.renderHeight,this.unzoomFromCrop(),ke.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,C.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 D.sent(),[4,C.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,D.sent()]}})})},$.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Pt("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 Pt("toolbar_colors",` background-color: `+this.styles.settings.toolbarBackgroundColor+`; `)),this.toolbarBlockStyleClass=this.styles.addClass(new Pt("toolbar-block",` display: flex; align-items: center; box-sizing: content-box; `));var C=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Pt("toolbar_button",` display: inline-block; width: `+(this.toolbarHeight-2*C)+`px; height: `+(this.toolbarHeight-2*C)+`px; padding: `+C+`px; cursor: default; user-select: none; box-sizing: content-box; `)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Pt("toolbar_button_colors",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; `)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Pt("toolbar_active_button",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; background-color: `+this.styles.settings.toolbarBackgroundActiveColor+` `)),this.styles.addRule(new Rt("."+this.toolbarButtonStyleClass.name+" svg",` height: `+this.toolbarHeight/2+`px; `)),this.styles.addRule(new Rt("."+this.toolbarButtonStyleColorsClass.name+":hover",` background-color: `+this.styles.settings.toolbarBackgroundHoverColor+` `)),this.toolbarDropdownStyleClass=this.styles.addClass(new Pt("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 Pt("toolbar_dropdown_colors",` background-color: `+this.styles.settings.toolbarBackgroundColor+`; `)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Pt("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 Pt("toolbar_straightener",` display: flex; overflow: hidden; justify-content: center; height: `+(this.toolbarHeight-2*C)+`px; padding: `+C+`px; cursor: default; user-select: none; box-sizing: content-box; `)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Pt("toolbar_straightener_colors",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; `))},$.instanceCounter=0,$}(),It=k("8hTe"),an=k.n(It),Ct=/]*>/g;function pn($){var C=document.createElement("div");return C.innerHTML=$,C.childNodes.length===0?"":C.childNodes[0].nodeValue}var nn=we.a=function($){var C=$.value,D=C===void 0?"":C,K=$.edit,re=K===void 0?!1:K,J=$.className,Re=$.showTextOnly,ut=$.showLines,St=$.replaces,Yt=$.zoomImg,dt=$.hasMask,Gt=$.style,sn=Gt===void 0?{}:Gt,Wn=$.stylesPrev,Si=Wn===void 0?{}:Wn,hi=String(D),Fn=Object(I.useRef)(),di=Object(I.useRef)(),Zi=Object(I.useState)(""),_i=Object(B.a)(Zi,2),ri=_i[0],wi=_i[1],Di=Object(I.useState)("office"),Oi=Object(B.a)(Di,2),Ri=Oi[0],Vi=Oi[1],cr=function(){var Cn=new Xe(di.current);Cn.displayMode="popup",Cn.addRenderEventListener(function(){var yi=Object(R.a)(L.a.mark(function Nn(Ti){var ii;return L.a.wrap(function(Ni){for(;;)switch(Ni.prev=Ni.next){case 0:return Fn.current.style.display="none",Ni.next=3,Object(xe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Ti}});case 3:ii=Ni.sent,ii!=null&&ii.id&&St(di.current.getAttribute("src").replace(ne.a.API_SERVER,""),"/api/attachments/".concat(ii==null?void 0:ii.id,"?type=").concat(ii.content_type));case 5:case"end":return Ni.stop()}},Nn)}));return function(Nn){return yi.apply(this,arguments)}}()),Cn.show()},rr=function(){var Cn=new ce(di.current);Cn.settings.displayMode="popup",Cn.addEventListener("render",function(){var yi=Object(R.a)(L.a.mark(function Nn(Ti){var ii;return L.a.wrap(function(Ni){for(;;)switch(Ni.prev=Ni.next){case 0:if(Fn.current.style.display="none",!di.current){Ni.next=6;break}return Ni.next=4,Object(xe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Ti.dataUrl}});case 4:ii=Ni.sent,ii!=null&&ii.id&&St(di.current.getAttribute("src").replace(ne.a.API_SERVER,""),"/api/attachments/".concat(ii==null?void 0:ii.id,"?type=").concat(ii.content_type));case 6:case"end":return Ni.stop()}},Nn)}));return function(Nn){return yi.apply(this,arguments)}}()),Cn.show(),window.markerArea=Cn},ji=Object(I.useMemo)(function(){Fn.current&&(Fn.current.style.zIndex=-1);try{var Hn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Cn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,yi=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;hi=hi.replace(Hn,"("+ne.a.API_SERVER+"/api/attachments/").replace(Cn,'"'+ne.a.API_SERVER+"/api/attachments/").replace(yi,'"'+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,` `)}catch(Cr){}var Nn=Z(hi),Ti=S();if(hi.match(/\[TOC\]/)&&(Nn=Nn.replace("

    [TOC]

    ",O()),w()),Nn=Nn.replace(/(__special_katext_id_\d+__)/g,function(Cr,Ni){var Xi=Ti[Ni],lr=Xi.type,gr=Xi.expression;return Object(ae.renderToString)(pn(gr)||"",{displayMode:lr==="block",throwOnError:!1,output:"html"})}),Nn=Nn.replace(/▁/g,"\u2581\u2581\u2581"),y(),Re){var ii=document.createElement("div");return ii.innerHTML=Nn,ii.innerText}return setTimeout(function(){return Tr()},500),Nn},[hi]),Wi=Object(I.useRef)();T.WebkitLineClamp=ut,ut&&(sn=Object(W.a)(Object(W.a)({},sn),T));function hr(Hn){var Cn=Hn.target;if(Cn.tagName.toUpperCase()==="IMG"){if(Yt){var yi=Cn.getAttribute("src");wi(yi),Vi("image")}}else if(Cn.tagName.toUpperCase()==="A"){var Nn=Cn.getAttribute("href");if(Nn.indexOf("office")>-1)Hn.preventDefault(),wi(Nn),Vi("office");else if(Nn.indexOf("application/pdf")>-1)Hn.preventDefault(),wi(Nn),Vi("pdf");else if(Nn.indexOf("text/html")>-1)Hn.preventDefault(),wi(Nn),Vi("html");else if(Nn.startsWith("#")){Hn.preventDefault();var Ti=document.getElementById(Nn.replace("#",""));Ti&&Ti.scrollIntoView(!0)}}}var Tr=function(){var Cn,yi=(Cn=Wi.current)===null||Cn===void 0?void 0:Cn.querySelectorAll("video");yi==null||yi.forEach(function(Nn){if(Nn.oncontextmenu=function(){return!1},Nn.src.indexOf(".m3u8")>-1&&!Nn.canPlayType("application/vnd.apple.mpegurl")){if(z.a.isSupported()){var Ti=new z.a;Ti.loadSource(Nn.src),Ti.attachMedia(Nn)}}})};Object(I.useEffect)(function(){if(Wi.current&&ji&&(ji.match(Ct)&&window.PR.prettyPrint()),Wi.current)return Wi.current.addEventListener("click",hr),function(){Wi.current.removeEventListener("click",hr),y(),w()}},[ji,Wi.current,hr]);var ar=function(Cn){if(!re)return;Cn.target.nodeName==="IMG"?(Fn.current.style.zIndex=1,Fn.current.style.display="flex",Fn.current.style.width=Cn.target.clientWidth+"px",Fn.current.style.height=Cn.target.clientHeight+"px",Fn.current.style.top=Cn.target.offsetTop+"px",Fn.current.style.left=Cn.target.offsetLeft+"px",di.current.src=Cn.target.getAttribute("src")):Fn.current.style.display="none"};return p.a.createElement("div",{style:{position:"relative"}},p.a.createElement("div",{ref:Wi,style:Object(W.a)({},sn),className:"".concat(J||""," markdown-body ").concat(an.a.mdBody),onMouseOver:ar,dangerouslySetInnerHTML:{__html:ji}}),p.a.createElement("div",{ref:Fn,className:an.a.button},p.a.createElement(V.a,null,p.a.createElement(Y.a,{onClick:function(){return cr()}},"\u88C1\u526A"),p.a.createElement(Y.a,{onClick:function(){return rr()}},"\u7F16\u8F91"))),p.a.createElement("img",{ref:di,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),p.a.createElement(me.a,{close:!0,data:ri,type:ri!=null&&ri.length?Ri:"",style:Object(W.a)({},Si),onClose:function(){return wi("")}}))}},"9VGf":function(Be,we,k){"use strict";k.d(we,"a",function(){return P});var ee=k("q1tI"),V=k.n(ee);function P(Y,W){var R=Object(ee.useRef)();Object(ee.useEffect)(function(){R.current=Y}),Object(ee.useEffect)(function(){function B(){R.current()}if(W!==null){var M=setInterval(B,W);return function(){return clearInterval(M)}}},[W])}},AMnG:function(Be,we,k){"use strict";var ee=k("miYZ"),V=k("tsqr"),P=k("tJVT"),Y=k("q1tI"),W=k.n(Y),R=k("nWbc"),B=k.n(R),M=k("Ot1p");we.a=function(L){var I=L.id,p=L.activeDiscussIndex,m=L.onReplyDiscuss,u=Object(Y.useState)(""),h=Object(P.a)(u,2),s=h[0],l=h[1];function i(n){l(n)}function r(){if(!s){V.b.info("\u56DE\u590D\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A!");return}m(I,s),l("")}return W.a.createElement("div",{key:I,className:"discuss-item-editor",style:{display:p===I?"block":"none",width:"100%"}},W.a.createElement(M.a,{miniToolbar:!0,startInit:p===I,defaultValue:s,id:I,noStorage:!0,watch:!1,height:155,placeholder:"\u6211\u8981\u56DE\u590D",showResizeBar:!0,onChange:i}),W.a.createElement("a",{onClick:r,className:"btn-send"},"\u53D1\u9001"))}},BU3w:function(Be,we,k){"use strict";k.d(we,"a",function(){return R});var ee=k("MNnm"),V="rc-util-key";function P(B){if(B.attachTo)return B.attachTo;var M=document.querySelector("head");return M||document.body}function Y(B){var M,L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ee.a)())return null;var I=document.createElement("style");if((M=L.csp)===null||M===void 0?void 0:M.nonce){var p;I.nonce=(p=L.csp)===null||p===void 0?void 0:p.nonce}I.innerHTML=B;var m=P(L),u=m.firstChild;return L.prepend&&m.prepend?m.prepend(I):L.prepend&&u?m.insertBefore(I,u):m.appendChild(I),I}var W=new Map;function R(B,M){var L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},I=P(L);if(!W.has(I)){var p=Y("",L),m=p.parentNode;W.set(I,m),m.removeChild(p)}var u=Array.from(W.get(I).children).find(function(r){return r.tagName==="STYLE"&&r[V]===M});if(u){var h,s;if(((h=L.csp)===null||h===void 0?void 0:h.nonce)&&u.nonce!==((s=L.csp)===null||s===void 0?void 0:s.nonce)){var l;u.nonce=(l=L.csp)===null||l===void 0?void 0:l.nonce}return u.innerHTML!==B&&(u.innerHTML=B),u}var i=Y(B,L);return i[V]=M,i}},Bd2K:function(Be,we,k){(function(ee){ee(k("VrN/"),k("osHv"))})(function(ee){ee.defineOption("autoCloseTags",!1,function(L,I,p){if(p!=ee.Init&&p&&L.removeKeyMap("autoCloseTags"),!I)return;var m={name:"autoCloseTags"};(typeof I!="object"||I.whenClosing!==!1)&&(m["'/'"]=function(u){return R(u)}),(typeof I!="object"||I.whenOpening!==!1)&&(m["'>'"]=function(u){return Y(u)}),L.addKeyMap(m)});var V=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],P=["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 Y(L){if(L.getOption("disableInput"))return ee.Pass;for(var I=L.listSelections(),p=[],m=L.getOption("autoCloseTags"),u=0;uh.ch&&(n=n.slice(0,n.length-s.end+h.ch));var x=n.toLowerCase();if(!n||s.type=="string"&&(s.end!=h.ch||!/[\"\']/.test(s.string.charAt(s.string.length-1))||s.string.length==1)||s.type=="tag"&&r.close||s.string.indexOf("/")==h.ch-s.start-1||w&&B(w,x)>-1||M(L,l.mode.xmlCurrentContext&&l.mode.xmlCurrentContext(i)||[],n,h,!0))return ee.Pass;var O=typeof m=="object"&&m.emptyTags;if(O&&B(O,n)>-1){p[u]={text:"/>",newPos:ee.Pos(h.line,h.ch+2)};continue}var E=T&&B(T,x)>-1;p[u]={indent:E,text:">"+(E?` `:"")+"",newPos:E?ee.Pos(h.line+1,0):ee.Pos(h.line,h.ch+1)}}for(var v=typeof m=="object"&&m.dontIndentOnAutoClose,u=I.length-1;u>=0;u--){var _=p[u];L.replaceRange(_.text,I[u].head,I[u].anchor,"+insert");var f=L.listSelections().slice(0);f[u]={head:_.newPos,anchor:_.newPos},L.setSelections(f),!v&&_.indent&&(L.indentLine(_.newPos.line,null,!0),L.indentLine(_.newPos.line+1,null,!0))}}function W(L,I){for(var p=L.listSelections(),m=[],u=I?"/":""&&(w+=">"),m[l]=w}if(L.replaceSelections(m),p=L.listSelections(),!s)for(var l=0;l=0&&I[i]==p;i--)++l;m=s.to;for(var i=1;i0){for(var I=0;I1&&arguments[1]!==void 0?arguments[1]:"",I=[],p=0;p=0;I--){var p=P().key(I);L(Y(p),p)}}function B(L){return P().removeItem(L)}function M(){return P().clear()}},DlQD:function(Be,we,k){(function(ee,V){Be.exports=V()})(this,function(){"use strict";function ee(Ee,ye){for(var _e=0;_eEe.length)&&(ye=Ee.length);for(var _e=0,le=new Array(ye);_e=Ee.length?{done:!0}:{done:!1,value:Ee[le++]}}}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 _e=Ee[Symbol.iterator](),_e.next.bind(_e)}function R(Ee,ye){return ye={exports:{}},Ee(ye,ye.exports),ye.exports}var B=R(function(Ee){function ye(){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 _e(le){Ee.exports.defaults=le}Ee.exports={defaults:ye(),getDefaults:ye,changeDefaults:_e}}),M=B.defaults,L=B.getDefaults,I=B.changeDefaults,p=/[&<>"']/,m=/[&<>"']/g,u=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,s={"&":"&","<":"<",">":">",'"':""","'":"'"},l=function(ye){return s[ye]};function i(Ee,ye){if(ye){if(p.test(Ee))return Ee.replace(m,l)}else if(u.test(Ee))return Ee.replace(h,l);return Ee}var r=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function n(Ee){return Ee.replace(r,function(ye,_e){return _e=_e.toLowerCase(),_e==="colon"?":":_e.charAt(0)==="#"?_e.charAt(1)==="x"?String.fromCharCode(parseInt(_e.substring(2),16)):String.fromCharCode(+_e.substring(1)):""})}var d=/(^|[^\[])\^/g;function w(Ee,ye){Ee=Ee.source||Ee,ye=ye||"";var _e={replace:function(de,ve){return ve=ve.source||ve,ve=ve.replace(d,"$1"),Ee=Ee.replace(de,ve),_e},getRegex:function(){return new RegExp(Ee,ye)}};return _e}var T=/[^\w:]/g,x=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function O(Ee,ye,_e){if(Ee){var le;try{le=decodeURIComponent(n(_e)).replace(T,"").toLowerCase()}catch(de){return null}if(le.indexOf("javascript:")===0||le.indexOf("vbscript:")===0||le.indexOf("data:")===0)return null}ye&&!x.test(_e)&&(_e=c(ye,_e));try{_e=encodeURI(_e).replace(/%25/g,"%")}catch(de){return null}return _e}var E={},v=/^[^:]+:\/*[^/]*$/,_=/^([^:]+:)[\s\S]*$/,f=/^([^:]+:\/*[^/]*)[\s\S]*$/;function c(Ee,ye){E[" "+Ee]||(v.test(Ee)?E[" "+Ee]=Ee+"/":E[" "+Ee]=N(Ee,"/",!0)),Ee=E[" "+Ee];var _e=Ee.indexOf(":")===-1;return ye.substring(0,2)==="//"?_e?ye:Ee.replace(_,"$1")+ye:ye.charAt(0)==="/"?_e?ye:Ee.replace(f,"$1")+ye:Ee+ye}var S={exec:function(){}};function y(Ee){for(var ye=1,_e,le;ye=0&&Ce[st]==="\\";)Ke=!Ke;return Ke?"|":" |"}),le=_e.split(/ \|/),de=0;if(le.length>ye)le.splice(ye);else for(;le.length=le.length?de.slice(le.length):de}).join(` `)}var Te=function(){function Ee(_e){this.options=_e||H}var ye=Ee.prototype;return ye.space=function(le){var de=this.rules.block.newline.exec(le);if(de)return de[0].length>1?{type:"space",raw:de[0]}:{raw:` `}},ye.code=function(le,de){var ve=this.rules.block.code.exec(le);if(ve){var pe=de[de.length-1];if(pe&&pe.type==="paragraph")return{raw:ve[0],text:ve[0].trimRight()};var Ce=ve[0].replace(/^ {4}/gm,"");return{type:"code",raw:ve[0],codeBlockStyle:"indented",text:this.options.pedantic?Ce:A(Ce,` `)}}},ye.fences=function(le){var de=this.rules.block.fences.exec(le);if(de){var ve=de[0],pe=xe(ve,de[3]||"");return{type:"code",raw:ve,lang:de[2]?de[2].trim():de[2],text:pe}}},ye.heading=function(le){var de=this.rules.block.heading.exec(le);if(de)return{type:"heading",raw:de[0],depth:de[1].length,text:de[2]}},ye.nptable=function(le){var de=this.rules.block.nptable.exec(le);if(de){var ve={type:"table",header:z(de[1].replace(/^ *| *\| *$/g,"")),align:de[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:de[3]?de[3].replace(/\n$/,"").split(` `):[],raw:de[0]};if(ve.header.length===ve.align.length){var pe=ve.align.length,Ce;for(Ce=0;Ce ?/gm,"");return{type:"blockquote",raw:de[0],text:ve}}},ye.list=function(le){var de=this.rules.block.list.exec(le);if(de){for(var ve=de[0],pe=de[2],Ce=pe.length>1,Ke=pe[pe.length-1]===")",st={type:"list",raw:ve,ordered:Ce,start:Ce?+pe.slice(0,-1):"",loose:!1,items:[]},At=de[0].match(this.rules.block.item),Ft=!1,kt,wt,Qe,it,We,ce,Se,ot=At.length,ze=0;ze1||this.options.smartLists&&Qe!==pe)&&(it=At.slice(ze+1).join(` `),st.raw=st.raw.substring(0,st.raw.length-it.length),ze=ot-1)),We=Ft||/\n\n(?!\s*$)/.test(kt),ze!==ot-1&&(Ft=kt.charAt(kt.length-1)===` `,We||(We=Ft)),We&&(st.loose=!0),ce=/^\[[ xX]\] /.test(kt),Se=void 0,ce&&(Se=kt[1]!==" ",kt=kt.replace(/^\[[ xX]\] +/,"")),st.items.push({type:"list_item",raw:ve,task:ce,checked:Se,loose:We,text:kt});return st}},ye.html=function(le){var de=this.rules.block.html.exec(le);if(de)return{type:this.options.sanitize?"paragraph":"html",raw:de[0],pre:!this.options.sanitizer&&(de[1]==="pre"||de[1]==="script"||de[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(de[0]):ne(de[0]):de[0]}},ye.def=function(le){var de=this.rules.block.def.exec(le);if(de){de[3]&&(de[3]=de[3].substring(1,de[3].length-1));var ve=de[1].toLowerCase().replace(/\s+/g," ");return{tag:ve,raw:de[0],href:de[2],title:de[3]}}},ye.table=function(le){var de=this.rules.block.table.exec(le);if(de){var ve={type:"table",header:z(de[1].replace(/^ *| *\| *$/g,"")),align:de[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:de[3]?de[3].replace(/\n$/,"").split(` `):[]};if(ve.header.length===ve.align.length){ve.raw=de[0];var pe=ve.align.length,Ce;for(Ce=0;Ce/i.test(pe[0])&&(de=!1),!ve&&/^<(pre|code|kbd|script)(\s|>)/i.test(pe[0])?ve=!0:ve&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(pe[0])&&(ve=!1),{type:this.options.sanitize?"text":"html",raw:pe[0],inLink:de,inRawBlock:ve,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(pe[0]):ne(pe[0]):pe[0]}},ye.link=function(le){var de=this.rules.inline.link.exec(le);if(de){var ve=ae(de[2],"()");if(ve>-1){var pe=de[0].indexOf("!")===0?5:4,Ce=pe+de[1].length+ve;de[2]=de[2].substring(0,ve),de[0]=de[0].substring(0,Ce).trim(),de[3]=""}var Ke=de[2],st="";if(this.options.pedantic){var At=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ke);At?(Ke=At[1],st=At[3]):st=""}else st=de[3]?de[3].slice(1,-1):"";Ke=Ke.trim().replace(/^<([\s\S]*)>$/,"$1");var Ft=me(de,{href:Ke&&Ke.replace(this.rules.inline._escapes,"$1"),title:st&&st.replace(this.rules.inline._escapes,"$1")},de[0]);return Ft}},ye.reflink=function(le,de){var ve;if((ve=this.rules.inline.reflink.exec(le))||(ve=this.rules.inline.nolink.exec(le))){var pe=(ve[2]||ve[1]).replace(/\s+/g," ");if(pe=de[pe.toLowerCase()],!pe||!pe.href){var Ce=ve[0].charAt(0);return{type:"text",raw:Ce,text:Ce}}var Ke=me(ve,pe,ve[0]);return Ke}},ye.strong=function(le,de,ve){ve===void 0&&(ve="");var pe=this.rules.inline.strong.start.exec(le);if(pe&&(!pe[1]||pe[1]&&(ve===""||this.rules.inline.punctuation.exec(ve)))){de=de.slice(-1*le.length);var Ce=pe[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Ce.lastIndex=0;for(var Ke;(pe=Ce.exec(de))!=null;)if(Ke=this.rules.inline.strong.middle.exec(de.slice(0,pe.index+3)),Ke)return{type:"strong",raw:le.slice(0,Ke[0].length),text:le.slice(2,Ke[0].length-2)}}},ye.em=function(le,de,ve){ve===void 0&&(ve="");var pe=this.rules.inline.em.start.exec(le);if(pe&&(!pe[1]||pe[1]&&(ve===""||this.rules.inline.punctuation.exec(ve)))){de=de.slice(-1*le.length);var Ce=pe[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Ce.lastIndex=0;for(var Ke;(pe=Ce.exec(de))!=null;)if(Ke=this.rules.inline.em.middle.exec(de.slice(0,pe.index+2)),Ke)return{type:"em",raw:le.slice(0,Ke[0].length),text:le.slice(1,Ke[0].length-1)}}},ye.codespan=function(le){var de=this.rules.inline.code.exec(le);if(de){var ve=de[2].replace(/\n/g," "),pe=/[^ ]/.test(ve),Ce=ve.startsWith(" ")&&ve.endsWith(" ");return pe&&Ce&&(ve=ve.substring(1,ve.length-1)),ve=ne(ve,!0),{type:"codespan",raw:de[0],text:ve}}},ye.br=function(le){var de=this.rules.inline.br.exec(le);if(de)return{type:"br",raw:de[0]}},ye.del=function(le){var de=this.rules.inline.del.exec(le);if(de)return{type:"del",raw:de[0],text:de[1]}},ye.autolink=function(le,de){var ve=this.rules.inline.autolink.exec(le);if(ve){var pe,Ce;return ve[2]==="@"?(pe=ne(this.options.mangle?de(ve[1]):ve[1]),Ce="mailto:"+pe):(pe=ne(ve[1]),Ce=pe),{type:"link",raw:ve[0],text:pe,href:Ce,tokens:[{type:"text",raw:pe,text:pe}]}}},ye.url=function(le,de){var ve;if(ve=this.rules.inline.url.exec(le)){var pe,Ce;if(ve[2]==="@")pe=ne(this.options.mangle?de(ve[0]):ve[0]),Ce="mailto:"+pe;else{var Ke;do Ke=ve[0],ve[0]=this.rules.inline._backpedal.exec(ve[0])[0];while(Ke!==ve[0]);pe=ne(ve[0]),ve[1]==="www."?Ce="http://"+pe:Ce=pe}return{type:"link",raw:ve[0],text:pe,href:Ce,tokens:[{type:"text",raw:pe,text:pe}]}}},ye.inlineText=function(le,de,ve){var pe=this.rules.inline.text.exec(le);if(pe){var Ce;return de?Ce=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(pe[0]):ne(pe[0]):pe[0]:Ce=ne(this.options.smartypants?ve(pe[0]):pe[0]),{type:"text",raw:pe[0],text:Ce}}},Ee}(),Oe=Z.noopTest,Ue=Z.edit,De=Z.merge,be={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]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Oe,table:Oe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};be._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,be._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,be.def=Ue(be.def).replace("label",be._label).replace("title",be._title).getRegex(),be.bullet=/(?:[*+-]|\d{1,9}[.)])/,be.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,be.item=Ue(be.item,"gm").replace(/bull/g,be.bullet).getRegex(),be.list=Ue(be.list).replace(/bull/g,be.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+be.def.source+")").getRegex(),be._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",be._comment=//,be.html=Ue(be.html,"i").replace("comment",be._comment).replace("tag",be._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),be.paragraph=Ue(be._paragraph).replace("hr",be.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",")|<(?:script|pre|style|!--)").replace("tag",be._tag).getRegex(),be.blockquote=Ue(be.blockquote).replace("paragraph",be.paragraph).getRegex(),be.normal=De({},be),be.gfm=De({},be.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*|$)"}),be.gfm.nptable=Ue(be.gfm.nptable).replace("hr",be.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",")|<(?:script|pre|style|!--)").replace("tag",be._tag).getRegex(),be.gfm.table=Ue(be.gfm.table).replace("hr",be.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",")|<(?:script|pre|style|!--)").replace("tag",be._tag).getRegex(),be.pedantic=De({},be.normal,{html:Ue(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",be._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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Oe,paragraph:Ue(be.normal._paragraph).replace("hr",be.hr).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",be.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ge={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Oe,tag:"^comment|^|^<[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:Oe,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",ge.punctuation=Ue(ge.punctuation).replace(/punctuation/g,ge._punctuation).getRegex(),ge._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ge._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ge.em.start=Ue(ge.em.start).replace(/punctuation/g,ge._punctuation).getRegex(),ge.em.middle=Ue(ge.em.middle).replace(/punctuation/g,ge._punctuation).replace(/overlapSkip/g,ge._overlapSkip).getRegex(),ge.em.endAst=Ue(ge.em.endAst,"g").replace(/punctuation/g,ge._punctuation).getRegex(),ge.em.endUnd=Ue(ge.em.endUnd,"g").replace(/punctuation/g,ge._punctuation).getRegex(),ge.strong.start=Ue(ge.strong.start).replace(/punctuation/g,ge._punctuation).getRegex(),ge.strong.middle=Ue(ge.strong.middle).replace(/punctuation/g,ge._punctuation).replace(/blockSkip/g,ge._blockSkip).getRegex(),ge.strong.endAst=Ue(ge.strong.endAst,"g").replace(/punctuation/g,ge._punctuation).getRegex(),ge.strong.endUnd=Ue(ge.strong.endUnd,"g").replace(/punctuation/g,ge._punctuation).getRegex(),ge.blockSkip=Ue(ge._blockSkip,"g").getRegex(),ge.overlapSkip=Ue(ge._overlapSkip,"g").getRegex(),ge._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ge._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ge._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])?)+(?![-_])/,ge.autolink=Ue(ge.autolink).replace("scheme",ge._scheme).replace("email",ge._email).getRegex(),ge._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ge.tag=Ue(ge.tag).replace("comment",be._comment).replace("attribute",ge._attribute).getRegex(),ge._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ge._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ge._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ge.link=Ue(ge.link).replace("label",ge._label).replace("href",ge._href).replace("title",ge._title).getRegex(),ge.reflink=Ue(ge.reflink).replace("label",ge._label).getRegex(),ge.reflinkSearch=Ue(ge.reflinkSearch,"g").replace("reflink",ge.reflink).replace("nolink",ge.nolink).getRegex(),ge.normal=De({},ge),ge.pedantic=De({},ge.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:Ue(/^!?\[(label)\]\((.*?)\)/).replace("label",ge._label).getRegex(),reflink:Ue(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ge._label).getRegex()}),ge.gfm=De({},ge.normal,{escape:Ue(ge.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&&(le="x"+le.toString(16)),ye+="&#"+le+";";return ye}var ht=function(){function Ee(_e){this.tokens=[],this.tokens.links=Object.create(null),this.options=_e||ct,this.options.tokenizer=this.options.tokenizer||new Te,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var le={block:vt.normal,inline:_t.normal};this.options.pedantic?(le.block=vt.pedantic,le.inline=_t.pedantic):this.options.gfm&&(le.block=vt.gfm,this.options.breaks?le.inline=_t.breaks:le.inline=_t.gfm),this.tokenizer.rules=le}Ee.lex=function(le,de){var ve=new Ee(de);return ve.lex(le)};var ye=Ee.prototype;return ye.lex=function(le){return le=le.replace(/\r\n|\r/g,` `).replace(/\t/g," "),this.blockTokens(le,this.tokens,!0),this.inline(this.tokens),this.tokens},ye.blockTokens=function(le,de,ve){de===void 0&&(de=[]),ve===void 0&&(ve=!0),le=le.replace(/^ +$/gm,"");for(var pe,Ce,Ke,st;le;){if(pe=this.tokenizer.space(le)){le=le.substring(pe.raw.length),pe.type&&de.push(pe);continue}if(pe=this.tokenizer.code(le,de)){le=le.substring(pe.raw.length),pe.type?de.push(pe):(st=de[de.length-1],st.raw+=` `+pe.raw,st.text+=` `+pe.text);continue}if(pe=this.tokenizer.fences(le)){le=le.substring(pe.raw.length),de.push(pe);continue}if(pe=this.tokenizer.heading(le)){le=le.substring(pe.raw.length),de.push(pe);continue}if(pe=this.tokenizer.nptable(le)){le=le.substring(pe.raw.length),de.push(pe);continue}if(pe=this.tokenizer.hr(le)){le=le.substring(pe.raw.length),de.push(pe);continue}if(pe=this.tokenizer.blockquote(le)){le=le.substring(pe.raw.length),pe.tokens=this.blockTokens(pe.text,[],ve),de.push(pe);continue}if(pe=this.tokenizer.list(le)){for(le=le.substring(pe.raw.length),Ke=pe.items.length,Ce=0;Ce0)for(;(At=this.tokenizer.rules.inline.reflinkSearch.exec(st))!=null;)Ft.includes(At[0].slice(At[0].lastIndexOf("[")+1,-1))&&(st=st.slice(0,At.index)+"["+"a".repeat(At[0].length-2)+"]"+st.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(At=this.tokenizer.rules.inline.blockSkip.exec(st))!=null;)st=st.slice(0,At.index)+"["+"a".repeat(At[0].length-2)+"]"+st.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;le;){if(Ke=this.tokenizer.escape(le)){le=le.substring(Ke.raw.length),de.push(Ke);continue}if(Ke=this.tokenizer.tag(le,ve,pe)){le=le.substring(Ke.raw.length),ve=Ke.inLink,pe=Ke.inRawBlock,de.push(Ke);continue}if(Ke=this.tokenizer.link(le)){le=le.substring(Ke.raw.length),Ke.type==="link"&&(Ke.tokens=this.inlineTokens(Ke.text,[],!0,pe)),de.push(Ke);continue}if(Ke=this.tokenizer.reflink(le,this.tokens.links)){le=le.substring(Ke.raw.length),Ke.type==="link"&&(Ke.tokens=this.inlineTokens(Ke.text,[],!0,pe)),de.push(Ke);continue}if(Ke=this.tokenizer.strong(le,st,Ce)){le=le.substring(Ke.raw.length),Ke.tokens=this.inlineTokens(Ke.text,[],ve,pe),de.push(Ke);continue}if(Ke=this.tokenizer.em(le,st,Ce)){le=le.substring(Ke.raw.length),Ke.tokens=this.inlineTokens(Ke.text,[],ve,pe),de.push(Ke);continue}if(Ke=this.tokenizer.codespan(le)){le=le.substring(Ke.raw.length),de.push(Ke);continue}if(Ke=this.tokenizer.br(le)){le=le.substring(Ke.raw.length),de.push(Ke);continue}if(Ke=this.tokenizer.del(le)){le=le.substring(Ke.raw.length),Ke.tokens=this.inlineTokens(Ke.text,[],ve,pe),de.push(Ke);continue}if(Ke=this.tokenizer.autolink(le,et)){le=le.substring(Ke.raw.length),de.push(Ke);continue}if(!ve&&(Ke=this.tokenizer.url(le,et))){le=le.substring(Ke.raw.length),de.push(Ke);continue}if(Ke=this.tokenizer.inlineText(le,pe,yt)){le=le.substring(Ke.raw.length),Ce=Ke.raw.slice(-1),de.push(Ke);continue}if(le){var kt="Infinite loop on byte: "+le.charCodeAt(0);if(this.options.silent){console.error(kt);break}else throw new Error(kt)}}return de},V(Ee,null,[{key:"rules",get:function(){return{block:vt,inline:_t}}}]),Ee}(),xt=B.defaults,Tt=Z.cleanUrl,mt=Z.escape,Ie=function(){function Ee(_e){this.options=_e||xt}var ye=Ee.prototype;return ye.code=function(le,de,ve){var pe=(de||"").match(/\S*/)[0];if(this.options.highlight){var Ce=this.options.highlight(le,pe);Ce!=null&&Ce!==le&&(ve=!0,le=Ce)}return pe?'
    '+(ve?le:mt(le,!0))+`
    `:"
    "+(ve?le:mt(le,!0))+`
    `},ye.blockquote=function(le){return`
    `+le+`
    `},ye.html=function(le){return le},ye.heading=function(le,de,ve,pe){return this.options.headerIds?"'+le+" `:""+le+" `},ye.hr=function(){return this.options.xhtml?`
    `:`
    `},ye.list=function(le,de,ve){var pe=de?"ol":"ul",Ce=de&&ve!==1?' start="'+ve+'"':"";return"<"+pe+Ce+`> `+le+" `},ye.listitem=function(le){return"
  • "+le+`
  • `},ye.checkbox=function(le){return" "},ye.paragraph=function(le){return"

    "+le+`

    `},ye.table=function(le,de){return de&&(de=""+de+""),` `+le+` `+de+`
    `},ye.tablerow=function(le){return` `+le+` `},ye.tablecell=function(le,de){var ve=de.header?"th":"td",pe=de.align?"<"+ve+' align="'+de.align+'">':"<"+ve+">";return pe+le+" `},ye.strong=function(le){return""+le+""},ye.em=function(le){return""+le+""},ye.codespan=function(le){return""+le+""},ye.br=function(){return this.options.xhtml?"
    ":"
    "},ye.del=function(le){return""+le+""},ye.link=function(le,de,ve){if(le=Tt(this.options.sanitize,this.options.baseUrl,le),le===null)return ve;var pe='",pe},ye.image=function(le,de,ve){if(le=Tt(this.options.sanitize,this.options.baseUrl,le),le===null)return ve;var pe=''+ve+'":">",pe},ye.text=function(le){return le},Ee}(),je=function(){function Ee(){}var ye=Ee.prototype;return ye.strong=function(le){return le},ye.em=function(le){return le},ye.codespan=function(le){return le},ye.del=function(le){return le},ye.html=function(le){return le},ye.text=function(le){return le},ye.link=function(le,de,ve){return""+ve},ye.image=function(le,de,ve){return""+ve},ye.br=function(){return""},Ee}(),$e=function(){function Ee(){this.seen={}}var ye=Ee.prototype;return ye.slug=function(le){var de=le.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(de)){var ve=de;do this.seen[ve]++,de=ve+"-"+this.seen[ve];while(this.seen.hasOwnProperty(de))}return this.seen[de]=0,de},Ee}(),at=B.defaults,lt=Z.unescape,bt=function(){function Ee(_e){this.options=_e||at,this.options.renderer=this.options.renderer||new Ie,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new je,this.slugger=new $e}Ee.parse=function(le,de){var ve=new Ee(de);return ve.parse(le)};var ye=Ee.prototype;return ye.parse=function(le,de){de===void 0&&(de=!0);var ve="",pe,Ce,Ke,st,At,Ft,kt,wt,Qe,it,We,ce,Se,ot,ze,Lt,Dt,ke,qe=le.length;for(pe=0;pe0&&ze.tokens[0].type==="text"?(ze.tokens[0].text=ke+" "+ze.tokens[0].text,ze.tokens[0].tokens&&ze.tokens[0].tokens.length>0&&ze.tokens[0].tokens[0].type==="text"&&(ze.tokens[0].tokens[0].text=ke+" "+ze.tokens[0].tokens[0].text)):ze.tokens.unshift({type:"text",text:ke}):ot+=ke),ot+=this.parse(ze.tokens,Se),Qe+=this.renderer.listitem(ot,Dt,Lt);ve+=this.renderer.list(Qe,We,ce);continue}case"html":{ve+=this.renderer.html(it.text);continue}case"paragraph":{ve+=this.renderer.paragraph(this.parseInline(it.tokens));continue}case"text":{for(Qe=it.tokens?this.parseInline(it.tokens):it.text;pe+1An error occurred:

    "+Me(Ke.message+"",!0)+"
    ";throw Ke}}Fe.options=Fe.setOptions=function(Ee){return Mt(Fe.defaults,Ee),tt(Fe.defaults),Fe},Fe.getDefaults=Pe,Fe.defaults=rt,Fe.use=function(Ee){var ye=Mt({},Ee);if(Ee.renderer&&function(){var le=Fe.defaults.renderer||new Ie,de=function(Ce){var Ke=le[Ce];le[Ce]=function(){for(var st=arguments.length,At=new Array(st),Ft=0;Ft=0;u--){if(!P(m[u]))continue;var h=m[u].split("="),s=unescape(h[0]),l=unescape(h[1]);p(l,s)}}function B(p,m){if(!p)return;Y.cookie=escape(p)+"="+escape(m)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function M(p){if(!p||!I(p))return;Y.cookie=escape(p)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function L(){R(function(p,m){M(m)})}function I(p){return new RegExp("(?:^|;\\s*)"+escape(p).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(Y.cookie)}},E2g8:function(Be,we,k){(function(ee,V){/*! * @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(P,Y){Be.exports=Y()})(this,function(){"use strict";function P(Ie){var je=typeof Ie;return Ie!==null&&(je==="object"||je==="function")}function Y(Ie){return typeof Ie=="function"}var W=void 0;Array.isArray?W=Array.isArray:W=function(Ie){return Object.prototype.toString.call(Ie)==="[object Array]"};var R=W,B=0,M=void 0,L=void 0,I=function(je,$e){x[B]=je,x[B+1]=$e,B+=2,B===2&&(L?L(O):v())};function p(Ie){L=Ie}function m(Ie){I=Ie}var u=typeof window!="undefined"?window:void 0,h=u||{},s=h.MutationObserver||h.WebKitMutationObserver,l=typeof self=="undefined"&&typeof ee!="undefined"&&{}.toString.call(ee)==="[object process]",i=typeof Uint8ClampedArray!="undefined"&&typeof importScripts!="undefined"&&typeof MessageChannel!="undefined";function r(){return function(){return ee.nextTick(O)}}function n(){return typeof M!="undefined"?function(){M(O)}:T()}function d(){var Ie=0,je=new s(O),$e=document.createTextNode("");return je.observe($e,{characterData:!0}),function(){$e.data=Ie=++Ie%2}}function w(){var Ie=new MessageChannel;return Ie.port1.onmessage=O,function(){return Ie.port2.postMessage(0)}}function T(){var Ie=setTimeout;return function(){return Ie(O,1)}}var x=new Array(1e3);function O(){for(var Ie=0;Ie`,triples:"",explode:"[]{}"},P=ee.Pos;ee.defineOption("autoCloseBrackets",!1,function(s,l,i){i&&i!=ee.Init&&(s.removeKeyMap(W),s.state.closeBrackets=null),l&&(R(Y(l,"pairs")),s.state.closeBrackets=l,s.addKeyMap(W))});function Y(s,l){return l=="pairs"&&typeof s=="string"?s:typeof s=="object"&&s[l]!=null?s[l]:V[l]}var W={Backspace:L,Enter:I};function R(s){for(var l=0;l=0;n--){var w=r[n].head;s.replaceRange("",P(w.line,w.ch-1),P(w.line,w.ch+1),"+delete")}}function I(s){var l=M(s),i=l&&Y(l,"explode");if(!i||s.getOption("disableInput"))return ee.Pass;for(var r=s.listSelections(),n=0;n0;return{anchor:new P(s.anchor.line,s.anchor.ch+(l?-1:1)),head:new P(s.head.line,s.head.ch+(l?1:-1))}}function m(s,l){var i=M(s);if(!i||s.getOption("disableInput"))return ee.Pass;var r=Y(i,"pairs"),n=r.indexOf(l);if(n==-1)return ee.Pass;for(var d=Y(i,"closeBefore"),w=Y(i,"triples"),T=r.charAt(n+1)==l,x=s.listSelections(),O=n%2==0,E,v=0;v=0&&s.getRange(f,P(f.line,f.ch+3))==l+l+l?c="skipThree":c="skip";else if(T&&f.ch>1&&w.indexOf(l)>=0&&s.getRange(P(f.line,f.ch-2),f)==l+l){if(f.ch>2&&/\bstring/.test(s.getTokenTypeAt(P(f.line,f.ch-2))))return ee.Pass;c="addFour"}else if(T){var y=f.ch==0?" ":s.getRange(P(f.line,f.ch-1),f);if(!ee.isWordChar(S)&&y!=l&&!ee.isWordChar(y))c="both";else return ee.Pass}else if(O&&(S.length===0||/\s/.test(S)||d.indexOf(S)>-1))c="both";else return ee.Pass;if(!E)E=c;else if(E!=c)return ee.Pass}var b=n%2?r.charAt(n-1):l,N=n%2?l:r.charAt(n+1);s.operation(function(){if(E=="skip")s.execCommand("goCharRight");else if(E=="skipThree")for(var F=0;F<3;F++)s.execCommand("goCharRight");else if(E=="surround"){for(var X=s.getSelections(),F=0;F ").concat(G);if(fe.ENABLE_CALLBACK&&fe.emitter.emit("log","error",Q),!fe.ENABLE_ERROR)return;console.error?console.error(Q):console.warn?console.warn(Q):console.log(Q)}},{key:"i",value:function(U,G){(!U||fe.FORCE_GLOBAL_TAG)&&(U=fe.GLOBAL_TAG);var Q="[".concat(U,"] > ").concat(G);if(fe.ENABLE_CALLBACK&&fe.emitter.emit("log","info",Q),!fe.ENABLE_INFO)return;console.info?console.info(Q):console.log(Q)}},{key:"w",value:function(U,G){(!U||fe.FORCE_GLOBAL_TAG)&&(U=fe.GLOBAL_TAG);var Q="[".concat(U,"] > ").concat(G);if(fe.ENABLE_CALLBACK&&fe.emitter.emit("log","warn",Q),!fe.ENABLE_WARN)return;console.warn?console.warn(Q):console.log(Q)}},{key:"d",value:function(U,G){(!U||fe.FORCE_GLOBAL_TAG)&&(U=fe.GLOBAL_TAG);var Q="[".concat(U,"] > ").concat(G);if(fe.ENABLE_CALLBACK&&fe.emitter.emit("log","debug",Q),!fe.ENABLE_DEBUG)return;console.debug?console.debug(Q):console.log(Q)}},{key:"v",value:function(U,G){(!U||fe.FORCE_GLOBAL_TAG)&&(U=fe.GLOBAL_TAG);var Q="[".concat(U,"] > ").concat(G);if(fe.ENABLE_CALLBACK&&fe.emitter.emit("log","verbose",Q),!fe.ENABLE_VERBOSE)return;console.log(Q)}}]),fe}();B.GLOBAL_TAG="flv.js",B.FORCE_GLOBAL_TAG=!1,B.ENABLE_ERROR=!0,B.ENABLE_INFO=!0,B.ENABLE_WARN=!0,B.ENABLE_DEBUG=!0,B.ENABLE_VERBOSE=!0,B.ENABLE_CALLBACK=!1,B.emitter=new R.a;var M=B,L=function(){function fe(){Object(ee.a)(this,fe),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(V.a)(fe,[{key:"reset",value:function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0}},{key:"addBytes",value:function(U){this._firstCheckpoint===0?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=U,this._totalBytes+=U):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=U,this._totalBytes+=U):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=U,this._totalBytes+=U,this._lastCheckpoint=this._now())}},{key:"currentKBps",get:function(){this.addBytes(0);var U=(this._now()-this._lastCheckpoint)/1e3;return U==0&&(U=1),this._intervalBytes/U/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 U=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/U/1024}}]),fe}(),I=L,p=k("yKVA"),m=k("879j"),u=function(){function fe(se){Object(ee.a)(this,fe),this._message=se}return Object(V.a)(fe,[{key:"name",get:function(){return"RuntimeException"}},{key:"message",get:function(){return this._message}},{key:"toString",value:function(){return this.name+": "+this.message}}]),fe}(),h=function(fe){Object(p.a)(U,fe);var se=Object(m.a)(U);function U(G){return Object(ee.a)(this,U),se.call(this,G)}return Object(V.a)(U,[{key:"name",get:function(){return"IllegalStateException"}}]),U}(u),s=function(fe){Object(p.a)(U,fe);var se=Object(m.a)(U);function U(G){return Object(ee.a)(this,U),se.call(this,G)}return Object(V.a)(U,[{key:"name",get:function(){return"InvalidArgumentException"}}]),U}(u),l=function(fe){Object(p.a)(U,fe);var se=Object(m.a)(U);function U(G){return Object(ee.a)(this,U),se.call(this,G)}return Object(V.a)(U,[{key:"name",get:function(){return"NotImplementedException"}}]),U}(u),i={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},r={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},n=function(){function fe(se){Object(ee.a)(this,fe),this._type=se||"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(V.a)(fe,[{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(U){this._onContentLengthKnown=U}},{key:"onURLRedirect",get:function(){return this._onURLRedirect},set:function(U){this._onURLRedirect=U}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(U){this._onDataArrival=U}},{key:"onError",get:function(){return this._onError},set:function(U){this._onError=U}},{key:"onComplete",get:function(){return this._onComplete},set:function(U){this._onComplete=U}},{key:"open",value:function(U,G){throw new l("Unimplemented abstract function!")}},{key:"abort",value:function(){throw new l("Unimplemented abstract function!")}}]),fe}(),d=k("oZsa");function w(fe,se){for(;!Object.prototype.hasOwnProperty.call(fe,se)&&!(fe=Object(d.a)(fe),fe===null););return fe}function T(fe,se,U){return typeof Reflect!="undefined"&&Reflect.get?T=Reflect.get:T=function(Q,te,he){var Le=w(Q,te);if(!Le)return;var Ge=Object.getOwnPropertyDescriptor(Le,te);return Ge.get?Ge.get.call(he):Ge.value},T(fe,se,U||fe)}var x={};function O(){var fe=self.navigator.userAgent.toLowerCase(),se=/(edge)\/([\w.]+)/.exec(fe)||/(opr)[\/]([\w.]+)/.exec(fe)||/(chrome)[ \/]([\w.]+)/.exec(fe)||/(iemobile)[\/]([\w.]+)/.exec(fe)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(fe)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(fe)||/(webkit)[ \/]([\w.]+)/.exec(fe)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(fe)||/(msie) ([\w.]+)/.exec(fe)||fe.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(fe)||fe.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(fe)||[],U=/(ipad)/.exec(fe)||/(ipod)/.exec(fe)||/(windows phone)/.exec(fe)||/(iphone)/.exec(fe)||/(kindle)/.exec(fe)||/(android)/.exec(fe)||/(windows)/.exec(fe)||/(mac)/.exec(fe)||/(linux)/.exec(fe)||/(cros)/.exec(fe)||[],G={browser:se[5]||se[3]||se[1]||"",version:se[2]||se[4]||"0",majorVersion:se[4]||se[2]||"0",platform:U[0]||""},Q={};if(G.browser){Q[G.browser]=!0;var te=G.majorVersion.split(".");Q.version={major:parseInt(G.majorVersion,10),string:G.version},te.length>1&&(Q.version.minor=parseInt(te[1],10)),te.length>2&&(Q.version.build=parseInt(te[2],10))}if(G.platform&&(Q[G.platform]=!0),(Q.chrome||Q.opr||Q.safari)&&(Q.webkit=!0),Q.rv||Q.iemobile){Q.rv&&delete Q.rv;var he="msie";G.browser=he,Q[he]=!0}if(Q.edge){delete Q.edge;var Le="msedge";G.browser=Le,Q[Le]=!0}if(Q.opr){var Ge="opera";G.browser=Ge,Q[Ge]=!0}if(Q.safari&&Q.android){var Ot="android";G.browser=Ot,Q[Ot]=!0}Q.name=G.browser,Q.platform=G.platform;for(var Nt in x)x.hasOwnProperty(Nt)&&delete x[Nt];Object.assign(x,Q)}O();var E=x,v=function(fe){Object(p.a)(U,fe);var se=Object(m.a)(U);function U(G,Q){var te;return Object(ee.a)(this,U),te=se.call(this,"fetch-stream-loader"),te.TAG="FetchStreamLoader",te._seekHandler=G,te._config=Q,te._needStash=!0,te._requestAbort=!1,te._contentLength=null,te._receivedLength=0,te}return Object(V.a)(U,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),T(Object(d.a)(U.prototype),"destroy",this).call(this)}},{key:"open",value:function(Q,te){var he=this;this._dataSource=Q,this._range=te;var Le=Q.url;this._config.reuseRedirectedURL&&Q.redirectedURL!=null&&(Le=Q.redirectedURL);var Ge=this._seekHandler.getConfig(Le,te),Ot=new self.Headers;if(typeof Ge.headers=="object"){var Nt=Ge.headers;for(var Xe in Nt)Nt.hasOwnProperty(Xe)&&Ot.append(Xe,Nt[Xe])}var It={method:"GET",headers:Ot,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(var an in this._config.headers)Ot.append(an,this._config.headers[an]);Q.cors===!1&&(It.mode="same-origin"),Q.withCredentials&&(It.credentials="include"),Q.referrerPolicy&&(It.referrerPolicy=Q.referrerPolicy),this._status=i.kConnecting,self.fetch(Ge.url,It).then(function(Ct){if(he._requestAbort){he._requestAbort=!1,he._status=i.kIdle;return}if(Ct.ok&&Ct.status>=200&&Ct.status<=299){if(Ct.url!==Ge.url&&he._onURLRedirect){var pn=he._seekHandler.removeURLParameters(Ct.url);he._onURLRedirect(pn)}var nn=Ct.headers.get("Content-Length");return nn!=null&&(he._contentLength=parseInt(nn),he._contentLength!==0&&(he._onContentLengthKnown&&he._onContentLengthKnown(he._contentLength))),he._pump.call(he,Ct.body.getReader())}else if(he._status=i.kError,he._onError)he._onError(r.HTTP_STATUS_CODE_INVALID,{code:Ct.status,msg:Ct.statusText});else throw new u("FetchStreamLoader: Http code invalid, "+Ct.status+" "+Ct.statusText)}).catch(function(Ct){if(he._status=i.kError,he._onError)he._onError(r.EXCEPTION,{code:-1,msg:Ct.message});else throw Ct})}},{key:"abort",value:function(){this._requestAbort=!0}},{key:"_pump",value:function(Q){var te=this;return Q.read().then(function(he){if(he.done)if(te._contentLength!==null&&te._receivedLength=15048,te=E.msedge?Q:!0;return self.fetch&&self.ReadableStream&&te}catch(he){return!1}}}]),U}(n),_=v,f=function(fe){Object(p.a)(U,fe);var se=Object(m.a)(U);function U(G,Q){var te;return Object(ee.a)(this,U),te=se.call(this,"xhr-moz-chunked-loader"),te.TAG="MozChunkedLoader",te._seekHandler=G,te._config=Q,te._needStash=!0,te._xhr=null,te._requestAbort=!1,te._contentLength=null,te._receivedLength=0,te}return Object(V.a)(U,[{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),T(Object(d.a)(U.prototype),"destroy",this).call(this)}},{key:"open",value:function(Q,te){this._dataSource=Q,this._range=te;var he=Q.url;this._config.reuseRedirectedURL&&Q.redirectedURL!=null&&(he=Q.redirectedURL);var Le=this._seekHandler.getConfig(he,te);this._requestURL=Le.url;var Ge=this._xhr=new XMLHttpRequest;if(Ge.open("GET",Le.url,!0),Ge.responseType="moz-chunked-arraybuffer",Ge.onreadystatechange=this._onReadyStateChange.bind(this),Ge.onprogress=this._onProgress.bind(this),Ge.onloadend=this._onLoadEnd.bind(this),Ge.onerror=this._onXhrError.bind(this),Q.withCredentials&&(Ge.withCredentials=!0),typeof Le.headers=="object"){var Ot=Le.headers;for(var Nt in Ot)Ot.hasOwnProperty(Nt)&&Ge.setRequestHeader(Nt,Ot[Nt])}if(typeof this._config.headers=="object"){var Xe=this._config.headers;for(var It in Xe)Xe.hasOwnProperty(It)&&Ge.setRequestHeader(It,Xe[It])}this._status=i.kConnecting,Ge.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=i.kComplete}},{key:"_onReadyStateChange",value:function(Q){var te=Q.target;if(te.readyState===2){if(te.responseURL!=null&&te.responseURL!==this._requestURL&&this._onURLRedirect){var he=this._seekHandler.removeURLParameters(te.responseURL);this._onURLRedirect(he)}if(te.status!==0&&(te.status<200||te.status>299))if(this._status=i.kError,this._onError)this._onError(r.HTTP_STATUS_CODE_INVALID,{code:te.status,msg:te.statusText});else throw new u("MozChunkedLoader: Http code invalid, "+te.status+" "+te.statusText);else this._status=i.kBuffering}}},{key:"_onProgress",value:function(Q){if(this._status===i.kError)return;this._contentLength===null&&(Q.total!==null&&Q.total!==0&&(this._contentLength=Q.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)));var te=Q.target.response,he=this._range.from+this._receivedLength;this._receivedLength+=te.byteLength,this._onDataArrival&&this._onDataArrival(te,he,this._receivedLength)}},{key:"_onLoadEnd",value:function(Q){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(Q){this._status=i.kError;var te=0,he=null;if(this._contentLength&&Q.loaded=200&&te.status<=299){if(this._status=i.kBuffering,te.responseURL!=null){var he=this._seekHandler.removeURLParameters(te.responseURL);te.responseURL!==this._currentRequestURL&&he!==this._currentRedirectedURL&&(this._currentRedirectedURL=he,this._onURLRedirect&&this._onURLRedirect(he))}var Le=te.getResponseHeader("Content-Length");if(Le!=null&&this._contentLength==null){var Ge=parseInt(Le);Ge>0&&(this._contentLength=Ge,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}}else if(this._status=i.kError,this._onError)this._onError(r.HTTP_STATUS_CODE_INVALID,{code:te.status,msg:te.statusText});else throw new u("MSStreamLoader: Http code invalid, "+te.status+" "+te.statusText);else if(te.readyState===3&&(te.status>=200&&te.status<=299)){this._status=i.kBuffering;var Ot=te.response;this._reader.readAsArrayBuffer(Ot)}}},{key:"_xhrOnError",value:function(Q){this._status=i.kError;var te=r.EXCEPTION,he={code:-1,msg:Q.constructor.name+" "+Q.type};if(this._onError)this._onError(te,he);else throw new u(he.msg)}},{key:"_msrOnProgress",value:function(Q){var te=Q.target,he=te.result;if(he==null){this._doReconnectIfNeeded();return}var Le=he.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=he.byteLength;var Ge=this._totalRange.from+this._receivedLength;this._receivedLength+=Le.byteLength,this._onDataArrival&&this._onDataArrival(Le,Ge,this._receivedLength),he.byteLength>=this._bufferLimit&&(M.v(this.TAG,"MSStream buffer exceeded max size near ".concat(Ge+Le.byteLength,", reconnecting...")),this._doReconnectIfNeeded())}},{key:"_doReconnectIfNeeded",value:function(){if(this._contentLength==null||this._receivedLength=this._contentLength&&(he=this._range.from+this._contentLength-1)),this._currentRequestRange={from:te,to:he},this._internalOpen(this._dataSource,this._currentRequestRange)}},{key:"_internalOpen",value:function(Q,te){this._lastTimeLoaded=0;var he=Q.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?he=this._currentRedirectedURL:Q.redirectedURL!=null&&(he=Q.redirectedURL));var Le=this._seekHandler.getConfig(he,te);this._currentRequestURL=Le.url;var Ge=this._xhr=new XMLHttpRequest;if(Ge.open("GET",Le.url,!0),Ge.responseType="arraybuffer",Ge.onreadystatechange=this._onReadyStateChange.bind(this),Ge.onprogress=this._onProgress.bind(this),Ge.onload=this._onLoad.bind(this),Ge.onerror=this._onXhrError.bind(this),Q.withCredentials&&(Ge.withCredentials=!0),typeof Le.headers=="object"){var Ot=Le.headers;for(var Nt in Ot)Ot.hasOwnProperty(Nt)&&Ge.setRequestHeader(Nt,Ot[Nt])}if(typeof this._config.headers=="object"){var Xe=this._config.headers;for(var It in Xe)Xe.hasOwnProperty(It)&&Ge.setRequestHeader(It,Xe[It])}Ge.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(Q){var te=Q.target;if(te.readyState===2){if(te.responseURL!=null){var he=this._seekHandler.removeURLParameters(te.responseURL);te.responseURL!==this._currentRequestURL&&he!==this._currentRedirectedURL&&(this._currentRedirectedURL=he,this._onURLRedirect&&this._onURLRedirect(he))}if(te.status>=200&&te.status<=299){if(this._waitForTotalLength)return;this._status=i.kBuffering}else if(this._status=i.kError,this._onError)this._onError(r.HTTP_STATUS_CODE_INVALID,{code:te.status,msg:te.statusText});else throw new u("RangeLoader: Http code invalid, "+te.status+" "+te.statusText)}}},{key:"_onProgress",value:function(Q){if(this._status===i.kError)return;if(this._contentLength===null){var te=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,te=!0;var he=Q.total;this._internalAbort(),he!=null&he!==0&&(this._totalLength=he)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,te){this._openSubRange();return}this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var Le=Q.loaded-this._lastTimeLoaded;this._lastTimeLoaded=Q.loaded,this._speedSampler.addBytes(Le)}},{key:"_normalizeSpeed",value:function(Q){var te=this._chunkSizeKBList,he=te.length-1,Le=0,Ge=0,Ot=he;if(Q=te[Le]&&Q=3&&(te=this._speedSampler.currentKBps)),te!==0){var he=this._normalizeSpeed(te);this._currentSpeedNormalized!==he&&(this._currentSpeedNormalized=he,this._currentChunkSizeKB=he)}var Le=Q.target.response,Ge=this._range.from+this._receivedLength;this._receivedLength+=Le.byteLength;var Ot=!1;this._contentLength!=null&&this._receivedLength0&&this._receivedLength0)for(var Le=Q.split("&"),Ge=0;Ge0;Ot[0]!==this._startName&&Ot[0]!==this._endName&&(Nt&&(he+="&"),he+=Le[Ge])}return he.length===0?G:G+"?"+he}}]),fe}(),z=A,ne=function(){function fe(se,U,G){Object(ee.a)(this,fe),this.TAG="IOController",this._config=U,this._extraData=G,this._stashInitialSize=1024*384,U.stashInitialSize!=null&&U.stashInitialSize>0&&(this._stashInitialSize=U.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,U.enableStashBuffer===!1&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=se,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(se.url),this._refTotalLength=se.filesize?se.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new I,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(V.a)(fe,[{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(U){this._extraData=U}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(U){this._onDataArrival=U}},{key:"onSeeked",get:function(){return this._onSeeked},set:function(U){this._onSeeked=U}},{key:"onError",get:function(){return this._onError},set:function(U){this._onError=U}},{key:"onComplete",get:function(){return this._onComplete},set:function(U){this._onComplete=U}},{key:"onRedirect",get:function(){return this._onRedirect},set:function(U){this._onRedirect=U}},{key:"onRecoveredEarlyEof",get:function(){return this._onRecoveredEarlyEof},set:function(U){this._onRecoveredEarlyEof=U}},{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===N?this._loader.currentSpeed:this._speedSampler.lastSecondKBps}},{key:"loaderType",get:function(){return this._loader.type}},{key:"_selectSeekHandler",value:function(){var U=this._config;if(U.seekType==="range")this._seekHandler=new H(this._config.rangeLoadZeroStart);else if(U.seekType==="param"){var G=U.seekParamStart||"bstart",Q=U.seekParamEnd||"bend";this._seekHandler=new z(G,Q)}else if(U.seekType==="custom"){if(typeof U.customSeekHandler!="function")throw new s("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new U.customSeekHandler}else throw new s("Invalid seekType in config: ".concat(U.seekType))}},{key:"_selectLoader",value:function(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=X;else if(_.isSupported())this._loaderClass=_;else if(c.isSupported())this._loaderClass=c;else if(N.isSupported())this._loaderClass=N;else throw new u("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(U){this._currentRange={from:0,to:-1},U&&(this._currentRange.from=U),this._speedSampler.reset(),U||(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 U=this._resumeFrom;this._resumeFrom=0,this._internalSeek(U,!0)}}},{key:"seek",value:function(U){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(U,!0)}},{key:"_internalSeek",value:function(U,G){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(G),this._loader.destroy(),this._loader=null;var Q={from:U,to:-1};this._currentRange={from:Q.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,Q),this._onSeeked&&this._onSeeked()}},{key:"updateUrl",value:function(U){if(!U||typeof U!="string"||U.length===0)throw new s("Url must be a non-empty string!");this._dataSource.url=U}},{key:"_expandBuffer",value:function(U){for(var G=this._stashSize;G+1024*1024*10){var te=new Uint8Array(this._stashBuffer,0,this._stashUsed),he=new Uint8Array(Q,0,G);he.set(te,0)}this._stashBuffer=Q,this._bufferSize=G}},{key:"_normalizeSpeed",value:function(U){var G=this._speedNormalizeList,Q=G.length-1,te=0,he=0,Le=Q;if(U=G[te]&&U=512&&U<=1024?G=Math.floor(U*1.5):G=U*2,G>8192&&(G=8192);var Q=G*1024+1024*1024*1;this._bufferSize0){var pn=this._stashBuffer.slice(0,this._stashUsed),nn=this._dispatchChunks(pn,this._stashByteStart);if(nn0){var $=new Uint8Array(pn,nn);Ct.set($,0),this._stashUsed=$.byteLength,this._stashByteStart+=nn}}else this._stashUsed=0,this._stashByteStart+=nn;this._stashUsed+U.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+U.byteLength),Ct=new Uint8Array(this._stashBuffer,0,this._bufferSize)),Ct.set(new Uint8Array(U),this._stashUsed),this._stashUsed+=U.byteLength}else{var C=this._dispatchChunks(U,G);if(Cthis._bufferSize&&(this._expandBuffer(D),Ct=new Uint8Array(this._stashBuffer,0,this._bufferSize)),Ct.set(new Uint8Array(U,C),0),this._stashUsed+=D,this._stashByteStart=G+C}}}else if(this._stashUsed===0){var Le=this._dispatchChunks(U,G);if(Lethis._bufferSize&&this._expandBuffer(Ge);var Ot=new Uint8Array(this._stashBuffer,0,this._bufferSize);Ot.set(new Uint8Array(U,Le),0),this._stashUsed+=Ge,this._stashByteStart=G+Le}}else{this._stashUsed+U.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+U.byteLength);var Nt=new Uint8Array(this._stashBuffer,0,this._bufferSize);Nt.set(new Uint8Array(U),this._stashUsed),this._stashUsed+=U.byteLength;var Xe=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(Xe0){var It=new Uint8Array(this._stashBuffer,Xe);Nt.set(It,0)}this._stashUsed-=Xe,this._stashByteStart+=Xe}}},{key:"_flushStashBuffer",value:function(U){if(this._stashUsed>0){var G=this._stashBuffer.slice(0,this._stashUsed),Q=this._dispatchChunks(G,this._stashByteStart),te=G.byteLength-Q;if(Q0){var he=new Uint8Array(this._stashBuffer,0,this._bufferSize),Le=new Uint8Array(G,Q);he.set(Le,0),this._stashUsed=Le.byteLength,this._stashByteStart+=Q}return 0}return this._stashUsed=0,this._stashByteStart=0,te}return 0}},{key:"_onLoaderComplete",value:function(U,G){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}},{key:"_onLoaderError",value:function(U,G){M.e(this.TAG,"Loader error, code = ".concat(G.code,", msg = ").concat(G.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,U=r.UNRECOVERABLE_EARLY_EOF);switch(U){case r.EARLY_EOF:{if(!this._config.isLive&&this._totalLength){var Q=this._currentRange.to+1;Q0){var G=fe.getConfig();U.emit("change",G)}}},{key:"registerListener",value:function(U){fe.emitter.addListener("change",U)}},{key:"removeListener",value:function(U){fe.emitter.removeListener("change",U)}},{key:"addLogListener",value:function(U){M.emitter.addListener("log",U),M.emitter.listenerCount("log")>0&&(M.ENABLE_CALLBACK=!0,fe._notifyChange())}},{key:"removeLogListener",value:function(U){M.emitter.removeListener("log",U),M.emitter.listenerCount("log")===0&&(M.ENABLE_CALLBACK=!1,fe._notifyChange())}}]),fe}();be.emitter=new R.a;var ge=be,He=function(){function fe(){Object(ee.a)(this,fe),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(V.a)(fe,[{key:"isComplete",value:function(){var U=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,G=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&&U&&G}},{key:"isSeekable",value:function(){return this.hasKeyframesIndex===!0}},{key:"getNearestKeyframe",value:function(U){if(this.keyframesIndex==null)return null;var G=this.keyframesIndex,Q=this._search(G.times,U);return{index:Q,milliseconds:G.times[Q],fileposition:G.filepositions[Q]}}},{key:"_search",value:function(U,G){var Q=0,te=U.length-1,he=0,Le=0,Ge=te;for(G=U[he]&&G=128){se.push(String.fromCharCode(te&65535)),G+=2;continue}}}else if(U[G]<240){if(vt(U,G,2)){var he=(U[G]&15)<<12|(U[G+1]&63)<<6|U[G+2]&63;if(he>=2048&&(he&63488)!==55296){se.push(String.fromCharCode(he&65535)),G+=3;continue}}}else if(U[G]<248&&vt(U,G,3)){var Le=(U[G]&7)<<18|(U[G+1]&63)<<12|(U[G+2]&63)<<6|U[G+3]&63;if(Le>65536&&Le<1114112){Le-=65536,se.push(String.fromCharCode(Le>>>10|55296)),se.push(String.fromCharCode(Le&1023|56320)),G+=4;continue}}}se.push(String.fromCharCode(65533)),++G}return se.join("")}var yt=_t,et=function(){var fe=new ArrayBuffer(2);return new DataView(fe).setInt16(0,256,!0),new Int16Array(fe)[0]===256}(),ht=function(){function fe(){Object(ee.a)(this,fe)}return Object(V.a)(fe,null,[{key:"parseScriptData",value:function(U,G,Q){var te={};try{var he=fe.parseValue(U,G,Q),Le=fe.parseValue(U,G+he.size,Q-he.size);te[he.data]=Le.data}catch(Ge){M.e("AMF",Ge.toString())}return te}},{key:"parseObject",value:function(U,G,Q){if(Q<3)throw new h("Data not enough when parse ScriptDataObject");var te=fe.parseString(U,G,Q),he=fe.parseValue(U,G+te.size,Q-te.size),Le=he.objectEnd;return{data:{name:te.data,value:he.data},size:te.size+he.size,objectEnd:Le}}},{key:"parseVariable",value:function(U,G,Q){return fe.parseObject(U,G,Q)}},{key:"parseString",value:function(U,G,Q){if(Q<2)throw new h("Data not enough when parse String");var te=new DataView(U,G,Q),he=te.getUint16(0,!et),Le;return he>0?Le=yt(new Uint8Array(U,G+2,he)):Le="",{data:Le,size:2+he}}},{key:"parseLongString",value:function(U,G,Q){if(Q<4)throw new h("Data not enough when parse LongString");var te=new DataView(U,G,Q),he=te.getUint32(0,!et),Le;return he>0?Le=yt(new Uint8Array(U,G+4,he)):Le="",{data:Le,size:4+he}}},{key:"parseDate",value:function(U,G,Q){if(Q<10)throw new h("Data size invalid when parse Date");var te=new DataView(U,G,Q),he=te.getFloat64(0,!et),Le=te.getInt16(8,!et);return he+=Le*60*1e3,{data:new Date(he),size:8+2}}},{key:"parseValue",value:function(U,G,Q){if(Q<1)throw new h("Data not enough when parse Value");var te=new DataView(U,G,Q),he=1,Le=te.getUint8(0),Ge,Ot=!1;try{switch(Le){case 0:Ge=te.getFloat64(1,!et),he+=8;break;case 1:{var Nt=te.getUint8(1);Ge=!!Nt,he+=1;break}case 2:{var Xe=fe.parseString(U,G+1,Q-1);Ge=Xe.data,he+=Xe.size;break}case 3:{Ge={};var It=0;for((te.getUint32(Q-4,!et)&16777215)===9&&(It=3);he32)throw new s("ExpGolomb: readBits() bits exceeded max 32bits!");if(U<=this._current_word_bits_left){var G=this._current_word>>>32-U;return this._current_word<<=U,this._current_word_bits_left-=U,G}var Q=this._current_word_bits_left?this._current_word:0;Q=Q>>>32-this._current_word_bits_left;var te=U-this._current_word_bits_left;this._fillCurrentWord();var he=Math.min(te,this._current_word_bits_left),Le=this._current_word>>>32-he;return this._current_word<<=he,this._current_word_bits_left-=he,Q=Q<>>U)!==0)return this._current_word<<=U,this._current_word_bits_left-=U,U;return this._fillCurrentWord(),U+this._skipLeadingZero()}},{key:"readUEG",value:function(){var U=this._skipLeadingZero();return this.readBits(U+1)-1}},{key:"readSEG",value:function(){var U=this.readUEG();return U&1?U+1>>>1:-1*(U>>>1)}}]),fe}(),mt=Tt,Ie=function(){function fe(){Object(ee.a)(this,fe)}return Object(V.a)(fe,null,[{key:"_ebsp2rbsp",value:function(U){for(var G=U,Q=G.byteLength,te=new Uint8Array(Q),he=0,Le=0;Le=2&&(G[Le]===3&&G[Le-1]===0&&G[Le-2]===0))continue;te[he]=G[Le],he++}return new Uint8Array(te.buffer,0,he)}},{key:"parseSPS",value:function(U){var G=fe._ebsp2rbsp(U),Q=new mt(G);Q.readByte();var te=Q.readByte();Q.readByte();var he=Q.readByte();Q.readUEG();var Le=fe.getProfileString(te),Ge=fe.getLevelString(he),Ot=1,Nt=420,Xe=[0,420,422,444],It=8;if((te===100||te===110||te===122||te===244||te===44||te===83||te===86||te===118||te===128||te===138||te===144)&&(Ot=Q.readUEG(),Ot===3&&Q.readBits(1),Ot<=3&&(Nt=Xe[Ot]),It=Q.readUEG()+8,Q.readUEG(),Q.readBits(1),Q.readBool()))for(var an=Ot!==3?8:12,Ct=0;Ct0&&di<16?(dt=Zi[di-1],Gt=_i[di-1]):di===255&&(dt=Q.readByte()<<8|Q.readByte(),Gt=Q.readByte()<<8|Q.readByte())}if(Q.readBool()&&Q.readBool(),Q.readBool()&&(Q.readBits(4),Q.readBool()&&Q.readBits(24)),Q.readBool()&&(Q.readUEG(),Q.readUEG()),Q.readBool()){var ri=Q.readBits(32),wi=Q.readBits(32);Wn=Q.readBool(),Si=wi,hi=ri*2,sn=Si/hi}}var Di=1;(dt!==1||Gt!==1)&&(Di=dt/Gt);var Oi=0,Ri=0;if(Ot===0)Oi=1,Ri=2-re;else{var Vi=Ot===3?1:2,cr=Ot===1?2:1;Oi=Vi,Ri=cr*(2-re)}var rr=(D+1)*16,ji=(2-re)*((K+1)*16);rr-=(J+Re)*Oi,ji-=(ut+St)*Ri;var Wi=Math.ceil(rr*Di);return Q.destroy(),Q=null,{profile_string:Le,level_string:Ge,bit_depth:It,ref_frames:C,chroma_format:Nt,chroma_format_string:fe.getChromaFormatString(Nt),frame_rate:{fixed:Wn,fps:sn,fps_den:hi,fps_num:Si},sar_ratio:{width:dt,height:Gt},codec_size:{width:rr,height:ji},present_size:{width:Wi,height:ji}}}},{key:"_skipScalingList",value:function(U,G){for(var Q=8,te=8,he=0,Le=0;Le>>8&255|(fe&255)<<8}function bt(fe){return(fe&4278190080)>>>24|(fe&16711680)>>>8|(fe&65280)<<8|(fe&255)<<24}function Mt(fe,se){return fe[se]<<24|fe[se+1]<<16|fe[se+2]<<8|fe[se+3]}var jt=function(){function fe(se,U){Object(ee.a)(this,fe),this.TAG="FLVDemuxer",this._config=U,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=se.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=se.hasAudioTrack,this._hasVideo=se.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new ct,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 G=new ArrayBuffer(2);return new DataView(G).setInt16(0,256,!0),new Int16Array(G)[0]===256}()}return Object(V.a)(fe,[{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(U){return U.onDataArrival=this.parseChunks.bind(this),this}},{key:"onTrackMetadata",get:function(){return this._onTrackMetadata},set:function(U){this._onTrackMetadata=U}},{key:"onMediaInfo",get:function(){return this._onMediaInfo},set:function(U){this._onMediaInfo=U}},{key:"onMetaDataArrived",get:function(){return this._onMetaDataArrived},set:function(U){this._onMetaDataArrived=U}},{key:"onScriptDataArrived",get:function(){return this._onScriptDataArrived},set:function(U){this._onScriptDataArrived=U}},{key:"onError",get:function(){return this._onError},set:function(U){this._onError=U}},{key:"onDataAvailable",get:function(){return this._onDataAvailable},set:function(U){this._onDataAvailable=U}},{key:"timestampBase",get:function(){return this._timestampBase},set:function(U){this._timestampBase=U}},{key:"overridedDuration",get:function(){return this._duration},set:function(U){this._durationOverrided=!0,this._duration=U,this._mediaInfo.duration=U}},{key:"overridedHasAudio",set:function(U){this._hasAudioFlagOverrided=!0,this._hasAudio=U,this._mediaInfo.hasAudio=U}},{key:"overridedHasVideo",set:function(U){this._hasVideoFlagOverrided=!0,this._hasVideo=U,this._mediaInfo.hasVideo=U}},{key:"resetMediaInfo",value:function(){this._mediaInfo=new ct}},{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(U,G){if(!this._onError||!this._onMediaInfo||!this._onTrackMetadata||!this._onDataAvailable)throw new h("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var Q=0,te=this._littleEndian;if(G===0)if(U.byteLength>13){var he=fe.probe(U);Q=he.dataOffset}else return 0;if(this._firstParse){this._firstParse=!1,G+Q!==this._dataOffset&&M.w(this.TAG,"First time parsing but chunk byteStart invalid!");var Le=new DataView(U,Q),Ge=Le.getUint32(0,!te);Ge!==0&&M.w(this.TAG,"PrevTagSize0 !== 0 !!!"),Q+=4}for(;QU.byteLength)break;var Nt=Ot.getUint8(0),Xe=Ot.getUint32(0,!te)&16777215;if(Q+11+Xe+4>U.byteLength)break;if(Nt!==8&&Nt!==9&&Nt!==18){M.w(this.TAG,"Unsupported tag type ".concat(Nt,", skipped")),Q+=11+Xe+4;continue}var It=Ot.getUint8(4),an=Ot.getUint8(5),Ct=Ot.getUint8(6),pn=Ot.getUint8(7),nn=Ct|an<<8|It<<16|pn<<24,$=Ot.getUint32(7,!te)&16777215;$!==0&&M.w(this.TAG,"Meet tag which has StreamID != 0!");var C=Q+11;switch(Nt){case 8:this._parseAudioData(U,C,Xe,nn);break;case 9:this._parseVideoData(U,C,Xe,nn,G+Q);break;case 18:this._parseScriptData(U,C,Xe);break}var D=Ot.getUint32(11+Xe,!te);D!==11+Xe&&M.w(this.TAG,"Invalid PrevTagSize ".concat(D)),Q+=11+Xe+4}return this._isInitialMetadataDispatched()&&(this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack)),Q}},{key:"_parseScriptData",value:function(U,G,Q){var te=xt.parseScriptData(U,G,Q);if(te.hasOwnProperty("onMetaData")){if(te.onMetaData==null||typeof te.onMetaData!="object"){M.w(this.TAG,"Invalid onMetaData structure!");return}this._metadata&&M.w(this.TAG,"Found another onMetaData tag!"),this._metadata=te;var he=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},he)),typeof he.hasAudio=="boolean"&&(this._hasAudioFlagOverrided===!1&&(this._hasAudio=he.hasAudio,this._mediaInfo.hasAudio=this._hasAudio)),typeof he.hasVideo=="boolean"&&(this._hasVideoFlagOverrided===!1&&(this._hasVideo=he.hasVideo,this._mediaInfo.hasVideo=this._hasVideo)),typeof he.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=he.audiodatarate),typeof he.videodatarate=="number"&&(this._mediaInfo.videoDataRate=he.videodatarate),typeof he.width=="number"&&(this._mediaInfo.width=he.width),typeof he.height=="number"&&(this._mediaInfo.height=he.height),typeof he.duration=="number"){if(!this._durationOverrided){var Le=Math.floor(he.duration*this._timescale);this._duration=Le,this._mediaInfo.duration=Le}}else this._mediaInfo.duration=0;if(typeof he.framerate=="number"){var Ge=Math.floor(he.framerate*1e3);if(Ge>0){var Ot=Ge/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=Ot,this._referenceFrameRate.fps_num=Ge,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=Ot}}if(typeof he.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;var Nt=he.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(Nt),he.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=he,M.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(te).length>0&&(this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},te)))}},{key:"_parseKeyframesIndex",value:function(U){for(var G=[],Q=[],te=1;te>>4;if(Ot!==2&&Ot!==10){this._onError(at.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+Ot);return}var Nt=0,Xe=(Ge&12)>>>2;if(Xe>=0&&Xe<=4)Nt=this._flvSoundRateTable[Xe];else{this._onError(at.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+Xe);return}var It=(Ge&2)>>>1,an=Ge&1,Ct=this._audioMetadata,pn=this._audioTrack;if(Ct||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),Ct=this._audioMetadata={},Ct.type="audio",Ct.id=pn.id,Ct.timescale=this._timescale,Ct.duration=this._duration,Ct.audioSampleRate=Nt,Ct.channelCount=an===0?1:2),Ot===10){var nn=this._parseAACAudioData(U,G+1,Q-1);if(nn==null)return;if(nn.packetType===0){Ct.config&&M.w(this.TAG,"Found another AudioSpecificConfig!");var $=nn.data;Ct.audioSampleRate=$.samplingRate,Ct.channelCount=$.channelCount,Ct.codec=$.codec,Ct.originalCodec=$.originalCodec,Ct.config=$.config,Ct.refSampleDuration=1024/Ct.audioSampleRate*Ct.timescale,M.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",Ct);var C=this._mediaInfo;C.audioCodec=Ct.originalCodec,C.audioSampleRate=Ct.audioSampleRate,C.audioChannelCount=Ct.channelCount,C.hasVideo?C.videoCodec!=null&&(C.mimeType='video/x-flv; codecs="'+C.videoCodec+","+C.audioCodec+'"'):C.mimeType='video/x-flv; codecs="'+C.audioCodec+'"',C.isComplete()&&this._onMediaInfo(C)}else if(nn.packetType===1){var D=this._timestampBase+te,K={unit:nn.data,length:nn.data.byteLength,dts:D,pts:D};pn.samples.push(K),pn.length+=nn.data.length}else M.e(this.TAG,"Flv: Unsupported AAC data type ".concat(nn.packetType))}else if(Ot===2){if(!Ct.codec){var re=this._parseMP3AudioData(U,G+1,Q-1,!0);if(re==null)return;Ct.audioSampleRate=re.samplingRate,Ct.channelCount=re.channelCount,Ct.codec=re.codec,Ct.originalCodec=re.originalCodec,Ct.refSampleDuration=1152/Ct.audioSampleRate*Ct.timescale,M.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",Ct);var J=this._mediaInfo;J.audioCodec=Ct.codec,J.audioSampleRate=Ct.audioSampleRate,J.audioChannelCount=Ct.channelCount,J.audioDataRate=re.bitRate,J.hasVideo?J.videoCodec!=null&&(J.mimeType='video/x-flv; codecs="'+J.videoCodec+","+J.audioCodec+'"'):J.mimeType='video/x-flv; codecs="'+J.audioCodec+'"',J.isComplete()&&this._onMediaInfo(J)}var Re=this._parseMP3AudioData(U,G+1,Q-1,!1);if(Re==null)return;var ut=this._timestampBase+te,St={unit:Re,length:Re.byteLength,dts:ut,pts:ut};pn.samples.push(St),pn.length+=Re.length}}},{key:"_parseAACAudioData",value:function(U,G,Q){if(Q<=1){M.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");return}var te={},he=new Uint8Array(U,G,Q);return te.packetType=he[0],he[0]===0?te.data=this._parseAACAudioSpecificConfig(U,G+1,Q-1):te.data=he.subarray(1),te}},{key:"_parseAACAudioSpecificConfig",value:function(U,G,Q){var te=new Uint8Array(U,G,Q),he=null,Le=0,Ge=0,Ot=null,Nt=0,Xe=null;if(Le=Ge=te[0]>>>3,Nt=(te[0]&7)<<1|te[1]>>>7,Nt<0||Nt>=this._mpegSamplingRates.length){this._onError(at.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");return}var It=this._mpegSamplingRates[Nt],an=(te[1]&120)>>>3;if(an<0||an>=8){this._onError(at.FORMAT_ERROR,"Flv: AAC invalid channel configuration");return}Le===5&&(Xe=(te[1]&7)<<1|te[2]>>>7,Ot=(te[2]&124)>>>2);var Ct=self.navigator.userAgent.toLowerCase();return Ct.indexOf("firefox")!==-1?Nt>=6?(Le=5,he=new Array(4),Xe=Nt-3):(Le=2,he=new Array(2),Xe=Nt):Ct.indexOf("android")!==-1?(Le=2,he=new Array(2),Xe=Nt):(Le=5,Xe=Nt,he=new Array(4),Nt>=6?Xe=Nt-3:an===1&&(Le=2,he=new Array(2),Xe=Nt)),he[0]=Le<<3,he[0]|=(Nt&15)>>>1,he[1]=(Nt&15)<<7,he[1]|=(an&15)<<3,Le===5&&(he[1]|=(Xe&15)>>>1,he[2]=(Xe&1)<<7,he[2]|=2<<2,he[3]=0),{config:he,samplingRate:It,channelCount:an,codec:"mp4a.40."+Le,originalCodec:"mp4a.40."+Ge}}},{key:"_parseMP3AudioData",value:function(U,G,Q,te){if(Q<4){M.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");return}var he=this._littleEndian,Le=new Uint8Array(U,G,Q),Ge=null;if(te){if(Le[0]!==255)return;var Ot=Le[1]>>>3&3,Nt=(Le[1]&6)>>1,Xe=(Le[2]&240)>>>4,It=(Le[2]&12)>>>2,an=Le[3]>>>6&3,Ct=an!==3?2:1,pn=0,nn=0,$=34,C="mp3";switch(Ot){case 0:pn=this._mpegAudioV25SampleRateTable[It];break;case 2:pn=this._mpegAudioV20SampleRateTable[It];break;case 3:pn=this._mpegAudioV10SampleRateTable[It];break}switch(Nt){case 1:$=34,Xe>>4,Ot=Le&15;if(Ot!==7){this._onError(at.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(Ot));return}this._parseAVCVideoPacket(U,G+1,Q-1,te,he,Ge)}},{key:"_parseAVCVideoPacket",value:function(U,G,Q,te,he,Le){if(Q<4){M.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");return}var Ge=this._littleEndian,Ot=new DataView(U,G,Q),Nt=Ot.getUint8(0),Xe=Ot.getUint32(0,!Ge)&16777215,It=Xe<<8>>8;if(Nt===0)this._parseAVCDecoderConfigurationRecord(U,G+4,Q-4);else if(Nt===1)this._parseAVCVideoData(U,G+4,Q-4,te,he,Le,It);else if(!(Nt===2)){this._onError(at.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(Nt));return}}},{key:"_parseAVCDecoderConfigurationRecord",value:function(U,G,Q){if(Q<7){M.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");return}var te=this._videoMetadata,he=this._videoTrack,Le=this._littleEndian,Ge=new DataView(U,G,Q);te?typeof te.avcc!="undefined"&&M.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),te=this._videoMetadata={},te.type="video",te.id=he.id,te.timescale=this._timescale,te.duration=this._duration);var Ot=Ge.getUint8(0),Nt=Ge.getUint8(1),Xe=Ge.getUint8(2),It=Ge.getUint8(3);if(Ot!==1||Nt===0){this._onError(at.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");return}if(this._naluLengthSize=(Ge.getUint8(4)&3)+1,this._naluLengthSize!==3&&this._naluLengthSize!==4){this._onError(at.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));return}var an=Ge.getUint8(5)&31;if(an===0){this._onError(at.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");return}else an>1&&M.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(an));for(var Ct=6,pn=0;pn1&&M.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat(Yt));Ct++;for(var dt=0;dt=Q){M.w(this.TAG,"Malformed Nalu near timestamp ".concat(pn,", offset = ").concat(an,", dataSize = ").concat(Q));break}var $=Nt.getUint32(an,!Ot);if(Ct===3&&($>>>=8),$>Q-Ct){M.w(this.TAG,"Malformed Nalus near timestamp ".concat(pn,", NaluSize > DataSize!"));return}var C=Nt.getUint8(an+Ct)&31;C===5&&(nn=!0);var D=new Uint8Array(U,G+an,Ct+$),K={type:C,data:D};Xe.push(K),It+=D.byteLength,an+=Ct+$}if(Xe.length){var re=this._videoTrack,J={units:Xe,length:It,isKeyframe:nn,dts:pn,cts:Ge,pts:pn+Ge};nn&&(J.fileposition=he),re.samples.push(J),re.length+=It}}}],[{key:"probe",value:function(U){var G=new Uint8Array(U),Q={match:!1};if(G[0]!==70||G[1]!==76||G[2]!==86||G[3]!==1)return Q;var te=(G[4]&4)>>>2!==0,he=(G[4]&1)!==0,Le=Mt(G,5);return Le<9?Q:{match:!0,consumed:Le,dataOffset:Le,hasAudioTrack:te,hasVideoTrack:he}}}]),fe}(),Me=jt,Pe=function(){function fe(){Object(ee.a)(this,fe)}return Object(V.a)(fe,null,[{key:"init",value:function(){fe.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 U in fe.types)fe.types.hasOwnProperty(U)&&(fe.types[U]=[U.charCodeAt(0),U.charCodeAt(1),U.charCodeAt(2),U.charCodeAt(3)]);var G=fe.constants={};G.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),G.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),G.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),G.STSC=G.STCO=G.STTS,G.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),G.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]),G.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]),G.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),G.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),G.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}},{key:"box",value:function(U){for(var G=8,Q=null,te=Array.prototype.slice.call(arguments,1),he=te.length,Le=0;Le>>24&255,Q[1]=G>>>16&255,Q[2]=G>>>8&255,Q[3]=G&255,Q.set(U,4);for(var Ge=8,Ot=0;Ot>>24&255,U>>>16&255,U>>>8&255,U&255,G>>>24&255,G>>>16&255,G>>>8&255,G&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(U){return fe.box(fe.types.trak,fe.tkhd(U),fe.mdia(U))}},{key:"tkhd",value:function(U){var G=U.id,Q=U.duration,te=U.presentWidth,he=U.presentHeight;return fe.box(fe.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,G>>>24&255,G>>>16&255,G>>>8&255,G&255,0,0,0,0,Q>>>24&255,Q>>>16&255,Q>>>8&255,Q&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,te>>>8&255,te&255,0,0,he>>>8&255,he&255,0,0]))}},{key:"mdia",value:function(U){return fe.box(fe.types.mdia,fe.mdhd(U),fe.hdlr(U),fe.minf(U))}},{key:"mdhd",value:function(U){var G=U.timescale,Q=U.duration;return fe.box(fe.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,G>>>24&255,G>>>16&255,G>>>8&255,G&255,Q>>>24&255,Q>>>16&255,Q>>>8&255,Q&255,85,196,0,0]))}},{key:"hdlr",value:function(U){var G=null;return U.type==="audio"?G=fe.constants.HDLR_AUDIO:G=fe.constants.HDLR_VIDEO,fe.box(fe.types.hdlr,G)}},{key:"minf",value:function(U){var G=null;return U.type==="audio"?G=fe.box(fe.types.smhd,fe.constants.SMHD):G=fe.box(fe.types.vmhd,fe.constants.VMHD),fe.box(fe.types.minf,G,fe.dinf(),fe.stbl(U))}},{key:"dinf",value:function(){var U=fe.box(fe.types.dinf,fe.box(fe.types.dref,fe.constants.DREF));return U}},{key:"stbl",value:function(U){var G=fe.box(fe.types.stbl,fe.stsd(U),fe.box(fe.types.stts,fe.constants.STTS),fe.box(fe.types.stsc,fe.constants.STSC),fe.box(fe.types.stsz,fe.constants.STSZ),fe.box(fe.types.stco,fe.constants.STCO));return G}},{key:"stsd",value:function(U){return U.type==="audio"?U.codec==="mp3"?fe.box(fe.types.stsd,fe.constants.STSD_PREFIX,fe.mp3(U)):fe.box(fe.types.stsd,fe.constants.STSD_PREFIX,fe.mp4a(U)):fe.box(fe.types.stsd,fe.constants.STSD_PREFIX,fe.avc1(U))}},{key:"mp3",value:function(U){var G=U.channelCount,Q=U.audioSampleRate,te=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,G,0,16,0,0,0,0,Q>>>8&255,Q&255,0,0]);return fe.box(fe.types[".mp3"],te)}},{key:"mp4a",value:function(U){var G=U.channelCount,Q=U.audioSampleRate,te=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,G,0,16,0,0,0,0,Q>>>8&255,Q&255,0,0]);return fe.box(fe.types.mp4a,te,fe.esds(U))}},{key:"esds",value:function(U){var G=U.config||[],Q=G.length,te=new Uint8Array([0,0,0,0,3,23+Q,0,1,0,4,15+Q,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([Q]).concat(G).concat([6,1,2]));return fe.box(fe.types.esds,te)}},{key:"avc1",value:function(U){var G=U.avcc,Q=U.codecWidth,te=U.codecHeight,he=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,Q>>>8&255,Q&255,te>>>8&255,te&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 fe.box(fe.types.avc1,he,fe.box(fe.types.avcC,G))}},{key:"mvex",value:function(U){return fe.box(fe.types.mvex,fe.trex(U))}},{key:"trex",value:function(U){var G=U.id,Q=new Uint8Array([0,0,0,0,G>>>24&255,G>>>16&255,G>>>8&255,G&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return fe.box(fe.types.trex,Q)}},{key:"moof",value:function(U,G){return fe.box(fe.types.moof,fe.mfhd(U.sequenceNumber),fe.traf(U,G))}},{key:"mfhd",value:function(U){var G=new Uint8Array([0,0,0,0,U>>>24&255,U>>>16&255,U>>>8&255,U&255]);return fe.box(fe.types.mfhd,G)}},{key:"traf",value:function(U,G){var Q=U.id,te=fe.box(fe.types.tfhd,new Uint8Array([0,0,0,0,Q>>>24&255,Q>>>16&255,Q>>>8&255,Q&255])),he=fe.box(fe.types.tfdt,new Uint8Array([0,0,0,0,G>>>24&255,G>>>16&255,G>>>8&255,G&255])),Le=fe.sdtp(U),Ge=fe.trun(U,Le.byteLength+16+16+8+16+8+8);return fe.box(fe.types.traf,te,he,Ge,Le)}},{key:"sdtp",value:function(U){for(var G=U.samples||[],Q=G.length,te=new Uint8Array(4+Q),he=0;he>>24&255,te>>>16&255,te>>>8&255,te&255,G>>>24&255,G>>>16&255,G>>>8&255,G&255],0);for(var Ge=0;Ge>>24&255,Ot>>>16&255,Ot>>>8&255,Ot&255,Nt>>>24&255,Nt>>>16&255,Nt>>>8&255,Nt&255,Xe.isLeading<<2|Xe.dependsOn,Xe.isDependedOn<<6|Xe.hasRedundancy<<4|Xe.isNonSync,0,0,It>>>24&255,It>>>16&255,It>>>8&255,It&255],12+16*Ge)}return fe.box(fe.types.trun,Le)}},{key:"mdat",value:function(U){return fe.box(fe.types.mdat,U)}}]),fe}();Pe.init();var tt=Pe,rt=function(){function fe(){Object(ee.a)(this,fe)}return Object(V.a)(fe,null,[{key:"getSilentFrame",value:function(U,G){if(U==="mp4a.40.2"){if(G===1)return new Uint8Array([0,200,0,128,35,128]);if(G===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(G===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(G===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(G===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(G===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(G===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(G===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(G===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}}]),fe}(),Fe=rt,Je=function fe(se,U,G,Q,te){Object(ee.a)(this,fe),this.dts=se,this.pts=U,this.duration=G,this.originalDts=Q,this.isSyncPoint=te,this.fileposition=null},Ee=function(){function fe(){Object(ee.a)(this,fe),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(V.a)(fe,[{key:"appendSyncPoint",value:function(U){U.isSyncPoint=!0,this.syncPoints.push(U)}}]),fe}(),ye=function(){function fe(){Object(ee.a)(this,fe),this._list=[]}return Object(V.a)(fe,[{key:"clear",value:function(){this._list=[]}},{key:"appendArray",value:function(U){var G=this._list;if(U.length===0)return;G.length>0&&U[0].originalDts=G[he].dts&&UG[te].lastSample.originalDts&&U=G[te].lastSample.originalDts&&(te===G.length-1||te0&&(he=this._searchNearestSegmentBefore(Q.originalBeginDts)+1),this._lastAppendLocation=he,this._list.splice(he,0,Q)}},{key:"getLastSegmentBefore",value:function(U){var G=this._searchNearestSegmentBefore(U);return G>=0?this._list[G]:null}},{key:"getLastSampleBefore",value:function(U){var G=this.getLastSegmentBefore(U);return G!=null?G.lastSample:null}},{key:"getLastSyncPointBefore",value:function(U){for(var G=this._searchNearestSegmentBefore(U),Q=this._list[G].syncPoints;Q.length===0&&G>0;)G--,Q=this._list[G].syncPoints;return Q.length>0?Q[Q.length-1]:null}}]),fe}(),le=function(){function fe(se){Object(ee.a)(this,fe),this.TAG="MP4Remuxer",this._config=se,this._isLive=se.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 _e("audio"),this._videoSegmentInfoList=new _e("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!!(E.chrome&&(E.version.major<50||E.version.major===50&&E.version.build<2661)),this._fillSilentAfterSeek=E.msedge||E.msie,this._mp3UseMpegAudio=!E.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return Object(V.a)(fe,[{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(U){return U.onDataAvailable=this.remux.bind(this),U.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}},{key:"onInitSegment",get:function(){return this._onInitSegment},set:function(U){this._onInitSegment=U}},{key:"onMediaSegment",get:function(){return this._onMediaSegment},set:function(U){this._onMediaSegment=U}},{key:"insertDiscontinuity",value:function(){this._audioNextDts=this._videoNextDts=void 0}},{key:"seek",value:function(U){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}},{key:"remux",value:function(U,G){if(!this._onMediaSegment)throw new h("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(U,G),this._remuxVideo(G),this._remuxAudio(U)}},{key:"_onTrackMetadataReceived",value:function(U,G){var Q=null,te="mp4",he=G.codec;if(U==="audio")this._audioMeta=G,G.codec==="mp3"&&this._mp3UseMpegAudio?(te="mpeg",he="",Q=new Uint8Array):Q=tt.generateInitSegment(G);else if(U==="video")this._videoMeta=G,Q=tt.generateInitSegment(G);else return;if(!this._onInitSegment)throw new h("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(U,{type:U,data:Q.buffer,codec:he,container:"".concat(U,"/").concat(te),mediaDuration:G.duration})}},{key:"_calculateDtsBase",value:function(U,G){if(this._dtsBaseInited)return;U.samples&&U.samples.length&&(this._audioDtsBase=U.samples[0].dts),G.samples&&G.samples.length&&(this._videoDtsBase=G.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0}},{key:"flushStashedSamples",value:function(){var U=this._videoStashedLastSample,G=this._audioStashedLastSample,Q={type:"video",id:1,sequenceNumber:0,samples:[],length:0};U!=null&&(Q.samples.push(U),Q.length=U.length);var te={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};G!=null&&(te.samples.push(G),te.length=G.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(Q,!0),this._remuxAudio(te,!0)}},{key:"_remuxAudio",value:function(U,G){if(this._audioMeta==null)return;var Q=U,te=Q.samples,he=void 0,Le=-1,Ge=-1,Ot=-1,Nt=this._audioMeta.refSampleDuration,Xe=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,It=this._dtsBaseInited&&this._audioNextDts===void 0,an=!1;if(!te||te.length===0)return;if(te.length===1&&!G)return;var Ct=0,pn=null,nn=0;Xe?(Ct=0,nn=Q.length):(Ct=8,nn=8+Q.length);var $=null;if(te.length>1&&($=te.pop(),nn-=$.length),this._audioStashedLastSample!=null){var C=this._audioStashedLastSample;this._audioStashedLastSample=null,te.unshift(C),nn+=C.length}$!=null&&(this._audioStashedLastSample=$);var D=te[0].dts-this._dtsBase;if(this._audioNextDts)he=D-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())he=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&(this._audioMeta.originalCodec!=="mp3"&&(an=!0));else{var K=this._audioSegmentInfoList.getLastSampleBefore(D);if(K!=null){var re=D-(K.originalDts+K.duration);re<=3&&(re=0);var J=K.dts+K.duration+re;he=D-J}else he=0}if(an){var Re=D-he,ut=this._videoSegmentInfoList.getLastSegmentBefore(D);if(ut!=null&&ut.beginDts=1?di=Gt[Gt.length-1].duration:di=Math.floor(Nt);var ri=!1,wi=null;if(di>Nt*1.5&&this._audioMeta.codec!=="mp3"&&this._fillAudioTimestampGap&&!E.safari){ri=!0;var Di=Math.abs(di-Nt),Oi=Math.ceil(Di/Nt),Ri=Fn+Nt;M.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync. `+"dts: ".concat(Fn+di," ms, expected: ").concat(Fn+Math.round(Nt)," ms, ")+"delta: ".concat(Math.round(Di)," ms, generate: ").concat(Oi," frames"));var Vi=Fe.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);Vi==null&&(M.w(this.TAG,"Unable to generate silent frame for "+"".concat(this._audioMeta.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),Vi=Si),wi=[];for(var cr=0;cr0){var ji=wi[wi.length-1];ji.duration=rr-ji.dts}var Wi={dts:rr,pts:rr,cts:0,unit:Vi,size:Vi.byteLength,duration:0,originalDts:hi,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};wi.push(Wi),nn+=Wi.size,Ri+=Nt}var hr=wi[wi.length-1];hr.duration=Fn+di-hr.dts,di=Math.round(Nt)}Gt.push({dts:Fn,pts:Fn,cts:0,unit:Wn.unit,size:Wn.unit.byteLength,duration:di,originalDts:hi,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),ri&&Gt.push.apply(Gt,wi)}Xe?pn=new Uint8Array(nn):(pn=new Uint8Array(nn),pn[0]=nn>>>24&255,pn[1]=nn>>>16&255,pn[2]=nn>>>8&255,pn[3]=nn&255,pn.set(tt.types.mdat,4));for(var Tr=0;Tr1&&(Ct=te.pop(),an-=Ct.length),this._videoStashedLastSample!=null){var pn=this._videoStashedLastSample;this._videoStashedLastSample=null,te.unshift(pn),an+=pn.length}Ct!=null&&(this._videoStashedLastSample=Ct);var nn=te[0].dts-this._dtsBase;if(this._videoNextDts)he=nn-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())he=0;else{var $=this._videoSegmentInfoList.getLastSampleBefore(nn);if($!=null){var C=nn-($.originalDts+$.duration);C<=3&&(C=0);var D=$.dts+$.duration+C;he=nn-D}else he=0}for(var K=new Ee,re=[],J=0;J=1?sn=re[re.length-1].duration:sn=Math.floor(this._videoMeta.refSampleDuration);if(St){var hi=new Je(Yt,Gt,sn,Re.dts,!0);hi.fileposition=Re.fileposition,K.appendSyncPoint(hi)}re.push({dts:Yt,pts:Gt,cts:dt,units:Re.units,size:Re.length,isKeyframe:St,duration:sn,originalDts:ut,flags:{isLeading:0,dependsOn:St?2:1,isDependedOn:St?1:0,hasRedundancy:0,isNonSync:St?0:1}})}It=new Uint8Array(an),It[0]=an>>>24&255,It[1]=an>>>16&255,It[2]=an>>>8&255,It[3]=an&255,It.set(tt.types.mdat,4);for(var Fn=0;Fn0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,he=this._demuxer.parseChunks(U,G);else if((te=Me.probe(U)).match){this._demuxer=new Me(te,this._config),this._remuxer||(this._remuxer=new de(this._config));var Le=this._mediaDataSource;Le.duration!=null&&!isNaN(Le.duration)&&(this._demuxer.overridedDuration=Le.duration),typeof Le.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=Le.hasAudio),typeof Le.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=Le.hasVideo),this._demuxer.timestampBase=Le.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),he=this._demuxer.parseChunks(U,G)}else te=null,M.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(function(){Q._internalAbort()}),this._emitter.emit(pe.DEMUX_ERROR,at.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),he=0;return he}},{key:"_onMediaInfo",value:function(U){var G=this;this._mediaInfo==null&&(this._mediaInfo=Object.assign({},U),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,ct.prototype));var Q=Object.assign({},U);Object.setPrototypeOf(Q,ct.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=Q,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(function(){var te=G._pendingSeekTime;G._pendingSeekTime=null,G.seek(te)})}},{key:"_onMetaDataArrived",value:function(U){this._emitter.emit(pe.METADATA_ARRIVED,U)}},{key:"_onScriptDataArrived",value:function(U){this._emitter.emit(pe.SCRIPTDATA_ARRIVED,U)}},{key:"_onIOSeeked",value:function(){this._remuxer.insertDiscontinuity()}},{key:"_onIOComplete",value:function(U){var G=U,Q=G+1;Q0&&Q[0].originalDts===te&&(te=Q[0].pts),this._emitter.emit(pe.RECOMMEND_SEEKPOINT,te)}}},{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(U){var G=this._mediaInfo.segments[U],Q=Object.assign({},G);Q.duration=this._mediaInfo.duration,Q.segmentCount=this._mediaInfo.segmentCount,delete Q.segments,delete Q.keyframesIndex,this._emitter.emit(pe.MEDIA_INFO,Q)}},{key:"_reportStatisticsInfo",value:function(){var U={};U.url=this._ioctl.currentURL,U.hasRedirect=this._ioctl.hasRedirect,U.hasRedirect&&(U.redirectedURL=this._ioctl.currentRedirectedURL),U.speed=this._ioctl.currentSpeed,U.loaderType=this._ioctl.loaderType,U.currentSegmentIndex=this._currentSegmentIndex,U.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(pe.STATISTICS_INFO,U)}}]),fe}(),Ke=Ce,st=function(se){var U="TransmuxingWorker",G=null,Q=nn.bind(this);Y.install(),se.addEventListener("message",function($){switch($.data.cmd){case"init":G=new Ke($.data.param[0],$.data.param[1]),G.on(pe.IO_ERROR,an.bind(this)),G.on(pe.DEMUX_ERROR,Ct.bind(this)),G.on(pe.INIT_SEGMENT,te.bind(this)),G.on(pe.MEDIA_SEGMENT,he.bind(this)),G.on(pe.LOADING_COMPLETE,Le.bind(this)),G.on(pe.RECOVERED_EARLY_EOF,Ge.bind(this)),G.on(pe.MEDIA_INFO,Ot.bind(this)),G.on(pe.METADATA_ARRIVED,Nt.bind(this)),G.on(pe.SCRIPTDATA_ARRIVED,Xe.bind(this)),G.on(pe.STATISTICS_INFO,It.bind(this)),G.on(pe.RECOMMEND_SEEKPOINT,pn.bind(this));break;case"destroy":G&&(G.destroy(),G=null),se.postMessage({msg:"destroyed"});break;case"start":G.start();break;case"stop":G.stop();break;case"seek":G.seek($.data.param);break;case"pause":G.pause();break;case"resume":G.resume();break;case"logging_config":{var C=$.data.param;ge.applyConfig(C),C.enableCallback===!0?ge.addLogListener(Q):ge.removeLogListener(Q);break}}});function te($,C){var D={msg:pe.INIT_SEGMENT,data:{type:$,data:C}};se.postMessage(D,[C.data])}function he($,C){var D={msg:pe.MEDIA_SEGMENT,data:{type:$,data:C}};se.postMessage(D,[C.data])}function Le(){var $={msg:pe.LOADING_COMPLETE};se.postMessage($)}function Ge(){var $={msg:pe.RECOVERED_EARLY_EOF};se.postMessage($)}function Ot($){var C={msg:pe.MEDIA_INFO,data:$};se.postMessage(C)}function Nt($){var C={msg:pe.METADATA_ARRIVED,data:$};se.postMessage(C)}function Xe($){var C={msg:pe.SCRIPTDATA_ARRIVED,data:$};se.postMessage(C)}function It($){var C={msg:pe.STATISTICS_INFO,data:$};se.postMessage(C)}function an($,C){se.postMessage({msg:pe.IO_ERROR,data:{type:$,info:C}})}function Ct($,C){se.postMessage({msg:pe.DEMUX_ERROR,data:{type:$,info:C}})}function pn($){se.postMessage({msg:pe.RECOMMEND_SEEKPOINT,data:$})}function nn($,C){se.postMessage({msg:"logcat_callback",data:{type:$,logcat:C}})}},At=st,Ft=function(){function fe(se,U){if(Object(ee.a)(this,fe),this.TAG="Transmuxer",this._emitter=new R.a,U.enableWorker&&typeof Worker!="undefined")try{var G=k("0r65");this._worker=G(At),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[se,U]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},ge.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:ge.getConfig()})}catch(te){M.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new Ke(se,U)}else this._controller=new Ke(se,U);if(this._controller){var Q=this._controller;Q.on(pe.IO_ERROR,this._onIOError.bind(this)),Q.on(pe.DEMUX_ERROR,this._onDemuxError.bind(this)),Q.on(pe.INIT_SEGMENT,this._onInitSegment.bind(this)),Q.on(pe.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),Q.on(pe.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),Q.on(pe.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),Q.on(pe.MEDIA_INFO,this._onMediaInfo.bind(this)),Q.on(pe.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),Q.on(pe.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),Q.on(pe.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),Q.on(pe.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return Object(V.a)(fe,[{key:"destroy",value:function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),ge.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(U,G){this._emitter.addListener(U,G)}},{key:"off",value:function(U,G){this._emitter.removeListener(U,G)}},{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(U){this._worker?this._worker.postMessage({cmd:"seek",param:U}):this._controller.seek(U)}},{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(U,G){var Q=this;Promise.resolve().then(function(){Q._emitter.emit(pe.INIT_SEGMENT,U,G)})}},{key:"_onMediaSegment",value:function(U,G){var Q=this;Promise.resolve().then(function(){Q._emitter.emit(pe.MEDIA_SEGMENT,U,G)})}},{key:"_onLoadingComplete",value:function(){var U=this;Promise.resolve().then(function(){U._emitter.emit(pe.LOADING_COMPLETE)})}},{key:"_onRecoveredEarlyEof",value:function(){var U=this;Promise.resolve().then(function(){U._emitter.emit(pe.RECOVERED_EARLY_EOF)})}},{key:"_onMediaInfo",value:function(U){var G=this;Promise.resolve().then(function(){G._emitter.emit(pe.MEDIA_INFO,U)})}},{key:"_onMetaDataArrived",value:function(U){var G=this;Promise.resolve().then(function(){G._emitter.emit(pe.METADATA_ARRIVED,U)})}},{key:"_onScriptDataArrived",value:function(U){var G=this;Promise.resolve().then(function(){G._emitter.emit(pe.SCRIPTDATA_ARRIVED,U)})}},{key:"_onStatisticsInfo",value:function(U){var G=this;Promise.resolve().then(function(){G._emitter.emit(pe.STATISTICS_INFO,U)})}},{key:"_onIOError",value:function(U,G){var Q=this;Promise.resolve().then(function(){Q._emitter.emit(pe.IO_ERROR,U,G)})}},{key:"_onDemuxError",value:function(U,G){var Q=this;Promise.resolve().then(function(){Q._emitter.emit(pe.DEMUX_ERROR,U,G)})}},{key:"_onRecommendSeekpoint",value:function(U){var G=this;Promise.resolve().then(function(){G._emitter.emit(pe.RECOMMEND_SEEKPOINT,U)})}},{key:"_onLoggingConfigChanged",value:function(U){this._worker&&this._worker.postMessage({cmd:"logging_config",param:U})}},{key:"_onWorkerMessage",value:function(U){var G=U.data,Q=G.data;if(G.msg==="destroyed"||this._workerDestroying){this._workerDestroying=!1,this._worker.terminate(),this._worker=null;return}switch(G.msg){case pe.INIT_SEGMENT:case pe.MEDIA_SEGMENT:this._emitter.emit(G.msg,Q.type,Q.data);break;case pe.LOADING_COMPLETE:case pe.RECOVERED_EARLY_EOF:this._emitter.emit(G.msg);break;case pe.MEDIA_INFO:Object.setPrototypeOf(Q,ct.prototype),this._emitter.emit(G.msg,Q);break;case pe.METADATA_ARRIVED:case pe.SCRIPTDATA_ARRIVED:case pe.STATISTICS_INFO:this._emitter.emit(G.msg,Q);break;case pe.IO_ERROR:case pe.DEMUX_ERROR:this._emitter.emit(G.msg,Q.type,Q.info);break;case pe.RECOMMEND_SEEKPOINT:this._emitter.emit(G.msg,Q);break;case"logcat_callback":M.emitter.emit("log",Q.type,Q.logcat);break;default:break}}}]),fe}(),kt=Ft,wt={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"},Qe=wt,it=function(){function fe(se){Object(ee.a)(this,fe),this.TAG="MSEController",this._config=se,this._emitter=new R.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 ye}return Object(V.a)(fe,[{key:"destroy",value:function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(U,G){this._emitter.addListener(U,G)}},{key:"off",value:function(U,G){this._emitter.removeListener(U,G)}},{key:"attachMediaElement",value:function(U){if(this._mediaSource)throw new h("MediaSource has been attached to an HTMLMediaElement!");var G=this._mediaSource=new window.MediaSource;G.addEventListener("sourceopen",this.e.onSourceOpen),G.addEventListener("sourceended",this.e.onSourceEnded),G.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=U,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),U.src=this._mediaSourceObjectURL}},{key:"detachMediaElement",value:function(){if(this._mediaSource){var U=this._mediaSource;for(var G in this._sourceBuffers){var Q=this._pendingSegments[G];Q.splice(0,Q.length),this._pendingSegments[G]=null,this._pendingRemoveRanges[G]=null,this._lastInitSegments[G]=null;var te=this._sourceBuffers[G];if(te){if(U.readyState!=="closed"){try{U.removeSourceBuffer(te)}catch(he){M.e(this.TAG,he.message)}te.removeEventListener("error",this.e.onSourceBufferError),te.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[G]=null,this._sourceBuffers[G]=null}}if(U.readyState==="open")try{U.endOfStream()}catch(he){M.e(this.TAG,he.message)}U.removeEventListener("sourceopen",this.e.onSourceOpen),U.removeEventListener("sourceended",this.e.onSourceEnded),U.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(U,G){if(!this._mediaSource||this._mediaSource.readyState!=="open"){this._pendingSourceBufferInit.push(U),this._pendingSegments[U.type].push(U);return}var Q=U,te="".concat(Q.container);Q.codec&&Q.codec.length>0&&(te+=";codecs=".concat(Q.codec));var he=!1;if(M.v(this.TAG,"Received Initialization Segment, mimeType: "+te),this._lastInitSegments[Q.type]=Q,te!==this._mimeTypes[Q.type]){if(this._mimeTypes[Q.type])M.v(this.TAG,"Notice: ".concat(Q.type," mimeType changed, origin: ").concat(this._mimeTypes[Q.type],", target: ").concat(te));else{he=!0;try{var Le=this._sourceBuffers[Q.type]=this._mediaSource.addSourceBuffer(te);Le.addEventListener("error",this.e.onSourceBufferError),Le.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(Ge){M.e(this.TAG,Ge.message),this._emitter.emit(Qe.ERROR,{code:Ge.code,msg:Ge.message});return}}this._mimeTypes[Q.type]=te}G||this._pendingSegments[Q.type].push(Q),he||this._sourceBuffers[Q.type]&&!this._sourceBuffers[Q.type].updating&&this._doAppendSegments(),E.safari&&Q.container==="audio/mpeg"&&Q.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=Q.mediaDuration/1e3,this._updateMediaSourceDuration())}},{key:"appendMediaSegment",value:function(U){var G=U;this._pendingSegments[G.type].push(G),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var Q=this._sourceBuffers[G.type];Q&&!Q.updating&&!this._hasPendingRemoveRanges()&&this._doAppendSegments()}},{key:"seek",value:function(U){for(var G in this._sourceBuffers){if(!this._sourceBuffers[G])continue;var Q=this._sourceBuffers[G];if(this._mediaSource.readyState==="open")try{Q.abort()}catch(Nt){M.e(this.TAG,Nt.message)}this._idrList.clear();var te=this._pendingSegments[G];if(te.splice(0,te.length),this._mediaSource.readyState==="closed")continue;for(var he=0;he=1&&U-te.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}},{key:"_doCleanupSourceBuffer",value:function(){var U=this._mediaElement.currentTime;for(var G in this._sourceBuffers){var Q=this._sourceBuffers[G];if(Q){for(var te=Q.buffered,he=!1,Le=0;Le=this._config.autoCleanupMaxBackwardDuration){he=!0;var Nt=U-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[G].push({start:Ge,end:Nt})}}else Ot0&&(isNaN(G)||Q>G)&&(M.v(this.TAG,"Update MediaSource duration from ".concat(G," to ").concat(Q)),this._mediaSource.duration=Q),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},{key:"_doRemoveRanges",value:function(){for(var U in this._pendingRemoveRanges){if(!this._sourceBuffers[U]||this._sourceBuffers[U].updating)continue;for(var G=this._sourceBuffers[U],Q=this._pendingRemoveRanges[U];Q.length&&!G.updating;){var te=Q.shift();G.remove(te.start,te.end)}}}},{key:"_doAppendSegments",value:function(){var U=this._pendingSegments;for(var G in U){if(!this._sourceBuffers[G]||this._sourceBuffers[G].updating)continue;if(U[G].length>0){var Q=U[G].shift();if(Q.timestampOffset){var te=this._sourceBuffers[G].timestampOffset,he=Q.timestampOffset/1e3,Le=Math.abs(te-he);Le>.1&&(M.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(te," to ").concat(he)),this._sourceBuffers[G].timestampOffset=he),delete Q.timestampOffset}if(!Q.data||Q.data.byteLength===0)continue;try{this._sourceBuffers[G].appendBuffer(Q.data),this._isBufferFull=!1,G==="video"&&Q.hasOwnProperty("info")&&this._idrList.appendArray(Q.info.syncPoints)}catch(Ge){this._pendingSegments[G].unshift(Q),Ge.code===22?(this._isBufferFull||this._emitter.emit(Qe.BUFFER_FULL),this._isBufferFull=!0):(M.e(this.TAG,Ge.message),this._emitter.emit(Qe.ERROR,{code:Ge.code,msg:Ge.message}))}}}}},{key:"_onSourceOpen",value:function(){if(M.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var U=this._pendingSourceBufferInit;U.length;){var G=U.shift();this.appendInitSegment(G,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(Qe.SOURCE_OPEN)}},{key:"_onSourceEnded",value:function(){M.v(this.TAG,"MediaSource onSourceEnded")}},{key:"_onSourceClose",value:function(){M.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 U=this._pendingSegments;return U.video.length>0||U.audio.length>0}},{key:"_hasPendingRemoveRanges",value:function(){var U=this._pendingRemoveRanges;return U.video.length>0||U.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(Qe.UPDATE_END)}},{key:"_onSourceBufferError",value:function(U){M.e(this.TAG,"SourceBuffer Error: ".concat(U))}}]),fe}(),We=it,ce={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},Se={NETWORK_EXCEPTION:r.EXCEPTION,NETWORK_STATUS_CODE_INVALID:r.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:r.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:r.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:at.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:at.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:at.CODEC_UNSUPPORTED},ot=function(){function fe(se,U){if(Object(ee.a)(this,fe),this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new R.a,this._config=xe(),typeof U=="object"&&Object.assign(this._config,U),se.type.toLowerCase()!=="flv")throw new s("FlvPlayer requires an flv MediaDataSource input!");se.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=se,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 G=E.chrome&&(E.version.major<50||E.version.major===50&&E.version.build<2661);this._alwaysSeekKeyframe=!!(G||E.msedge||E.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return Object(V.a)(fe,[{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(U,G){var Q=this;U===De.MEDIA_INFO?this._mediaInfo!=null&&Promise.resolve().then(function(){Q._emitter.emit(De.MEDIA_INFO,Q.mediaInfo)}):U===De.STATISTICS_INFO&&(this._statisticsInfo!=null&&Promise.resolve().then(function(){Q._emitter.emit(De.STATISTICS_INFO,Q.statisticsInfo)})),this._emitter.addListener(U,G)}},{key:"off",value:function(U,G){this._emitter.removeListener(U,G)}},{key:"attachMediaElement",value:function(U){var G=this;if(this._mediaElement=U,U.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),U.addEventListener("seeking",this.e.onvSeeking),U.addEventListener("canplay",this.e.onvCanPlay),U.addEventListener("stalled",this.e.onvStalled),U.addEventListener("progress",this.e.onvProgress),this._msectl=new We(this._config),this._msectl.on(Qe.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(Qe.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(Qe.SOURCE_OPEN,function(){G._mseSourceOpened=!0,G._hasPendingLoad&&(G._hasPendingLoad=!1,G.load())}),this._msectl.on(Qe.ERROR,function(Q){G._emitter.emit(De.ERROR,ce.MEDIA_ERROR,Se.MEDIA_MSE_ERROR,Q)}),this._msectl.attachMediaElement(U),this._pendingSeekTime!=null)try{U.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(Q){}}},{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 U=this;if(!this._mediaElement)throw new h("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new h("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 kt(this._mediaDataSource,this._config),this._transmuxer.on(pe.INIT_SEGMENT,function(G,Q){U._msectl.appendInitSegment(Q)}),this._transmuxer.on(pe.MEDIA_SEGMENT,function(G,Q){if(U._msectl.appendMediaSegment(Q),U._config.lazyLoad&&!U._config.isLive){var te=U._mediaElement.currentTime;Q.info.endDts>=(te+U._config.lazyLoadMaxDuration)*1e3&&(U._progressChecker==null&&(M.v(U.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),U._suspendTransmuxer()))}}),this._transmuxer.on(pe.LOADING_COMPLETE,function(){U._msectl.endOfStream(),U._emitter.emit(De.LOADING_COMPLETE)}),this._transmuxer.on(pe.RECOVERED_EARLY_EOF,function(){U._emitter.emit(De.RECOVERED_EARLY_EOF)}),this._transmuxer.on(pe.IO_ERROR,function(G,Q){U._emitter.emit(De.ERROR,ce.NETWORK_ERROR,G,Q)}),this._transmuxer.on(pe.DEMUX_ERROR,function(G,Q){U._emitter.emit(De.ERROR,ce.MEDIA_ERROR,G,{code:-1,msg:Q})}),this._transmuxer.on(pe.MEDIA_INFO,function(G){U._mediaInfo=G,U._emitter.emit(De.MEDIA_INFO,Object.assign({},G))}),this._transmuxer.on(pe.METADATA_ARRIVED,function(G){U._emitter.emit(De.METADATA_ARRIVED,G)}),this._transmuxer.on(pe.SCRIPTDATA_ARRIVED,function(G){U._emitter.emit(De.SCRIPTDATA_ARRIVED,G)}),this._transmuxer.on(pe.STATISTICS_INFO,function(G){U._statisticsInfo=U._fillStatisticsInfo(G),U._emitter.emit(De.STATISTICS_INFO,Object.assign({},U._statisticsInfo))}),this._transmuxer.on(pe.RECOMMEND_SEEKPOINT,function(G){U._mediaElement&&!U._config.accurateSeek&&(U._requestSetTime=!0,U._mediaElement.currentTime=G/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(U){this._mediaElement.volume=U}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(U){this._mediaElement.muted=U}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(U){this._mediaElement?this._internalSeek(U):this._pendingSeekTime=U}},{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(U){if(U.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return U;var G=!0,Q=0,te=0;if(this._mediaElement.getVideoPlaybackQuality){var he=this._mediaElement.getVideoPlaybackQuality();Q=he.totalVideoFrames,te=he.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(Q=this._mediaElement.webkitDecodedFrameCount,te=this._mediaElement.webkitDroppedFrameCount):G=!1;return G&&(U.decodedFrames=Q,U.droppedFrames=te),U}},{key:"_onmseUpdateEnd",value:function(){if(!this._config.lazyLoad||this._config.isLive)return;for(var U=this._mediaElement.buffered,G=this._mediaElement.currentTime,Q=0,te=0,he=0;he=G+this._config.lazyLoadMaxDuration&&this._progressChecker==null&&(M.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},{key:"_onmseBufferFull",value:function(){M.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 U=this._mediaElement.currentTime,G=this._mediaElement.buffered,Q=!1,te=0;te=he&&U=Le-this._config.lazyLoadRecoverDuration&&(Q=!0);break}}Q&&(window.clearInterval(this._progressChecker),this._progressChecker=null,Q&&(M.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}},{key:"_isTimepointBuffered",value:function(U){for(var G=this._mediaElement.buffered,Q=0;Q=te&&U0){var he=this._mediaElement.buffered.start(0);(he<1&&U0&&G.currentTime0){var te=Q.start(0);if(te<1&&G0&&(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(U){this._mediaElement.volume=U}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(U){this._mediaElement.muted=U}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(U){this._mediaElement?this._mediaElement.currentTime=U:this._pendingSeekTime=U}},{key:"mediaInfo",get:function(){var U=this._mediaElement instanceof HTMLAudioElement?"audio/":"video/",G={mimeType:U+this._mediaDataSource.type};return this._mediaElement&&(G.duration=Math.floor(this._mediaElement.duration*1e3),this._mediaElement instanceof HTMLVideoElement&&(G.width=this._mediaElement.videoWidth,G.height=this._mediaElement.videoHeight)),G}},{key:"statisticsInfo",get:function(){var U={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return U;var G=!0,Q=0,te=0;if(this._mediaElement.getVideoPlaybackQuality){var he=this._mediaElement.getVideoPlaybackQuality();Q=he.totalVideoFrames,te=he.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(Q=this._mediaElement.webkitDecodedFrameCount,te=this._mediaElement.webkitDroppedFrameCount):G=!1;return G&&(U.decodedFrames=Q,U.droppedFrames=te),U}},{key:"_onvLoadedMetadata",value:function(U){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(De.MEDIA_INFO,this.mediaInfo)}},{key:"_reportStatisticsInfo",value:function(){this._emitter.emit(De.STATISTICS_INFO,this.statisticsInfo)}}]),fe}(),Dt=Lt;Y.install();function ke(fe,se){var U=fe;if(U==null||typeof U!="object")throw new s("MediaDataSource must be an javascript object!");if(!U.hasOwnProperty("type"))throw new s("MediaDataSource must has type field to indicate video file type!");switch(U.type){case"flv":return new ze(U,se);default:return new Dt(U,se)}}function qe(){return Oe.supportMSEH264Playback()}function Rt(){return Oe.getFeatureList()}var Pt={};Pt.createPlayer=ke,Pt.isSupported=qe,Pt.getFeatureList=Rt,Pt.BaseLoader=n,Pt.LoaderStatus=i,Pt.LoaderErrors=r,Pt.Events=De,Pt.ErrorTypes=ce,Pt.ErrorDetails=Se,Pt.FlvPlayer=ze,Pt.NativePlayer=Dt,Pt.LoggingControl=ge,Object.defineProperty(Pt,"version",{enumerable:!0,get:function(){return"__VERSION__"}});var $t=we.a=Pt},GgEA:function(Be,we,k){},Gytx:function(Be,we){Be.exports=function(ee,V,P,Y){var W=P?P.call(Y,ee,V):void 0;if(W!==void 0)return!!W;if(ee===V)return!0;if(typeof ee!="object"||!ee||typeof V!="object"||!V)return!1;var R=Object.keys(ee),B=Object.keys(V);if(R.length!==B.length)return!1;for(var M=Object.prototype.hasOwnProperty.bind(V),L=0;L>>6)+L(128|N&63):L(224|N>>>12&15)+L(128|N>>>6&63)+L(128|N&63)}else{var N=65536+(b.charCodeAt(0)-55296)*1024+(b.charCodeAt(1)-56320);return L(240|N>>>18&7)+L(128|N>>>12&63)+L(128|N>>>6&63)+L(128|N&63)}},p=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,m=function(b){return b.replace(p,I)},u=function(b){var N=[0,2,1][b.length%3],F=b.charCodeAt(0)<<16|(b.length>1?b.charCodeAt(1):0)<<8|(b.length>2?b.charCodeAt(2):0),X=[B.charAt(F>>>18),B.charAt(F>>>12&63),N>=2?"=":B.charAt(F>>>6&63),N>=1?"=":B.charAt(F&63)];return X.join("")},h=Y.btoa&&typeof Y.btoa=="function"?function(b){return Y.btoa(b)}:function(b){if(b.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return b.replace(/[\s\S]{1,3}/g,u)},s=function(b){return h(m(String(b)))},l=function(b){return b.replace(/[+\/]/g,function(N){return N=="+"?"-":"_"}).replace(/=/g,"")},i=function(b,N){return N?l(s(b)):s(b)},r=function(b){return i(b,!0)},n;Y.Uint8Array&&(n=function(b,N){for(var F="",X=0,Z=b.length;X>>18)+B.charAt(ne>>>12&63)+(typeof A!="undefined"?B.charAt(ne>>>6&63):"=")+(typeof z!="undefined"?B.charAt(ne&63):"=")}return N?l(F):F});var d=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,w=function(b){switch(b.length){case 4:var N=(7&b.charCodeAt(0))<<18|(63&b.charCodeAt(1))<<12|(63&b.charCodeAt(2))<<6|63&b.charCodeAt(3),F=N-65536;return L((F>>>10)+55296)+L((F&1023)+56320);case 3:return L((15&b.charCodeAt(0))<<12|(63&b.charCodeAt(1))<<6|63&b.charCodeAt(2));default:return L((31&b.charCodeAt(0))<<6|63&b.charCodeAt(1))}},T=function(b){return b.replace(d,w)},x=function(b){var N=b.length,F=N%4,X=(N>0?M[b.charAt(0)]<<18:0)|(N>1?M[b.charAt(1)]<<12:0)|(N>2?M[b.charAt(2)]<<6:0)|(N>3?M[b.charAt(3)]:0),Z=[L(X>>>16),L(X>>>8&255),L(X&255)];return Z.length-=[0,0,2,1][F],Z.join("")},O=Y.atob&&typeof Y.atob=="function"?function(b){return Y.atob(b)}:function(b){return b.replace(/\S{1,4}/g,x)},E=function(b){return O(String(b).replace(/[^A-Za-z0-9\+\/]/g,""))},v=function(b){return T(O(b))},_=function(b){return String(b).replace(/[-_]/g,function(N){return N=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},f=function(b){return v(_(b))},c;Y.Uint8Array&&(c=function(b){return Uint8Array.from(E(_(b)),function(N){return N.charCodeAt(0)})});var S=function(){var b=Y.Base64;return Y.Base64=W,b};if(Y.Base64={VERSION:R,atob:E,btoa:h,fromBase64:f,toBase64:i,utob:m,encode:i,encodeURI:r,btou:T,decode:f,noConflict:S,fromUint8Array:n,toUint8Array:c},typeof Object.defineProperty=="function"){var y=function(b){return{value:b,enumerable:!1,writable:!0,configurable:!0}};Y.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",y(function(){return f(this)})),Object.defineProperty(String.prototype,"toBase64",y(function(b){return i(this,b)})),Object.defineProperty(String.prototype,"toBase64URI",y(function(){return i(this,!0)}))}}return Y.Meteor&&(Base64=Y.Base64),Be.exports?Be.exports.Base64=Y.Base64:!(V=[],P=function(){return Y.Base64}.apply(we,V),P!==void 0&&(Be.exports=P)),{Base64:Y.Base64}})}).call(this,k("IyRk"))},JOrW:function(Be,we,k){Be.exports=k.p+"static/gf.09d89ab3.svg"},LdHM:function(Be,we,k){"use strict";k.d(we,"b",function(){return d}),k.d(we,"a",function(){return T});var ee=k("1OyB"),V=k("vuIU"),P=k("Ji7U"),Y=k("LK+K"),W=k("q1tI"),R=k("rePB"),B=k("Ff2n"),M=k("ODXe"),L=k("4IlW"),I=k("bX4T"),p=k("YrtM"),m=k("TSYQ"),u=k.n(m),h=k("+nKL"),s=k("8OUc"),l=function(z,ne){var ae=z.prefixCls,me=z.id,xe=z.flattenOptions,Te=z.childrenAsData,Oe=z.values,Ue=z.searchValue,De=z.multiple,be=z.defaultActiveFirstOption,ge=z.height,He=z.itemHeight,ct=z.notFoundContent,vt=z.open,_t=z.menuItemSelectedIcon,yt=z.virtual,et=z.onSelect,ht=z.onToggleOpen,xt=z.onActiveValue,Tt=z.onScroll,mt=z.onMouseEnter,Ie="".concat(ae,"-item"),je=Object(p.a)(function(){return xe},[vt,xe],function(Je,Ee){return Ee[0]&&Je[1]!==Ee[1]}),$e=W.useRef(null),at=function(Ee){Ee.preventDefault()},lt=function(Ee){$e.current&&$e.current.scrollTo({index:Ee})},bt=function(Ee){for(var ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,_e=je.length,le=0;le<_e;le+=1){var de=(Ee+le*ye+_e)%_e,ve=je[de],pe=ve.group,Ce=ve.data;if(!pe&&!Ce.disabled)return de}return-1},Mt=W.useState(function(){return bt(0)}),jt=Object(M.a)(Mt,2),Me=jt[0],Pe=jt[1],tt=function(Ee){Pe(Ee);var ye=je[Ee];if(!ye){xt(null,-1);return}xt(ye.data.value,Ee)};W.useEffect(function(){tt(be!==!1?bt(0):-1)},[je.length,Ue]),W.useEffect(function(){var Je=setTimeout(function(){if(!De&&vt&&Oe.size===1){var Ee=Array.from(Oe)[0],ye=je.findIndex(function(_e){var le=_e.data;return le.value===Ee});tt(ye),lt(ye)}});return function(){return clearTimeout(Je)}},[vt]);var rt=function(Ee){Ee!==void 0&&et(Ee,{selected:!Oe.has(Ee)}),De||ht(!1)};if(W.useImperativeHandle(ne,function(){return{onKeyDown:function(Ee){var ye=Ee.which;switch(ye){case L.a.UP:case L.a.DOWN:{var _e=0;if(ye===L.a.UP?_e=-1:ye===L.a.DOWN&&(_e=1),_e!==0){var le=bt(Me+_e,_e);lt(le),tt(le)}break}case L.a.ENTER:{var de=je[Me];de&&!de.data.disabled?rt(de.data.value):rt(void 0),vt&&Ee.preventDefault();break}case L.a.ESC:ht(!1)}},onKeyUp:function(){},scrollTo:function(Ee){lt(Ee)}}}),je.length===0)return W.createElement("div",{role:"listbox",id:"".concat(me,"_list"),className:"".concat(Ie,"-empty"),onMouseDown:at},ct);function Fe(Je){var Ee=je[Je];if(!Ee)return null;var ye=Ee.data||{},_e=ye.value,le=ye.label,de=ye.children,ve=Object(I.a)(ye,!0),pe=Te?de:le;return Ee?W.createElement("div",Object.assign({"aria-label":typeof pe=="string"?pe:null},ve,{key:Je,role:"option",id:"".concat(me,"_list_").concat(Je),"aria-selected":Oe.has(_e)}),_e):null}return W.createElement(W.Fragment,null,W.createElement("div",{role:"listbox",id:"".concat(me,"_list"),style:{height:0,width:0,overflow:"hidden"}},Fe(Me-1),Fe(Me),Fe(Me+1)),W.createElement(h.a,{itemKey:"key",ref:$e,data:je,height:ge,itemHeight:He,fullHeight:!1,onMouseDown:at,onScroll:Tt,virtual:yt,onMouseEnter:mt},function(Je,Ee){var ye,_e=Je.group,le=Je.groupOption,de=Je.data,ve=de.label,pe=de.key;if(_e)return W.createElement("div",{className:u()(Ie,"".concat(Ie,"-group"))},ve!==void 0?ve:pe);var Ce=de.disabled,Ke=de.value,st=de.title,At=de.children,Ft=de.style,kt=de.className,wt=Object(B.a)(de,["disabled","value","title","children","style","className"]),Qe=Oe.has(Ke),it="".concat(Ie,"-option"),We=u()(Ie,it,kt,(ye={},Object(R.a)(ye,"".concat(it,"-grouped"),le),Object(R.a)(ye,"".concat(it,"-active"),Me===Ee&&!Ce),Object(R.a)(ye,"".concat(it,"-disabled"),Ce),Object(R.a)(ye,"".concat(it,"-selected"),Qe),ye)),ce=Te?At:ve,Se=!_t||typeof _t=="function"||Qe;return W.createElement("div",Object.assign({},wt,{"aria-selected":Qe,className:We,title:st,onMouseMove:function(){if(Me===Ee||Ce)return;tt(Ee)},onClick:function(){Ce||rt(Ke)},style:Ft}),W.createElement("div",{className:"".concat(it,"-content")},ce||Ke),W.isValidElement(_t)||Qe,Se&&W.createElement(s.a,{className:"".concat(Ie,"-option-state"),customizeIcon:_t,customizeIconProps:{isSelected:Qe}},Qe?"\u2713":null))}))},i=W.forwardRef(l);i.displayName="OptionList";var r=i,n=function(){return null};n.isSelectOption=!0;var d=n,w=function(){return null};w.isSelectOptGroup=!0;var T=w,x=k("VTBJ"),O=k("Zm9Q");function E(A){var z=A.key,ne=A.props,ae=ne.children,me=ne.value,xe=Object(B.a)(ne,["children","value"]);return Object(x.a)({key:z,value:me!==void 0?me:z,children:ae},xe)}function v(A){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(O.a)(A).map(function(ne,ae){if(!W.isValidElement(ne)||!ne.type)return null;var me=ne.type.isSelectOptGroup,xe=ne.key,Te=ne.props,Oe=Te.children,Ue=Object(B.a)(Te,["children"]);return z||!me?E(ne):Object(x.a)(Object(x.a)({key:"__RC_SELECT_GRP__".concat(xe===null?ae:xe,"__"),label:xe},Ue),{},{options:v(Oe)})}).filter(function(ne){return ne})}var _=k("2Qr1"),f=k("qNPg"),c=k("U8pU"),S=k("Kwbf"),y=k("WKfj");function b(A){var z=A.mode,ne=A.options,ae=A.children,me=A.backfill,xe=A.allowClear,Te=A.placeholder,Oe=A.getInputElement,Ue=A.showSearch,De=A.onSearch,be=A.defaultOpen,ge=A.autoFocus,He=A.labelInValue,ct=A.value,vt=A.inputValue,_t=A.optionLabelProp,yt=z==="multiple"||z==="tags",et=Ue!==void 0?Ue:yt||z==="combobox",ht=ne||v(ae);if(Object(S.a)(z!=="tags"||ht.every(function(Ie){return!Ie.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),z==="tags"||z==="combobox"){var xt=ht.some(function(Ie){return Ie.options?Ie.options.some(function(je){return typeof("value"in je?je.value:je.key)=="number"}):typeof("value"in Ie?Ie.value:Ie.key)=="number"});Object(S.a)(!xt,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(S.a)(z!=="combobox"||!_t,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(S.a)(z==="combobox"||!me,"`backfill` only works with `combobox` mode."),Object(S.a)(z==="combobox"||!Oe,"`getInputElement` only work with `combobox` mode."),Object(S.b)(z!=="combobox"||!Oe||!xe||!Te,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),De&&!et&&z!=="combobox"&&z!=="tags"&&Object(S.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(S.b)(!be||ge,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),ct!=null){var Tt=Object(y.d)(ct);Object(S.a)(!He||Tt.every(function(Ie){return Object(c.a)(Ie)==="object"&&("key"in Ie||"value"in Ie)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(S.a)(!yt||Array.isArray(ct),"`value` should be array when `mode` is `multiple` or `tags`")}if(ae){var mt=null;Object(O.a)(ae).some(function(Ie){if(!W.isValidElement(Ie)||!Ie.type)return!1;var je=Ie.type;if(je.isSelectOption)return!1;if(je.isSelectOptGroup){var $e=Object(O.a)(Ie.props.children).every(function(at){return!W.isValidElement(at)||!Ie.type||at.type.isSelectOption?!0:(mt=at.type,!1)});return!$e}return mt=je,!0}),mt&&Object(S.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(mt.displayName||mt.name||mt,"`.")),Object(S.a)(vt===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var N=b,F=Object(f.a)({prefixCls:"rc-select",components:{optionList:r},convertChildrenToData:v,flattenOptions:_.d,getLabeledValue:_.e,filterOptions:_.b,isValueDisabled:_.g,findValueOption:_.c,warningProps:N,fillOptionsWithMissingValue:_.a}),X=function(A){Object(P.a)(ne,A);var z=Object(Y.a)(ne);function ne(){var ae;return Object(ee.a)(this,ne),ae=z.apply(this,arguments),ae.selectRef=W.createRef(),ae.focus=function(){ae.selectRef.current.focus()},ae.blur=function(){ae.selectRef.current.blur()},ae}return Object(V.a)(ne,[{key:"render",value:function(){return W.createElement(F,Object.assign({ref:this.selectRef},this.props))}}]),ne}(W.Component);X.Option=d,X.OptGroup=T;var Z=X,H=we.c=Z},M8RZ:function(Be,we,k){"use strict";k.d(we,"a",function(){return L});var ee=k("fWQN"),V=k("mtLc"),P=k("yKVA"),Y=k("879j"),W=k("q1tI"),R=k.n(W),B=k("i8i4"),M=k.n(B),L=function(I){Object(P.a)(m,I);var p=Object(Y.a)(m);function m(u){var h;Object(ee.a)(this,m),h=p.call(this,u);var s=window.document;return h.node=s.createElement("div"),s.body.appendChild(h.node),h}return Object(V.a)(m,[{key:"render",value:function(){var h=this.props.children;return Object(B.createPortal)(h,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),m}(R.a.Component)},MFOe:function(Be,we,k){(function(ee){var V=R(),P=B(),Y=M(),W=typeof window!="undefined"?window:ee;Be.exports={assign:V,create:P,trim:Y,bind:L,slice:I,each:p,map:m,pluck:u,isList:h,isFunction:s,isObject:l,Global:W};function R(){return Object.assign?Object.assign:function(r,n,d,w){for(var T=1;T=0;l-=1){var i=M.get(l)||new Set;i.forEach(function(r){var n=r.parent,d=r.node;if(I(d)||!r.parent||s.has(r.parent.key))return;if(I(r.parent.node)){s.add(n.key);return}var w=!0,T=!1;(n.children||[]).filter(function(x){return!I(x.node)}).forEach(function(x){var O=x.key,E=p.has(O);w&&!E&&(w=!1),!T&&(E||m.has(O))&&(T=!0)}),w&&p.add(n.key),T&&m.add(n.key),s.add(n.key)})}return{checkedKeys:Array.from(p),halfCheckedKeys:Array.from(V(m,p))}}function W(B,M,L,I,p){for(var m=new Set(B),u=new Set(M),h=0;h<=I;h+=1){var s=L.get(h)||new Set;s.forEach(function(n){var d=n.key,w=n.node,T=n.children,x=T===void 0?[]:T;!m.has(d)&&!u.has(d)&&!p(w)&&x.filter(function(O){return!p(O.node)}).forEach(function(O){m.delete(O.key)})})}u=new Set;for(var l=new Set,i=I;i>=0;i-=1){var r=L.get(i)||new Set;r.forEach(function(n){var d=n.parent,w=n.node;if(p(w)||!n.parent||l.has(n.parent.key))return;if(p(n.parent.node)){l.add(d.key);return}var T=!0,x=!1;(d.children||[]).filter(function(O){return!p(O.node)}).forEach(function(O){var E=O.key,v=m.has(E);T&&!v&&(T=!1),!x&&(v||u.has(E))&&(x=!0)}),T||m.delete(d.key),x&&u.add(d.key),l.add(d.key)})}return{checkedKeys:Array.from(m),halfCheckedKeys:Array.from(V(u,m))}}function R(B,M,L,I){var p=[],m;I?m=I:m=P;var u=new Set(B.filter(function(i){var r=!!L[i];return r||p.push(i),r})),h=new Map,s=0;Object.keys(L).forEach(function(i){var r=L[i],n=r.level,d=h.get(n);d||(d=new Set,h.set(n,d)),d.add(r),s=Math.max(s,n)}),Object(ee.a)(!p.length,"Tree missing follow keys: ".concat(p.slice(0,100).map(function(i){return"'".concat(i,"'")}).join(", ")));var l;return M===!0?l=Y(u,h,s,m):l=W(u,M.halfCheckedKeys,h,s,m),l}},OLES:function(Be,we,k){"use strict";var ee=k("U8pU"),V=k("VTBJ"),P=k("Ff2n"),Y=k("q1tI"),W=k("uciX"),R=k("7ixt"),B=function(u){var h=u.overlay,s=u.prefixCls,l=u.id,i=u.overlayInnerStyle;return Y.createElement("div",{className:"".concat(s,"-inner"),id:l,role:"tooltip",style:i},typeof h=="function"?h():h)},M=B,L=function(u,h){var s=u.overlayClassName,l=u.trigger,i=l===void 0?["hover"]:l,r=u.mouseEnterDelay,n=r===void 0?0:r,d=u.mouseLeaveDelay,w=d===void 0?.1:d,T=u.overlayStyle,x=u.prefixCls,O=x===void 0?"rc-tooltip":x,E=u.children,v=u.onVisibleChange,_=u.afterVisibleChange,f=u.transitionName,c=u.animation,S=u.placement,y=S===void 0?"right":S,b=u.align,N=b===void 0?{}:b,F=u.destroyTooltipOnHide,X=F===void 0?!1:F,Z=u.defaultVisible,H=u.getTooltipContainer,A=u.overlayInnerStyle,z=Object(P.a)(u,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),ne=Object(Y.useRef)(null);Object(Y.useImperativeHandle)(h,function(){return ne.current});var ae=Object(V.a)({},z);"visible"in u&&(ae.popupVisible=u.visible);var me=function(){var De=u.arrowContent,be=De===void 0?null:De,ge=u.overlay,He=u.id;return[Y.createElement("div",{className:"".concat(O,"-arrow"),key:"arrow"},be),Y.createElement(M,{key:"content",prefixCls:O,id:He,overlay:ge,overlayInnerStyle:A})]},xe=!1,Te=!1;if(typeof X=="boolean")xe=X;else if(X&&Object(ee.a)(X)==="object"){var Oe=X.keepParent;xe=Oe===!0,Te=Oe===!1}return Y.createElement(W.a,Object.assign({popupClassName:s,prefixCls:O,popup:me,action:i,builtinPlacements:R.a,popupPlacement:y,ref:ne,popupAlign:N,getPopupContainer:H,onPopupVisibleChange:v,afterPopupVisibleChange:_,popupTransitionName:f,popupAnimation:c,defaultPopupVisible:Z,destroyPopupOnHide:xe,autoDestroy:Te,mouseLeaveDelay:w,popupStyle:T,mouseEnterDelay:n},ae),E)},I=Object(Y.forwardRef)(L),p=we.a=I},OZM5:function(Be,we,k){"use strict";k.d(we,"b",function(){return I}),k.d(we,"a",function(){return p}),k.d(we,"k",function(){return m}),k.d(we,"h",function(){return u}),k.d(we,"i",function(){return h}),k.d(we,"g",function(){return s}),k.d(we,"c",function(){return l}),k.d(we,"d",function(){return i}),k.d(we,"j",function(){return d}),k.d(we,"e",function(){return w}),k.d(we,"f",function(){return T});var ee=k("KQm4"),V=k("U8pU"),P=k("Ff2n"),Y=k("q1tI"),W=k.n(Y),R=k("Kwbf"),B=k("WaYH"),M=.25,L=2;function I(x,O){var E=x.slice(),v=E.indexOf(O);return v>=0&&E.splice(v,1),E}function p(x,O){var E=x.slice();return E.indexOf(O)===-1&&E.push(O),E}function m(x){return x.split("-")}function u(x,O){return"".concat(x,"-").concat(O)}function h(x){return x&&x.type&&x.type.isTreeNode}function s(x,O){var E=[x],v=O[x];function _(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];f.forEach(function(c){var S=c.key,y=c.children;E.push(S),_(y)})}return _(v.children),E}function l(x,O){var E=x.clientY,v=O.selectHandle.getBoundingClientRect(),_=v.top,f=v.bottom,c=v.height,S=Math.max(c*M,L);return E<=_+S?-1:E>=f-S?1:0}function i(x,O){if(!x)return;var E=O.multiple;return E?x.slice():x.length?[x[0]]:x}var r=function(O){return O};function n(x,O){if(!x)return[];var E=O||{},v=E.processProps,_=v===void 0?r:v,f=Array.isArray(x)?x:[x];return f.map(function(c){var S=c.children,y=Object(P.a)(c,["children"]),b=n(S,O);return W.a.createElement(B.a,Object.assign({},_(y)),b)})}function d(x){if(!x)return null;var O;if(Array.isArray(x))O={checkedKeys:x,halfCheckedKeys:void 0};else if(Object(V.a)(x)==="object")O={checkedKeys:x.checked||void 0,halfCheckedKeys:x.halfChecked||void 0};else return Object(R.a)(!1,"`checkedKeys` is not an array or an object"),null;return O}function w(x,O){var E=new Set;function v(_){if(E.has(_))return;var f=O[_];if(!f)return;E.add(_);var c=f.parent,S=f.node;if(S.disabled)return;c&&v(c.key)}return(x||[]).forEach(function(_){v(_)}),Object(ee.a)(E)}function T(x){var O={};return Object.keys(x).forEach(function(E){(E.startsWith("data-")||E.startsWith("aria-"))&&(O[E]=x[E])}),O}},"OkW/":function(Be,we,k){},Ot1p:function(Be,we,k){"use strict";var ee=k("2qtc"),V=k("kLXV"),P=k("rAM+"),Y=k("miYZ"),W=k("tsqr"),R=k("9og8"),B=k("tJVT"),M=k("jrin"),L=k("WmNS"),I=k.n(L),p=k("q1tI"),m=k.n(p),u=k("VrN/"),h=k.n(u),s=k("bdgK"),l=k("p77/"),i=k("Bd2K"),r=k("ELLl"),n=k("19Vz"),d=k("lZu9"),w=k("+NIl"),T=k("kSUc"),x=k("9Bee"),O=function(Ce){var Ke=Ce.value,st=Ke===void 0?"":Ke,At=Ce.className,Ft=Ce.showTextOnly,kt=Ce.showLines,wt=Ce.style,Qe=wt===void 0?{}:wt,it=Object(p.useMemo)(function(){return""},[st]);return m.a.createElement(m.a.Fragment,null,m.a.createElement("div",{dangerouslySetInnerHTML:{__html:it}}))},E=k("0Owb"),v=k("dejd"),_=k("C+DQ"),f=k("1vsH"),c=k("m3rI"),S=[{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 y(Ce){var Ke=Ce.onActionCallback,st=Ce.title,At=Ce.icon,Ft=Ce.actionName,kt=Ce.className,wt=kt===void 0?"":kt,Qe=Ce.children;function it(){Ke(Ft)}return m.a.createElement("a",{title:st,className:wt,onClick:it},m.a.createElement("i",{className:"md-iconfont ".concat(At)}),Qe)}var b=function(Ce){var Ke=Ce.watch,st=Ce.showNullButton,At=Ce.onActionCallback,Ft=Ce.fullScreen,kt=Ce.insertTemp,wt=Ce.hidetoolBar,Qe=Ce.uuid,it=Ce.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(f.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(f.F)("_educoder_session"),"&key=").concat(Qe,"&api=").concat(encodeURIComponent(c.a.PROXY_SERVER)));var We=[].concat(S,[{title:"".concat(Ke?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ke?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return m.a.createElement("ul",{className:"markdown-toolbar-container"},!wt&&We.map(function(ce,Se){return m.a.createElement("li",{key:Se},ce.actionName?m.a.createElement(y,Object(E.a)({},ce,{onActionCallback:At})):m.a.createElement("span",{className:"v-line"}))}),st?m.a.createElement("li",null,m.a.createElement(y,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:At},m.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,kt&&m.a.createElement("li",null,m.a.createElement(y,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(kt),onActionCallback:At},m.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),m.a.createElement("li",{className:"btn-full-screen"},m.a.createElement(y,{icon:"".concat(Ft?"icon-shrink":"icon-enlarge"),title:Ft?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:At})))},N=k("M8RZ"),F=k("+L6B"),X=k("2/Rp"),Z=k("y8nQ"),H=k("Vl3Y"),A=k("5NDa"),z=k("5rEg"),ne={labelCol:{span:4},wrapperCol:{span:20}},ae=function(Ce){var Ke=Ce.callback,st=Ce.onCancel;function At(Ft){Ke(Ft)}return m.a.createElement(H.a,Object(E.a)({},ne,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:At}),m.a.createElement(H.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},m.a.createElement(z.a,null)),m.a.createElement(H.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},m.a.createElement(z.a,null)),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(X.a,{type:"ghost",onClick:st},"\u53D6\u6D88")))},me=k("7ahc"),xe=k("HmJG"),Te=k("BjJ7"),Oe=H.a.useForm,Ue={width:280,marginRight:10},De={labelCol:{span:5},wrapperCol:{span:19}},be=function(Ce){var Ke=Ce.callback,st=Ce.onCancel,At=Oe(),Ft=Object(B.a)(At,1),kt=Ft[0];function wt(We){Ke(We)}function Qe(We,ce){if(We.status===-1){W.b.error(We.message);return}kt.setFieldsValue({src:"/api/attachments/".concat(We.id),type:ce.type})}function it(We){var ce=We.target.files[0];He(ce,Qe)}return m.a.createElement(H.a,Object(E.a)({form:kt},De,{className:"upload-image-panel",onFinish:wt}),m.a.createElement(H.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},m.a.createElement("div",{className:"flex-container"},m.a.createElement(H.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},m.a.createElement(z.a,{style:Ue})),m.a.createElement(ge,{onFileChange:it}))),m.a.createElement(H.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},m.a.createElement(z.a,{style:{width:264}})),m.a.createElement(H.a.Item,{style:{textAlign:"right"}},m.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(X.a,{type:"ghost",onClick:st},"\u53D6\u6D88")))};function ge(Ce){var Ke=Ce.onFileChange;return m.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",m.a.createElement("input",{type:"file",onChange:Ke}))}function He(Ce,Ke){if(!Ce)throw new String("\u6CA1\u6709\u6587\u4EF6");var st=new FormData;st.append("editormd-image-file",Ce),st.append("file_param_name","editormd-image-file"),st.append("byxhr","true");var At=new window.XMLHttpRequest;At.withCredentials=!0,At.addEventListener("load",function(Ft){Ke(JSON.parse(Ft.target.responseText),Ce)},!1),At.addEventListener("error",function(Ft){console.error(Ft)},!1),At.open("POST","".concat(Te.a,"/api/attachments.json")),At.send(st)}var ct=k("giR+"),vt=k("fyUT"),_t=k("7Kak"),yt=k("9yH6"),et=yt.a.Group,ht={margin:"0 8px"},xt=function(Ce){var Ke=Ce.callback,st=Ce.onCancel;function At(Ft){Ke(Ft)}return m.a.createElement(H.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:At},m.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},m.a.createElement("span",{style:ht},"\u5355\u5143\u683C\u6570\uFF1A"),m.a.createElement("span",{style:ht},"\u884C\u6570"),m.a.createElement(H.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},m.a.createElement(vt.a,null)),m.a.createElement("span",{style:ht},"\u5217\u6570"),m.a.createElement(H.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},m.a.createElement(vt.a,null))),m.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},m.a.createElement("span",{style:ht},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),m.a.createElement(H.a.Item,{name:"align"},m.a.createElement(et,null,m.a.createElement(yt.a,{value:"default"},m.a.createElement("i",{className:"fa fa-align-justify"})),m.a.createElement(yt.a,{value:"left"},m.a.createElement("i",{className:"fa fa-align-left"})),m.a.createElement(yt.a,{value:"center"},m.a.createElement("i",{className:"fa fa-align-center"})),m.a.createElement(yt.a,{value:"right"},m.a.createElement("i",{className:"fa fa-align-right"}))))),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(X.a,{type:"ghost",onClick:st},"\u53D6\u6D88")))},Tt=k("ErOA"),mt=k("7Cbv"),Ie="link",je="upload-image",$e="code-block",at="add-table",lt="------------",bt={default:lt,left:":".concat(lt),center:":".concat(lt,":"),right:"".concat(lt,":")},Mt=k("9VGf"),jt,Me;function Pe(){}var tt=0,rt=1e4,Fe="\u2581",Je=` **\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 Ee(Ce){return/^\d+$/.test(Ce)?"".concat(Ce,"px"):Ce}var ye=navigator.platform.toUpperCase().indexOf("MAC")>=0,_e=ye?"Cmd":"Ctrl",le=["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"],de=(jt={},Object(M.a)(jt,_e+"-B","bold"),Object(M.a)(jt,_e+"-I","italic"),jt),ve=(Me={},Object(M.a)(Me,Ie,"\u6DFB\u52A0\u94FE\u63A5"),Object(M.a)(Me,$e,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(M.a)(Me,je,"\u6DFB\u52A0\u6587\u4EF6"),Object(M.a)(Me,at,"\u6DFB\u52A0\u8868\u683C"),Me),pe=we.a=function(Ce){var Ke=Ce.defaultValue,st=Ke===void 0?"":Ke,At=Ce.onChange,Ft=Ce.width,kt=Ft===void 0?"100%":Ft,wt=Ce.height,Qe=wt===void 0?400:wt,it=Ce.miniToolbar,We=it===void 0?!1:it,ce=Ce.isFocus,Se=ce===void 0?!1:ce,ot=Ce.watch,ze=Ce.insertTemp,Lt=Ce.mode,Dt=Lt===void 0?"markdown":Lt,ke=Ce.id,qe=ke===void 0?"markdown-editor-id":ke,Rt=Ce.showResizeBar,Pt=Rt===void 0?!1:Rt,$t=Ce.noStorage,fe=$t===void 0?!1:$t,se=Ce.showNullButton,U=se===void 0?!1:se,G=Ce.hidetoolBar,Q=G===void 0?!1:G,te=Ce.fullScreen,he=te===void 0?!1:te,Le=Ce.onBlur,Ge=Ce.onCMBeforeChange,Ot=Ce.onFullScreen,Nt=Ce.className,Xe=Nt===void 0?"":Nt,It=Ce.disablePaste,an=It===void 0?!1:It,Ct=Ce.placeholder,pn=Ct===void 0?"":Ct,nn=Ce.values,$=nn===void 0?"":nn,C=Object(p.useState)(null),D=Object(B.a)(C,2),K=D[0],re=D[1],J=Object(p.useState)(st),Re=Object(B.a)(J,2),ut=Re[0],St=Re[1],Yt=Object(p.useState)(ot),dt=Object(B.a)(Yt,2),Gt=dt[0],sn=dt[1],Wn=Object(p.useState)(he),Si=Object(B.a)(Wn,2),hi=Si[0],Fn=Si[1],di=Object(p.useState)(""),Zi=Object(B.a)(di,2),_i=Zi[0],ri=Zi[1],wi=Object(p.useState)(0),Di=Object(B.a)(wi,2),Oi=Di[0],Ri=Di[1],Vi=Object(p.useState)(Qe),cr=Object(B.a)(Vi,2),rr=cr[0],ji=cr[1],Wi=Object(p.useState)(!1),hr=Object(B.a)(Wi,2),Tr=hr[0],ar=hr[1],Hn=Object(p.useRef)(Object(mt.a)()),Cn=Object(p.useRef)(!1),yi=Object(p.useRef)(),Nn=Object(p.useRef)(),Ti=Object(p.useRef)(),ii=Object(p.useRef)(),Cr=Object(p.useRef)(),Ni=function(){var mn=Object(R.a)(I.a.mark(function On(){var _n,jn;return I.a.wrap(function(un){for(;;)switch(un.prev=un.next){case 0:return un.next=2,Object(Tt.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Hn.current}});case 2:jn=un.sent,jn!=null&&(_n=jn.attachments)!==null&&_n!==void 0&&_n.length&&(console.log("cm:",K,Nn),jn.attachments.map(function(Bn){Bn.content_type.indexOf("image")>-1?K.replaceSelection("![,](/api/attachments/".concat(Bn.id,"?type=").concat(Bn.content_type,")")):Bn.content_type.indexOf("video")>-1?K.replaceSelection('')):Bn.content_type.indexOf("pdf")>-1?K.replaceSelection('
    ').concat(Bn.name,"")):K.replaceSelection("[".concat(Bn.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(Bn.id,"?type=").concat(Bn.content_type,")"))}));case 4:case"end":return un.stop()}},On)}));return function(){return mn.apply(this,arguments)}}();Object(p.useEffect)(function(){St($),K==null||K.setValue($)},[$]),Object(p.useEffect)(function(){Ot==null||Ot(hi)},[hi]),Object(p.useEffect)(function(){if(Nn.current){var mn=h.a.fromTextArea(Nn.current,{mode:Dt,lineNumbers:!We,lineWrapping:!0,value:st,autoCloseTags:!0,autoCloseBrackets:!0});Se&&mn.focus();function On(_n,jn){if(an){jn.preventDefault();return}var Jn=jn.clipboardData;if(Jn){var un=Jn.types.toString(),Bn=Jn.items;if(un==="Files"||Jn.types.indexOf("Files")>-1){if(jn.preventDefault(),Dt=="stex")return;try{var Ai,Yi=Bn[1];((Ai=Bn[0])===null||Ai===void 0?void 0:Ai.kind)==="file"&&(Yi=Bn[0]);var Xn=Yi.getAsFile(),_r=Xn.name.split(".").pop();He(Xn,function(oi){if(oi.id){var Ye,pt,Kt;(Xn==null||((Ye=Xn.type)===null||Ye===void 0)?void 0:Ye.indexOf("image"))>-1?mn.replaceSelection("![,](/api/attachments/".concat(oi.id,"?type=").concat(oi.content_type,")")):(Xn==null||((pt=Xn.type)===null||pt===void 0)?void 0:pt.indexOf("video"))>-1?mn.replaceSelection('')):(Xn==null||((Kt=Xn.type)===null||Kt===void 0)?void 0:Kt.indexOf("pdf"))>-1?mn.replaceSelection('').concat(Xn.name,"")):le.includes(_r)?mn.replaceSelection('').concat(Xn.name,"")):mn.replaceSelection("[".concat(Xn.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(oi.id,"?type=").concat(oi.content_type,")"))}else(oi==null?void 0:oi.status)===401&&(document.location.href="/user/login")})}catch(oi){W.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return mn.on("paste",On),mn.on("dragleave",function(_n,jn){Ti.current.classList.remove("mouse-hover-md")}),mn.on("dragover",function(_n,jn){Ti.current.classList.add("mouse-hover-md")}),mn.on("drop",function(_n,jn){Ti.current.classList.add("mouse-hover-md");var Jn;if(Jn=jn.dataTransfer.files,Jn.length>0){jn.preventDefault(),jn.stopPropagation();for(var un=function(Yi){var Xn=Jn[Yi],_r=Xn.name.split(".").pop();He(Xn,function(oi){if(oi.id){var Ye,pt,Kt;(Xn==null||((Ye=Xn.type)===null||Ye===void 0)?void 0:Ye.indexOf("image"))>-1?mn.replaceSelection("![,](/api/attachments/".concat(oi.id,"?type=").concat(oi.content_type,")")):(Xn==null||((pt=Xn.type)===null||pt===void 0)?void 0:pt.indexOf("video"))>-1?mn.replaceSelection('')):(Xn==null||((Kt=Xn.type)===null||Kt===void 0)?void 0:Kt.indexOf("pdf"))>-1?mn.replaceSelection('').concat(Xn.name,"")):le.includes(_r)?mn.replaceSelection('').concat(Xn.name,"")):mn.replaceSelection("[".concat(Xn.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(oi.id,"?type=").concat(oi.content_type,")"))}else(oi==null?void 0:oi.status)===401&&(document.location.href="/user/login")})},Bn=0;Bn0||Bn.target.offsetWidth>0)&&(Xi(),K.setSize("100%","100%"),K.refresh())}}catch(Ai){Jn.e(Ai)}finally{Jn.f()}});return _n.observe(Nn.current.parentElement),_n}if(K){var On=mn();return function(){On.unobserve(Nn.current.parentElement)}}},[K,Xi]),Object(p.useEffect)(function(){if(K){for(var mn=[],On=function(){var Bn=jn[_n];Jn=Object(B.a)(Bn,2);var Ai=Jn[0],Yi=Jn[1],Xn=Object(M.a)({},Ai,function(){lr(Yi)});mn.push(Xn),K.addKeyMap(Xn)},_n=0,jn=Object.entries(de);_n0){var mn=new Date().getTime(),On=window.sessionStorage.getItem(qe);mn>=Oi+rt&&(!On||On!==ut)&&(window.sessionStorage.setItem(qe,ut),ar(!0))}},rt),Object(p.useEffect)(function(){sn(ot)},[K,ot]),Object(p.useEffect)(function(){K&&(Se&&K.focus())},[K,Se]),Object(p.useEffect)(function(){if(Gt&&K){var mn=K.getScrollerElement();function On(_n){var jn=_n.target;if(Cr.current){var Jn=jn.scrollTop/jn.scrollHeight;Cr.current.scrollTop=Cr.current.scrollHeight*Jn}}return mn.addEventListener("scroll",On),function(){mn.removeEventListener("scroll",On)}}},[K,Gt]),Object(p.useEffect)(function(){if(K&&Ge){function mn(On,_n){Ge(On,_n)}return K.on("beforeChange",mn),function(){K.off("beforeChange",mn)}}},[K,Ge]),Object(p.useEffect)(function(){if(K&&Le){function mn(){Le(K.getValue())}return K.on("blur",mn),function(){K.off("blur",mn)}}},[K,Le]),Object(p.useEffect)(function(){if(K){function mn(On){var _n=On.getValue();St(_n),Ri(new Date().getTime()),On.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),At&&At(_n)}return K.on("change",mn),function(){K.off("change",mn)}}},[K,At]),Object(p.useEffect)(function(){K&&(st==null?(K.setValue(""),St("")):st!==K.getValue()&&(K.setValue(st),St(st),K.setCursor(K.lineCount(),0)))},[K,st]);var lr=Object(p.useCallback)(function(mn){var On=K.getCursor(),_n=K.getSelection(),jn=_n.split(` `);switch(mn){case"bold":return K.replaceSelection("**"+_n+"**"),_n===""&&K.setCursor(On.line,On.ch+2),K.focus();case"italic":return K.replaceSelection("*"+_n+"*"),_n===""&&K.setCursor(On.line,On.ch+1),K.focus();case"code":return K.replaceSelection("`"+_n+"`"),_n===""&&K.setCursor(On.line,On.ch+1),K.focus();case"inline-latex":return K.replaceSelection("`$$"+_n+"$$`"),_n===""&&K.setCursor(On.line,On.ch+3),K.focus();case"latex":return K.replaceSelection("```latex\n"+_n+"\n```"),K.setCursor(On.line+1,_n.length+1),K.focus();case"line-break":return K.replaceSelection(`
    `),K.focus();case"list-ul":return _n===""?K.replaceSelection("- "+_n):K.replaceSelection(jn.map(function(Jn){return Jn===""?"":"- ".concat(Jn)}).join(` `)),K.focus();case"list-ol":return _n===""?K.replaceSelection("1. "+_n):K.replaceSelection(jn.map(function(Jn,un){return Jn===""?"":"".concat(un+1,". ").concat(Jn)}).join(` `)),K.focus();case"add-null-ch":return _n===""&&K.setCursor(On.line,On.ch+1),K.replaceSelection(Fe),K.focus();case"inster-template-1":return _n===""&&K.setCursor(On.line,On.ch),K.replaceSelection(Je),K.focus();case"eraser":return K.setValue(""),K.focus();case"trigger-watch":return sn(!Gt),K.focus();case"trigger-full-screen":return Fn(!hi),K.focus();case Ie:ri(Ie);return;case $e:ri($e);return;case je:ri(je);return;case at:ri(at);return;default:throw new Error}},[K,Gt,hi]),gr=Object(p.useCallback)(function(mn){ri("");switch(_i){case Ie:var On=mn.title,_n=mn.link;return K.replaceSelection("[".concat(On,"](").concat(_n,")")),K.focus();case $e:var jn=mn.language,Jn=mn.content;return K.replaceSelection(["```"+jn,Jn,"```"].join(` `)),K.focus();case je:var un=mn.src,Bn=mn.alt;return Bn?K.replaceSelection("![ ".concat(Bn," ]( ").concat(un,' "').concat(Bn,'" )')):K.replaceSelection("![,](".concat(un,")")),K.focus();case at:for(var Ai=mn.row,Yi=mn.col,Xn=mn.align,_r=` `,oi=0;oi300&&(Ai=300);var Yi=Qe+Ai+"px";ji(Yi)}}return mn.addEventListener("mousedown",jn),document.addEventListener("mousemove",un),document.addEventListener("mouseup",Jn),function(){mn.removeEventListener("mousedown",jn),document.removeEventListener("mousemove",un),document.removeEventListener("mouseup",Jn)}}},[K,ii]),Object(p.useEffect)(function(){ji(Qe)},[Qe]);var wr=Ee(kt),Xr=Ee(rr),vr={width:wr,height:Xr},Yr=Object(p.useMemo)(function(){if(Oi){var mn=new Date(Oi),On=mn.getHours(),_n=mn.getMinutes(),jn=mn.getSeconds();return On=On<10?"0"+On:On,_n=_n<10?"0"+_n:_n,jn=jn<10?"0"+jn:jn,"".concat(On,":").concat(_n,":").concat(jn)}return 0},[Oi]);function $r(){window.sessionStorage.removeItem(qe),ar(!1),Ri(0)}function fr(){ar(!1),Ri(0),K.setValue(window.sessionStorage.getItem(qe))}function Jr(mn,On){var _n=K.getValue();_n=_n.replace(mn,On),St(_n),K==null||K.setValue(_n)}return m.a.createElement(p.Fragment,null,m.a.createElement("div",{className:"markdown-editor-wrapper",ref:Ti},m.a.createElement("div",{className:"markdown-editor-container ".concat(Xe," ").concat(Gt?"on-preview":""," ").concat(We?"mini":""," ").concat(hi?"full-screen":""),style:vr},m.a.createElement(b,{insertTemp:ze,watch:Gt,fullScreen:hi,showNullButton:U,onActionCallback:lr,hidetoolBar:Q,uuid:Hn.current,setOpenPhones:function(){Cn.current=!0}}),m.a.createElement("div",{className:"markdown-editor-body"},m.a.createElement("div",{className:"codemirror-container"},m.a.createElement("textarea",{ref:Nn,placeholder:pn})),Gt?m.a.createElement("div",{ref:Cr,className:"preview-container"},Dt==="stex"&&m.a.createElement(O,{value:ut}),Dt!=="stex"&&m.a.createElement(x.a,{edit:!0,value:ut,replaces:Jr})):null))),Pt?m.a.createElement("a",{ref:ii,className:"editor-resize"}):null,m.a.createElement(N.a,null,ve[_i]?m.a.createElement(V.a,{centered:!0,title:ve[_i],visible:!0,onCancel:kr,footer:null,className:"markdown-popup-form"},Hr):null))}},P5Jw:function(Be,we,k){"use strict";var ee=k("rHrb"),V=ee.CopyToClipboard;V.CopyToClipboard=V,Be.exports=V},PD8m:function(Be,we){Be.exports={name:"memoryStorage",read:ee,write:V,each:P,remove:Y,clearAll:W};var k={};function ee(R){return k[R]}function V(R,B){k[R]=B}function P(R){for(var B in k)k.hasOwnProperty(B)&&R(k[B],B)}function Y(R){delete k[R]}function W(R){k={}}},RELg:function(Be,we,k){var ee=k("MFOe"),V=ee.Global;Be.exports={name:"oldIE-userDataStorage",write:B,read:M,each:L,remove:I,clearAll:p};var P="storejs",Y=V.document,W=h(),R=(V.navigator?V.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function B(s,l){if(R)return;var i=u(s);W(function(r){r.setAttribute(i,l),r.save(P)})}function M(s){if(R)return;var l=u(s),i=null;return W(function(r){i=r.getAttribute(l)}),i}function L(s){W(function(l){for(var i=l.XMLDocument.documentElement.attributes,r=i.length-1;r>=0;r--){var n=i[r];s(l.getAttribute(n.name),n.name)}})}function I(s){var l=u(s);W(function(i){i.removeAttribute(l),i.save(P)})}function p(){W(function(s){var l=s.XMLDocument.documentElement.attributes;s.load(P);for(var i=l.length-1;i>=0;i--)s.removeAttribute(l[i].name);s.save(P)})}var m=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function u(s){return s.replace(/^\d/,"___$&").replace(m,"___")}function h(){if(!Y||!Y.documentElement||!Y.documentElement.addBehavior)return null;var s="script",l,i,r;try{i=new ActiveXObject("htmlfile"),i.open(),i.write("<"+s+">document.w=window'),i.close(),l=i.w.frames[0].document,r=l.createElement("div")}catch(n){r=Y.createElement("div"),l=Y.body}return function(n){var d=[].slice.call(arguments,0);d.unshift(r),l.appendChild(r),r.addBehavior("#default#userData"),r.load(P),n.apply(this,d),l.removeChild(r);return}}},RpDr:function(Be,we,k){"use strict";k.d(we,"a",function(){return x}),k.d(we,"c",function(){return v});var ee=k("+L6B"),V=k("2/Rp"),P=k("tJVT"),Y=k("k1fw"),W=k("jrin"),R=k("5NDa"),B=k("5rEg"),M=k("q1tI"),L=k.n(M),I=k("8Skl"),p=k("y3Kf"),m=k("bdLU"),u=k("J66h"),h=k.n(u),s=k("++UQ"),l=k.n(s),i=k("IxHN"),r=k("9Bee"),n=k("1vsH"),d,w=B.a.TextArea,T={visible:!1,tabIndex:"0"},x=(d={},Object(W.a)(d,m.a.NOMATCH,"\u6D4B\u8BD5\u7528\u4F8B\u7ED3\u679C\u4E0D\u5339\u914D"),Object(W.a)(d,m.a.OK,"\u8C03\u8BD5\u901A\u8FC7"),Object(W.a)(d,2,"\u8C03\u8BD5\u8D85\u65F6"),Object(W.a)(d,3,"\u8C03\u8BD5pod\u5931\u8D25"),Object(W.a)(d,4,"\u7F16\u8BD1\u5931\u8D25"),Object(W.a)(d,5,"\u6267\u884C\u5931\u8D25"),d),O;(function(f){f[f.SET_VISIBLE=0]="SET_VISIBLE",f[f.SET_TABINDEX=1]="SET_TABINDEX"})(O||(O={}));function E(f,c){switch(c.type){case O.SET_VISIBLE:return Object(Y.a)(Object(Y.a)({},f),{},{visible:c.payload});case O.SET_TABINDEX:return Object(Y.a)(Object(Y.a)({},f),{},{tabIndex:c.payload});default:throw new Error}}function v(f){var c=f.status,S=f.error_msg,y=f.output,b=f.input,N=f.expected_output,F=f.is_file,X=f.input_file_url,Z=f.output_file_url,H=f.expected_output_file_url,A=null,z={minHeight:150,marginBottom:10,paddingLeft:24,background:"#070f19",color:"#fff"};switch(c){case m.a.NOMATCH:A=L.a.createElement(L.a.Fragment,null,L.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),!F&&L.a.createElement(r.a,{value:b,style:z}),F&&L.a.createElement("div",{style:z},L.a.createElement("a",{onClick:function(){return Object(n.y)(X,b)}},b)),L.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),!F&&L.a.createElement(r.a,{value:y&&u.Base64.decode(y)||"",style:z}),F&&L.a.createElement("div",{style:z},L.a.createElement("a",{onClick:function(){return Object(n.y)(Z,y)}},y)),L.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),!F&&L.a.createElement(r.a,{value:N&&u.Base64.decode(N)||"",style:z}),F&&L.a.createElement("div",{style:z},L.a.createElement("a",{onClick:function(){return Object(n.y)(H,N)}},N)));break;case m.a.EXECUTEFAILURE:A=L.a.createElement(L.a.Fragment,null,L.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!F&&L.a.createElement(r.a,{value:b,style:z}),F&&L.a.createElement("div",{style:z},L.a.createElement("a",{onClick:function(){return Object(n.y)(X,b)}},b)),L.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),L.a.createElement("pre",{className:"error"},u.Base64.decode(S)));break;case m.a.COMPILEFAILURE:A=L.a.createElement(L.a.Fragment,null,L.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!F&&L.a.createElement(r.a,{value:b,style:z}),F&&L.a.createElement("div",{style:z},L.a.createElement("a",{onClick:function(){return Object(n.y)(X,b)}},b)),L.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),L.a.createElement("pre",{className:"error"},u.Base64.decode(S)));break;case m.a.PODFAILURE:A=L.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case m.a.TIMEOUT:A=L.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return L.a.createElement(L.a.Fragment,null," ",A," ")}function _(f){var c=f.status,S=f.error_msg,y=f.execute_time,b=f.output,N=f.input,F=f.expected_output,X=f.is_file,Z=f.input_file_url,H=f.output_file_url,A=f.expected_output_file_url,z=null;switch(c){case m.a.OK:z=L.a.createElement(L.a.Fragment,null,L.a.createElement("p",null,"\u6267\u884C\u7528\u65F6\uFF1A",y),L.a.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A"),L.a.createElement("pre",null,u.Base64.decode(b)));break;case m.a.NOMATCH:z=L.a.createElement(L.a.Fragment,null,L.a.createElement("p",null,"\u8F93\u5165\uFF1A",L.a.createElement("pre",null,N)),L.a.createElement("p",null,"\u8F93\u51FA\uFF1A",b&&u.Base64.decode(b)),L.a.createElement("p",null,"\u9884\u671F\u8F93\u51FA\uFF1A",F&&u.Base64.decode(F)));break;case m.a.EXECUTEFAILURE:z=L.a.createElement(L.a.Fragment,null,L.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",L.a.createElement("pre",null,N)),L.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),L.a.createElement("pre",{className:"error"},u.Base64.decode(S)));break;case m.a.COMPILEFAILURE:z=L.a.createElement(L.a.Fragment,null,L.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",L.a.createElement("pre",null,N)),L.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),L.a.createElement("pre",{className:"error"},u.Base64.decode(S)));break;case m.a.PODFAILURE:z=L.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case m.a.TIMEOUT:z=L.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return L.a.createElement(L.a.Fragment,null," ",z," ")}we.b=function(f){var c=f.id,S=f.input,y=f.debuging,b=f.submitting,N=f.executingMessage,F=f.debugResult,X=f.onChangeInput,Z=f.onDebugCode,H=f.onSubmitCode,A=Object(M.useReducer)(E,T),z=Object(P.a)(A,2),ne=z[0],ae=z[1],me=ne.visible,xe=ne.tabIndex;Object(M.useEffect)(function(){ae({type:O.SET_VISIBLE,payload:!1})},[c]);function Te(be){var ge=be.target.id;ae({type:O.SET_TABINDEX,payload:ge})}function Oe(){ae({type:O.SET_VISIBLE,payload:!me})}var Ue=Object(M.useMemo)(function(){if(F){var be=F.status;return L.a.createElement(L.a.Fragment,null,_(F))}return null},[F]);function De(){ae({type:O.SET_VISIBLE,payload:!0}),ae({type:O.SET_TABINDEX,payload:"1"}),Z()}return L.a.createElement("div",{className:"test-case-panel"},L.a.createElement("div",{className:"test-case-panel-body ".concat(me?"active":"")},L.a.createElement("ul",{className:"s-navs"},L.a.createElement("li",null,L.a.createElement("a",{className:xe==="0"?"active":"",id:"0",onClick:Te},"\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B")),L.a.createElement("li",null,L.a.createElement("a",{className:xe==="1"?"active":"",id:"1",onClick:Te},"\u4EE3\u7801\u6267\u884C\u7ED3\u679C"))),L.a.createElement("div",{className:"tab-panel-body ".concat(xe==="0"?"":"hide")},L.a.createElement(w,{placeholder:"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D",value:S,onChange:X})),L.a.createElement("div",{className:"tab-panel-body ".concat(xe==="1"?"":"hide")},y?L.a.createElement(i.a,{message:N}):F?L.a.createElement("section",{style:{height:200}}," ",Ue," "):L.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"))),L.a.createElement("a",{className:"btn-collapse ".concat(me?"up":""),onClick:Oe},me?L.a.createElement(I.a,null):L.a.createElement(p.a,null)),L.a.createElement("footer",{className:"footer"},L.a.createElement("span",{style:{visibility:"hidden"}},"\u63A7\u5236\u53F0"),L.a.createElement("div",{className:"flex-container"},L.a.createElement(V.a,{id:"oj-prev",className:"btn-blue",type:"ghost"},"\u4E0A\u4E00\u9898"),L.a.createElement(V.a,{id:"oj-next",className:"btn-blue",type:"ghost"},"\u4E0B\u4E00\u9898"),L.a.createElement(V.a,{className:"btn-green",type:"ghost",loading:y,onClick:De},"\u8C03\u8BD5\u4EE3\u7801"),L.a.createElement(V.a,{type:"primary",loading:b,disabled:b,onClick:function(){ae({type:O.SET_VISIBLE,payload:!1}),H()}},"\u8BC4\u6D4B\u5E76\u63D0\u4EA4"))))}},"S/kP":function(Be,we,k){Be.exports=k.p+"static/time.a3dc82f3.svg"},"SA+Z":function(Be,we,k){var ee=k("wTVA"),V=k("EbDI"),P=k("ZhPi"),Y=k("wkBT");function W(R){return ee(R)||V(R)||P(R)||Y()}Be.exports=W,Be.exports.__esModule=!0,Be.exports.default=Be.exports},SJMd:function(Be,we){/** * @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 k,ee,V,P=!1,Y,W;window.PR_SHOULD_USE_CONTINUATION=!0;var R,B;(function(){var M=window,L=["break,continue,do,else,for,if,return,while"],I=[L,"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"],p=[I,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],m=[p,"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"],u=[p,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],h=[p,"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",l=[p,"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",r=[L,"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"],n=[L,"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"],d=[L,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],w=[m,h,u,l,i,r,n,d],T=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,x="str",O="kwd",E="com",v="typ",_="lit",f="pun",c="pln",S="tag",y="dec",b="src",N="atn",F="atv",X="nocode",Z="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function H(et){for(var ht=0,xt=!1,Tt=!1,mt=0,Ie=et.length;mt122||(le<65||_e>90||tt.push([Math.max(65,_e)|32,Math.min(le,90)|32]),le<97||_e>122||tt.push([Math.max(97,_e)&~32,Math.min(le,122)&~32]))}}tt.sort(function(Ce,Ke){return Ce[0]-Ke[0]||Ke[1]-Ce[1]});for(var de=[],ve=[],Je=0;Jepe[0]&&(pe[1]+1>pe[0]&&Fe.push("-"),Fe.push(lt(pe[1])))}return Fe.push("]"),Fe.join("")}function Mt(Me){for(var Pe=Me.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=Pe.length,rt=[],Fe=0,Je=0;Fe=2&&_e==="["?Pe[Fe]=bt(Ee):_e!=="\\"&&(Pe[Fe]=Ee.replace(/[a-zA-Z]/g,function(ve){var pe=ve.charCodeAt(0);return"["+String.fromCharCode(pe&~32,pe|32)+"]"}))}return Pe.join("")}for(var jt=[],mt=0,Ie=et.length;mt=0;)xt[jt.charAt(Me)]=Mt;var Pe=Mt[1],tt=""+Pe;at.hasOwnProperty(tt)||($e.push(Pe),at[tt]=null)}$e.push(/[\0-\uffff]/),Tt=H($e)})();var mt=ht.length,Ie=function(je){for(var $e=je.sourceCode,at=je.basePos,lt=je.sourceNode,bt=[at,c],Mt=0,jt=$e.match(Tt)||[],Me={},Pe=0,tt=jt.length;Pe=5&&Fe.substring(0,5)==="lang-",Ee&&!(Je&&typeof Je[1]=="string")&&(Ee=!1,Fe=b),Ee||(Me[rt]=Fe)}var le=Mt;if(Mt+=rt.length,!Ee)bt.push(at+le,Fe);else{var de=Je[1],ve=rt.indexOf(de),pe=ve+de.length;Je[2]&&(pe=rt.length-Je[2].length,ve=pe-de.length);var Ce=Fe.substring(5);z(lt,at+le,rt.substring(0,ve),Ie,bt),z(lt,at+le+ve,de,ge(Ce,de),bt),z(lt,at+le+pe,rt.substring(pe),Ie,bt)}}je.decorations=bt};return Ie}function xe(et){var ht=[],xt=[];et.tripleQuotedStrings?ht.push([x,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):et.multiLineStrings?ht.push([x,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):ht.push([x,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),et.verbatimStrings&&xt.push([x,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Tt=et.hashComments;Tt&&(et.cStyleComments?(Tt>1?ht.push([E,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):ht.push([E,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),xt.push([x,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):ht.push([E,/^#[^\r\n]*/,null,"#"])),et.cStyleComments&&(xt.push([E,/^\/\/[^\r\n]*/,null]),xt.push([E,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var mt=et.regexLiterals;if(mt){var Ie=mt>1?"":` \r`,je=Ie?".":"[\\S\\s]",$e="/(?=[^/*"+Ie+"])(?:[^/\\x5B\\x5C"+Ie+"]|\\x5C"+je+"|\\x5B(?:[^\\x5C\\x5D"+Ie+"]|\\x5C"+je+")*(?:\\x5D|$))+/";xt.push(["lang-regex",RegExp("^"+Z+"("+$e+")")])}var at=et.types;at&&xt.push([v,at]);var lt=(""+et.keywords).replace(/^ | $/g,"");lt.length&&xt.push([O,new RegExp("^(?:"+lt.replace(/[\s,]+/g,"|")+")\\b"),null]),ht.push([c,/^\s+/,null,` \r \xA0`]);var bt="^.[^\\s\\w.$@'\"`/\\\\]*";return et.regexLiterals&&(bt+="(?!s*/)"),xt.push([_,/^@[a-z_$][a-z_$@0-9]*/i,null],[v,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[c,/^[a-z_$][a-z_$@0-9]*/i,null],[_,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[c,/^\\[\s\S]?/,null],[f,new RegExp(bt),null]),me(ht,xt)}var Te=xe({keywords:w,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Oe(et,ht,xt){for(var Tt=/(?:^|\s)nocode(?:\s|$)/,mt=/\r\n?|\n/,Ie=et.ownerDocument,je=Ie.createElement("li");et.firstChild;)je.appendChild(et.firstChild);var $e=[je];function at(Pe){var tt=Pe.nodeType;if(tt==1&&!Tt.test(Pe.className))if(Pe.nodeName==="br")lt(Pe),Pe.parentNode&&Pe.parentNode.removeChild(Pe);else for(var rt=Pe.firstChild;rt;rt=rt.nextSibling)at(rt);else if((tt==3||tt==4)&&xt){var Fe=Pe.nodeValue,Je=Fe.match(mt);if(Je){var Ee=Fe.substring(0,Je.index);Pe.nodeValue=Ee;var ye=Fe.substring(Je.index+Je[0].length);if(ye){var _e=Pe.parentNode;_e.insertBefore(Ie.createTextNode(ye),Pe.nextSibling)}lt(Pe),Ee||Pe.parentNode.removeChild(Pe)}}}function lt(Pe){for(;!Pe.nextSibling;)if(Pe=Pe.parentNode,!Pe)return;function tt(Je,Ee){var ye=Ee?Je.cloneNode(!1):Je,_e=Je.parentNode;if(_e){var le=tt(_e,1),de=Je.nextSibling;le.appendChild(ye);for(var ve=de;ve;ve=de)de=ve.nextSibling,le.appendChild(ve)}return ye}for(var rt=tt(Pe.nextSibling,0),Fe;(Fe=rt.parentNode)&&Fe.nodeType===1;)rt=Fe;$e.push(rt)}for(var bt=0;bt<$e.length;++bt)at($e[bt]);ht===(ht|0)&&$e[0].setAttribute("value",ht);var Mt=Ie.createElement("ol");Mt.className="linenums";for(var jt=Math.max(0,ht-1|0)||0,bt=0,Me=$e.length;bt=_e&&(at+=2),Ie>=le&&(Mt+=2)}}finally{Fe&&(Fe.style.display=Je)}}var De={};function be(et,ht){for(var xt=ht.length;--xt>=0;){var Tt=ht[xt];De.hasOwnProperty(Tt)?M.console&&console.warn("cannot override language handler %s",Tt):De[Tt]=et}}function ge(et,ht){return et&&De.hasOwnProperty(et)||(et=/^\s*]*(?:>|$)/],[E,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[f,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),be(me([[c,/^[\s]+/,null,` \r `],[F,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[S,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[N,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[f,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),be(me([],[[F,/^[\s\S]+/]]),["uq.val"]),be(xe({keywords:m,hashComments:!0,cStyleComments:!0,types:T}),["c","cc","cpp","cxx","cyc","m"]),be(xe({keywords:"null,true,false"}),["json"]),be(xe({keywords:h,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:T}),["cs"]),be(xe({keywords:u,cStyleComments:!0}),["java"]),be(xe({keywords:d,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),be(xe({keywords:r,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),be(xe({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),be(xe({keywords:n,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),be(xe({keywords:l,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),be(xe({keywords:s,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),be(me([],[[x,/^[\s\S]+/]]),["regex"]);function He(et){var ht=et.langExtension;try{var xt=A(et.sourceNode,et.pre),Tt=xt.sourceCode;et.sourceCode=Tt,et.spans=xt.spans,et.basePos=0,ge(ht,Tt)(et),Ue(et)}catch(mt){M.console&&console.log(mt&&mt.stack||mt)}}function ct(et,ht,xt){var Tt=xt||!1,mt=ht||null,Ie=document.createElement("div");Ie.innerHTML="
    "+et+"
    ",Ie=Ie.firstChild,Tt&&Oe(Ie,Tt,!0);var je={langExtension:mt,numberLines:Tt,sourceNode:Ie,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return He(je),Ie.innerHTML}function vt(et,ht){var xt=ht||document.body,Tt=xt.ownerDocument||document;function mt(ye){return xt.getElementsByTagName(ye)}for(var Ie=[mt("pre"),mt("code"),mt("xmp")],je=[],$e=0;$e=0;h--)if(this.__items[h].match(u))return!0;return!1},I.prototype.set_indent=function(u,h){this.is_empty()&&(this.__indent_count=u||0,this.__alignment_count=h||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},I.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},I.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},I.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var u=this.__parent.current_line;return u.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),u.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),u.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,u.__items[0]===" "&&(u.__items.splice(0,1),u.__character_count-=1),!0}return!1},I.prototype.is_empty=function(){return this.__items.length===0},I.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},I.prototype.push=function(u){this.__items.push(u);var h=u.lastIndexOf(` `);h!==-1?this.__character_count=u.length-h:this.__character_count+=u.length},I.prototype.pop=function(){var u=null;return this.is_empty()||(u=this.__items.pop(),this.__character_count-=u.length),u},I.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},I.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},I.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},I.prototype.toString=function(){var u="";return this.is_empty()?this.__parent.indent_empty_lines&&(u=this.__parent.get_indent_string(this.__indent_count)):(u=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),u+=this.__items.join("")),u};function p(u,h){this.__cache=[""],this.__indent_size=u.indent_size,this.__indent_string=u.indent_char,u.indent_with_tabs||(this.__indent_string=new Array(u.indent_size+1).join(u.indent_char)),h=h||"",u.indent_level>0&&(h=new Array(u.indent_level+1).join(this.__indent_string)),this.__base_string=h,this.__base_string_length=h.length}p.prototype.get_indent_size=function(u,h){var s=this.__base_string_length;return h=h||0,u<0&&(s=0),s+=u*this.__indent_size,s+=h,s},p.prototype.get_indent_string=function(u,h){var s=this.__base_string;return h=h||0,u<0&&(u=0,s=""),h+=u*this.__indent_size,this.__ensure_cache(h),s+=this.__cache[h],s},p.prototype.__ensure_cache=function(u){for(;u>=this.__cache.length;)this.__add_column()},p.prototype.__add_column=function(){var u=this.__cache.length,h=0,s="";this.__indent_size&&u>=this.__indent_size&&(h=Math.floor(u/this.__indent_size),u-=h*this.__indent_size,s=new Array(h+1).join(this.__indent_string)),u&&(s+=new Array(u+1).join(" ")),this.__cache.push(s)};function m(u,h){this.__indent_cache=new p(u,h),this.raw=!1,this._end_with_newline=u.end_with_newline,this.indent_size=u.indent_size,this.wrap_line_length=u.wrap_line_length,this.indent_empty_lines=u.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new I(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(u,h){return this.__indent_cache.get_indent_string(u,h)},m.prototype.get_indent_size=function(u,h){return this.__indent_cache.get_indent_size(u,h)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(u){return this.is_empty()||!u&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(u){this.trim(!0);var h=this.current_line.pop();h&&(h[h.length-1]===` `&&(h=h.replace(/\n+$/g,"")),this.current_line.push(h)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(` `);return u!==` `&&(s=s.replace(/[\n]/g,u)),s},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(u,h){return u=u||0,h=h||0,this.next_line.set_indent(u,h),this.__lines.length>1?(this.current_line.set_indent(u,h),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(u){for(var h=0;h1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(u,h){for(var s=this.__lines.length-2;s>=0;){var l=this.__lines[s];if(l.is_empty())break;if(l.item(0).indexOf(u)!==0&&l.item(-1)!==h){this.__lines.splice(s+1,0,new I(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},L.exports.Output=m},,,,function(L){function I(u,h){this.raw_options=p(u,h),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}I.prototype._get_array=function(u,h){var s=this.raw_options[u],l=h||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(l=s.concat()):typeof s=="string"&&(l=s.split(/[^a-zA-Z0-9_\/\-]+/)),l},I.prototype._get_boolean=function(u,h){var s=this.raw_options[u],l=s===void 0?!!h:!!s;return l},I.prototype._get_characters=function(u,h){var s=this.raw_options[u],l=h||"";return typeof s=="string"&&(l=s.replace(/\\r/,"\r").replace(/\\n/,` `).replace(/\\t/," ")),l},I.prototype._get_number=function(u,h){var s=this.raw_options[u];h=parseInt(h,10),isNaN(h)&&(h=0);var l=parseInt(s,10);return isNaN(l)&&(l=h),l},I.prototype._get_selection=function(u,h,s){var l=this._get_selection_list(u,h,s);if(l.length!==1)throw new Error("Invalid Option Value: The option '"+u+`' can only be one of the following values: `+h+` You passed in: '`+this.raw_options[u]+"'");return l[0]},I.prototype._get_selection_list=function(u,h,s){if(!h||h.length===0)throw new Error("Selection list cannot be empty.");if(s=s||[h[0]],!this._is_valid_selection(s,h))throw new Error("Invalid Default Value!");var l=this._get_array(u,s);if(!this._is_valid_selection(l,h))throw new Error("Invalid Option Value: The option '"+u+`' can contain only the following values: `+h+` You passed in: '`+this.raw_options[u]+"'");return l},I.prototype._is_valid_selection=function(u,h){return u.length&&h.length&&!u.some(function(s){return h.indexOf(s)===-1})};function p(u,h){var s={};u=m(u);var l;for(l in u)l!==h&&(s[l]=u[l]);if(h&&u[h])for(l in u[h])s[l]=u[h][l];return s}function m(u){var h={},s;for(s in u){var l=s.replace(/-/g,"_");h[l]=u[s]}return h}L.exports.Options=I,L.exports.normalizeOpts=m,L.exports.mergeOpts=p},,function(L){var I=RegExp.prototype.hasOwnProperty("sticky");function p(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}p.prototype.restart=function(){this.__position=0},p.prototype.back=function(){this.__position>0&&(this.__position-=1)},p.prototype.hasNext=function(){return this.__position=0&&m=0&&u=m.length&&this.__input.substring(u-m.length,u).toLowerCase()===m},L.exports.InputScanner=p},,,,,function(L){function I(p,m){p=typeof p=="string"?p:p.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(p+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(p+/\sbeautify\signore:end\s/.source+m,"g")}I.prototype.get_directives=function(p){if(!p.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var u=this.__directive_pattern.exec(p);u;)m[u[1]]=u[2],u=this.__directive_pattern.exec(p);return m},I.prototype.readIgnored=function(p){return p.readUntilAfter(this.__directives_end_ignore_pattern)},L.exports.Directives=I},,function(L,I,p){var m=p(16).Beautifier,u=p(17).Options;function h(s,l){var i=new m(s,l);return i.beautify()}L.exports=h,L.exports.defaultOptions=function(){return new u}},function(L,I,p){var m=p(17).Options,u=p(2).Output,h=p(8).InputScanner,s=p(13).Directives,l=new s(/\/\*/,/\*\//),i=/\r\n|[\r\n]/,r=/\r\n|[\r\n]/g,n=/\s/,d=/(?:\s|\n)+/g,w=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,T=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function x(O,E){this._source_text=O||"",this._options=new m(E),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}x.prototype.eatString=function(O){var E="";for(this._ch=this._input.next();this._ch;){if(E+=this._ch,this._ch==="\\")E+=this._input.next();else if(O.indexOf(this._ch)!==-1||this._ch===` `)break;this._ch=this._input.next()}return E},x.prototype.eatWhitespace=function(O){for(var E=n.test(this._input.peek()),v=0;n.test(this._input.peek());)this._ch=this._input.next(),O&&this._ch===` `&&((v===0||v0&&this._indentLevel--},x.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var O=this._source_text,E=this._options.eol;E==="auto"&&(E=` `,O&&i.test(O||"")&&(E=O.match(i)[0])),O=O.replace(r,` `);var v=O.match(/^[\t ]*/)[0];this._output=new u(this._options,v),this._input=new h(O),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var _=0,f=!1,c=!1,S=!1,y=!1,b=!1,N=!1,F=this._ch,X=!1,Z,H,A;Z=this._input.read(d),H=Z!=="",A=F,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),F=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var z=this._input.read(w),ne=l.get_directives(z);ne&&ne.ignore==="start"&&(z+=l.readIgnored(this._input)),this.print_string(z),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(T)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(H),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ae=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ae.match(/[ :]$/)&&(ae=this.eatString(": ").replace(/\s$/,""),this.print_string(ae),this._output.space_before_token=!0),ae=ae.replace(/\s$/,""),ae==="extend"?y=!0:ae==="import"&&(b=!0),ae in this.NESTED_AT_RULE?(this._nestedLevel+=1,ae in this.CONDITIONAL_GROUP_RULE&&(S=!0)):!f&&_===0&&ae.indexOf(":")!==-1&&(c=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(H),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")c&&(c=!1,this.outdent()),S?(S=!1,f=this._indentLevel>=this._nestedLevel):f=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&f&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(A==="("?this._output.space_before_token=!1:A!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),A==="{"&&this._output.trim(!0),b=!1,y=!1,c&&(this.outdent(),c=!1),this.print_string(this._ch),f=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&(this._input.peek()!=="}"&&this._output.add_new_line(!0)),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var me=0;me"||this._ch==="+"||this._ch==="~")&&!c&&_===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&n.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(H),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),n.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var Oe=A==='"'||A==="'";this.preserveSingleSpace(Oe||H),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===` `&&X&&this._output.add_new_line()}var Ue=this._output.get_code(E);return Ue},L.exports.Beautifier=x},function(L,I,p){var m=p(6).Options;function u(h){m.call(this,h,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var s=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||s;var l=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var i=0;i=15&&(m=!1,L=!0);var x=n&&(I||m&&(T==null||T<12.11)),O=P||B&&M>=9;function E(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var v=function(e,t){var o=e.className,a=E(t).exec(o);if(a){var g=o.slice(a.index+a[0].length);e.className=o.slice(0,a.index)+(g?a[1]+g:"")}};function _(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function f(e,t){return _(e).appendChild(t)}function c(e,t,o,a){var g=document.createElement(e);if(o&&(g.className=o),a&&(g.style.cssText=a),typeof t=="string")g.appendChild(document.createTextNode(t));else if(t)for(var j=0;j=t)return q+(t-j);q+=ie-j,q+=o-q%o,j=ie+1}}var ne=function(){this.id=null,this.f=null,this.time=0,this.handler=H(this.onTimeout,this)};ne.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ne.prototype.set=function(e,t){this.f=t;var o=+new Date+e;(!this.id||o=t)return a+Math.min(q,t-g);if(g+=j-a,g+=o-g%o,a=j+1,g>=t)return a}}var be=[""];function ge(e){for(;be.length<=e;)be.push(He(be)+" ");return be[e]}function He(e){return e[e.length-1]}function ct(e,t){for(var o=[],a=0;a"\x80"&&(e.toUpperCase()!=e.toLowerCase()||et.test(e))}function xt(e,t){return t?t.source.indexOf("\\w")>-1&&ht(e)?!0:t.test(e):ht(e)}function Tt(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var mt=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Ie(e){return e.charCodeAt(0)>=768&&mt.test(e)}function je(e,t,o){for(;(o<0?t>0:to?-1:1;;){if(t==o)return t;var g=(t+o)/2,j=a<0?Math.ceil(g):Math.floor(g);if(j==t)return e(j)?t:o;e(j)?o=j:t=j+a}}function at(e,t,o,a){if(!e)return a(t,o,"ltr",0);for(var g=!1,j=0;jt||t==o&&q.to==t)&&(a(Math.max(q.from,t),Math.min(q.to,o),q.level==1?"rtl":"ltr",j),g=!0)}g||a(t,o,"ltr")}var lt=null;function bt(e,t,o){var a;lt=null;for(var g=0;gt)return g;j.to==t&&(j.from!=j.to&&o=="before"?a=g:lt=g),j.from==t&&(j.from!=j.to&&o!="before"?a=g:lt=g)}return a!=null?a:lt}var Mt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function o(ue){return ue<=247?e.charAt(ue):1424<=ue&&ue<=1524?"R":1536<=ue&&ue<=1785?t.charAt(ue-1536):1774<=ue&&ue<=2220?"r":8192<=ue&&ue<=8203?"w":ue==8204?"b":"L"}var a=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,g=/[stwN]/,j=/[LRr]/,q=/[Lb1n]/,ie=/[1n]/;function oe(ue,Ae,Ne){this.level=ue,this.from=Ae,this.to=Ne}return function(ue,Ae){var Ne=Ae=="ltr"?"L":"R";if(ue.length==0||Ae=="ltr"&&!a.test(ue))return!1;for(var Ze=ue.length,Ve=[],Et=0;Et-1&&(a[t]=g.slice(0,j).concat(g.slice(j+1)))}}}function Fe(e,t){var o=tt(e,t);if(!o.length)return;for(var a=Array.prototype.slice.call(arguments,2),g=0;g0}function _e(e){e.prototype.on=function(t,o){Pe(this,t,o)},e.prototype.off=function(t,o){rt(this,t,o)}}function le(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function de(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ve(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function pe(e){le(e),de(e)}function Ce(e){return e.target||e.srcElement}function Ke(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),n&&e.ctrlKey&&t==1&&(t=3),t}var st=function(){if(B&&M<9)return!1;var e=c("div");return"draggable"in e||"dragDrop"in e}(),At;function Ft(e){if(At==null){var t=c("span","\u200B");f(e,c("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(At=t.offsetWidth<=1&&t.offsetHeight>2&&!(B&&M<8))}var o=At?c("span","\u200B"):c("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return o.setAttribute("cm-text",""),o}var kt;function wt(e){if(kt!=null)return kt;var t=f(e,document.createTextNode("A\u062EA")),o=y(t,0,1).getBoundingClientRect(),a=y(t,1,2).getBoundingClientRect();return _(e),!o||o.left==o.right?!1:kt=a.right-o.right<3}var Qe=` b`.split(/\n/).length!=3?function(e){for(var t=0,o=[],a=e.length;t<=a;){var g=e.indexOf(` `,t);g==-1&&(g=e.length);var j=e.slice(t,e.charAt(g-1)=="\r"?g-1:g),q=j.indexOf("\r");q!=-1?(o.push(j.slice(0,q)),t+=q+1):(o.push(j),t=g+1)}return o}:function(e){return e.split(/\r\n?|\n/)},it=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(o){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},We=function(){var e=c("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),ce=null;function Se(e){if(ce!=null)return ce;var t=f(e,c("span","x")),o=t.getBoundingClientRect(),a=y(t,0,1).getBoundingClientRect();return ce=Math.abs(o.left-a.left)>1}var ot={},ze={};function Lt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),ot[e]=t}function Dt(e,t){ze[e]=t}function ke(e){if(typeof e=="string"&&ze.hasOwnProperty(e))e=ze[e];else if(e&&typeof e.name=="string"&&ze.hasOwnProperty(e.name)){var t=ze[e.name];typeof t=="string"&&(t={name:t}),e=yt(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return ke("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return ke("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function qe(e,t){t=ke(t);var o=ot[t.name];if(!o)return qe(e,"text/plain");var a=o(e,t);if(Rt.hasOwnProperty(t.name)){var g=Rt[t.name];for(var j in g){if(!g.hasOwnProperty(j))continue;a.hasOwnProperty(j)&&(a["_"+j]=a[j]),a[j]=g[j]}}if(a.name=t.name,t.helperType&&(a.helperType=t.helperType),t.modeProps)for(var q in t.modeProps)a[q]=t.modeProps[q];return a}var Rt={};function Pt(e,t){var o=Rt.hasOwnProperty(e)?Rt[e]:Rt[e]={};A(t,o)}function $t(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var o={};for(var a in t){var g=t[a];g instanceof Array&&(g=g.concat([])),o[a]=g}return o}function fe(e,t){for(var o;e.innerMode&&!(o=e.innerMode(t),!o||o.mode==e);)t=o.state,e=o.mode;return o||{mode:e,state:t}}function se(e,t,o){return e.startState?e.startState(t,o):!0}var U=function(e,t,o){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=o};U.prototype.eol=function(){return this.pos>=this.string.length},U.prototype.sol=function(){return this.pos==this.lineStart},U.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},U.prototype.next=function(){if(this.post},U.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},U.prototype.skipToEnd=function(){this.pos=this.string.length},U.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},U.prototype.backUp=function(e){this.pos-=e},U.prototype.column=function(){return this.lastColumnPos0?null:(j&&t!==!1&&(this.pos+=j[0].length),j)}},U.prototype.current=function(){return this.string.slice(this.start,this.pos)},U.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},U.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},U.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function G(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var o=e;!o.lines;)for(var a=0;;++a){var g=o.children[a],j=g.chunkSize();if(t=e.first&&to?Xe(o,G(e,o).text.length):D(t,G(e,t.line).text.length)}function D(e,t){var o=e.ch;return o==null||o>t?Xe(e.line,t):o<0?Xe(e.line,0):e}function K(e,t){for(var o=[],a=0;athis.maxLookAhead&&(this.maxLookAhead=e),t},J.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},J.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},J.fromSaved=function(e,t,o){return t instanceof re?new J(e,$t(e.mode,t.state),o,t.lookAhead):new J(e,$t(e.mode,t),o)},J.prototype.save=function(e){var t=e!==!1?$t(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new re(t,this.maxLookAhead):t};function Re(e,t,o,a){var g=[e.state.modeGen],j={};hi(e,t.text,e.doc.mode,o,function(ue,Ae){return g.push(ue,Ae)},j,a);for(var q=o.state,ie=function(ue){o.baseTokens=g;var Ae=e.state.overlays[ue],Ne=1,Ze=0;o.state=!0,hi(e,t.text,Ae.mode,o,function(Ve,Et){for(var Ut=Ne;ZeVe&&g.splice(Ne,1,Ve,g[Ne+1],Ht),Ne+=2,Ze=Math.min(Ve,Ht)}if(!Et)return;if(Ae.opaque)g.splice(Ut,Ne-Ut,Ve,"overlay "+Et),Ne=Ut+2;else for(;Ute.options.maxHighlightLength&&$t(e.doc.mode,a.state),j=Re(e,t,a);g&&(a.state=g),t.stateAfter=a.save(!g),t.styles=j.styles,j.classes?t.styleClasses=j.classes:t.styleClasses&&(t.styleClasses=null),o===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function St(e,t,o){var a=e.doc,g=e.display;if(!a.mode.startState)return new J(a,!0,t);var j=Fn(e,t,o),q=j>a.first&&G(a,j-1).stateAfter,ie=q?J.fromSaved(a,q,j):new J(a,se(a.mode),j);return a.iter(j,t,function(oe){Yt(e,oe.text,ie);var ue=ie.line;oe.stateAfter=ue==t-1||ue%5==0||ue>=g.viewFrom&&uet.start)return j}throw new Error("Mode "+e.name+" failed to advance stream.")}var sn=function(e,t,o){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=o};function Wn(e,t,o,a){var g=e.doc,j=g.mode,q;t=C(g,t);var ie=G(g,t.line),oe=St(e,t.line,o),ue=new U(ie.text,e.options.tabSize,oe),Ae;for(a&&(Ae=[]);(a||ue.pose.options.maxHighlightLength?(ie=!1,q&&Yt(e,t,a,Ae.pos),Ae.pos=t.length,Ne=null):Ne=Si(Gt(o,Ae,a.state,Ze),j),Ze){var Ve=Ze[0].name;Ve&&(Ne="m-"+(Ne?Ve+" "+Ne:Ve))}if(!ie||ue!=Ne){for(;oeq;--ie){if(ie<=j.first)return j.first;var oe=G(j,ie-1),ue=oe.stateAfter;if(ue&&(!o||ie+(ue instanceof re?ue.lookAhead:0)<=j.modeFrontier))return ie;var Ae=z(oe.text,null,e.options.tabSize);(g==null||a>Ae)&&(g=ie-1,a=Ae)}return g}function di(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontiero;a--){var g=G(e,a).stateAfter;if(g&&(!(g instanceof re)||a+g.lookAhead=t:j.to>t);(a||(a=[])).push(new Di(q,j.from,oe?null:j.to))}}return a}function rr(e,t,o){var a;if(e)for(var g=0;g=t:j.to>t);if(ie||j.from==t&&q.type=="bookmark"&&(!o||j.marker.insertLeft)){var oe=j.from==null||(q.inclusiveLeft?j.from<=t:j.from0&&ie)for(var dn=0;dn0)continue;var Ae=[oe,1],Ne=It(ue.from,ie.from),Ze=It(ue.to,ie.to);(Ne<0||!q.inclusiveLeft&&!Ne)&&Ae.push({from:ue.from,to:ie.from}),(Ze>0||!q.inclusiveRight&&!Ze)&&Ae.push({from:ie.to,to:ue.to}),g.splice.apply(g,Ae),oe+=Ae.length-3}return g}function Tr(e){var t=e.markedSpans;if(!t)return;for(var o=0;ot)&&(!a||yi(a,j.marker)<0)&&(a=j.marker)}return a}function Ni(e,t,o,a,g){var j=G(e,t),q=_i&&j.markedSpans;if(q)for(var ie=0;ie=0&&Ne<=0||Ae<=0&&Ne>=0)continue;if(Ae<=0&&(oe.marker.inclusiveRight&&g.inclusiveLeft?It(ue.to,o)>=0:It(ue.to,o)>0)||Ae>=0&&(oe.marker.inclusiveRight&&g.inclusiveLeft?It(ue.from,a)<=0:It(ue.from,a)<0))return!0}}function Xi(e){for(var t;t=Ti(e);)e=t.find(-1,!0).line;return e}function lr(e){for(var t;t=ii(e);)e=t.find(1,!0).line;return e}function gr(e){for(var t,o;t=ii(e);)e=t.find(1,!0).line,(o||(o=[])).push(e);return o}function Hr(e,t){var o=G(e,t),a=Xi(o);return o==a?t:Le(a)}function kr(e,t){if(t>e.lastLine())return t;var o=G(e,t),a;if(!wr(e,o))return t;for(;a=ii(o);)o=a.find(1,!0).line;return Le(o)+1}function wr(e,t){var o=_i&&t.markedSpans;if(o)for(var a=void 0,g=0;gt.maxLineLength&&(t.maxLineLength=g,t.maxLine=a)})}var fr=function(e,t,o){this.text=e,ar(this,t),this.height=o?o(this):1};fr.prototype.lineNo=function(){return Le(this)},_e(fr);function Jr(e,t,o,a){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Tr(e),ar(e,o);var g=a?a(e):1;g!=e.height&&he(e,g)}function mn(e){e.parent=null,Tr(e)}var On={},_n={};function jn(e,t){if(!e||/^\s*$/.test(e))return null;var o=t.addModeClass?_n:On;return o[e]||(o[e]=e.replace(/\S+/g,"cm-$&"))}function Jn(e,t){var o=S("span",null,null,L?"padding-right: .1px":null),a={pre:S("pre",[o],"CodeMirror-line"),content:o,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var g=0;g<=(t.rest?t.rest.length:0);g++){var j=g?t.rest[g-1]:t.line,q=void 0;a.pos=0,a.addToken=Bn,wt(e.display.measure)&&(q=jt(j,e.doc.direction))&&(a.addToken=Yi(a.addToken,q)),a.map=[];var ie=t!=e.display.externalMeasured&&Le(j);_r(j,a,ut(e,j,ie)),j.styleClasses&&(j.styleClasses.bgClass&&(a.bgClass=X(j.styleClasses.bgClass,a.bgClass||"")),j.styleClasses.textClass&&(a.textClass=X(j.styleClasses.textClass,a.textClass||""))),a.map.length==0&&a.map.push(0,0,a.content.appendChild(Ft(e.display.measure))),g==0?(t.measure.map=a.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(a.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(L){var oe=a.content.lastChild;(/\bcm-tab\b/.test(oe.className)||oe.querySelector&&oe.querySelector(".cm-tab"))&&(a.content.className="cm-tab-wrap-hack")}return Fe(e,"renderLine",e,t.line,a.pre),a.pre.className&&(a.textClass=X(a.pre.className,a.textClass||"")),a}function un(e){var t=c("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Bn(e,t,o,a,g,j,q){if(!t)return;var ie=e.splitSpaces?Ai(t,e.trailingSpace):t,oe=e.cm.state.specialChars,ue=!1,Ae;if(!oe.test(t))e.col+=t.length,Ae=document.createTextNode(ie),e.map.push(e.pos,e.pos+t.length,Ae),B&&M<9&&(ue=!0),e.pos+=t.length;else{Ae=document.createDocumentFragment();for(var Ne=0;;){oe.lastIndex=Ne;var Ze=oe.exec(t),Ve=Ze?Ze.index-Ne:t.length-Ne;if(Ve){var Et=document.createTextNode(ie.slice(Ne,Ne+Ve));B&&M<9?Ae.appendChild(c("span",[Et])):Ae.appendChild(Et),e.map.push(e.pos,e.pos+Ve,Et),e.col+=Ve,e.pos+=Ve}if(!Ze)break;Ne+=Ve+1;var Ut=void 0;if(Ze[0]==" "){var Ht=e.cm.options.tabSize,Jt=Ht-e.col%Ht;Ut=Ae.appendChild(c("span",ge(Jt),"cm-tab")),Ut.setAttribute("role","presentation"),Ut.setAttribute("cm-text"," "),e.col+=Jt}else Ze[0]=="\r"||Ze[0]==` `?(Ut=Ae.appendChild(c("span",Ze[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ut.setAttribute("cm-text",Ze[0]),e.col+=1):(Ut=e.cm.options.specialCharPlaceholder(Ze[0]),Ut.setAttribute("cm-text",Ze[0]),B&&M<9?Ae.appendChild(c("span",[Ut])):Ae.appendChild(Ut),e.col+=1);e.map.push(e.pos,e.pos+1,Ut),e.pos++}}if(e.trailingSpace=ie.charCodeAt(t.length-1)==32,o||a||g||ue||j||q){var rn=o||"";a&&(rn+=a),g&&(rn+=g);var Zt=c("span",[Ae],rn,j);if(q)for(var dn in q)q.hasOwnProperty(dn)&&dn!="style"&&dn!="class"&&Zt.setAttribute(dn,q[dn]);return e.content.appendChild(Zt)}e.content.appendChild(Ae)}function Ai(e,t){if(e.length>1&&!/ /.test(e))return e;for(var o=t,a="",g=0;gue&&Ne.from<=ue);Ze++);if(Ne.to>=Ae)return e(o,a,g,j,q,ie,oe);e(o,a.slice(0,Ne.to-ue),g,j,null,ie,oe),j=null,a=a.slice(Ne.to-ue),ue=Ne.to}}}function Xn(e,t,o,a){var g=!a&&o.widgetNode;g&&e.map.push(e.pos,e.pos+t,g),!a&&e.cm.display.input.needsContentAttribute&&(g||(g=e.content.appendChild(document.createElement("span"))),g.setAttribute("cm-marker",o.id)),g&&(e.cm.display.input.setUneditable(g),e.content.appendChild(g)),e.pos+=t,e.trailingSpace=!1}function _r(e,t,o){var a=e.markedSpans,g=e.text,j=0;if(!a){for(var q=1;qoe||Qn.collapsed&&En.to==oe&&En.from==oe)){if(En.to!=null&&En.to!=oe&&Ve>En.to&&(Ve=En.to,Ut=""),Qn.className&&(Et+=" "+Qn.className),Qn.css&&(Ze=(Ze?Ze+";":"")+Qn.css),Qn.startStyle&&En.from==oe&&(Ht+=" "+Qn.startStyle),Qn.endStyle&&En.to==Ve&&(dn||(dn=[])).push(Qn.endStyle,En.to),Qn.title&&((rn||(rn={})).title=Qn.title),Qn.attributes)for(var Ci in Qn.attributes)(rn||(rn={}))[Ci]=Qn.attributes[Ci];Qn.collapsed&&(!Jt||yi(Jt.marker,Qn)<0)&&(Jt=En)}else En.from>oe&&Ve>En.from&&(Ve=En.from)}if(dn)for(var nr=0;nr=ie)break;for(var Mr=Math.min(ie,Ve);;){if(Ae){var Er=oe+Ae.length;if(!Jt){var Gi=Er>Mr?Ae.slice(0,Mr-oe):Ae;t.addToken(t,Gi,Ne?Ne+Et:Et,Ht,oe+Gi.length==Ve?Ut:"",Ze,rn)}if(Er>=Mr){Ae=Ae.slice(Mr-oe),oe=Mr;break}oe=Er,Ht=""}Ae=g.slice(j,j=o[ue++]),Ne=jn(o[ue++],t.cm.options)}}}function oi(e,t,o){this.line=t,this.rest=gr(t),this.size=this.rest?Le(He(this.rest))-o+1:1,this.node=this.text=null,this.hidden=wr(e,t)}function Ye(e,t,o){for(var a=[],g,j=t;j2&&j.push((oe.bottom+ue.top)/2-o.top)}}j.push(o.bottom-o.top)}}function Tn(e,t,o){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var a=0;ao)return{map:e.measure.maps[g],cache:e.measure.caches[g],before:!0}}function si(e,t){t=Xi(t);var o=Le(t),a=e.display.externalMeasured=new oi(e.doc,t,o);a.lineN=o;var g=a.built=Jn(e,a);return a.text=g.pre,f(e.display.lineMeasure,g.pre),a}function vi(e,t,o,a){return Dn(e,ti(e,t),o,a)}function ui(e,t){if(t>=e.display.viewFrom&&t=o.lineN&&tt)&&(j=oe-ie,g=j-1,t>=oe&&(q="right")),g!=null){if(a=e[ue+2],ie==oe&&o==(a.insertLeft?"left":"right")&&(q=o),o=="left"&&g==0)for(;ue&&e[ue-2]==e[ue-3]&&e[ue-1].insertLeft;)a=e[(ue-=3)+2],q="left";if(o=="right"&&g==oe-ie)for(;ue=0&&!((o=e[g]).left!=o.right);g--);return o}function Qt(e,t,o,a){var g=Rn(t.map,o,a),j=g.node,q=g.start,ie=g.end,oe=g.collapse,ue;if(j.nodeType==3){for(var Ae=0;Ae<4;Ae++){for(;q&&Ie(t.line.text.charAt(g.coverStart+q));)--q;for(;g.coverStart+ie0&&(oe=a="right");var Ne;e.options.lineWrapping&&(Ne=j.getClientRects()).length>1?ue=Ne[a=="right"?Ne.length-1:0]:ue=j.getBoundingClientRect()}if(B&&M<9&&!q&&(!ue||!ue.left&&!ue.right)){var Ze=j.parentNode.getClientRects()[0];Ze?ue={left:Ze.left,right:Ze.left+Yn(e.display),top:Ze.top,bottom:Ze.bottom}:ue=yn}for(var Ve=ue.top-t.rect.top,Et=ue.bottom-t.rect.top,Ut=(Ve+Et)/2,Ht=t.view.measure.heights,Jt=0;Jt=a.text.length?(oe=a.text.length,ue="before"):oe<=0&&(oe=0,ue="after"),!ie)return q(ue=="before"?oe-1:oe,ue=="before");function Ae(Et,Ut,Ht){var Jt=ie[Ut],rn=Jt.level==1;return q(Ht?Et-1:Et,rn!=Ht)}var Ne=bt(ie,oe,ue),Ze=lt,Ve=Ae(oe,Ne,ue=="before");return Ze!=null&&(Ve.other=Ae(oe,Ze,ue!="before")),Ve}function Rr(e,t){var o=0;t=C(e.doc,t),e.options.lineWrapping||(o=Yn(e.display)*t.ch);var a=G(e.doc,t.line),g=vr(a)+mi(e.display);return{left:o,right:o,top:g,bottom:g+a.height}}function Nr(e,t,o,a,g){var j=Xe(e,t,o);return j.xRel=g,a&&(j.outside=a),j}function Kr(e,t,o){var a=e.doc;if(o+=e.display.viewOffset,o<0)return Nr(a.first,0,null,-1,-1);var g=Ge(a,o),j=a.first+a.size-1;if(g>j)return Nr(a.first+a.size-1,G(a,j).text.length,null,1,1);t<0&&(t=0);for(var q=G(a,g);;){var ie=ta(e,q,g,t,o),oe=Cr(q,ie.ch+(ie.xRel>0||ie.outside>0?1:0));if(!oe)return ie;var ue=oe.find(1);if(ue.line==g)return ue;q=G(a,g=ue.line)}}function Ur(e,t,o,a){a-=Li(t);var g=t.text.length,j=$e(function(q){return Dn(e,o,q-1).bottom<=a},g,0);return g=$e(function(q){return Dn(e,o,q).top>a},j,g),{begin:j,end:g}}function da(e,t,o,a){o||(o=ti(e,t));var g=qi(e,t,Dn(e,o,a),"line").top;return Ur(e,t,o,g)}function yr(e,t,o,a){return e.bottom<=o?!1:e.top>o?!0:(a?e.left:e.right)>t}function ta(e,t,o,a,g){g-=vr(t);var j=ti(e,t),q=Li(t),ie=0,oe=t.text.length,ue=!0,Ae=jt(t,e.doc.direction);if(Ae){var Ne=(e.options.lineWrapping?fi:Da)(e,t,o,j,Ae,a,g);ue=Ne.level!=1,ie=ue?Ne.from:Ne.to-1,oe=ue?Ne.to:Ne.from-1}var Ze=null,Ve=null,Et=$e(function(An){var En=Dn(e,j,An);return En.top+=q,En.bottom+=q,yr(En,a,g,!1)?(En.top<=g&&En.left<=a&&(Ze=An,Ve=En),!0):!1},ie,oe),Ut,Ht,Jt=!1;if(Ve){var rn=a-Ve.left=dn.bottom?1:0}return Et=je(t.text,Et,1),Nr(o,Et,Ht,Jt,a-Ut)}function Da(e,t,o,a,g,j,q){var ie=$e(function(Ne){var Ze=g[Ne],Ve=Ze.level!=1;return yr(li(e,Xe(o,Ve?Ze.to:Ze.from,Ve?"before":"after"),"line",t,a),j,q,!0)},0,g.length-1),oe=g[ie];if(ie>0){var ue=oe.level!=1,Ae=li(e,Xe(o,ue?oe.from:oe.to,ue?"after":"before"),"line",t,a);yr(Ae,j,q,!0)&&Ae.top>q&&(oe=g[ie-1])}return oe}function fi(e,t,o,a,g,j,q){var ie=Ur(e,t,a,q),oe=ie.begin,ue=ie.end;/\s/.test(t.text.charAt(ue-1))&&ue--;for(var Ae=null,Ne=null,Ze=0;Ze=ue||Ve.to<=oe)continue;var Et=Ve.level!=1,Ut=Dn(e,a,Et?Math.min(ue,Ve.to)-1:Math.max(oe,Ve.from)).right,Ht=UtHt)&&(Ae=Ve,Ne=Ht)}return Ae||(Ae=g[g.length-1]),Ae.fromue&&(Ae={from:Ae.from,to:ue,level:Ae.level}),Ae}var xn;function zn(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(xn==null){xn=c("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)xn.appendChild(document.createTextNode("x")),xn.appendChild(c("br"));xn.appendChild(document.createTextNode("x"))}f(e.measure,xn);var o=xn.offsetHeight/50;return o>3&&(e.cachedTextHeight=o),_(e.measure),o||1}function Yn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=c("span","xxxxxxxxxx"),o=c("pre",[t],"CodeMirror-line-like");f(e.measure,o);var a=t.getBoundingClientRect(),g=(a.right-a.left)/10;return g>2&&(e.cachedCharWidth=g),g||10}function Ui(e){for(var t=e.display,o={},a={},g=t.gutters.clientLeft,j=t.gutters.firstChild,q=0;j;j=j.nextSibling,++q){var ie=e.display.gutterSpecs[q].className;o[ie]=j.offsetLeft+j.clientLeft+g,a[ie]=j.clientWidth}return{fixedPos:Vn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:o,gutterWidth:a,wrapperWidth:t.wrapper.clientWidth}}function Vn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Ar(e){var t=zn(e.display),o=e.options.lineWrapping,a=o&&Math.max(5,e.display.scroller.clientWidth/Yn(e.display)-3);return function(g){if(wr(e.doc,g))return 0;var j=0;if(g.widgets)for(var q=0;q0&&(ue=G(e.doc,oe.line).text).length==oe.ch){var Ae=z(ue,ue.length,e.options.tabSize)-ue.length;oe=Xe(oe.line,Math.max(0,Math.round((j-ai(e.display).left)/Yn(e.display))-Ae))}return oe}function Lr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var o=e.display.view,a=0;at)&&(g.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=g.viewTo)_i&&Hr(e.doc,t)g.viewFrom?Pn(e):(g.viewFrom+=a,g.viewTo+=a);else if(t<=g.viewFrom&&o>=g.viewTo)Pn(e);else if(t<=g.viewFrom){var j=wn(e,o,o+a,1);j?(g.view=g.view.slice(j.index),g.viewFrom=j.lineN,g.viewTo+=a):Pn(e)}else if(o>=g.viewTo){var q=wn(e,t,t,-1);q?(g.view=g.view.slice(0,q.index),g.viewTo=q.lineN):Pn(e)}else{var ie=wn(e,t,t,-1),oe=wn(e,o,o+a,1);ie&&oe?(g.view=g.view.slice(0,ie.index).concat(Ye(e,ie.lineN,oe.lineN)).concat(g.view.slice(oe.index)),g.viewTo+=a):Pn(e)}var ue=g.externalMeasured;ue&&(o=g.lineN&&t=a.viewTo)return;var j=a.view[Lr(e,t)];if(j.node==null)return;var q=j.changes||(j.changes=[]);ae(q,o)==-1&&q.push(o)}function Pn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function wn(e,t,o,a){var g=Lr(e,t),j,q=e.display.view;if(!_i||o==e.doc.first+e.doc.size)return{index:g,lineN:o};for(var ie=e.display.viewFrom,oe=0;oe0){if(g==q.length-1)return null;j=ie+q[g].size-t,g++}else j=ie-t;t+=j,o+=j}for(;Hr(e.doc,o)!=o;){if(g==(a<0?0:q.length-1))return null;o+=a*q[g-(a<0?1:0)].size,g+=a}return{index:g,lineN:o}}function $n(e,t,o){var a=e.display,g=a.view;g.length==0||t>=a.viewTo||o<=a.viewFrom?(a.view=Ye(e,t,o),a.viewFrom=t):(a.viewFrom>t?a.view=Ye(e,t,a.viewFrom).concat(a.view):a.viewFromo&&(a.view=a.view.slice(0,Lr(e,o)))),a.viewTo=o}function en(e){for(var t=e.display.view,o=0,a=0;a=e.display.viewTo||ie.to().line0?t.blinker=setInterval(function(){e.hasFocus()||Ir(e),t.cursorDiv.style.visibility=(o=!o)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function na(e){e.state.focused||(e.display.input.focus(),Wr(e))}function _a(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ir(e))},100)}function Wr(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Fe(e,"focus",e,t),e.state.focused=!0,F(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),L&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),bn(e)}function Ir(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Fe(e,"blur",e,t),e.state.focused=!1,v(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Dr(e){for(var t=e.display,o=t.lineDiv.offsetTop,a=0;a.005||Ae<-.005)&&(he(g.line,q),Zr(g.line),g.rest))for(var Ne=0;Nee.display.sizerWidth){var Ze=Math.ceil(ie/Yn(e.display));Ze>e.display.maxLineLength&&(e.display.maxLineLength=Ze,e.display.maxLine=g.line,e.display.maxLineChanged=!0)}}}function Zr(e){if(e.widgets)for(var t=0;t=q&&(j=Ge(t,vr(G(t,oe))-e.wrapper.clientHeight),q=oe)}return{from:j,to:Math.max(q,j+1)}}function ia(e,t){if(Je(e,"scrollCursorIntoView"))return;var o=e.display,a=o.sizer.getBoundingClientRect(),g=null;if(t.top+a.top<0?g=!0:t.bottom+a.top>(window.innerHeight||document.documentElement.clientHeight)&&(g=!1),g!=null&&!s){var j=c("div","\u200B",null,`position: absolute; top: `+(t.top-o.viewOffset-mi(e.display))+`px; height: `+(t.bottom-t.top+kn(e)+o.barHeight)+`px; left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(j),j.scrollIntoView(g),e.display.lineSpace.removeChild(j)}}function go(e,t,o,a){a==null&&(a=0);var g;!e.options.lineWrapping&&t==o&&(t=t.ch?Xe(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,o=t.sticky=="before"?Xe(t.line,t.ch+1,"before"):t);for(var j=0;j<5;j++){var q=!1,ie=li(e,t),oe=!o||o==t?ie:li(e,o);g={left:Math.min(ie.left,oe.left),top:Math.min(ie.top,oe.top)-a,right:Math.max(ie.left,oe.left),bottom:Math.max(ie.bottom,oe.bottom)+a};var ue=vo(e,g),Ae=e.doc.scrollTop,Ne=e.doc.scrollLeft;if(ue.scrollTop!=null&&(Ma(e,ue.scrollTop),Math.abs(e.doc.scrollTop-Ae)>1&&(q=!0)),ue.scrollLeft!=null&&(ca(e,ue.scrollLeft),Math.abs(e.doc.scrollLeft-Ne)>1&&(q=!0)),!q)break}return g}function Qi(e,t){var o=vo(e,t);o.scrollTop!=null&&Ma(e,o.scrollTop),o.scrollLeft!=null&&ca(e,o.scrollLeft)}function vo(e,t){var o=e.display,a=zn(e.display);t.top<0&&(t.top=0);var g=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:o.scroller.scrollTop,j=Gn(e),q={};t.bottom-t.top>j&&(t.bottom=t.top+j);var ie=e.doc.height+gi(o),oe=t.topie-a;if(t.topg+j){var Ae=Math.min(t.top,(ue?ie:t.bottom)-j);Ae!=g&&(q.scrollTop=Ae)}var Ne=e.options.fixedGutter?0:o.gutters.offsetWidth,Ze=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:o.scroller.scrollLeft-Ne,Ve=ei(e)-o.gutters.offsetWidth,Et=t.right-t.left>Ve;return Et&&(t.right=t.left+Ve),t.left<10?q.scrollLeft=0:t.leftVe+Ze-3&&(q.scrollLeft=t.right+(Et?0:10)-Ve),q}function _o(e,t){if(t==null)return;qa(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function ya(e){qa(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Pa(e,t,o){(t!=null||o!=null)&&qa(e),t!=null&&(e.curOp.scrollLeft=t),o!=null&&(e.curOp.scrollTop=o)}function Js(e,t){qa(e),e.curOp.scrollToPos=t}function qa(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var o=Rr(e,t.from),a=Rr(e,t.to);Wo(e,o,a,t.margin)}}function Wo(e,t,o,a){var g=vo(e,{left:Math.min(t.left,o.left),top:Math.min(t.top,o.top)-a,right:Math.max(t.right,o.right),bottom:Math.max(t.bottom,o.bottom)+a});Pa(e,g.scrollLeft,g.scrollTop)}function Ma(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;P||bo(e,{top:t}),Ho(e,t,!0),P&&bo(e),Ua(e,100)}function Ho(e,t,o){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!o)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function ca(e,t,o,a){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(o?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!a)return;e.doc.scrollLeft=t,Xo(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function ka(e){var t=e.display,o=t.gutters.offsetWidth,a=Math.round(e.doc.height+gi(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?o:0,docHeight:a,scrollHeight:a+kn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:o}}var ha=function(e,t,o){this.cm=o;var a=this.vert=c("div",[c("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),g=this.horiz=c("div",[c("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");a.tabIndex=g.tabIndex=-1,e(a),e(g),Pe(a,"scroll",function(){a.clientHeight&&t(a.scrollTop,"vertical")}),Pe(g,"scroll",function(){g.clientWidth&&t(g.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,B&&M<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ha.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,o=e.scrollHeight>e.clientHeight+1,a=e.nativeBarWidth;if(o){this.vert.style.display="block",this.vert.style.bottom=t?a+"px":"0";var g=e.viewHeight-(t?a:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+g)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=o?a+"px":"0",this.horiz.style.left=e.barLeft+"px";var j=e.viewWidth-e.barLeft-(o?a:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+j)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(a==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:o?a:0,bottom:t?a:0}},ha.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ha.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ha.prototype.zeroWidthHack=function(){var e=n&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ne,this.disableVert=new ne},ha.prototype.enableZeroWidthBar=function(e,t,o){e.style.pointerEvents="auto";function a(){var g=e.getBoundingClientRect(),j=o=="vert"?document.elementFromPoint(g.right-1,(g.top+g.bottom)/2):document.elementFromPoint((g.right+g.left)/2,g.bottom-1);j!=e?e.style.pointerEvents="none":t.set(1e3,a)}t.set(1e3,a)},ha.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Na=function(){};Na.prototype.update=function(){return{bottom:0,right:0}},Na.prototype.setScrollLeft=function(){},Na.prototype.setScrollTop=function(){},Na.prototype.clear=function(){};function ba(e,t){t||(t=ka(e));var o=e.display.barWidth,a=e.display.barHeight;Ko(e,t);for(var g=0;g<4&&o!=e.display.barWidth||a!=e.display.barHeight;g++)o!=e.display.barWidth&&e.options.lineWrapping&&Dr(e),Ko(e,ka(e)),o=e.display.barWidth,a=e.display.barHeight}function Ko(e,t){var o=e.display,a=o.scrollbars.update(t);o.sizer.style.paddingRight=(o.barWidth=a.right)+"px",o.sizer.style.paddingBottom=(o.barHeight=a.bottom)+"px",o.heightForcer.style.borderBottom=a.bottom+"px solid transparent",a.right&&a.bottom?(o.scrollbarFiller.style.display="block",o.scrollbarFiller.style.height=a.bottom+"px",o.scrollbarFiller.style.width=a.right+"px"):o.scrollbarFiller.style.display="",a.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(o.gutterFiller.style.display="block",o.gutterFiller.style.height=a.bottom+"px",o.gutterFiller.style.width=t.gutterWidth+"px"):o.gutterFiller.style.display=""}var Go={native:ha,null:Na};function zo(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&v(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Go[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Pe(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,o){o=="horizontal"?ca(e,t):Ma(e,t)},e),e.display.scrollbars.addClass&&F(e.display.wrapper,e.display.scrollbars.addClass)}var Zs=0;function fa(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Zs},Kt(e.curOp)}function pa(e){var t=e.curOp;t&&tn(t,function(o){for(var a=0;a=o.viewTo)||o.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new eo(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&yo(e.cm,e.update)}function nl(e){var t=e.cm,o=t.display;e.updatedDisplay&&Dr(t),e.barMeasure=ka(t),o.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=vi(t,o.maxLine,o.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(o.scroller.clientWidth,o.sizer.offsetLeft+e.adjustWidthTo+kn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,o.sizer.offsetLeft+e.adjustWidthTo-ei(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=o.input.prepareSelection())}function il(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)return;var o=+new Date+e.options.workTime,a=St(e,t.highlightFrontier),g=[];t.iter(a.line,Math.min(t.first+t.size,e.display.viewTo+500),function(j){if(a.line>=e.display.viewFrom){var q=j.styles,ie=j.text.length>e.options.maxHighlightLength?$t(t.mode,a.state):null,oe=Re(e,j,a,!0);ie&&(a.state=ie),j.styles=oe.styles;var ue=j.styleClasses,Ae=oe.classes;Ae?j.styleClasses=Ae:ue&&(j.styleClasses=null);for(var Ne=!q||q.length!=j.styles.length||ue!=Ae&&(!ue||!Ae||ue.bgClass!=Ae.bgClass||ue.textClass!=Ae.textClass),Ze=0;!Ne&&Zeo)return Ua(e,e.options.workDelay),!0}),t.highlightFrontier=a.line,t.modeFrontier=Math.max(t.modeFrontier,a.line),g.length&&Pr(e,function(){for(var j=0;j=o.viewFrom&&t.visible.to<=o.viewTo&&(o.updateLineNumbers==null||o.updateLineNumbers>=o.viewTo)&&o.renderedView==o.view&&en(e)==0)return!1;Yo(e)&&(Pn(e),t.dims=Ui(e));var g=a.first+a.size,j=Math.max(t.visible.from-e.options.viewportMargin,a.first),q=Math.min(g,t.visible.to+e.options.viewportMargin);o.viewFromq&&o.viewTo-q<20&&(q=Math.min(g,o.viewTo)),_i&&(j=Hr(e.doc,j),q=kr(e.doc,q));var ie=j!=o.viewFrom||q!=o.viewTo||o.lastWrapHeight!=t.wrapperHeight||o.lastWrapWidth!=t.wrapperWidth;$n(e,j,q),o.viewOffset=vr(G(e.doc,o.viewFrom)),e.display.mover.style.top=o.viewOffset+"px";var oe=en(e);if(!ie&&oe==0&&!t.force&&o.renderedView==o.view&&(o.updateLineNumbers==null||o.updateLineNumbers>=o.viewTo))return!1;var ue=sl(e);return oe>4&&(o.lineDiv.style.display="none"),ul(e,o.updateLineNumbers,t.dims),oe>4&&(o.lineDiv.style.display=""),o.renderedView=o.view,ll(ue),_(o.cursorDiv),_(o.selectionDiv),o.gutters.style.height=o.sizer.style.minHeight=0,ie&&(o.lastWrapHeight=t.wrapperHeight,o.lastWrapWidth=t.wrapperWidth,Ua(e,400)),o.updateLineNumbers=null,!0}function Vo(e,t){for(var o=t.viewport,a=!0;;a=!1){if(!a||!e.options.lineWrapping||t.oldDisplayWidth==ei(e)){if(o&&o.top!=null&&(o={top:Math.min(e.doc.height+gi(e.display)-Gn(e),o.top)}),t.visible=Gr(e.display,e.doc,o),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else a&&(t.visible=Gr(e.display,e.doc,o));if(!yo(e,t))break;Dr(e);var g=ka(e);In(e),ba(e,g),xo(e,g),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function bo(e,t){var o=new eo(e,t);if(yo(e,o)){Dr(e),Vo(e,o);var a=ka(e);In(e),ba(e,a),xo(e,a),o.finish()}}function ul(e,t,o){var a=e.display,g=e.options.lineNumbers,j=a.lineDiv,q=j.firstChild;function ie(Et){var Ut=Et.nextSibling;return L&&n&&e.display.currentWheelTarget==Et?Et.style.display="none":Et.parentNode.removeChild(Et),Ut}for(var oe=a.view,ue=a.viewFrom,Ae=0;Ae-1&&(Ve=!1),cn(e,Ne,ue,o)),Ve&&(_(Ne.lineNumber),Ne.lineNumber.appendChild(document.createTextNode(Nt(e.options,ue)))),q=Ne.node.nextSibling}ue+=Ne.size}for(;q;)q=ie(q)}function Eo(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function xo(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+kn(e)+"px"}function Xo(e){var t=e.display,o=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var a=Vn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,g=t.gutters.offsetWidth,j=a+"px",q=0;qq.clientWidth,oe=q.scrollHeight>q.clientHeight;if(!(a&&ie||g&&oe))return;if(g&&n&&L){e:for(var ue=t.target,Ae=j.view;ue!=q;ue=ue.parentNode)for(var Ne=0;Ne=0&&It(e,a.to())<=0)return o}return-1};var pi=function(e,t){this.anchor=e,this.head=t};pi.prototype.from=function(){return nn(this.anchor,this.head)},pi.prototype.to=function(){return pn(this.anchor,this.head)},pi.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function zr(e,t,o){var a=e&&e.options.selectionsMayTouch,g=t[o];t.sort(function(Ze,Ve){return It(Ze.from(),Ve.from())}),o=ae(t,g);for(var j=1;j0:oe>=0){var ue=nn(ie.from(),q.from()),Ae=pn(ie.to(),q.to()),Ne=ie.empty()?q.from()==q.head:ie.from()==ie.head;j<=o&&--o,t.splice(--j,2,new pi(Ne?Ae:ue,Ne?ue:Ae))}}return new jr(t,o)}function ra(e,t){return new jr([new pi(e,t||e)],0)}function aa(e){return e.text?Xe(e.from.line+e.text.length-1,He(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Zo(e,t){if(It(e,t.from)<0)return e;if(It(e,t.to)<=0)return aa(t);var o=e.line+t.text.length-(t.to.line-t.from.line)-1,a=e.ch;return e.line==t.to.line&&(a+=aa(t).ch-t.to.ch),Xe(o,a)}function To(e,t){for(var o=[],a=0;a1&&e.remove(ie.line+1,Et-1),e.insert(ie.line+1,Jt)}nt(e,"change",e,t)}function oa(e,t,o){function a(g,j,q){if(g.linked)for(var ie=0;ie1&&!e.done[e.done.length-2].ranges)return e.done.pop(),He(e.done)}function rs(e,t,o,a){var g=e.history;g.undone.length=0;var j=+new Date,q,ie;if((g.lastOp==a||g.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&g.lastModTime>j-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(q=pl(g,g.lastOp==a)))ie=He(q.changes),It(t.from,t.to)==0&&It(t.from,ie.to)==0?ie.to=aa(t):q.changes.push(Oo(e,t));else{var oe=He(g.done);for((!oe||!oe.ranges)&&io(e.sel,g.done),q={changes:[Oo(e,t)],generation:g.generation},g.done.push(q);g.done.length>g.undoDepth;)g.done.shift(),g.done[0].ranges||g.done.shift()}g.done.push(o),g.generation=++g.maxGeneration,g.lastModTime=g.lastSelTime=j,g.lastOp=g.lastSelOp=a,g.lastOrigin=g.lastSelOrigin=t.origin,ie||Fe(e,"historyAdded")}function ml(e,t,o,a){var g=t.charAt(0);return g=="*"||g=="+"&&o.ranges.length==a.ranges.length&&o.somethingSelected()==a.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,o,a){var g=e.history,j=a&&a.origin;o==g.lastSelOp||j&&g.lastSelOrigin==j&&(g.lastModTime==g.lastSelTime&&g.lastOrigin==j||ml(e,j,He(g.done),t))?g.done[g.done.length-1]=t:io(t,g.done),g.lastSelTime=+new Date,g.lastSelOrigin=j,g.lastSelOp=o,a&&a.clearRedo!==!1&&is(g.undone)}function io(e,t){var o=He(t);o&&o.ranges&&o.equals(e)||t.push(e)}function as(e,t,o,a){var g=t["spans_"+e.id],j=0;e.iter(Math.max(e.first,o),Math.min(e.first+e.size,a),function(q){q.markedSpans&&((g||(g=t["spans_"+e.id]={}))[j]=q.markedSpans),++j})}function vl(e){if(!e)return null;for(var t,o=0;o-1&&(He(ie)[Ne]=ue[Ne],delete ue[Ne]))}}return a}function Ro(e,t,o,a){if(a){var g=e.anchor;if(o){var j=It(t,g)<0;j!=It(o,g)<0?(g=t,t=o):j!=It(t,o)<0&&(t=o)}return new pi(g,t)}else return new pi(o||t,t)}function ro(e,t,o,a,g){g==null&&(g=e.cm&&(e.cm.display.shift||e.extend)),ur(e,new jr([Ro(e.sel.primary(),t,o,g)],0),a)}function ss(e,t,o){for(var a=[],g=e.cm&&(e.cm.display.shift||e.extend),j=0;j=t.ch:ie.to>t.ch))){if(g&&(Fe(oe,"beforeCursorEnter"),oe.explicitlyCleared))if(j.markedSpans){--q;continue}else break;if(!oe.atomic)continue;if(o){var Ne=oe.find(a<0?1:-1),Ze=void 0;if((a<0?Ae:ue)&&(Ne=fs(e,Ne,-a,Ne&&Ne.line==t.line?j:null)),Ne&&Ne.line==t.line&&(Ze=It(Ne,o))&&(a<0?Ze<0:Ze>0))return xa(e,Ne,t,a,g)}var Ve=oe.find(a<0?-1:1);return(a<0?ue:Ae)&&(Ve=fs(e,Ve,a,Ve.line==t.line?j:null)),Ve?xa(e,Ve,t,a,g):null}}return t}function oo(e,t,o,a,g){var j=a||1,q=xa(e,t,o,j,g)||!g&&xa(e,t,o,j,!0)||xa(e,t,o,-j,g)||!g&&xa(e,t,o,-j,!0);return q||(e.cantEdit=!0,Xe(e.first,0))}function fs(e,t,o,a){return o<0&&t.ch==0?t.line>e.first?C(e,Xe(t.line-1)):null:o>0&&t.ch==(a||G(e,t.line)).text.length?t.line=0;--g)gs(e,{from:a[g].from,to:a[g].to,text:g?[""]:t.text,origin:t.origin});else gs(e,t)}function gs(e,t){if(t.text.length==1&&t.text[0]==""&&It(t.from,t.to)==0)return;var o=To(e,t);rs(e,t,o,e.cm?e.cm.curOp.id:NaN),Ba(e,t,o,ji(e,t));var a=[];oa(e,function(g,j){!j&&ae(a,g.history)==-1&&(bs(g.history,t),a.push(g.history)),Ba(g,t,null,ji(g,t))})}function so(e,t,o){var a=e.cm&&e.cm.state.suppressEdits;if(a&&!o)return;for(var g=e.history,j,q=e.sel,ie=t=="undo"?g.done:g.undone,oe=t=="undo"?g.undone:g.done,ue=0;ue=0;--Ve){var Et=Ze(Ve);if(Et)return Et.v}}function vs(e,t){if(t==0)return;if(e.first+=t,e.sel=new jr(ct(e.sel.ranges,function(g){return new pi(Xe(g.anchor.line+t,g.anchor.ch),Xe(g.head.line+t,g.head.ch))}),e.sel.primIndex),e.cm){Pi(e.cm,e.first,e.first-t,t);for(var o=e.cm.display,a=o.viewFrom;ae.lastLine())return;if(t.from.linej&&(t={from:t.from,to:Xe(j,G(e,j).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Q(e,t.from,t.to),o||(o=To(e,t)),e.cm?bl(e.cm,t,a):wo(e,t,a),ao(e,o,Te),e.cantEdit&&oo(e,Xe(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,o){var a=e.doc,g=e.display,j=t.from,q=t.to,ie=!1,oe=j.line;e.options.lineWrapping||(oe=Le(Xi(G(a,j.line))),a.iter(oe,q.line+1,function(Ve){if(Ve==g.maxLine)return ie=!0,!0})),a.sel.contains(t.from,t.to)>-1&&Ee(e),wo(a,t,o,Ar(e)),e.options.lineWrapping||(a.iter(oe,j.line+t.text.length,function(Ve){var Et=Yr(Ve);Et>g.maxLineLength&&(g.maxLine=Ve,g.maxLineLength=Et,g.maxLineChanged=!0,ie=!1)}),ie&&(e.curOp.updateMaxLine=!0)),di(a,j.line),Ua(e,400);var ue=t.text.length-(q.line-j.line)-1;t.full?Pi(e):j.line==q.line&&t.text.length==1&&!es(e.doc,t)?or(e,j.line,"text"):Pi(e,j.line,q.line+1,ue);var Ae=ye(e,"changes"),Ne=ye(e,"change");if(Ne||Ae){var Ze={from:j,to:q,text:t.text,removed:t.removed,origin:t.origin};Ne&&nt(e,"change",e,Ze),Ae&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ze)}e.display.selForContextMenu=null}function Ta(e,t,o,a,g){var j;a||(a=o),It(a,o)<0&&(j=[a,o],o=j[0],a=j[1]),typeof t=="string"&&(t=e.splitLines(t)),Sa(e,{from:o,to:a,text:t,origin:g})}function _s(e,t,o,a){o1||!(this.children[0]instanceof Ha))){var ie=[];this.collapse(ie),this.children=[new Ha(ie)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var q=g.lines.length%25+25,ie=q;ie10);e.parent.maybeSpill()},iterN:function(e,t,o){for(var a=0;ae.display.maxLineLength&&(e.display.maxLine=ue,e.display.maxLineLength=Ae,e.display.maxLineChanged=!0)}a!=null&&e&&this.collapsed&&Pi(e,a,g+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&cs(e.doc)),e&&nt(e,"markerCleared",e,this,a,g),t&&pa(e),this.parent&&this.parent.clear()},sa.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var o,a,g=0;g0||q==0&&j.clearWhenEmpty!==!1)return j;if(j.replacedWith&&(j.collapsed=!0,j.widgetNode=S("span",[j.replacedWith],"CodeMirror-widget"),a.handleMouseEvents||j.widgetNode.setAttribute("cm-ignore-events","true"),a.insertLeft&&(j.widgetNode.insertLeft=!0)),j.collapsed){if(Ni(e,t.line,t,o,j)||t.line!=o.line&&Ni(e,o.line,t,o,j))throw new Error("Inserting collapsed marker partially overlapping an existing one");wi()}j.addToHistory&&rs(e,{from:t,to:o,origin:"markText"},e.sel,NaN);var ie=t.line,oe=e.cm,ue;if(e.iter(ie,o.line+1,function(Ne){oe&&j.collapsed&&!oe.options.lineWrapping&&Xi(Ne)==oe.display.maxLine&&(ue=!0),j.collapsed&&ie!=t.line&&he(Ne,0),Vi(Ne,new Di(j,ie==t.line?t.ch:null,ie==o.line?o.ch:null)),++ie}),j.collapsed&&e.iter(t.line,o.line+1,function(Ne){wr(e,Ne)&&he(Ne,0)}),j.clearOnEnter&&Pe(j,"beforeCursorEnter",function(){return j.clear()}),j.readOnly&&(ri(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),j.collapsed&&(j.id=++xs,j.atomic=!0),oe){if(ue&&(oe.curOp.updateMaxLine=!0),j.collapsed)Pi(oe,t.line,o.line+1);else if(j.className||j.startStyle||j.endStyle||j.css||j.attributes||j.title)for(var Ae=t.line;Ae<=o.line;Ae++)or(oe,Ae,"text");j.atomic&&cs(oe.doc),nt(oe,"markerAdded",oe,j)}return j}var za=function(e,t){this.markers=e,this.primary=t;for(var o=0;o=0;oe--)Sa(this,a[oe]);ie?us(this,ie):this.cm&&ya(this.cm)}),undo:tr(function(){so(this,"undo")}),redo:tr(function(){so(this,"redo")}),undoSelection:tr(function(){so(this,"undo",!0)}),redoSelection:tr(function(){so(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,o=0,a=0;a=e.ch)&&t.push(g.marker.parent||g.marker)}return t},findMarks:function(e,t,o){e=C(this,e),t=C(this,t);var a=[],g=e.line;return this.iter(e.line,t.line+1,function(j){var q=j.markedSpans;if(q)for(var ie=0;ie=oe.to||oe.from==null&&g!=e.line||oe.from!=null&&g==t.line&&oe.from>=t.ch)&&(!o||o(oe.marker))&&a.push(oe.marker.parent||oe.marker)}++g}),a},getAllMarks:function(){var e=[];return this.iter(function(t){var o=t.markedSpans;if(o)for(var a=0;ae)return t=e,!0;e-=j,++o}),C(this,Xe(o,t))},indexFromPos:function(e){e=C(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var Ae=e.dataTransfer.getData("Text");if(Ae){var Ne;if(t.state.draggingText&&!t.state.draggingText.copy&&(Ne=t.listSelections()),ao(t.doc,ra(o,o)),Ne)for(var Ze=0;Ze=0;ie--)Ta(e.doc,"",a[ie].from,a[ie].to,"+delete");ya(e)})}function Lo(e,t,o){var a=je(e.text,t+o,o);return a<0||a>e.text.length?null:a}function Io(e,t,o){var a=Lo(e,t.ch,o);return a==null?null:new Xe(t.line,a,o<0?"after":"before")}function Do(e,t,o,a,g){if(e){t.doc.direction=="rtl"&&(g=-g);var j=jt(o,t.doc.direction);if(j){var q=g<0?He(j):j[0],ie=g<0==(q.level==1),oe=ie?"after":"before",ue;if(q.level>0||t.doc.direction=="rtl"){var Ae=ti(t,o);ue=g<0?o.text.length-1:0;var Ne=Dn(t,Ae,ue).top;ue=$e(function(Ze){return Dn(t,Ae,Ze).top==Ne},g<0==(q.level==1)?q.from:q.to-1,ue),oe=="before"&&(ue=Lo(o,ue,1))}else ue=g<0?q.to:q.from;return new Xe(a,ue,oe)}}return new Xe(a,g<0?o.text.length:0,g<0?"before":"after")}function Ml(e,t,o,a){var g=jt(t,e.doc.direction);if(!g)return Io(t,o,a);o.ch>=t.text.length?(o.ch=t.text.length,o.sticky="before"):o.ch<=0&&(o.ch=0,o.sticky="after");var j=bt(g,o.ch,o.sticky),q=g[j];if(e.doc.direction=="ltr"&&q.level%2==0&&(a>0?q.to>o.ch:q.from=q.from&&Ze>=Ae.begin)){var Ve=Ne?"before":"after";return new Xe(o.line,Ze,Ve)}}var Et=function(Jt,rn,Zt){for(var dn=function(Ci,nr){return nr?new Xe(o.line,ie(Ci,1),"before"):new Xe(o.line,Ci,"after")};Jt>=0&&Jt0==(An.level!=1),Qn=En?Zt.begin:ie(Zt.end,-1);if(An.from<=Qn&&Qn0?Ae.end:ie(Ae.begin,-1);return Ht!=null&&!(a>0&&Ht==t.text.length)&&(Ut=Et(a>0?0:g.length-1,a,ue(Ht)),Ut)?Ut:null}var Ya={selectAll:ps,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Te)},killLine:function(e){return Oa(e,function(t){if(t.empty()){var o=G(e.doc,t.head.line).text.length;return t.head.ch==o&&t.head.line0)g=new Xe(g.line,g.ch+1),e.replaceRange(j.charAt(g.ch-1)+j.charAt(g.ch-2),Xe(g.line,g.ch-2),g,"+transpose");else if(g.line>e.doc.first){var q=G(e.doc,g.line-1).text;q&&(g=new Xe(g.line,1),e.replaceRange(j.charAt(0)+e.doc.lineSeparator()+q.charAt(q.length-1),Xe(g.line-1,q.length-1),g,"+transpose"))}}o.push(new pi(g,g))}e.setSelections(o)})},newlineAndIndent:function(e){return Pr(e,function(){for(var t=e.listSelections(),o=t.length-1;o>=0;o--)e.replaceRange(e.doc.lineSeparator(),t[o].anchor,t[o].head,"+input");t=e.listSelections();for(var a=0;ae&&It(t,this.pos)==0&&o==this.button};var Qa,Ja;function Wl(e,t){var o=+new Date;return Ja&&Ja.compare(o,e,t)?(Qa=Ja=null,"triple"):Qa&&Qa.compare(o,e,t)?(Ja=new Mo(o,e,t),Qa=null,"double"):(Qa=new Mo(o,e,t),Ja=null,"single")}function Fs(e){var t=this,o=t.display;if(Je(t,e)||o.activeTouch&&o.input.supportsTouch())return;if(o.input.ensurePolled(),o.shift=e.shiftKey,Un(o,e)){L||(o.scroller.draggable=!1,setTimeout(function(){return o.scroller.draggable=!0},100));return}if(ko(t,e))return;var a=$i(t,e),g=Ke(e),j=a?Wl(a,g):"single";if(window.focus(),g==1&&t.state.selectingText&&t.state.selectingText(e),a&&Hl(t,g,a,j,e))return;g==1?a?Gl(t,a,j,e):Ce(e)==o.scroller&&le(e):g==2?(a&&ro(t.doc,a),setTimeout(function(){return o.input.focus()},20)):g==3&&(O?t.display.input.onContextMenu(e):_a(t))}function Hl(e,t,o,a,g){var j="Click";return a=="double"?j="Double"+j:a=="triple"&&(j="Triple"+j),j=(t==1?"Left":t==2?"Middle":"Right")+j,$a(e,As(j,g),g,function(q){if(typeof q=="string"&&(q=Ya[q]),!q)return!1;var ie=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),ie=q(e,o)!=xe}finally{e.state.suppressEdits=!1}return ie})}function Kl(e,t,o){var a=e.getOption("configureMouse"),g=a?a(e,t,o):{};if(g.unit==null){var j=d?o.shiftKey&&o.metaKey:o.altKey;g.unit=j?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(g.extend==null||e.doc.extend)&&(g.extend=e.doc.extend||o.shiftKey),g.addNew==null&&(g.addNew=n?o.metaKey:o.ctrlKey),g.moveOnDrag==null&&(g.moveOnDrag=!(n?o.altKey:o.ctrlKey)),g}function Gl(e,t,o,a){B?setTimeout(H(na,e),0):e.curOp.focus=N();var g=Kl(e,o,a),j=e.doc.sel,q;e.options.dragDrop&&st&&!e.isReadOnly()&&o=="single"&&(q=j.contains(t))>-1&&(It((q=j.ranges[q]).from(),t)<0||t.xRel>0)&&(It(q.to(),t)>0||t.xRel<0)?zl(e,a,t,g):Vl(e,a,t,g)}function zl(e,t,o,a){var g=e.display,j=!1,q=er(e,function(ue){L&&(g.scroller.draggable=!1),e.state.draggingText=!1,rt(g.wrapper.ownerDocument,"mouseup",q),rt(g.wrapper.ownerDocument,"mousemove",ie),rt(g.scroller,"dragstart",oe),rt(g.scroller,"drop",q),j||(le(ue),a.addNew||ro(e.doc,o,null,null,a.extend),L&&!u||B&&M==9?setTimeout(function(){g.wrapper.ownerDocument.body.focus({preventScroll:!0}),g.input.focus()},20):g.input.focus())}),ie=function(ue){j=j||Math.abs(t.clientX-ue.clientX)+Math.abs(t.clientY-ue.clientY)>=10},oe=function(){return j=!0};L&&(g.scroller.draggable=!0),e.state.draggingText=q,q.copy=!a.moveOnDrag,g.scroller.dragDrop&&g.scroller.dragDrop(),Pe(g.wrapper.ownerDocument,"mouseup",q),Pe(g.wrapper.ownerDocument,"mousemove",ie),Pe(g.scroller,"dragstart",oe),Pe(g.scroller,"drop",q),_a(e),setTimeout(function(){return g.input.focus()},20)}function js(e,t,o){if(o=="char")return new pi(t,t);if(o=="word")return e.findWordAt(t);if(o=="line")return new pi(Xe(t.line,0),C(e.doc,Xe(t.line+1,0)));var a=o(e,t);return new pi(a.from,a.to)}function Vl(e,t,o,a){var g=e.display,j=e.doc;le(t);var q,ie,oe=j.sel,ue=oe.ranges;if(a.addNew&&!a.extend?(ie=j.sel.contains(o),ie>-1?q=ue[ie]:q=new pi(o,o)):(q=j.sel.primary(),ie=j.sel.primIndex),a.unit=="rectangle")a.addNew||(q=new pi(o,o)),o=$i(e,t,!0,!0),ie=-1;else{var Ae=js(e,o,a.unit);a.extend?q=Ro(q,Ae.anchor,Ae.head,a.extend):q=Ae}a.addNew?ie==-1?(ie=ue.length,ur(j,zr(e,ue.concat([q]),ie),{scroll:!1,origin:"*mouse"})):ue.length>1&&ue[ie].empty()&&a.unit=="char"&&!a.extend?(ur(j,zr(e,ue.slice(0,ie).concat(ue.slice(ie+1)),0),{scroll:!1,origin:"*mouse"}),oe=j.sel):Ao(j,ie,q,Oe):(ie=0,ur(j,new jr([q],0),Oe),oe=j.sel);var Ne=o;function Ze(Zt){if(It(Ne,Zt)==0)return;if(Ne=Zt,a.unit=="rectangle"){for(var dn=[],An=e.options.tabSize,En=z(G(j,o.line).text,o.ch,An),Qn=z(G(j,Zt.line).text,Zt.ch,An),Ci=Math.min(En,Qn),nr=Math.max(En,Qn),ki=Math.min(o.line,Zt.line),Mr=Math.min(e.lastLine(),Math.max(o.line,Zt.line));ki<=Mr;ki++){var Er=G(j,ki).text,Gi=De(Er,Ci,An);Ci==nr?dn.push(new pi(Xe(ki,Gi),Xe(ki,Gi))):Er.length>Gi&&dn.push(new pi(Xe(ki,Gi),Xe(ki,De(Er,nr,An))))}dn.length||dn.push(new pi(o,o)),ur(j,zr(e,oe.ranges.slice(0,ie).concat(dn),ie),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Zt)}else{var xr=q,sr=js(e,Zt,a.unit),Ji=xr.anchor,zi;It(sr.anchor,Ji)>0?(zi=sr.head,Ji=nn(xr.from(),sr.anchor)):(zi=sr.anchor,Ji=pn(xr.to(),sr.head));var Fi=oe.ranges.slice(0);Fi[ie]=Xl(e,new pi(C(j,Ji),zi)),ur(j,zr(e,Fi,ie),Oe)}}var Ve=g.wrapper.getBoundingClientRect(),Et=0;function Ut(Zt){var dn=++Et,An=$i(e,Zt,!0,a.unit=="rectangle");if(!An)return;if(It(An,Ne)!=0){e.curOp.focus=N(),Ze(An);var En=Gr(g,j);(An.line>=En.to||An.lineVe.bottom?20:0;Qn&&setTimeout(er(e,function(){if(Et!=dn)return;g.scroller.scrollTop+=Qn,Ut(Zt)}),50)}}function Ht(Zt){e.state.selectingText=!1,Et=Infinity,Zt&&(le(Zt),g.input.focus()),rt(g.wrapper.ownerDocument,"mousemove",Jt),rt(g.wrapper.ownerDocument,"mouseup",rn),j.history.lastSelOrigin=null}var Jt=er(e,function(Zt){Zt.buttons===0||!Ke(Zt)?Ht(Zt):Ut(Zt)}),rn=er(e,Ht);e.state.selectingText=rn,Pe(g.wrapper.ownerDocument,"mousemove",Jt),Pe(g.wrapper.ownerDocument,"mouseup",rn)}function Xl(e,t){var o=t.anchor,a=t.head,g=G(e.doc,o.line);if(It(o,a)==0&&o.sticky==a.sticky)return t;var j=jt(g);if(!j)return t;var q=bt(j,o.ch,o.sticky),ie=j[q];if(ie.from!=o.ch&&ie.to!=o.ch)return t;var oe=q+(ie.from==o.ch==(ie.level!=1)?0:1);if(oe==0||oe==j.length)return t;var ue;if(a.line!=o.line)ue=(a.line-o.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Ae=bt(j,a.ch,a.sticky),Ne=Ae-q||(a.ch-o.ch)*(ie.level==1?-1:1);Ae==oe-1||Ae==oe?ue=Ne<0:ue=Ne>0}var Ze=j[oe+(ue?-1:0)],Ve=ue==(Ze.level==1),Et=Ve?Ze.from:Ze.to,Ut=Ve?"after":"before";return o.ch==Et&&o.sticky==Ut?t:new pi(new Xe(o.line,Et,Ut),a)}function Bs(e,t,o,a){var g,j;if(t.touches)g=t.touches[0].clientX,j=t.touches[0].clientY;else try{g=t.clientX,j=t.clientY}catch(Ze){return!1}if(g>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;a&&le(t);var q=e.display,ie=q.lineDiv.getBoundingClientRect();if(j>ie.bottom||!ye(e,o))return ve(t);j-=ie.top-q.viewOffset;for(var oe=0;oe=g){var Ae=Ge(e.doc,j),Ne=e.display.gutterSpecs[oe];return Fe(e,o,e,Ae,Ne.className,t),ve(t)}}}function ko(e,t){return Bs(e,t,"gutterClick",!0)}function Ws(e,t){if(Un(e.display,t)||Yl(e,t))return;if(Je(e,t,"contextmenu"))return;O||e.display.input.onContextMenu(t)}function Yl(e,t){return ye(e,"gutterContextMenu")?Bs(e,t,"gutterContextMenu",!1):!1}function Hs(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),qt(e)}var Ra={toString:function(){return"CodeMirror.Init"}},Ks={},ho={};function $l(e){var t=e.optionHandlers;function o(a,g,j,q){e.defaults[a]=g,j&&(t[a]=q?function(ie,oe,ue){ue!=Ra&&j(ie,oe,ue)}:j)}e.defineOption=o,e.Init=Ra,o("value","",function(a,g){return a.setValue(g)},!0),o("mode",null,function(a,g){a.doc.modeOption=g,Co(a)},!0),o("indentUnit",2,Co,!0),o("indentWithTabs",!1),o("smartIndent",!0),o("tabSize",4,function(a){ja(a),qt(a),Pi(a)},!0),o("lineSeparator",null,function(a,g){if(a.doc.lineSep=g,!g)return;var j=[],q=a.doc.first;a.doc.iter(function(oe){for(var ue=0;;){var Ae=oe.text.indexOf(g,ue);if(Ae==-1)break;ue=Ae+g.length,j.push(Xe(q,Ae))}q++});for(var ie=j.length-1;ie>=0;ie--)Ta(a.doc,g,j[ie],Xe(j[ie].line,j[ie].ch+g.length))}),o("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(a,g,j){a.state.specialChars=new RegExp(g.source+(g.test(" ")?"":"| "),"g"),j!=Ra&&a.refresh()}),o("specialCharPlaceholder",un,function(a){return a.refresh()},!0),o("electricChars",!0),o("inputStyle",r?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),o("spellcheck",!1,function(a,g){return a.getInputField().spellcheck=g},!0),o("autocorrect",!1,function(a,g){return a.getInputField().autocorrect=g},!0),o("autocapitalize",!1,function(a,g){return a.getInputField().autocapitalize=g},!0),o("rtlMoveVisually",!w),o("wholeLineUpdateBefore",!0),o("theme","default",function(a){Hs(a),Fa(a)},!0),o("keyMap","default",function(a,g,j){var q=uo(g),ie=j!=Ra&&uo(j);ie&&ie.detach&&ie.detach(a,q),q.attach&&q.attach(a,ie||null)}),o("extraKeys",null),o("configureMouse",null),o("lineWrapping",!1,Jl,!0),o("gutters",[],function(a,g){a.display.gutterSpecs=So(g,a.options.lineNumbers),Fa(a)},!0),o("fixedGutter",!0,function(a,g){a.display.gutters.style.left=g?Vn(a.display)+"px":"0",a.refresh()},!0),o("coverGutterNextToScrollbar",!1,function(a){return ba(a)},!0),o("scrollbarStyle","native",function(a){zo(a),ba(a),a.display.scrollbars.setScrollTop(a.doc.scrollTop),a.display.scrollbars.setScrollLeft(a.doc.scrollLeft)},!0),o("lineNumbers",!1,function(a,g){a.display.gutterSpecs=So(a.options.gutters,g),Fa(a)},!0),o("firstLineNumber",1,Fa,!0),o("lineNumberFormatter",function(a){return a},Fa,!0),o("showCursorWhenSelecting",!1,In,!0),o("resetSelectionOnContextMenu",!0),o("lineWiseCopyCut",!0),o("pasteLinesPerSelection",!0),o("selectionsMayTouch",!1),o("readOnly",!1,function(a,g){g=="nocursor"&&(Ir(a),a.display.input.blur()),a.display.input.readOnlyChanged(g)}),o("screenReaderLabel",null,function(a,g){g=g===""?null:g,a.display.input.screenReaderLabelChanged(g)}),o("disableInput",!1,function(a,g){g||a.display.input.reset()},!0),o("dragDrop",!0,Ql),o("allowDropFileTypes",null),o("cursorBlinkRate",530),o("cursorScrollMargin",0),o("cursorHeight",1,In,!0),o("singleCursorHeightPerLine",!0,In,!0),o("workTime",100),o("workDelay",100),o("flattenSpans",!0,ja,!0),o("addModeClass",!1,ja,!0),o("pollInterval",100),o("undoDepth",200,function(a,g){return a.doc.history.undoDepth=g}),o("historyEventDelay",1250),o("viewportMargin",10,function(a){return a.refresh()},!0),o("maxHighlightLength",1e4,ja,!0),o("moveInputWithCursor",!0,function(a,g){g||a.display.input.resetPosition()}),o("tabindex",null,function(a,g){return a.display.input.getField().tabIndex=g||""}),o("autofocus",null),o("direction","ltr",function(a,g){return a.doc.setDirection(g)},!0),o("phrases",null)}function Ql(e,t,o){var a=o&&o!=Ra;if(!t!=!a){var g=e.display.dragFunctions,j=t?Pe:rt;j(e.display.scroller,"dragstart",g.start),j(e.display.scroller,"dragenter",g.enter),j(e.display.scroller,"dragover",g.over),j(e.display.scroller,"dragleave",g.leave),j(e.display.scroller,"drop",g.drop)}}function Jl(e){e.options.lineWrapping?(F(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(v(e.display.wrapper,"CodeMirror-wrap"),$r(e)),Br(e),Pi(e),qt(e),setTimeout(function(){return ba(e)},100)}function Ii(e,t){var o=this;if(!(this instanceof Ii))return new Ii(e,t);this.options=t=t?A(t):{},A(Ks,t,!1);var a=t.value;typeof a=="string"?a=new br(a,t.mode,null,t.lineSeparator,t.direction):t.mode&&(a.modeOption=t.mode),this.doc=a;var g=new Ii.inputStyles[t.inputStyle](this),j=this.display=new dl(e,a,g,t);j.wrapper.CodeMirror=this,Hs(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),zo(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new ne,keySeq:null,specialChars:null},t.autofocus&&!r&&j.input.focus(),B&&M<11&&setTimeout(function(){return o.display.input.reset(!0)},20),Zl(this),Al(),fa(this),this.curOp.forceUpdate=!0,ts(this,a),t.autofocus&&!r||this.hasFocus()?setTimeout(function(){o.hasFocus()&&!o.state.focused&&Wr(o)},20):Ir(this);for(var q in ho)ho.hasOwnProperty(q)&&ho[q](this,t[q],Ra);Yo(this),t.finishInit&&t.finishInit(this);for(var ie=0;ie20*20}Pe(t.scroller,"touchstart",function(oe){if(!Je(e,oe)&&!j(oe)&&!ko(e,oe)){t.input.ensurePolled(),clearTimeout(o);var ue=+new Date;t.activeTouch={start:ue,moved:!1,prev:ue-a.end<=300?a:null},oe.touches.length==1&&(t.activeTouch.left=oe.touches[0].pageX,t.activeTouch.top=oe.touches[0].pageY)}}),Pe(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Pe(t.scroller,"touchend",function(oe){var ue=t.activeTouch;if(ue&&!Un(t,oe)&&ue.left!=null&&!ue.moved&&new Date-ue.start<300){var Ae=e.coordsChar(t.activeTouch,"page"),Ne;!ue.prev||q(ue,ue.prev)?Ne=new pi(Ae,Ae):!ue.prev.prev||q(ue,ue.prev.prev)?Ne=e.findWordAt(Ae):Ne=new pi(Xe(Ae.line,0),C(e.doc,Xe(Ae.line+1,0))),e.setSelection(Ne.anchor,Ne.head),e.focus(),le(oe)}g()}),Pe(t.scroller,"touchcancel",g),Pe(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Ma(e,t.scroller.scrollTop),ca(e,t.scroller.scrollLeft,!0),Fe(e,"scroll",e))}),Pe(t.scroller,"mousewheel",function(oe){return Jo(e,oe)}),Pe(t.scroller,"DOMMouseScroll",function(oe){return Jo(e,oe)}),Pe(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(oe){Je(e,oe)||pe(oe)},over:function(oe){Je(e,oe)||(Rl(e,oe),pe(oe))},start:function(oe){return Ol(e,oe)},drop:er(e,wl),leave:function(oe){Je(e,oe)||Cs(e)}};var ie=t.input.getField();Pe(ie,"keyup",function(oe){return Ns.call(e,oe)}),Pe(ie,"keydown",er(e,ks)),Pe(ie,"keypress",er(e,Us)),Pe(ie,"focus",function(oe){return Wr(e,oe)}),Pe(ie,"blur",function(oe){return Ir(e,oe)})}var No=[];Ii.defineInitHook=function(e){return No.push(e)};function Za(e,t,o,a){var g=e.doc,j;o==null&&(o="add"),o=="smart"&&(g.mode.indent?j=St(e,t).state:o="prev");var q=e.options.tabSize,ie=G(g,t),oe=z(ie.text,null,q);ie.stateAfter&&(ie.stateAfter=null);var ue=ie.text.match(/^\s*/)[0],Ae;if(!a&&!/\S/.test(ie.text))Ae=0,o="not";else if(o=="smart"&&(Ae=g.mode.indent(j,ie.text.slice(ue.length),ie.text),Ae==xe||Ae>150)){if(!a)return;o="prev"}o=="prev"?t>g.first?Ae=z(G(g,t-1).text,null,q):Ae=0:o=="add"?Ae=oe+e.options.indentUnit:o=="subtract"?Ae=oe-e.options.indentUnit:typeof o=="number"&&(Ae=oe+o),Ae=Math.max(0,Ae);var Ne="",Ze=0;if(e.options.indentWithTabs)for(var Ve=Math.floor(Ae/q);Ve;--Ve)Ze+=q,Ne+=" ";if(Zeq,oe=Qe(t),ue=null;if(ie&&a.ranges.length>1)if(Vr&&Vr.text.join(` `)==t){if(a.ranges.length%Vr.text.length==0){ue=[];for(var Ae=0;Ae=0;Ze--){var Ve=a.ranges[Ze],Et=Ve.from(),Ut=Ve.to();Ve.empty()&&(o&&o>0?Et=Xe(Et.line,Et.ch-o):e.state.overwrite&&!ie?Ut=Xe(Ut.line,Math.min(G(j,Ut.line).text.length,Ut.ch+He(oe).length)):ie&&Vr&&Vr.lineWise&&Vr.text.join(` `)==oe.join(` `)&&(Et=Ut=Xe(Et.line,0)));var Ht={from:Et,to:Ut,text:ue?ue[Ze%ue.length]:oe,origin:g||(ie?"paste":e.state.cutIncoming>q?"cut":"+input")};Sa(e.doc,Ht),nt(e,"inputRead",e,Ht)}t&&!ie&&zs(e,t),ya(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ne),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Gs(e,t){var o=e.clipboardData&&e.clipboardData.getData("Text");if(o)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Pr(t,function(){return Uo(t,o,0,null,"paste")}),!0}function zs(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var o=e.doc.sel,a=o.ranges.length-1;a>=0;a--){var g=o.ranges[a];if(g.head.ch>100||a&&o.ranges[a-1].head.line==g.head.line)continue;var j=e.getModeAt(g.head),q=!1;if(j.electricChars){for(var ie=0;ie-1){q=Za(e,g.head.line,"smart");break}}else j.electricInput&&(j.electricInput.test(G(e.doc,g.head.line).text.slice(0,g.head.ch))&&(q=Za(e,g.head.line,"smart")));q&&nt(e,"electricInput",e,g.head.line)}}function Vs(e){for(var t=[],o=[],a=0;aj&&(Za(this,ie.head.line,a,!0),j=ie.head.line,q==this.doc.sel.primIndex&&ya(this));else{var oe=ie.from(),ue=ie.to(),Ae=Math.max(j,oe.line);j=Math.min(this.lastLine(),ue.line-(ue.ch?0:1))+1;for(var Ne=Ae;Ne0&&Ao(this.doc,q,new pi(oe,Ze[q].to()),Te)}}}),getTokenAt:function(a,g){return Wn(this,a,g)},getLineTokens:function(a,g){return Wn(this,Xe(a),g,!0)},getTokenTypeAt:function(a){a=C(this.doc,a);var g=ut(this,G(this.doc,a.line)),j=0,q=(g.length-1)/2,ie=a.ch,oe;if(ie==0)oe=g[2];else for(;;){var ue=j+q>>1;if((ue?g[ue*2-1]:0)>=ie)q=ue;else if(g[ue*2+1]oe&&(a=oe,q=!0),ie=G(this.doc,a)}else ie=a;return qi(this,ie,{top:0,left:0},g||"page",j||q).top+(q?this.doc.height-vr(ie):0)},defaultTextHeight:function(){return zn(this.display)},defaultCharWidth:function(){return Yn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(a,g,j,q,ie){var oe=this.display;a=li(this,C(this.doc,a));var ue=a.bottom,Ae=a.left;if(g.style.position="absolute",g.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(g),oe.sizer.appendChild(g),q=="over")ue=a.top;else if(q=="above"||q=="near"){var Ne=Math.max(oe.wrapper.clientHeight,this.doc.height),Ze=Math.max(oe.sizer.clientWidth,oe.lineSpace.clientWidth);(q=="above"||a.bottom+g.offsetHeight>Ne)&&a.top>g.offsetHeight?ue=a.top-g.offsetHeight:a.bottom+g.offsetHeight<=Ne&&(ue=a.bottom),Ae+g.offsetWidth>Ze&&(Ae=Ze-g.offsetWidth)}g.style.top=ue+"px",g.style.left=g.style.right="",ie=="right"?(Ae=oe.sizer.clientWidth-g.offsetWidth,g.style.right="0px"):(ie=="left"?Ae=0:ie=="middle"&&(Ae=(oe.sizer.clientWidth-g.offsetWidth)/2),g.style.left=Ae+"px"),j&&Qi(this,{left:Ae,top:ue,right:Ae+g.offsetWidth,bottom:ue+g.offsetHeight})},triggerOnKeyDown:pr(ks),triggerOnKeyPress:pr(Us),triggerOnKeyUp:Ns,triggerOnMouseDown:pr(Fs),execCommand:function(a){if(Ya.hasOwnProperty(a))return Ya[a].call(null,this)},triggerElectric:pr(function(a){zs(this,a)}),findPosH:function(a,g,j,q){var ie=1;g<0&&(ie=-1,g=-g);for(var oe=C(this.doc,a),ue=0;ue0&&Ae(j.charAt(q-1));)--q;for(;ie.5||this.options.lineWrapping)&&Br(this),Fe(this,"refresh",this)}),swapDoc:pr(function(a){var g=this.doc;return g.cm=null,this.state.selectingText&&this.state.selectingText(),ts(this,a),qt(this),this.display.input.reset(),Pa(this,a.scrollLeft,a.scrollTop),this.curOp.forceScroll=!0,nt(this,"swapDoc",this,g),g}),phrase:function(a){var g=this.options.phrases;return g&&Object.prototype.hasOwnProperty.call(g,a)?g[a]:a},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},_e(e),e.registerHelper=function(a,g,j){o.hasOwnProperty(a)||(o[a]=e[a]={_global:[]}),o[a][g]=j},e.registerGlobalHelper=function(a,g,j,q){e.registerHelper(a,g,q),o[a]._global.push({pred:j,val:q})}}function Fo(e,t,o,a,g){var j=t,q=o,ie=G(e,t.line),oe=g&&e.direction=="rtl"?-o:o;function ue(){var rn=t.line+oe;return rn=e.first+e.size?!1:(t=new Xe(rn,t.ch,t.sticky),ie=G(e,rn))}function Ae(rn){var Zt;if(a=="codepoint"){var dn=ie.text.charCodeAt(t.ch+(a>0?0:-1));isNaN(dn)?Zt=null:Zt=new Xe(t.line,Math.max(0,Math.min(ie.text.length,t.ch+o*(dn>=55296&&dn<56320?2:1))),-o)}else g?Zt=Ml(e.cm,ie,t,o):Zt=Io(ie,t,o);if(Zt==null)if(!rn&&ue())t=Do(g,e.cm,ie,t.line,oe);else return!1;else t=Zt;return!0}if(a=="char"||a=="codepoint")Ae();else if(a=="column")Ae(!0);else if(a=="word"||a=="group")for(var Ne=null,Ze=a=="group",Ve=e.cm&&e.cm.getHelper(t,"wordChars"),Et=!0;!(o<0&&!Ae(!Et));Et=!1){var Ut=ie.text.charAt(t.ch)||` `,Ht=xt(Ut,Ve)?"w":Ze&&Ut==` `?"n":!Ze||/\s/.test(Ut)?null:"p";if(Ze&&!Et&&!Ht&&(Ht="s"),Ne&&Ne!=Ht){o<0&&(o=1,Ae(),t.sticky="after");break}if(Ht&&(Ne=Ht),o>0&&!Ae(!Et))break}var Jt=oo(e,t,j,q,!0);return an(j,Jt)&&(Jt.hitSide=!0),Jt}function $s(e,t,o,a){var g=e.doc,j=t.left,q;if(a=="page"){var ie=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),oe=Math.max(ie-.5*zn(e.display),3);q=(o>0?t.bottom:t.top)+o*oe}else a=="line"&&(q=o>0?t.bottom+3:t.top-3);for(var ue;!(ue=Kr(e,j,q),!ue.outside);){if(o<0?q<=0:q>=g.height){ue.hitSide=!0;break}q+=o*5}return ue}var xi=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ne,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};xi.prototype.init=function(e){var t=this,o=this,a=o.cm,g=o.div=e.lineDiv;Xs(g,a.options.spellcheck,a.options.autocorrect,a.options.autocapitalize);function j(ie){for(var oe=ie.target;oe;oe=oe.parentNode){if(oe==g)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(oe.className))break}return!1}Pe(g,"paste",function(ie){if(!j(ie)||Je(a,ie)||Gs(ie,a))return;M<=11&&setTimeout(er(a,function(){return t.updateFromDOM()}),20)}),Pe(g,"compositionstart",function(ie){t.composing={data:ie.data,done:!1}}),Pe(g,"compositionupdate",function(ie){t.composing||(t.composing={data:ie.data,done:!1})}),Pe(g,"compositionend",function(ie){t.composing&&(ie.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Pe(g,"touchstart",function(){return o.forceCompositionEnd()}),Pe(g,"input",function(){t.composing||t.readFromDOMSoon()});function q(ie){if(!j(ie)||Je(a,ie))return;if(a.somethingSelected())fo({lineWise:!1,text:a.getSelections()}),ie.type=="cut"&&a.replaceSelection("",null,"cut");else if(a.options.lineWiseCopyCut){var oe=Vs(a);fo({lineWise:!0,text:oe.text}),ie.type=="cut"&&a.operation(function(){a.setSelections(oe.ranges,0,Te),a.replaceSelection("",null,"cut")})}else return;if(ie.clipboardData){ie.clipboardData.clearData();var ue=Vr.text.join(` `);if(ie.clipboardData.setData("Text",ue),ie.clipboardData.getData("Text")==ue){ie.preventDefault();return}}var Ae=Ys(),Ne=Ae.firstChild;a.display.lineSpace.insertBefore(Ae,a.display.lineSpace.firstChild),Ne.value=Vr.text.join(` `);var Ze=document.activeElement;Z(Ne),setTimeout(function(){a.display.lineSpace.removeChild(Ae),Ze.focus(),Ze==g&&o.showPrimarySelection()},50)}Pe(g,"copy",q),Pe(g,"cut",q)},xi.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},xi.prototype.prepareSelection=function(){var e=Ei(this.cm,!1);return e.focus=document.activeElement==this.div,e},xi.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},xi.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},xi.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,o=t.doc.sel.primary(),a=o.from(),g=o.to();if(t.display.viewTo==t.display.viewFrom||a.line>=t.display.viewTo||g.line=t.display.viewFrom&&Qs(t,a)||{node:ie[0].measure.map[2],offset:0},ue=g.linee.firstLine()&&(a=Xe(a.line-1,G(e.doc,a.line-1).length)),g.ch==G(e.doc,g.line).text.length&&g.linet.viewTo-1)return!1;var j,q,ie;a.line==t.viewFrom||(j=Lr(e,a.line))==0?(q=Le(t.view[0].line),ie=t.view[0].node):(q=Le(t.view[j].line),ie=t.view[j-1].node.nextSibling);var oe=Lr(e,g.line),ue,Ae;if(oe==t.view.length-1?(ue=t.viewTo-1,Ae=t.lineDiv.lastChild):(ue=Le(t.view[oe+1].line)-1,Ae=t.view[oe+1].node.previousSibling),!ie)return!1;for(var Ne=e.doc.splitLines(tu(e,ie,Ae,q,ue)),Ze=Q(e.doc,Xe(q,0),Xe(ue,G(e.doc,ue).text.length));Ne.length>1&&Ze.length>1;)if(He(Ne)==He(Ze))Ne.pop(),Ze.pop(),ue--;else if(Ne[0]==Ze[0])Ne.shift(),Ze.shift(),q++;else break;for(var Ve=0,Et=0,Ut=Ne[0],Ht=Ze[0],Jt=Math.min(Ut.length,Ht.length);Vea.ch&&rn.charCodeAt(rn.length-Et-1)==Zt.charCodeAt(Zt.length-Et-1);)Ve--,Et++;Ne[Ne.length-1]=rn.slice(0,rn.length-Et).replace(/^\u200b+/,""),Ne[0]=Ne[0].slice(Ve).replace(/\u200b+$/,"");var An=Xe(q,Ve),En=Xe(ue,Ze.length?He(Ze).length-Et:0);if(Ne.length>1||Ne[0]||It(An,En))return Ta(e.doc,Ne,An,En,"+input"),!0},xi.prototype.ensurePolled=function(){this.forceCompositionEnd()},xi.prototype.reset=function(){this.forceCompositionEnd()},xi.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},xi.prototype.readFromDOMSoon=function(){var e=this;if(this.readDOMTimeout!=null)return;this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80)},xi.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Pr(this.cm,function(){return Pi(e.cm)})},xi.prototype.setUneditable=function(e){e.contentEditable="false"},xi.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||er(this.cm,Uo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},xi.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},xi.prototype.onContextMenu=function(){},xi.prototype.resetPosition=function(){},xi.prototype.needsContentAttribute=!0;function Qs(e,t){var o=ui(e,t.line);if(!o||o.hidden)return null;var a=G(e.doc,t.line),g=Tn(o,a,t.line),j=jt(a,e.doc.direction),q="left";if(j){var ie=bt(j,t.ch);q=ie%2?"right":"left"}var oe=Rn(g.map,t.ch,q);return oe.offset=oe.collapse=="right"?oe.end:oe.start,oe}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Aa(e,t){return t&&(e.bad=!0),e}function tu(e,t,o,a,g){var j="",q=!1,ie=e.doc.lineSeparator(),oe=!1;function ue(Ve){return function(Et){return Et.id==Ve}}function Ae(){q&&(j+=ie,oe&&(j+=ie),q=oe=!1)}function Ne(Ve){Ve&&(Ae(),j+=Ve)}function Ze(Ve){if(Ve.nodeType==1){var Et=Ve.getAttribute("cm-text");if(Et){Ne(Et);return}var Ut=Ve.getAttribute("cm-marker"),Ht;if(Ut){var Jt=e.findMarks(Xe(a,0),Xe(g+1,0),ue(+Ut));Jt.length&&(Ht=Jt[0].find(0))&&Ne(Q(e.doc,Ht.from,Ht.to).join(ie));return}if(Ve.getAttribute("contenteditable")=="false")return;var rn=/^(pre|div|p|li|table|br)$/i.test(Ve.nodeName);if(!/^br$/i.test(Ve.nodeName)&&Ve.textContent.length==0)return;rn&&Ae();for(var Zt=0;Zt=9&&t.hasSelection&&(t.hasSelection=null),o.poll()}),Pe(g,"paste",function(q){if(Je(a,q)||Gs(q,a))return;a.state.pasteIncoming=+new Date,o.fastPoll()});function j(q){if(Je(a,q))return;if(a.somethingSelected())fo({lineWise:!1,text:a.getSelections()});else if(a.options.lineWiseCopyCut){var ie=Vs(a);fo({lineWise:!0,text:ie.text}),q.type=="cut"?a.setSelections(ie.ranges,null,Te):(o.prevInput="",g.value=ie.text.join(` `),Z(g))}else return;q.type=="cut"&&(a.state.cutIncoming=+new Date)}Pe(g,"cut",j),Pe(g,"copy",j),Pe(e.scroller,"paste",function(q){if(Un(e,q)||Je(a,q))return;if(!g.dispatchEvent){a.state.pasteIncoming=+new Date,o.focus();return}var ie=new Event("paste");ie.clipboardData=q.clipboardData,g.dispatchEvent(ie)}),Pe(e.lineSpace,"selectstart",function(q){Un(e,q)||le(q)}),Pe(g,"compositionstart",function(){var q=a.getCursor("from");o.composing&&o.composing.range.clear(),o.composing={start:q,range:a.markText(q,a.getCursor("to"),{className:"CodeMirror-composing"})}}),Pe(g,"compositionend",function(){o.composing&&(o.poll(),o.composing.range.clear(),o.composing=null)})},Bi.prototype.createField=function(e){this.wrapper=Ys(),this.textarea=this.wrapper.firstChild},Bi.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Bi.prototype.prepareSelection=function(){var e=this.cm,t=e.display,o=e.doc,a=Ei(e);if(e.options.moveInputWithCursor){var g=li(e,o.sel.primary().head,"div"),j=t.wrapper.getBoundingClientRect(),q=t.lineDiv.getBoundingClientRect();a.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,g.top+q.top-j.top)),a.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,g.left+q.left-j.left))}return a},Bi.prototype.showSelection=function(e){var t=this.cm,o=t.display;f(o.cursorDiv,e.cursors),f(o.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Bi.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var o=t.getSelection();this.textarea.value=o,t.state.focused&&Z(this.textarea),B&&M>=9&&(this.hasSelection=o)}else e||(this.prevInput=this.textarea.value="",B&&M>=9&&(this.hasSelection=null))},Bi.prototype.getField=function(){return this.textarea},Bi.prototype.supportsTouch=function(){return!1},Bi.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!r||N()!=this.textarea))try{this.textarea.focus()}catch(e){}},Bi.prototype.blur=function(){this.textarea.blur()},Bi.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Bi.prototype.receivedFocus=function(){this.slowPoll()},Bi.prototype.slowPoll=function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Bi.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function o(){var a=t.poll();!a&&!e?(e=!0,t.polling.set(60,o)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,o)},Bi.prototype.poll=function(){var e=this,t=this.cm,o=this.textarea,a=this.prevInput;if(this.contextMenuPending||!t.state.focused||it(o)&&!a&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var g=o.value;if(g==a&&!t.somethingSelected())return!1;if(B&&M>=9&&this.hasSelection===g||n&&/[\uf700-\uf7ff]/.test(g))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var j=g.charCodeAt(0);if(j==8203&&!a&&(a="\u200B"),j==8666)return this.reset(),this.cm.execCommand("undo")}for(var q=0,ie=Math.min(a.length,g.length);q1e3||g.indexOf(` `)>-1?o.value=e.prevInput="":e.prevInput=g,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Bi.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Bi.prototype.onKeyPress=function(){B&&M>=9&&(this.hasSelection=null),this.fastPoll()},Bi.prototype.onContextMenu=function(e){var t=this,o=t.cm,a=o.display,g=t.textarea;t.contextMenuPending&&t.contextMenuPending();var j=$i(o,e),q=a.scroller.scrollTop;if(!j||m)return;var ie=o.options.resetSelectionOnContextMenu;ie&&o.doc.sel.contains(j)==-1&&er(o,ur)(o.doc,ra(j),Te);var oe=g.style.cssText,ue=t.wrapper.style.cssText,Ae=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",g.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-Ae.top-5)+"px; left: "+(e.clientX-Ae.left-5)+`px; z-index: 1000; background: `+(B?"rgba(255, 255, 255, .05)":"transparent")+`; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ne;L&&(Ne=window.scrollY),a.input.focus(),L&&window.scrollTo(null,Ne),a.input.reset(),o.somethingSelected()||(g.value=t.prevInput=" "),t.contextMenuPending=Ve,a.selForContextMenu=o.doc.sel,clearTimeout(a.detectingSelectAll);function Ze(){if(g.selectionStart!=null){var Ut=o.somethingSelected(),Ht="\u200B"+(Ut?g.value:"");g.value="\u21DA",g.value=Ht,t.prevInput=Ut?"":"\u200B",g.selectionStart=1,g.selectionEnd=Ht.length,a.selForContextMenu=o.doc.sel}}function Ve(){if(t.contextMenuPending!=Ve)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=ue,g.style.cssText=oe,B&&M<9&&a.scrollbars.setScrollTop(a.scroller.scrollTop=q),g.selectionStart!=null){(!B||B&&M<9)&&Ze();var Ut=0,Ht=function(){a.selForContextMenu==o.doc.sel&&g.selectionStart==0&&g.selectionEnd>0&&t.prevInput=="\u200B"?er(o,ps)(o):Ut++<10?a.detectingSelectAll=setTimeout(Ht,500):(a.selForContextMenu=null,a.input.reset())};a.detectingSelectAll=setTimeout(Ht,200)}}if(B&&M>=9&&Ze(),O){pe(e);var Et=function(){rt(window,"mouseup",Et),setTimeout(Ve,20)};Pe(window,"mouseup",Et)}else setTimeout(Ve,50)},Bi.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Bi.prototype.setUneditable=function(){},Bi.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?A(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var o=N();t.autofocus=o==e||e.getAttribute("autofocus")!=null&&o==document.body}function a(){e.value=ie.getValue()}var g;if(e.form&&(Pe(e.form,"submit",a),!t.leaveSubmitMethodAlone)){var j=e.form;g=j.submit;try{var q=j.submit=function(){a(),j.submit=g,j.submit(),j.submit=q}}catch(oe){}}t.finishInit=function(oe){oe.save=a,oe.getTextArea=function(){return e},oe.toTextArea=function(){oe.toTextArea=isNaN,a(),e.parentNode.removeChild(oe.getWrapperElement()),e.style.display="",e.form&&(rt(e.form,"submit",a),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=g))}},e.style.display="none";var ie=Ii(function(oe){return e.parentNode.insertBefore(oe,e.nextSibling)},t);return ie}function ru(e){e.off=rt,e.on=Pe,e.wheelEventPixels=cl,e.Doc=br,e.splitLines=Qe,e.countColumn=z,e.findColumn=De,e.isWordChar=ht,e.Pass=xe,e.signal=Fe,e.Line=fr,e.changeEnd=aa,e.scrollbarModel=Go,e.Pos=Xe,e.cmpPos=It,e.modes=ot,e.mimeModes=ze,e.resolveMode=ke,e.getMode=qe,e.modeExtensions=Rt,e.extendMode=Pt,e.copyState=$t,e.startState=se,e.innerMode=fe,e.commands=Ya,e.keyMap=qr,e.keyName=Ls,e.isModifierKey=Rs,e.lookupKey=wa,e.normalizeKeyMap=Pl,e.StringStream=U,e.SharedTextMarker=za,e.TextMarker=sa,e.LineWidget=Ga,e.e_preventDefault=le,e.e_stopPropagation=de,e.e_stop=pe,e.addClass=F,e.contains=b,e.rmClass=v,e.keyNames=la}$l(Ii),ql(Ii);var au="iter insert remove copy getEditor constructor".split(" ");for(var mo in br.prototype)br.prototype.hasOwnProperty(mo)&&ae(au,mo)<0&&(Ii.prototype[mo]=function(e){return function(){return e.apply(this.doc,arguments)}}(br.prototype[mo]));return _e(br),Ii.inputStyles={textarea:Bi,contenteditable:xi},Ii.defineMode=function(e){!Ii.defaults.mode&&e!="null"&&(Ii.defaults.mode=e),Lt.apply(this,arguments)},Ii.defineMIME=Dt,Ii.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Ii.defineMIME("text/plain","null"),Ii.defineExtension=function(e,t){Ii.prototype[e]=t},Ii.defineDocExtension=function(e,t){br.prototype[e]=t},Ii.fromTextArea=iu,ru(Ii),Ii.version="5.58.2",Ii})},W7jJ:function(Be,we,k){"use strict";k.r(we);var ee=k("0Owb"),V=k("PpiC"),P=k("OaEy"),Y=k("2fM7"),W=k("T2oS"),R=k("W9HT"),B=k("miYZ"),M=k("tsqr"),L=k("2qtc"),I=k("kLXV"),p=k("9og8"),m=k("tJVT"),u=k("k1fw"),h=k("aHsQ"),s=k("sGsY"),l=k("WmNS"),i=k.n(l),r=k("q1tI"),n=k.n(r),d=k("Fvcw"),w=k("GIiI"),T=k("Ty5D"),x=k("9kvl"),O=k("55Ip"),E=k("7qur"),v=k("cDPC"),_=k("m3rI"),f=k("RCxd"),c=k("EHPI"),S=k("J66h"),y=k("uMZB"),b=k.n(y),N=k("sNtx"),F=k("RpDr"),X=k("+L6B"),Z=k("2/Rp"),H=k("y8nQ"),A=k("Vl3Y"),z=k("5NDa"),ne=k("5rEg"),ae=ne.a.TextArea,me=5e3,xe=function(Ye){var pt=Ye.callback,Kt=Ye.onCancel,fn=Ye.notes;function tn(Xt){pt(Xt)}return n.a.createElement(A.a,{className:"note-form-panel",onFinish:tn,initialValues:{notes:fn}},n.a.createElement(A.a.Item,{name:"notes",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9"},{max:me,message:"\u7B14\u8BB0\u6700\u5927\u5B57\u6570\u4E3A".concat(me)}]},n.a.createElement(ae,{placeholder:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9",rows:5})),n.a.createElement(A.a.Item,{style:{textAlign:"right"}},n.a.createElement(Z.a,{type:"ghost",onClick:Kt,style:{marginRight:10}}," \u53D6\u6D88 "),n.a.createElement(Z.a,{type:"primary",htmlType:"submit"}," \u63D0\u4EA4 ")))},Te=k("ZsLC"),Oe=k.n(Te),Ue=k("DjyN"),De=k("NUBc"),be=k("g9YV"),ge=k("wCAj"),He=k("Hw79"),ct=k.n(He),vt=k("ye1Q"),_t=k("lfch"),yt=k("bdLU"),et=k("1vsH"),ht=k("wd/R"),xt=k.n(ht),Tt=ge.a.Column,mt=function(Ye){var pt=Ye.submitResult,Kt=Ye.submitting,fn=Ye.submitRecords,tn=Ye.page,Xt=Ye.onPageChange,nt=Ye.topicId,gt=pt||{},cn=gt.status,ft=gt.id,hn=gt.input,Bt=gt.output,vn=gt.expected_output,Kn=gt.is_file,Mn=gt.input_file_url,Sn=gt.output_file_url,ni=gt.expected_output_file_url,Ln=gt.error_msg,Zn=fn||{},qn=Zn.records,bi=Zn.records_count,Un=Object(T.i)();function mi(){Kn?navigator.clipboard.writeText(S.Base64.decode(Ln)).then(function(){M.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")}):navigator.clipboard.writeText(S.Base64.decode(Bt)).then(function(){M.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")})}return n.a.createElement(R.a,{spinning:Kt,tip:"\u8BC4\u6D4B\u4E2D...",indicator:n.a.createElement(vt.a,{style:{fontSize:24},spin:!0})},ft?n.a.createElement(n.a.Fragment,null,n.a.createElement("ul",{className:ct.a.info},n.a.createElement("li",null,"\u6267\u884C\u7ED3\u679C\uFF1A",n.a.createElement("span",{className:cn===yt.a.OK?"c-green":"c-red"},F.a[cn])),n.a.createElement("li",{className:ct.a.error},n.a.createElement("a",{onClick:mi},"\u590D\u5236\u9519\u8BEF\u4FE1\u606F ",n.a.createElement(_t.a,null)," ")),n.a.createElement("li",null,n.a.createElement(O.a,{to:"/problems/".concat(nt,"/record-detail/").concat(ft,"?backId=").concat(Un==null?void 0:Un.save_identifier)},"\u663E\u793A\u8BE6\u60C5 > "))),cn!==yt.a.OK?n.a.createElement(n.a.Fragment,null,n.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),n.a.createElement("pre",null,!Kn&&hn,Kn&&n.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(et.y)(Mn,hn)}},hn)),n.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),n.a.createElement("pre",null,(cn===4||cn===5)&&S.Base64.decode(Ln),cn!=4&&cn!=5&&(Kn?n.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(et.y)(Sn,Bt)}},Bt):S.Base64.decode(Bt))),n.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),n.a.createElement("pre",null,!Kn&&S.Base64.decode(vn),Kn&&n.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(et.y)(ni,vn)}},vn))):null):null,(qn==null?void 0:qn.length)>0?n.a.createElement(ge.a,{dataSource:qn,rowKey:"id",pagination:!1},n.a.createElement(Tt,{title:"\u63D0\u4EA4\u65F6\u95F4",dataIndex:"created_at",key:"created_at",render:function(ai,kn){return n.a.createElement("span",null," ",xt()(ai).format("YYYY-MM-DD HH:mm:ss"))}}),n.a.createElement(Tt,{title:"\u63D0\u4EA4\u7ED3\u679C",dataIndex:"status",key:"status",render:function(ai,kn){var ei;return n.a.createElement(O.a,{className:ai===0?"c-green":"c-red",to:"/problems/".concat(nt,"/record-detail/").concat(kn.id,"?backId=").concat(Un==null?void 0:Un.save_identifier)},(ei=F.a[ai])===null||ei===void 0?void 0:ei.replace("\u8C03\u8BD5","\u8BC4\u6D4B"))}}),n.a.createElement(Tt,{title:"\u6267\u884C\u7528\u65F6 (S)",dataIndex:"execute_time",key:"execute_time"}),n.a.createElement(Tt,{title:"\u5185\u5B58\u6D88\u8017\uFF08MB\uFF09",dataIndex:"execute_memory",key:"execute_memory"}),n.a.createElement(Tt,{title:"\u8BED\u8A00",dataIndex:"language",key:"language"})):null,bi>15?n.a.createElement(De.a,{className:ct.a.pagination,current:tn,pageSize:15,total:bi,onChange:Xt}):null)},Ie=k("BdwD"),je=k("DYRE"),$e=k("zeV3"),at=k("+BJd"),lt=k("mr32"),bt=k("TcMa"),Mt=k.n(bt),jt=k("9Bee"),Me={1:{name:"\u7B80\u5355",color:"#52c41a"},2:{name:"\u9002\u4E2D",color:"#faad14"},3:{name:"\u56F0\u96BE",color:"#f5222d"}},Pe=function(Ye){var pt=Ye.hack,Kt=Ye.onTriggerPraise,fn=Ye.toDiscuss,tn=pt.language,Xt=pt.difficulty,nt=pt.time_limit,gt=pt.username,cn=pt.user_path,ft=pt.user_praise,hn=pt.comments_count,Bt=pt.praises_count,vn=pt.description,Kn=pt.pass_count,Mn=pt.submit_count,Sn=Object(T.h)();console.log(pt.language,"language");var ni=Me[Xt];return n.a.createElement(n.a.Fragment,null,n.a.createElement("ul",{className:Mt.a.info},n.a.createElement("li",null,"\u96BE\u5EA6\uFF1A",n.a.createElement(lt.a,{color:ni.color},ni.name)),n.a.createElement("li",null,"\u8BC4\u6D4B\u65F6\u957F\u9650\u5236\uFF1A",n.a.createElement("b",null,nt,"\u79D2"))),n.a.createElement(jt.a,{value:vn,className:Mt.a.desc}),n.a.createElement("ul",{className:Mt.a["commit-info"]},n.a.createElement("li",null,n.a.createElement($e.a,{size:4},n.a.createElement("span",null,"\u901A\u8FC7\u6B21\u6570")," ",n.a.createElement("b",null,Kn))),n.a.createElement("li",null,n.a.createElement($e.a,{size:4},n.a.createElement("span",null,"\u63D0\u4EA4\u6B21\u6570")," ",n.a.createElement("b",null,Mn))," "),n.a.createElement("li",{style:{flex:"1 0 0"}}),n.a.createElement("li",null,n.a.createElement($e.a,{size:4},n.a.createElement("i",{className:"iconfont icon-huifu1",onClick:fn})," ",n.a.createElement("b",null,hn))," ")))},tt=k("dhSg"),rt=k("ps8w"),Fe=k.n(rt),Je=k("oBTY"),Ee=k("M8RZ"),ye=k("OkW/"),_e=k("ErOA");function le(Ye){return Object(_e.c)("comments.json",Ye)}function de(Ye){return Object(_e.f)("/discusses/".concat(Ye,"/plus.json"),{container_type:"Discuss",type:1})}function ve(Ye){return Object(_e.f)("comments/reply.json",Ye)}function pe(Ye){return Object(_e.f)("comments.json",Ye)}function Ce(Ye){return Object(_e.f)("comments/".concat(Ye==null?void 0:Ye.id,"/hidden.json"),Ye)}function Ke(Ye){return Object(_e.b)("comments/".concat(Ye==null?void 0:Ye.id,".json"))}var st=k("GgEA"),At=k("AMnG"),Ft=k("xKgJ");function kt(Ye){var pt=Ye.author;return n.a.createElement("a",{href:"/users/".concat(pt.login),target:"_blank"},n.a.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",height:"50",style:{borderRadius:"50%"},src:"".concat(_.a.IMG_SERVER,"/images/").concat(pt.image_url),width:"50"}))}function wt(Ye){var pt=Ye.data,Kt=Ye.index,fn=Ye.parentDiscussIndex,tn=Ye.user,Xt=Ye.onSetActionType,nt=pt.author,gt=pt.can_delete,cn=pt.content,ft=pt.id,hn=pt.time;function Bt(){Xt({id:ft,index:Kt,type:"delete-discuss",parentDiscussIndex:fn,message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}var vn=tn.admin||gt||nt.user_id===tn.user_id;return n.a.createElement("div",{className:"discuss-item-container second-discuss "},n.a.createElement(kt,{author:nt}),n.a.createElement("section",null,n.a.createElement("div",{className:"discuss-info"},n.a.createElement("a",{href:"/users/".concat(nt.login),target:"_blank"},nt.name),n.a.createElement("span",{className:"grey"},hn),n.a.createElement("div",{className:"btn-group",style:{marginBottom:0}},vn?n.a.createElement("a",{onClick:Bt,title:"\u5220\u9664"},n.a.createElement("i",{className:"iconfont icon-shanchu"})):null)),n.a.createElement(jt.a,{className:"discuss-content",value:cn})))}var Qe=function(Ye){var pt=Ye.user,Kt=Ye.data,fn=Ye.index,tn=Ye.onPlusDiscuss,Xt=Ye.onSetActionType,nt=Ye.activeDiscussIndex,gt=Ye.onReplyDiscuss,cn=Ye.onSetActiveDiscussIndex,ft=Kt.content,hn=Kt.children,Bt=Kt.hidden,vn=Kt.id,Kn=Kt.praise_count,Mn=Kt.time,Sn=Kt.user_praise,ni=Kt.can_delete,Ln=Kt.author;console.log(ni&&(!hn||hn.length==0),"children22");function Zn(){cn(vn)}function qn(){tn(vn,!Sn,fn)}function bi(){Xt({id:vn,index:fn,type:"delete-discuss",message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}function Un(){Xt({id:vn,index:fn,params:{hidden:Bt?"0":"1"},type:"hidden-discuss",message:Bt?"\u786E\u5B9A\u8981\u53D6\u6D88\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417":"\u786E\u5B9A\u8981\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417"})}var mi=pt.admin||pt.user_id===Ln.user_id;return n.a.createElement("div",{className:"discuss-item-container",key:vn},n.a.createElement(kt,{author:Ln}),n.a.createElement("section",null,n.a.createElement("div",{className:"discuss-info"},n.a.createElement("a",{href:"/users/".concat(Ln.login),target:"_blank"}," ",Ln.name," "),n.a.createElement("span",{className:"grey"},Mn)),n.a.createElement(jt.a,{className:"discuss-content",value:ft}),hn&&hn.length>0?n.a.createElement("div",{className:"reply-discuss-container"},hn.map(function(gi,ai){return n.a.createElement(wt,{key:gi.id,data:gi,index:ai,user:pt,onSetActionType:Xt,parentDiscussIndex:fn})})):null,n.a.createElement("div",{className:"btn-group"},Object(Ft.v)()?n.a.createElement("a",{onClick:Un,title:Bt?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF\u8BC4\u8BBA"},n.a.createElement("i",{className:Bt?"iconfont icon-yincangbiyan":"fa fa-eye"})):null,ni&&(!hn||hn.length==0)?n.a.createElement("a",{onClick:bi,title:"\u5220\u9664"},n.a.createElement("i",{className:"iconfont icon-shanchu"})):null,n.a.createElement("a",{onClick:Zn,title:"\u56DE\u590D"}," ",n.a.createElement("i",{className:"iconfont icon-huifu1"})," "),n.a.createElement("a",{onClick:qn,className:Sn?"c-orange":""},n.a.createElement("i",{className:Sn?"iconfont icon-dianzan mr3":"iconfont icon-dianzan-xian mr3 "}),n.a.createElement("span",null,Kn||""))),n.a.createElement(At.a,{id:vn,activeDiscussIndex:nt,onReplyDiscuss:gt})))},it=k("kaH+"),We=k("Wx9E"),ce=k("Ot1p"),Se=function(Ye){var pt=Ye.user_praise,Kt=Ye.praise_count,fn=Ye.praisePlus,tn=Ye.onCreateDiscuss,Xt=Ye.discuss_count,nt=Object(r.useState)(!1),gt=Object(m.a)(nt,2),cn=gt[0],ft=gt[1],hn=Object(r.useState)(""),Bt=Object(m.a)(hn,2),vn=Bt[0],Kn=Bt[1];function Mn(qn){Kn(qn)}function Sn(){ft(!0)}function ni(){ft(!1)}function Ln(){return Zn.apply(this,arguments)}function Zn(){return Zn=Object(p.a)(i.a.mark(function qn(){return i.a.wrap(function(Un){for(;;)switch(Un.prev=Un.next){case 0:tn(vn),Kn(""),ft(!1);case 3:case"end":return Un.stop()}},qn)})),Zn.apply(this,arguments)}return n.a.createElement("div",{className:"dis-input-editor-container ".concat(cn?"active":""," ")},n.a.createElement("div",{className:cn?"text-area hide":"text-area"},n.a.createElement("input",{placeholder:"\u8BF4\u70B9\u4EC0\u4E48",onClick:Sn}),n.a.createElement("a",{style:{alignItems:"center"}}," ",n.a.createElement("i",{className:"iconfont icon-huifu1"})," \xA0 \xA0",Xt," "),n.a.createElement("a",{className:"c-light-black",onClick:fn,style:{alignItems:"center"},title:pt?"\u53D6\u6D88\u70B9\u8D5E":"\u70B9\u8D5E"},n.a.createElement("i",{className:"mr3 ".concat(pt?"iconfont icon-dianzan c-orange":"iconfont icon-dianzan-xian"," ")}),Kt?n.a.createElement("span",null,Kt):"")),cn?n.a.createElement("div",{className:"input-mask",onClick:ni}):null,n.a.createElement("div",{className:cn?"md-container":"md-container hide"},n.a.createElement(ce.a,{id:"discuss-input-editor",miniToolbar:!0,watch:!1,noStorage:!0,defaultValue:vn,height:240,onChange:Mn}),n.a.createElement("div",{className:"tip-container",onClick:ni},n.a.createElement("a",{className:"btn-send",onClick:Ln}," \u53D1\u9001 "))))},ot={loading:!1,page:1,data:[],count:0,actionType:null,activeDiscussIndex:null},ze;(function(Ye){Ye[Ye.GET_DISCUSSES=0]="GET_DISCUSSES",Ye[Ye.TOP_OR_DOWN_DISCUSS=1]="TOP_OR_DOWN_DISCUSS",Ye[Ye.ACTIVE_DISCUSS_INDEX=2]="ACTIVE_DISCUSS_INDEX",Ye[Ye.PLUS_DISCUSS=3]="PLUS_DISCUSS",Ye[Ye.SET_ACTION_TYPE=4]="SET_ACTION_TYPE",Ye[Ye.SET_PAGE=5]="SET_PAGE",Ye[Ye.SHOW_DISCUSSES_LOADING=6]="SHOW_DISCUSSES_LOADING"})(ze||(ze={}));function Lt(Ye,pt){switch(pt.type){case ze.SHOW_DISCUSSES_LOADING:return Object(u.a)(Object(u.a)({},Ye),{},{loading:!0});case ze.GET_DISCUSSES:return Object(u.a)(Object(u.a)({},Ye),pt.payload);case ze.TOP_OR_DOWN_DISCUSS:return Object(u.a)(Object(u.a)({},Ye),pt.payload);case ze.SET_ACTION_TYPE:return Object(u.a)(Object(u.a)({},Ye),pt.payload);case ze.PLUS_DISCUSS:return Object(u.a)(Object(u.a)({},Ye),pt.payload);case ze.SET_PAGE:return Object(u.a)(Object(u.a)({},Ye),{},{page:pt.payload});case ze.ACTIVE_DISCUSS_INDEX:return Object(u.a)(Object(u.a)({},Ye),pt.payload);default:throw new Error}}var Dt=function(Ye){var pt=Ye.user,Kt=Ye.identifier,fn=Ye.hack,tn=Ye.onTriggerPraise,Xt=Ye.setDiscussTotal,nt=Object(r.useReducer)(Lt,ot),gt=Object(m.a)(nt,2),cn=gt[0],ft=gt[1],hn=cn.loading,Bt=cn.page,vn=cn.data,Kn=cn.count,Mn=cn.actionType,Sn=cn.activeDiscussIndex,ni=Object(r.useCallback)(Object(p.a)(i.a.mark(function Tn(){var si,vi,ui;return i.a.wrap(function(Dn){for(;;)switch(Dn.prev=Dn.next){case 0:return ft({type:ze.SHOW_DISCUSSES_LOADING}),Dn.next=3,le({container_type:"Practice",container_identifier:Kt,limit:10,page:Bt});case 3:si=Dn.sent,vi=si.comments,ui=si.disscuss_count,ft({type:ze.GET_DISCUSSES,payload:{data:vi,count:ui,loading:!1}}),Xt(ui);case 7:case"end":return Dn.stop()}},Tn)})),[Bt,Kt]);Object(r.useEffect)(function(){ni()},[Kt,Bt]);function Ln(Tn){ft({type:ze.SET_PAGE,page:Tn})}function Zn(Tn){ft({type:ze.SET_ACTION_TYPE,payload:{actionType:Tn}})}function qn(Tn){Sn===Tn?ft({type:ze.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:null}}):ft({type:ze.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:Tn}})}function bi(Tn,si,vi){return Un.apply(this,arguments)}function Un(){return Un=Object(p.a)(i.a.mark(function Tn(si,vi,ui){var ti;return i.a.wrap(function(yn){for(;;)switch(yn.prev=yn.next){case 0:return yn.prev=0,yn.next=3,de(si);case 3:ti=yn.sent,vn[ui].user_praise=vi,vn[ui].praise_count=ti.praise_count,ft({type:ze.PLUS_DISCUSS,payload:{data:Object(Je.a)(vn)}}),yn.next=12;break;case 9:yn.prev=9,yn.t0=yn.catch(0),console.log(yn.t0);case 12:case"end":return yn.stop()}},Tn,null,[[0,9]])})),Un.apply(this,arguments)}function mi(){return gi.apply(this,arguments)}function gi(){return gi=Object(p.a)(i.a.mark(function Tn(){var si,vi,ui,ti,Dn;return i.a.wrap(function(Rn){for(;;)switch(Rn.prev=Rn.next){case 0:if(si=Mn.id,vi=Mn.params,ui=Mn.type,ti=Mn.index,Dn=Mn.parentDiscussIndex,!(ui==="hidden-discuss")){Rn.next=7;break}return console.log(vi,"params"),Rn.next=5,Ce(Object(u.a)({id:si,container_type:"Practice",container_identifier:Kt},vi));case 5:Dn?vn[Dn].children[ti].hidden=vi.hidden==1:vn[ti].hidden=vi.hidden==1,ft({type:ze.SET_ACTION_TYPE,payload:{actionType:null,data:Object(Je.a)(vn)}});case 7:if(!(ui==="delete-discuss")){Rn.next=13;break}return Rn.next=10,Ke({id:si,container_type:"Practice",container_identifier:Kt});case 10:return ft({type:ze.SET_ACTION_TYPE,payload:{actionType:null}}),Rn.next=13,ni();case 13:case"end":return Rn.stop()}},Tn)})),gi.apply(this,arguments)}function ai(){ft({type:ze.SET_ACTION_TYPE,payload:{actionType:null}})}function kn(Tn,si){return ei.apply(this,arguments)}function ei(){return ei=Object(p.a)(i.a.mark(function Tn(si,vi){return i.a.wrap(function(ti){for(;;)switch(ti.prev=ti.next){case 0:return ti.prev=0,ti.next=3,ve({container_type:"Practice",container_identifier:Kt,comments:{content:vi,parent_id:si}});case 3:ni(),ti.next=9;break;case 6:ti.prev=6,ti.t0=ti.catch(0),console.log(ti.t0);case 9:case"end":return ti.stop()}},Tn,null,[[0,6]])})),ei.apply(this,arguments)}function Gn(Tn){return Vt.apply(this,arguments)}function Vt(){return Vt=Object(p.a)(i.a.mark(function Tn(si){return i.a.wrap(function(ui){for(;;)switch(ui.prev=ui.next){case 0:return ft({type:ze.SHOW_DISCUSSES_LOADING}),ui.next=3,pe({comments:{content:si},container_type:"Practice",container_identifier:Kt});case 3:ni();case 4:case"end":return ui.stop()}},Tn)})),Vt.apply(this,arguments)}return n.a.createElement(n.a.Fragment,null,n.a.createElement("div",{className:"discuss-panel"},vn.length===0?n.a.createElement(Ie.a,null):vn.map(function(Tn,si){return n.a.createElement(Qe,{onReplyDiscuss:kn,onPlusDiscuss:bi,onSetActiveDiscussIndex:qn,onSetActionType:Zn,data:Tn,index:si,user:pt,activeDiscussIndex:Sn})}),Kn>10?n.a.createElement("div",{className:"pagination-container"},n.a.createElement(De.a,{showQuickJumper:!0,onChange:Ln,current:Bt,total:Kn})):null),n.a.createElement(Se,{user_praise:fn.user_praise,praise_count:fn.praises_count,praisePlus:tn,discuss_count:fn.comments_count,onCreateDiscuss:Gn}),n.a.createElement(Ee.a,null,n.a.createElement(I.a,{centered:!0,title:"\u63D0\u793A",visible:!!Mn,onOk:mi,onCancel:ai},n.a.createElement("p",null,Mn?Mn.message:"")),n.a.createElement(it.a,null)))},ke=k("1FX+"),qe=k.n(ke),Rt=k("pYxM"),Pt=k.n(Rt),$t=k("sB/4"),fe=k.n($t),se=k("Wtmd"),U=k.n(se),G=k("CNDd"),Q=k.n(G),te=k("nCk5"),he=k.n(te),Le=k("kovY"),Ge=k.n(Le),Ot=function(pt){var Kt=pt.style,fn=Kt===void 0?{}:Kt,tn=pt.onClick,Xt=pt.onAssist,nt=pt.onHide,gt=pt.data,cn=pt.active,ft=pt.showLine;return n.a.createElement(n.a.Fragment,null,n.a.createElement("div",{className:cn===(gt==null?void 0:gt.id)?"".concat(Pt.a.list," ").concat(Pt.a.active):Pt.a.list,style:fn,onClick:function(){return tn(gt)}},(gt==null?void 0:gt.video)&&n.a.createElement("div",{className:Pt.a.left},n.a.createElement("img",{src:gt==null?void 0:gt.video_cover}),n.a.createElement("div",null,n.a.createElement("img",{src:fe.a}),n.a.createElement("span",null,gt==null?void 0:gt.video_duration)),n.a.createElement("div",{className:Pt.a.mask})),n.a.createElement("div",{className:Pt.a.right},n.a.createElement("div",{className:Pt.a.name},n.a.createElement("img",{src:_.a.IMG_SERVER+"/images/"+(gt==null?void 0:gt.image_url),width:30,height:30}),n.a.createElement("div",{title:gt==null?void 0:gt.name,className:Pt.a.title},gt==null?void 0:gt.name),(gt==null?void 0:gt.is_authority)&&n.a.createElement("div",{className:Pt.a.b},"\u5B98\u65B9"),(gt==null?void 0:gt.is_excellent)&&n.a.createElement("div",{className:Pt.a.a},"\u7CBE\u9009")),n.a.createElement("div",{className:Pt.a.des},n.a.createElement(jt.a,{showLines:2,showTextOnly:!0,value:(gt==null?void 0:gt.content)||"\u6682\u65E0\u5185\u5BB9"})),n.a.createElement("div",{className:Pt.a.tag},n.a.createElement("span",{className:"current",onClick:function(Bt){Bt.stopPropagation(),Xt(gt)}},n.a.createElement("img",{src:gt!=null&>.user_liker?Q.a:U.a}),n.a.createElement("span",{style:{color:gt!=null&>.user_liker?"#0152d9":"#656f87"}},gt==null?void 0:gt.praises_count)),n.a.createElement("span",null,n.a.createElement("img",{src:he.a}),n.a.createElement("span",null,gt==null?void 0:gt.discusses_count)),n.a.createElement("span",null,n.a.createElement("img",{src:Ge.a}),n.a.createElement("span",null,gt==null?void 0:gt.viewed_count)),Object(Ft.v)()&&n.a.createElement("span",{className:"current",style:{color:"#0152d9",marginRight:0,userSelect:"none"},onClick:function(Bt){Bt.stopPropagation(),nt(gt)}},gt!=null&>.is_hidden?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF")))),ft&&n.a.createElement("div",{className:Pt.a.line}))},Nt=Ot,Xe=k("5Dmo"),It=k("3S7+"),an=k("Z8dc"),Ct=k.n(an),pn=k("7+5b"),nn=k.n(pn),$=k("twBr"),C=k.n($),D=k("oE5q"),K=k.n(D),re=k("9+Du"),J=function(pt){var Kt,fn=pt.onClose,tn=pt.onOk,Xt=pt.identifier,nt=pt.active,gt=A.a.useForm(),cn=Object(m.a)(gt,1),ft=cn[0],hn=Object(r.useState)({}),Bt=Object(m.a)(hn,2),vn=Bt[0],Kn=Bt[1],Mn=Object(r.useState)(!1),Sn=Object(m.a)(Mn,2),ni=Sn[0],Ln=Sn[1],Zn=Object(r.useState)(!1),qn=Object(m.a)(Zn,2),bi=qn[0],Un=qn[1],mi=Object(r.useState)([]),gi=Object(m.a)(mi,2),ai=gi[0],kn=gi[1],ei=Object(Ft.x)(),Gn=Object(T.i)();Object(r.useEffect)(function(){nt&&Vt()},[nt]);var Vt=function(){var ln=Object(p.a)(i.a.mark(function Wt(){var qt,gn,ci,Li,qi,Hi,Or,li,Rr,Nr,Kr,Ur;return i.a.wrap(function(yr){for(;;)switch(yr.prev=yr.next){case 0:return yr.next=2,Object(E.k)(Xt,{active:nt});case 2:qt=yr.sent,(qt==null?void 0:qt.status)===0&&(Hi={name:qt==null||((gn=qt.data)===null||gn===void 0)?void 0:gn.name,content:qt==null||((ci=qt.data)===null||ci===void 0)?void 0:ci.content},ft.setFieldsValue(Hi),Kn(Hi),qt!=null&&(Li=qt.data)!==null&&Li!==void 0&&(qi=Li.videos)!==null&&qi!==void 0&&qi[0]&&kn([{video_id:qt==null||((Or=qt.data)===null||Or===void 0||((li=Or.videos)===null||li===void 0||((Rr=li[0])===null||Rr===void 0)))?void 0:Rr.video_id,name:qt==null||((Nr=qt.data)===null||Nr===void 0||((Kr=Nr.videos)===null||Kr===void 0||((Ur=Kr[0])===null||Ur===void 0)))?void 0:Ur.title,loaded:100}]));case 4:case"end":return yr.stop()}},Wt)}));return function(){return ln.apply(this,arguments)}}(),Tn=function(Wt,qt){Kn(Object(u.a)({},qt))},si=function(){var ln=Object(p.a)(i.a.mark(function Wt(qt){var gn,ci,Li,qi,Hi;return i.a.wrap(function(li){for(;;)switch(li.prev=li.next){case 0:if(ci={videos:ai,articles:qt},Un(!0),!nt){li.next=9;break}return ci.active=nt,li.next=6,Object(E.j)(Xt,ci);case 6:Li=li.sent,li.next=12;break;case 9:return li.next=11,Object(E.a)(Xt,ci);case 11:Li=li.sent;case 12:((gn=Li)===null||gn===void 0?void 0:gn.status)===0&&(console.log(nt||((qi=Li)===null||qi===void 0?void 0:qi.id),44),tn(nt||((Hi=Li)===null||Hi===void 0?void 0:Hi.id))),Un(!1);case 14:case"end":return li.stop()}},Wt)}));return function(qt){return ln.apply(this,arguments)}}(),vi=function(Wt){var qt=1024,gn=Wt.name.toLowerCase();return gn&&gn.indexOf(".avi")==-1&&gn.indexOf(".flv")==-1&&gn.indexOf(".f4v")==-1&&gn.indexOf(".m4v")==-1&&gn.indexOf(".mov")==-1&&gn.indexOf(".mp4")==-1&&gn.indexOf(".rmvb")==-1&&gn.indexOf(".swf")==-1&&gn.indexOf(".webm")==-1&&gn.indexOf(".wmv")==-1?(M.b.info("\u4E0D\u652F\u6301\u7684\u89C6\u9891\u683C\u5F0F"),!0):Wt.size>qt*1024*1024?(M.b.info("\u89C6\u9891\u5927\u5C0F\u8D85\u8FC7".concat(qt,"M")),!0):ai!=null&&ai.find(function(ci){return ci.name===Wt.name})?(M.b.info("\u4F60\u4E0D\u80FD\u4E0A\u4F20\u540C\u4E00\u4E2A\u89C6\u9891\u6587\u4EF6\u540D\u79F0\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u3002"),!0):!1},ui=function(Wt,qt){I.a.confirm({title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:n.a.createElement("div",{className:"tc"},"\u60A8\u786E\u8BA4\u8981",qt?"\u5220\u9664":"\u53D6\u6D88\u4E0A\u4F20","\u8BE5\u89C6\u9891\u5417\uFF1F"),onOk:function(){kn([])}})},ti={accept:".mkv, .flv, .f4v, .rmvb, .swf, video/mp4,video/x-m4v,video/flv,video/f4v,video/rmvb,video/swf,video/*",onBefore:vi,onBeginInitFile:function(Wt){Ln(!0),kn([{name:Wt.filename,loaded:0}])},onComplete:function(Wt){kn([{name:Wt.filename,loaded:Wt.percent,video_id:Wt.id}]),Ln(!1)},onError:function(){kn([]),Ln(!1)},onProgress:function(Wt){kn([{name:Wt.filename,loaded:Wt.percent}])},chunkSize:1024*1024*2,options:{user_id:ei==null?void 0:ei.user_id}},Dn=function(){return n.a.createElement(re.a,ti,n.a.createElement("div",{className:Ct.a.main},n.a.createElement("img",{src:nn.a,alt:""}),n.a.createElement("span",null,"\u4E0A\u4F20\u89C6\u9891")))},yn=function(Wt){return n.a.createElement("div",{className:Ct.a.mainLoading},n.a.createElement("div",{className:Ct.a.proWarp},n.a.createElement("div",{className:Ct.a.pro},n.a.createElement("div",{style:{width:Wt}})),n.a.createElement("span",null,Wt||0,"%")),n.a.createElement("aside",null,"\u4E0A\u4F20\u4E2D"),n.a.createElement("div",{className:Ct.a.tip},n.a.createElement(It.a,{getPopupContainer:function(gn){return gn.parentNode},title:n.a.createElement("div",null,n.a.createElement("div",null,"1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F",n.a.createElement("a",{className:"current c-light-primary",target:"_blank",href:"/users/innov/videos/protocol"},"\u4E0A\u4F20\u5185\u5BB9\u534F\u8BAE"),"\uFF0C\u4E0D\u5F97\u4E0A\u4F20\u672A\u7ECF\u4ED6\u4EBA\u6388\u6743\u7684\u4F5C\u54C1\uFF1B"),n.a.createElement("div",null,"2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC71G\uFF1B"),n.a.createElement("div",null,"3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B"))},n.a.createElement("img",{src:K.a,alt:""}))))},Rn=function(Wt){return n.a.createElement("div",{className:Ct.a.mainSucceed},n.a.createElement("img",{src:C.a,alt:""}),n.a.createElement("span",null,"\u4E0A\u4F20\u6210\u529F"),n.a.createElement("div",{className:Ct.a.tip},n.a.createElement(It.a,{getPopupContainer:function(gn){return gn.parentNode},title:n.a.createElement("div",null,n.a.createElement("div",null,"1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F",n.a.createElement("a",{className:"current c-light-primary",target:"_blank",href:"/users/innov/videos/protocol"},"\u4E0A\u4F20\u5185\u5BB9\u534F\u8BAE"),"\uFF0C\u4E0D\u5F97\u4E0A\u4F20\u672A\u7ECF\u4ED6\u4EBA\u6388\u6743\u7684\u4F5C\u54C1\uFF1B"),n.a.createElement("div",null,"2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC71G\uFF1B"),n.a.createElement("div",null,"3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B"))},n.a.createElement("img",{src:K.a,alt:""}))),n.a.createElement("div",{className:Ct.a.del,onClick:function(){return ui(Wt.name,Wt.loaded==100)}},n.a.createElement("i",{className:"iconfont icon-shanchu7 mr5"}),"\u5220\u9664\u89C6\u9891"))},zt=function(){return n.a.createElement(n.a.Fragment,null,ai==null?void 0:ai.map(function(Wt,qt){return n.a.createElement(n.a.Fragment,{key:qt},Wt.loaded==100?Rn(Wt):yn(Wt.loaded))}))},Qt=function(){I.a.confirm({centered:!0,width:500,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u6CE8\u610F",icon:null,className:"custom-modal-divider",content:"\u60A8\u6B63\u5728\u7F16\u5199\u9898\u89E3\uFF0C\u70B9\u51FB\u5173\u95ED\u540E\uFF0C\u60A8\u7684\u9898\u89E3\u5185\u5BB9\u5C06\u4E0D\u4F1A\u8FDB\u884C\u4FDD\u5B58\u3002",onOk:fn})},on=ai==null?void 0:ai.length;return n.a.createElement("div",{className:Ct.a.listForm},n.a.createElement("header",null,nt?"\u7F16\u8F91":"\u53D1\u5E03","\u9898\u89E3"),n.a.createElement("section",{className:Ct.a.scroll,id:"sss"},n.a.createElement("div",{className:Ct.a.formWrap}," ",n.a.createElement(A.a,{form:ft,scrollToFirstError:!0,layout:"vertical",onValuesChange:Tn,onFinish:si},n.a.createElement(A.a.Item,{name:"name",label:"\u6807\u9898:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u540D\u79F0"},{max:60,message:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"},{whitespace:!0,message:"\u8BF7\u52FF\u8F93\u5165\u7A7A\u683C"}]},n.a.createElement(ne.a,{bordered:!1,placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26",suffix:"".concat(((Kt=vn.name)===null||Kt===void 0?void 0:Kt.length)||0,"/60")})),n.a.createElement(A.a.Item,{name:"content",label:"\u5185\u5BB9:"},n.a.createElement(ce.a,{defaultValue:vn.content||"",watch:!0})))),n.a.createElement("div",{className:Ct.a.upload},on?zt():Dn())),n.a.createElement("div",{className:Ct.a.btns},n.a.createElement(Z.a,{onClick:Qt,type:"primary",ghost:!0},"\u5173\u95ED"),n.a.createElement(Z.a,{loading:bi,disabled:ni,onClick:function(){return ft.submit()},type:"primary"},"\u53D1\u5E03\u9898\u89E3")))},Re=J,ut=k("cWXX"),St=k("/ezw"),Yt=k("CaVn"),dt=k.n(Yt),Gt=k("s8/Y"),sn=k.n(Gt),Wn=k("JOrW"),Si=k.n(Wn),hi=k("gqXR"),Fn=k.n(hi),di=k("14J3"),Zi=k("BMrR"),_i=k("jCWc"),ri=k("kPKH"),wi=k("wW8i"),Di=k.n(wi),Oi=k("MVJL"),Ri=k.n(Oi),Vi=function(pt){var Kt=pt.id,fn=pt.cb,tn=Object(r.useState)(""),Xt=Object(m.a)(tn,2),nt=Xt[0],gt=Xt[1];return n.a.createElement("aside",{className:"mt10"},n.a.createElement(ce.a,{defaultValue:nt,id:"writeForumsReviewId",onChange:function(ft){gt(ft)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),n.a.createElement(Zi.a,null,n.a.createElement(ri.a,{flex:"1"}),n.a.createElement(ri.a,null,n.a.createElement(Z.a,{type:"primary",size:"large",onClick:Object(p.a)(i.a.mark(function cn(){return i.a.wrap(function(hn){for(;;)switch(hn.prev=hn.next){case 0:nt===""?M.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"):fn(Kt,nt);case 1:case"end":return hn.stop()}},cn)}))},"\u53D1\u9001"))))},cr=function(pt){var Kt,fn=pt.data;return n.a.createElement("div",{className:Ri.a.thirdlyLevelDiscuss},n.a.createElement("span",{className:"c-grey-333"},n.a.createElement("span",{className:"font 14 c-light-primary"},fn==null||((Kt=fn.author)===null||Kt===void 0)?void 0:Kt.name),"@",n.a.createElement("span",{className:"font 14 c-light-primary"},fn==null?void 0:fn.parent_name),":"),n.a.createElement(jt.a,{value:fn==null?void 0:fn.content}))},rr=function(pt){var Kt,fn,tn,Xt,nt=pt.data,gt=pt.onReplyDiscuss,cn=pt.thirdlyReply,ft=pt.setThirdlyReply,hn=Object(Ft.x)();return console.log(hn,"user"),n.a.createElement("div",{className:Ri.a.list},n.a.createElement("img",{src:_.a.IMG_SERVER+"/images/"+(nt==null||((Kt=nt.author)===null||Kt===void 0)?void 0:Kt.image_url)}),n.a.createElement("div",{className:Ri.a.wrap},n.a.createElement("div",{className:"font14",style:{marginBottom:6}},n.a.createElement("span",{className:"c-grey-333"},nt==null||((fn=nt.author)===null||fn===void 0)?void 0:fn.name),(hn==null?void 0:hn.login)!==(nt==null||((tn=nt.author)===null||tn===void 0)?void 0:tn.login)&&n.a.createElement("span",{onClick:function(){return ft(nt==null?void 0:nt.id)},className:"c-grey-999 current",style:{float:"right"}},n.a.createElement("i",{className:"iconfont icon-huifu3 mr3 font12"}),n.a.createElement("span",null,"\u56DE\u590D"))),n.a.createElement(jt.a,{value:nt==null?void 0:nt.content}),nt==null||((Xt=nt.children)===null||Xt===void 0)?void 0:Xt.map(function(Bt){return n.a.createElement(cr,{key:Bt.id,data:Bt})}),cn===(nt==null?void 0:nt.id)&&n.a.createElement("div",null,n.a.createElement(Vi,{id:nt==null?void 0:nt.id,cb:gt}),n.a.createElement("div",{style:{textAlign:"end",paddingTop:20},onClick:function(){return ft(null)},className:"c-light-primary current"},n.a.createElement("i",{style:{transform:"scale(0.7)",display:"inline-block"},className:"iconfont icon-shouqi font12"}),"\u6536\u8D77\u56DE\u590D")),n.a.createElement("div",{className:Ri.a.line})))},ji=function(pt){var Kt,fn,tn,Xt,nt=pt.data,gt=pt.onReplyDiscuss,cn=pt.secondReply,ft=pt.setSecondReply,hn=pt.thirdlyReply,Bt=pt.setThirdlyReply,vn=pt.onPlusDiscuss,Kn=Object(r.useState)(!1),Mn=Object(m.a)(Kn,2),Sn=Mn[0],ni=Mn[1];return console.log(nt,"data"),n.a.createElement("div",{className:Ri.a.discussItem},n.a.createElement("div",{className:Ri.a.list},n.a.createElement("img",{src:_.a.IMG_SERVER+"/images/"+(nt==null||((Kt=nt.author)===null||Kt===void 0)?void 0:Kt.image_url)}),n.a.createElement("div",{className:Ri.a.wrap},n.a.createElement("div",{className:"font14",style:{marginBottom:6}},n.a.createElement("span",{className:"c-grey-333 mr30"},nt==null||((fn=nt.author)===null||fn===void 0)?void 0:fn.name),n.a.createElement("span",{className:"c-grey-999"},nt==null?void 0:nt.time)),n.a.createElement(jt.a,{value:nt==null?void 0:nt.content}),n.a.createElement("div",{className:Ri.a.btns},n.a.createElement("div",{onClick:function(){return vn(nt==null?void 0:nt.id)},className:nt!=null&&nt.user_praise?"c-light-primary":"c-grey-999"},n.a.createElement("i",{className:"iconfont icon-xiaodianzan2 mr3"}),n.a.createElement("span",null,nt==null?void 0:nt.praise_count)),n.a.createElement("div",{onClick:function(){var Zn;if((nt==null||((Zn=nt.children)===null||Zn===void 0)?void 0:Zn.length)===0)return;ft(null),ni(!Sn)},style:{color:Sn?"#0152d9":"#999999"}},n.a.createElement("i",{className:"iconfont icon-xiaopinglun2 mr3"}),n.a.createElement("span",null,Sn?"\u6536\u8D77\u8BC4\u8BBA":nt==null||((tn=nt.children)===null||tn===void 0)?void 0:tn.length)),n.a.createElement("div",{onClick:function(){ni(!1),ft(cn===(nt==null?void 0:nt.id)?null:nt==null?void 0:nt.id)},style:{color:cn===(nt==null?void 0:nt.id)?"#0152d9":"#999999"}},n.a.createElement("i",{className:"iconfont icon-huifu3 mr3"}),n.a.createElement("span",null,cn===(nt==null?void 0:nt.id)?"\u6536\u8D77\u56DE\u590D":"\u56DE\u590D"))),cn===(nt==null?void 0:nt.id)&&n.a.createElement(Vi,{id:nt==null?void 0:nt.id,cb:function(Zn,qn){gt(Zn,qn),ni(!0)}}),Sn&&n.a.createElement("div",{className:Ri.a.secondLevelDiscuss},nt==null||((Xt=nt.children)===null||Xt===void 0)?void 0:Xt.map(function(Ln){return n.a.createElement(rr,{thirdlyReply:hn,setThirdlyReply:Bt,key:Ln.id,data:Ln,onReplyDiscuss:gt})})))))},Wi=ji,hr=function(pt){var Kt=pt.identifier,fn=pt.active,tn=pt.onOk,Xt=Object(r.useState)(""),nt=Object(m.a)(Xt,2),gt=nt[0],cn=nt[1],ft=Object(r.useState)(1),hn=Object(m.a)(ft,2),Bt=hn[0],vn=hn[1],Kn=Object(r.useState)([]),Mn=Object(m.a)(Kn,2),Sn=Mn[0],ni=Mn[1],Ln=Object(r.useState)(0),Zn=Object(m.a)(Ln,2),qn=Zn[0],bi=Zn[1],Un=Object(r.useState)(null),mi=Object(m.a)(Un,2),gi=mi[0],ai=mi[1],kn=Object(r.useState)(null),ei=Object(m.a)(kn,2),Gn=ei[0],Vt=ei[1];Object(r.useEffect)(function(){Tn(1),vn(1)},[fn]);var Tn=function(){var Dn=Object(p.a)(i.a.mark(function yn(Rn){var zt;return i.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:return on.next=2,le({container_type:"QuestionSolutionArticle",container_identifier:fn,limit:5,page:Rn});case 2:zt=on.sent,zt!=null&&zt.comments&&(ni((zt==null?void 0:zt.comments)||[]),vn(Rn),bi(zt==null?void 0:zt.disscuss_count));case 4:case"end":return on.stop()}},yn)}));return function(Rn){return Dn.apply(this,arguments)}}(),si=function(){var Dn=Object(p.a)(i.a.mark(function yn(){var Rn;return i.a.wrap(function(Qt){for(;;)switch(Qt.prev=Qt.next){case 0:if(!(gt==="")){Qt.next=3;break}return M.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),Qt.abrupt("return");case 3:return Qt.next=5,pe({comments:{content:gt},container_type:"QuestionSolutionArticle",container_identifier:fn});case 5:Rn=Qt.sent,Rn!=null&&Rn.discuss&&(cn(""),Tn(Bt),tn());case 7:case"end":return Qt.stop()}},yn)}));return function(){return Dn.apply(this,arguments)}}(),vi=function(){var Dn=Object(p.a)(i.a.mark(function yn(Rn,zt,Qt){var on;return i.a.wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:return Wt.next=2,ve({container_type:"QuestionSolutionArticle",container_identifier:fn,comments:{content:zt,parent_id:Rn}});case 2:on=Wt.sent,ai(null),Vt(null),Tn(Bt);case 6:case"end":return Wt.stop()}},yn)}));return function(Rn,zt,Qt){return Dn.apply(this,arguments)}}(),ui=function(){var Dn=Object(p.a)(i.a.mark(function yn(Rn){var zt;return i.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:return on.next=2,de(Rn);case 2:zt=on.sent,Tn(Bt);case 4:case"end":return on.stop()}},yn)}));return function(Rn){return Dn.apply(this,arguments)}}(),ti=function(yn){vn(yn),Tn(yn)};return n.a.createElement("div",{className:Di.a.discuss},n.a.createElement("aside",{className:Di.a.reply,style:{borderWidth:qn?1:0}},n.a.createElement(ce.a,{defaultValue:gt,id:"writeForumsReviewId",onChange:function(yn){cn(yn)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),n.a.createElement(Zi.a,null,n.a.createElement(ri.a,{flex:"1"}),n.a.createElement(ri.a,null,n.a.createElement(Z.a,{type:"primary",size:"large",onClick:function(){return si()}},"\u53D1\u9001")))),Sn==null?void 0:Sn.map(function(Dn){return n.a.createElement(Wi,{secondReply:gi,setSecondReply:ai,thirdlyReply:Gn,setThirdlyReply:Vt,key:Dn.id,data:Dn,onReplyDiscuss:vi,onPlusDiscuss:ui})}),n.a.createElement(De.a,{className:Di.a.pagination,showTotal:function(yn){return n.a.createElement("span",{style:{color:"#656F87"}},"\u5171",n.a.createElement("span",{className:"c-light-primary"},yn),"\u6761\u6570\u636E")},current:Bt,onChange:ti,total:qn,showSizeChanger:!1,showQuickJumper:!0,hideOnSinglePage:!0,pageSize:5}))},Tr=hr,ar=k("hgre"),Hn=function(pt){var Kt,fn,tn,Xt,nt,gt,cn,ft,hn,Bt,vn=pt.active,Kn=pt.identifier,Mn=pt.onAssist,Sn=pt.onEdit,ni=pt.onArticlesSkip,Ln=pt.onClose,Zn=pt.onOk,qn=pt.onDelete,bi=pt.detailsIndex,Un=pt.btnShowStatus,mi=Object(r.useState)(!0),gi=Object(m.a)(mi,2),ai=gi[0],kn=gi[1],ei=Object(r.useState)({}),Gn=Object(m.a)(ei,2),Vt=Gn[0],Tn=Gn[1];Object(r.useEffect)(function(){vn&&si()},[vn,bi]);var si=function(){var yn=Object(p.a)(i.a.mark(function Rn(){var zt,Qt,on=arguments;return i.a.wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:return zt=on.length>0&&on[0]!==void 0?on[0]:!0,zt&&kn(!0),Wt.next=4,Object(E.d)(Kn,{active:vn});case 4:Qt=Wt.sent,(Qt==null?void 0:Qt.status)===0&&Tn((Qt==null?void 0:Qt.data)||{}),kn(!1);case 7:case"end":return Wt.stop()}},Rn)}));return function(){return yn.apply(this,arguments)}}(),vi=function(){var yn=Object(p.a)(i.a.mark(function Rn(zt){var Qt;return i.a.wrap(function(ln){for(;;)switch(ln.prev=ln.next){case 0:return ln.next=2,Object(E.g)(Kn,Object(u.a)({active:vn},zt));case 2:Qt=ln.sent,(Qt==null?void 0:Qt.status)===0&&(si(!1),Zn());case 4:case"end":return ln.stop()}},Rn)}));return function(zt){return yn.apply(this,arguments)}}(),ui=function(){var yn=Object(p.a)(i.a.mark(function Rn(zt){var Qt;return i.a.wrap(function(ln){for(;;)switch(ln.prev=ln.next){case 0:return ln.next=2,Object(E.c)(Kn,{active:zt==null?void 0:zt.id});case 2:Qt=ln.sent,Qt.status===0&&(si(!1),Zn());case 4:case"end":return ln.stop()}},Rn)}));return function(zt){return yn.apply(this,arguments)}}(),ti=function(Rn){I.a.confirm({centered:!0,width:500,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",icon:null,className:"custom-modal-divider",content:"\u786E\u8BA4\u8981\u5220\u9664\u8BE5\u9898\u89E3\u5417?",onOk:function(){return qn(Rn)}})},Dn=function(){si(!1),Zn()};return n.a.createElement("div",{className:dt.a.listDetails},n.a.createElement(St.a,{className:"pt20 pl20 pr20",loading:ai,active:!0,paragraph:{rows:5}},n.a.createElement("div",{className:dt.a.head},n.a.createElement("div",{className:dt.a.name},n.a.createElement("div",{title:Vt==null?void 0:Vt.name,className:dt.a.title},Vt==null?void 0:Vt.name),(Vt==null?void 0:Vt.is_authority)&&n.a.createElement("div",{className:dt.a.b},"\u5B98\u65B9"),(Vt==null?void 0:Vt.is_excellent)&&n.a.createElement("div",{className:dt.a.a},"\u7CBE\u9009")),n.a.createElement("div",{className:dt.a.tag},n.a.createElement("img",{src:_.a.IMG_SERVER+"/images/"+(Vt==null?void 0:Vt.image_url)}),n.a.createElement("div",{className:"c-grey-333 ml5 mr20 font14"},Vt==null?void 0:Vt.username),n.a.createElement("div",{style:{display:"inline-block",marginBottom:-2},className:"c-grey-999 mr20 font12"},"\u53D1\u5E03\u4E8E",xt()(Vt==null?void 0:Vt.created_at).format("YYYY-MM-DD")),n.a.createElement("span",null,n.a.createElement("img",{src:U.a}),n.a.createElement("span",null,Vt==null?void 0:Vt.praises_count)),n.a.createElement("span",null,n.a.createElement("img",{src:he.a}),n.a.createElement("span",null,Vt==null?void 0:Vt.discusses_count)),n.a.createElement("span",null,n.a.createElement("img",{src:Ge.a}),n.a.createElement("span",null,Vt==null?void 0:Vt.viewed_count)),n.a.createElement("div",{className:dt.a.btn},(Object(Ft.v)()||(Vt==null?void 0:Vt.is_self))&&n.a.createElement(n.a.Fragment,null,n.a.createElement(Z.a,{onClick:function(){return ti(Vt)},type:"primary",ghost:!0},"\u5220\u9664"),n.a.createElement(Z.a,{onClick:function(){return Sn(Vt)},type:"primary",ghost:!0},"\u7F16\u8F91")),Object(Ft.v)()&&n.a.createElement(Z.a,{onClick:function(){return vi({is_authority:!(Vt!=null&&Vt.is_authority)})},type:"primary"},n.a.createElement("img",{src:Si.a}),Vt!=null&&Vt.is_authority?"\u53D6\u6D88":"\u8BBE\u4E3A","\u5B98\u65B9"),Object(Ft.v)()&&n.a.createElement(Z.a,{onClick:function(){return vi({is_excellent:!(Vt!=null&&Vt.is_excellent)})},type:"primary"},n.a.createElement("img",{src:sn.a}),Vt!=null&&Vt.is_excellent?"\u53D6\u6D88":"\u8BBE\u4E3A","\u7CBE\u9009")))),n.a.createElement("div",{className:dt.a.scroll},(Vt==null||((Kt=Vt.videos)===null||Kt===void 0||((fn=Kt[0])===null||fn===void 0))?void 0:fn.id)&&n.a.createElement("div",{className:dt.a.video},n.a.createElement(R.a,{tip:"\u6B63\u5728\u8F6C\u7801\uFF0C\u8BF7\u7A0D\u7B49...",spinning:!(Vt!=null&&(tn=Vt.videos)!==null&&tn!==void 0&&(Xt=tn[0])!==null&&Xt!==void 0&&Xt.transcoded)},n.a.createElement(ar.a,{poster:Vt==null||((nt=Vt.videos)===null||nt===void 0||((gt=nt[0])===null||gt===void 0))?void 0:gt.cover_url,src:(Vt==null||((cn=Vt.videos)===null||cn===void 0||((ft=cn[0])===null||ft===void 0))?void 0:ft.play_url)||"",videoId:Vt==null||((hn=Vt.videos)===null||hn===void 0||((Bt=hn[0])===null||Bt===void 0))?void 0:Bt.id,logWatchHistory:function(){}}))),n.a.createElement(jt.a,{className:dt.a.html,value:(Vt==null?void 0:Vt.content)||""}),n.a.createElement("div",{onClick:function(){return ui(Vt)},className:dt.a.g},n.a.createElement("img",{className:"mr10",src:(Vt!=null&&Vt.user_liker,Fn.a)}),n.a.createElement("span",null,Vt==null?void 0:Vt.praises_count)),n.a.createElement(Tr,{onOk:Dn,active:vn,identifier:Kn})),n.a.createElement("div",{className:dt.a.btns},n.a.createElement(Z.a,{onClick:function(){return Ln()},type:"primary",ghost:!0},"\u5173\u95ED"),Un[0]&&n.a.createElement(Z.a,{onClick:function(Rn){return ni(Rn,"prev")},style:{marginLeft:20},type:"primary"},"\u4E0A\u4E00\u9898\u89E3"),Un[1]&&n.a.createElement(Z.a,{onClick:function(Rn){return ni(Rn,"next")},style:{marginLeft:20},type:"primary"},"\u4E0B\u4E00\u9898\u89E3"))))},Cn=Hn,yi=k("3tLw"),Nn=k.n(yi),Ti=k("ek7X"),ii=k("0NbB"),Cr=function(pt){var Kt=pt.identifier,fn=pt.tabStatus,tn=pt.setFilterListTotal,Xt=pt.setListStatus,nt={page:1,limit:10,total:0,search:"",save_search:"",sort_by:"updated_at",sort_direction:null},gt=Object(r.useState)(Object(u.a)({},nt)),cn=Object(m.a)(gt,2),ft=cn[0],hn=cn[1],Bt=Object(r.useState)(!1),vn=Object(m.a)(Bt,2),Kn=vn[0],Mn=vn[1],Sn=Object(r.useState)(0),ni=Object(m.a)(Sn,2),Ln=ni[0],Zn=ni[1],qn=Object(r.useState)(1),bi=Object(m.a)(qn,2),Un=bi[0],mi=bi[1],gi=Object(r.useState)(null),ai=Object(m.a)(gi,2),kn=ai[0],ei=ai[1],Gn=Object(r.useState)([]),Vt=Object(m.a)(Gn,2),Tn=Vt[0],si=Vt[1],vi=Object(r.useState)([!0,!0]),ui=Object(m.a)(vi,2),ti=ui[0],Dn=ui[1],yn=Object(r.useState)(0),Rn=Object(m.a)(yn,2),zt=Rn[0],Qt=Rn[1],on=Object(r.useRef)(null);Object(r.useEffect)(function(){li()},[fn]),Object(r.useEffect)(function(){ln()},[kn]),Object(r.useEffect)(function(){qt(Object(u.a)({},nt)),li()},[Kt]),Object(r.useEffect)(function(){return window.addEventListener("resize",Wt),Xt(zt),function(){window.removeEventListener("resize",Wt)}},[zt]);var ln=function(){var fi=Object(p.a)(i.a.mark(function xn(){var zn,Yn;return i.a.wrap(function(Vn){for(;;)switch(Vn.prev=Vn.next){case 0:if(kn){Vn.next=3;break}return Dn([!0,!0]),Vn.abrupt("return");case 3:zn=[!0,!0],Yn=Tn==null?void 0:Tn.findIndex(function(Ar){return Ar.id===kn}),Yn===0&&ft.page===1&&(zn[0]=!1),(ft.page-1)*ft.limit+(Yn+1)===ft.total&&(zn[1]=!1),Dn(zn);case 8:case"end":return Vn.stop()}},xn)}));return function(){return fi.apply(this,arguments)}}(),Wt=function(){if(zt){var xn,zn=window.innerWidth-((xn=on.current)===null||xn===void 0?void 0:xn.clientWidth);Zn(zn)}},qt=function(){var fi=Object(p.a)(i.a.mark(function xn(zn){var Yn,Ui,Vn,Ar;return i.a.wrap(function($i){for(;;)switch($i.prev=$i.next){case 0:return Mn(!0),$i.next=3,Object(E.f)(Kt,zn);case 3:return Yn=$i.sent,(Yn==null?void 0:Yn.status)===0&&(si((Yn==null||((Ui=Yn.data)===null||Ui===void 0)?void 0:Ui.articles)||[]),hn(Object(u.a)(Object(u.a)({},zn),{},{total:Yn==null||((Vn=Yn.data)===null||Vn===void 0)?void 0:Vn.articles_count})),tn(Yn==null||((Ar=Yn.data)===null||Ar===void 0)?void 0:Ar.articles_count)),Mn(!1),$i.abrupt("return",Yn);case 7:case"end":return $i.stop()}},xn)}));return function(zn){return fi.apply(this,arguments)}}(),gn=function(){(ft==null?void 0:ft.sort_direction)===null?ft.sort_direction="asc":(ft==null?void 0:ft.sort_direction)==="asc"?ft.sort_direction="desc":(ft==null?void 0:ft.sort_direction)==="desc"&&(ft.sort_direction=null),ft.page=1,li(),hn(Object(u.a)({},ft)),qt(ft)},ci=function(){ft.page=1,ft.search=ft==null?void 0:ft.save_search,li(),hn(Object(u.a)({},ft)),qt(ft)},Li=function(){var xn,zn=document.getElementsByClassName("btn-resize");zn[0].style.visibility="hidden";var Yn=window.innerWidth-((xn=on.current)===null||xn===void 0?void 0:xn.clientWidth);Zn(Yn)},qi=function(){Li(),Qt(1)},Hi=function(xn){Li(),ei(xn==null?void 0:xn.id),Qt(3)},Or=function(xn){Li(),ei(xn==null?void 0:xn.id),Qt(2)},li=function(){var xn=document.getElementsByClassName("btn-resize");xn[0].style.visibility="visible",Zn(0),Qt(0),ei(null)},Rr=function(xn){Qt(3),ei(xn),ft.page=1,hn(Object(u.a)({},ft)),qt(ft)},Nr=function(xn){Qt(3),ei(xn),hn(Object(u.a)({},ft)),qt(ft)},Kr=function(xn){hn(Object(u.a)({},ft)),qt(ft)},Ur=function(){var fi=Object(p.a)(i.a.mark(function xn(zn){var Yn;return i.a.wrap(function(Vn){for(;;)switch(Vn.prev=Vn.next){case 0:return Vn.next=2,Object(E.c)(Kt,{active:zn==null?void 0:zn.id});case 2:Yn=Vn.sent,Yn.status===0&&(qt(ft),mi(Un+1));case 4:case"end":return Vn.stop()}},xn)}));return function(zn){return fi.apply(this,arguments)}}(),da=function(){var fi=Object(p.a)(i.a.mark(function xn(zn){var Yn;return i.a.wrap(function(Vn){for(;;)switch(Vn.prev=Vn.next){case 0:return Vn.next=2,Object(E.e)(Kt,{active:zn==null?void 0:zn.id});case 2:Yn=Vn.sent,Yn.status===0&&(qt(ft),mi(Un+1));case 4:case"end":return Vn.stop()}},xn)}));return function(zn){return fi.apply(this,arguments)}}(),yr=function(){var fi=Object(p.a)(i.a.mark(function xn(zn){var Yn;return i.a.wrap(function(Vn){for(;;)switch(Vn.prev=Vn.next){case 0:return Vn.next=2,Object(E.i)(Kt,{active:zn==null?void 0:zn.id});case 2:Yn=Vn.sent,Yn.status===0&&(li(),qt(ft));case 4:case"end":return Vn.stop()}},xn)}));return function(zn){return fi.apply(this,arguments)}}(),ta=function(xn){ft.page=xn,hn(Object(u.a)({},ft)),qt(ft)},Da=function(){var fi=Object(p.a)(i.a.mark(function xn(zn,Yn){var Ui,Vn,Ar,Br,$i,Lr,Pi,or,Pn,wn,$n;return i.a.wrap(function(In){for(;;)switch(In.prev=In.next){case 0:if(Ui=Tn==null?void 0:Tn.findIndex(function(Ei){return Ei.id===kn}),console.log(Ui,Yn,22),!(Yn==="prev")){In.next=21;break}if(!(Ui===void 0)){In.next=6;break}return M.b.warn("\u4E0A\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),In.abrupt("return");case 6:if(!(Ui===0)){In.next=19;break}if(!(ft.page===1)){In.next=10;break}return M.b.warn("\u4E0A\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),In.abrupt("return");case 10:if(!(ft.page!==1)){In.next=17;break}return ft.page=ft.page-1,hn(Object(u.a)({},ft)),In.next=15,qt(ft);case 15:Vn=In.sent,(Vn==null?void 0:Vn.status)===0&&(Lr=Vn==null||((Ar=Vn.data)===null||Ar===void 0)?void 0:Ar.articles[(Vn==null||((Br=Vn.data)===null||Br===void 0||(($i=Br.articles)===null||$i===void 0))?void 0:$i.length)-1],ei(Lr==null?void 0:Lr.id),console.log(zn.target,555));case 17:In.next=21;break;case 19:Pi=Tn[Ui-1],ei(Pi==null?void 0:Pi.id);case 21:if(!(Yn==="next")){In.next=39;break}if(!(Ui===void 0)){In.next=25;break}return M.b.warn("\u4E0B\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),In.abrupt("return");case 25:if(!((ft.page-1)*ft.limit+(Ui+1)===ft.total)){In.next=28;break}return M.b.warn("\u4E0B\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),In.abrupt("return");case 28:if(!(Ui+1===ft.limit)){In.next=37;break}return ft.page=ft.page+1,hn(Object(u.a)({},ft)),In.next=33,qt(ft);case 33:or=In.sent,(or==null?void 0:or.status)===0&&(wn=or==null||((Pn=or.data)===null||Pn===void 0)?void 0:Pn.articles[0],ei(wn==null?void 0:wn.id)),In.next=39;break;case 37:$n=Tn[Ui+1],ei($n==null?void 0:$n.id);case 39:case"end":return In.stop()}},xn)}));return function(zn,Yn){return fi.apply(this,arguments)}}();return n.a.createElement("div",{className:qe.a.wrap,ref:on},n.a.createElement("div",{className:qe.a.head},n.a.createElement("div",{className:qe.a.sort,onClick:gn},n.a.createElement("span",null,"\u6700\u65B0"),n.a.createElement("aside",null,n.a.createElement(Ti.a,{style:{color:(ft==null?void 0:ft.sort_direction)==="asc"?"#0152d9":"#bfbfbf"}}),n.a.createElement(ii.a,{style:{color:(ft==null?void 0:ft.sort_direction)==="desc"?"#0152d9":"#bfbfbf"}}))),n.a.createElement(ne.a.Search,{value:ft.save_search,className:qe.a["oj-width-input"],placeholder:"\u641C\u7D22\u9898\u89E3",onChange:function(xn){ft.save_search=xn.target.value,hn(Object(u.a)({},ft))},onSearch:ci}),n.a.createElement("div",{onClick:qi,className:qe.a.btn},n.a.createElement("img",{src:Nn.a}),"\u5199\u9898\u89E3")),n.a.createElement("div",{className:qe.a.listWarp},n.a.createElement(R.a,{spinning:Kn,className:"mt20"},Tn==null?void 0:Tn.map(function(fi,xn){var zn=!0;return xn+1===Tn.length&&xn!==0&&(zn=!1),n.a.createElement(Nt,{active:kn,key:fi.id,data:fi,showLine:zn,onClick:Hi,onAssist:Ur,onHide:da})}),(Tn==null?void 0:Tn.length)===0&&n.a.createElement(Ie.a,{customText:"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"}))),n.a.createElement(De.a,{className:qe.a.pagination,showTotal:function(xn){return n.a.createElement("span",{style:{color:"#656F87"}},"\u5171",n.a.createElement("span",{className:"c-light-primary"},xn),"\u6761\u6570\u636E")},total:ft.total,showSizeChanger:!1,current:ft==null?void 0:ft.page,onChange:ta,hideOnSinglePage:!0,showQuickJumper:!0}),zt>0&&n.a.createElement("div",{className:qe.a.fixedRight,style:{width:Ln}},zt===1&&n.a.createElement(Re,{identifier:Kt,onClose:li,onOk:Rr}),zt===2&&n.a.createElement(Re,{active:kn,identifier:Kt,onClose:li,onOk:Nr}),zt===3&&n.a.createElement(Cn,{btnShowStatus:ti,onArticlesSkip:Da,detailsIndex:Un,active:kn,identifier:Kt,onClose:li,onOk:Kr,onEdit:Or,onAssist:Ur,onDelete:yr})))},Ni=Cr,Xi=k("VEzc"),lr=k.n(Xi),gr=function(pt){var Kt,fn=pt.visible,tn=pt.onVisible,Xt=pt.value,nt=pt.onChange,gt=pt.setIndex,cn={page:1,per_page:30,total:0,tag_discipline_id:[],search:"",save_search:"",difficulty:null},ft=Object(r.useState)(cn),hn=Object(m.a)(ft,2),Bt=hn[0],vn=hn[1],Kn=Object(r.useState)([]),Mn=Object(m.a)(Kn,2),Sn=Mn[0],ni=Mn[1],Ln=Object(r.useState)([]),Zn=Object(m.a)(Ln,2),qn=Zn[0],bi=Zn[1],Un=Object(r.useState)(!1),mi=Object(m.a)(Un,2),gi=mi[0],ai=mi[1],kn=Object(r.useRef)([]),ei=Object(r.useRef)(null),Gn=Object(T.i)();Object(r.useEffect)(function(){return Gn!=null&&Gn.id&&(ei.current=setInterval(function(){Vt(30)},3e4)),function(){clearInterval(ei.current)}},[]);var Vt=function(){var zt=Object(p.a)(i.a.mark(function Qt(on){var ln;return i.a.wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:return qt.next=2,Object(E.r)(Gn==null?void 0:Gn.id,{practice_time:on});case 2:ln=qt.sent;case 3:case"end":return qt.stop()}},Qt)}));return function(on){return zt.apply(this,arguments)}}();Object(r.useEffect)(function(){Dn(Bt),ui()},[]),Object(r.useEffect)(function(){return window.addEventListener("click",si),function(){window.removeEventListener("click",si)}},[Gn==null?void 0:Gn.save_identifier,fn]),Object(r.useEffect)(function(){var zt=kn.current.findIndex(function(qt){return qt.identifier===(Gn==null?void 0:Gn.save_identifier)}),Qt=kn.current[zt-1],on=kn.current[zt+1],ln=document.getElementById("oj-prev"),Wt=document.getElementById("oj-next");Qt?ln.style.display="block":ln.style.display="none",on?Wt.style.display="block":Wt.style.display="none"},[Gn==null?void 0:Gn.save_identifier,kn.current]);var Tn=function(Qt,on){if(Qt.id===on)return Qt;for(var ln=0,Wt=Qt;Wt=Wt.parentNode;ln++){if(Wt.id===on)return Wt;if(Wt==document.documentElement)return!1}},si=function(){var zt=Object(p.a)(i.a.mark(function Qt(on){var ln,Wt,qt;return i.a.wrap(function(ci){for(;;)switch(ci.prev=ci.next){case 0:if(!Tn(on.target,"oj-drawer")&&fn&&tn(!1),ln=kn.current.findIndex(function(Li){return Li.identifier===(Gn==null?void 0:Gn.save_identifier)}),Wt=kn.current[ln-1],qt=kn.current[ln+1],!(on.target.id==="oj-prev")){ci.next=14;break}if(!(!Wt||ln===-1)){ci.next=8;break}return M.b.warn("\u4E0A\u4E00\u9898\u4E0D\u5B58\u5728"),ci.abrupt("return");case 8:return on.target.style.pointerEvents="none",on.target.style.cursor="not-allowed",ci.next=12,yn(Wt==null?void 0:Wt.identifier);case 12:gt("0"),setTimeout(function(){on.target.style.pointerEvents="auto",on.target.style.cursor="pointer"},400);case 14:if(!(on.target.id==="oj-next"||on.target.id==="oj-modal-next")){ci.next=24;break}if(!(!qt||ln===-1)){ci.next=18;break}return M.b.warn("\u4E0B\u4E00\u9898\u4E0D\u5B58\u5728"),ci.abrupt("return");case 18:return on.target.style.pointerEvents="none",on.target.style.cursor="not-allowed",ci.next=22,yn(qt==null?void 0:qt.identifier);case 22:gt("0"),setTimeout(function(){on.target.style.pointerEvents="auto",on.target.style.cursor="pointer"},400);case 24:case"end":return ci.stop()}},Qt)}));return function(on){return zt.apply(this,arguments)}}();Object(r.useEffect)(function(){nt(Gn==null?void 0:Gn.save_identifier);var zt=qn.findIndex(function(Qt){return Qt.some(function(on){return on.identifier===(Gn==null?void 0:Gn.save_identifier)})});zt===-1?vn(Object(u.a)(Object(u.a)({},Bt),{},{page:1})):vn(Object(u.a)(Object(u.a)({},Bt),{},{page:zt+1}))},[Gn==null?void 0:Gn.save_identifier,qn]);var vi=function(Qt){Bt.page=1,Bt.tag_discipline_id=Qt,vn(Object(u.a)({},Bt)),Dn(Bt)},ui=function(){var zt=Object(p.a)(i.a.mark(function Qt(){var on;return i.a.wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:return Wt.next=2,Object(_e.a)("/api/tag_disciplines.json",{method:"get",params:{target:"practice",position:"index"}});case 2:on=Wt.sent,ni(on.tag_disciplines||[]);case 4:case"end":return Wt.stop()}},Qt)}));return function(){return zt.apply(this,arguments)}}(),ti=function(Qt){Bt.page=1,Bt.difficulty=typeof Qt=="number"?Qt:null,vn(Object(u.a)({},Bt)),Dn(Bt)},Dn=function(){var zt=Object(p.a)(i.a.mark(function Qt(on){var ln,Wt,qt,gn,ci,Li;return i.a.wrap(function(Hi){for(;;)switch(Hi.prev=Hi.next){case 0:return ai(!0),Hi.next=3,Object(E.p)(on);case 3:if(ln=Hi.sent,ln!=null&&ln.practices_list){for(qt=ln==null||((Wt=ln.practices_list)===null||Wt===void 0)?void 0:Wt.length,gn=[],ci=0;ci(In+3)*1e3,Ir!==0&&!Gr&&setTimeout(Ki,1e3),!Gr){Qi.next=12;break}return I.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),gt({type:un.SET_SUBMITING,payload:!1}),Qi.abrupt("return");case 12:if(!(Ir===0)){Qi.next=19;break}return Dr.status===2&&I.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),Qi.next=16,Object(E.o)(ft,{limit:15,page:qn});case 16:ia=Qi.sent,gt({type:un.SET_SUBMIT_RESULT,payload:Object(u.a)(Object(u.a)({},nt),{},{submitResult:Dr,submitting:!1,submitRecords:ia})}),(Dr==null?void 0:Dr.status)===0&&on(!0);case 19:case"end":return Qi.stop()}},_a)})),Mi.apply(this,arguments)},Ki=function(){return Mi.apply(this,arguments)},$n={},bn.next=14,Object(E.s)(ft,$n);case 14:if(en=bn.sent,!(en.status===-1)){bn.next=18;break}return window.parent.location.href="/classrooms/".concat(Bt.query.coursesId,"/exercise/").concat(Bt.query.exercisesId,"/detail"),bn.abrupt("return");case 18:In=gn.time_limit,Ei=Bn(),Ki();case 21:bn.next=26;break;case 23:bn.prev=23,bn.t0=bn.catch(3),gt({type:un.SET_SUBMITING,payload:!1});case 26:case"end":return bn.stop()}},Pn,null,[[3,23]])})),Ur.apply(this,arguments)}function da(){return yr.apply(this,arguments)}function yr(){return yr=Object(p.a)(i.a.mark(function Pn(){var wn,$n,en,In,Ei,Ki,Mi;return i.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return nt.debuging=!0,gt({type:un.SET_DEBUGING,payload:!0}),bn.prev=2,bn.next=5,Rr();case 5:if(wn=bn.sent,!(wn.status===0)){bn.next=21;break}return Mi=function(){return Mi=Object(p.a)(i.a.mark(function _a(){var Wr,Ir,Dr,Zr,Gr,ia;return i.a.wrap(function(Qi){for(;;)switch(Qi.prev=Qi.next){case 0:return Qi.next=2,Object(E.l)(ft,"debug");case 2:if(Wr=Qi.sent,Ir=Wr.status,Dr=Wr.message,Zr=Wr.data,Gr=Bn(),ia=Gr-Ei>($n+3)*1e3,Ir!==0&&!ia&&(gt({type:un.SET_EXECUTE_MESSAGE,payload:Dr}),setTimeout(Ki,1e3)),!ia){Qi.next=13;break}return I.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),gt({type:un.SET_DEBUGING,payload:!1}),Qi.abrupt("return");case 13:Ir===0&&(gt({type:un.SET_DEBUGING,payload:!1}),Zr.status===2&&I.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),gt({type:un.SET_EXECUTE_RESULT,payload:Object(u.a)(Object(u.a)({},nt),{},{debugResult:Zr,debuging:!1})}));case 14:case"end":return Qi.stop()}},_a)})),Mi.apply(this,arguments)},Ki=function(){return Mi.apply(this,arguments)},$n=gn.time_limit,en={input:encodeURIComponent(Sn.test_case.input)},bn.next=13,Object(E.h)(ft,en);case 13:if(In=bn.sent,!(In.status===-1)){bn.next=17;break}return window.parent.location.href="/classrooms/".concat(Bt.query.coursesId,"/exercise/").concat(Bt.query.exercisesId,"/detail"),bn.abrupt("return");case 17:Ei=Bn(),Ki(),bn.next=22;break;case 21:gt({type:un.SET_DEBUGING,payload:!1});case 22:bn.next=27;break;case 24:bn.prev=24,bn.t0=bn.catch(2),console.log(bn.t0);case 27:return bn.prev=27,bn.finish(27);case 29:case"end":return bn.stop()}},Pn,null,[[2,24,27,29]])})),yr.apply(this,arguments)}function ta(Pn){var wn;clearTimeout(ln.current),ln.current=setTimeout(function(){var $n;Rr({code:S.Base64.encode(Pn),language:Wt==null||(($n=Wt.current)===null||$n===void 0)?void 0:$n.language})},2e3),gt({type:un.SET_DATA,payload:Object(u.a)(Object(u.a)({},Wt==null?void 0:Wt.current),{},{hack:Object(u.a)(Object(u.a)({},Wt==null||((wn=Wt.current)===null||wn===void 0)?void 0:wn.hack),{},{code:Pn})})})}function Da(Pn){var wn=Pn.target.value;gt({type:un.SET_DATA,payload:Object(u.a)(Object(u.a)({},Sn),{},{test_case:{input:wn}})})}var fi=function(){var Pn=Object(p.a)(i.a.mark(function wn($n){var en,In,Ei,Ki,Mi;return i.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return gt({type:un.SET_LOADING,payload:!0}),bn.next=3,Rr();case 3:if(en=bn.sent,!(en.status===0)){bn.next=14;break}return gt({type:un.SET_SUBMIT_RESULT,payload:{languageValue:$n}}),Wt.current.language=$n,In="".concat(qt==null?void 0:qt.login,"-language"),localStorage.setItem(In,$n),bn.next=11,Object(E.w)(ft);case 11:Ei=bn.sent,Ei.status===0&&(Mi=Ei==null||((Ki=Ei.data)===null||Ki===void 0)?void 0:Ki.find(function(na){return na.language===$n}),ta(S.Base64.decode(Mi.code))),setTimeout(function(){gt({type:un.SET_LOADING,payload:!1})},300);case 14:case"end":return bn.stop()}},wn)}));return function($n){return Pn.apply(this,arguments)}}();function xn(){return zn.apply(this,arguments)}function zn(){return zn=Object(p.a)(i.a.mark(function Pn(){var wn;return i.a.wrap(function(en){for(;;)switch(en.prev=en.next){case 0:return en.prev=0,en.next=3,Object(E.q)(ft,{language:vn});case 3:wn=en.sent,wn.status===401?hn.replace("/login",{from:Bt.pathname}):(ta(S.Base64.decode(wn.code)),Hi()),en.next=10;break;case 7:en.prev=7,en.t0=en.catch(0),console.log(en.t0);case 10:case"end":return en.stop()}},Pn,null,[[0,7]])})),zn.apply(this,arguments)}function Yn(){I.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:n.a.createElement("p",null,"\u521D\u59CB\u4EE3\u7801\u6709\u4FEE\u6539\uFF0C\u66F4\u65B0\u540E\u5C06\u8986\u76D6\u73B0\u6709\u4EE3\u7801\u54E6~ ",n.a.createElement("br",null),"\u8BF7\u5C06\u60A8\u7F16\u8F91\u7684\u4EE3\u7801\u4FDD\u5B58\u81F3\u672C\u5730\uFF0C\u4EE5\u9632\u4E22\u5931"),onOk:function(){return Object(p.a)(i.a.mark(function wn(){var $n;return i.a.wrap(function(In){for(;;)switch(In.prev=In.next){case 0:return In.next=2,Object(E.t)(ft,{language:vn});case 2:$n=In.sent,$n.status===401?hn.replace("/login",{from:Bt.pathname}):ta(S.Base64.decode($n.code));case 4:case"end":return In.stop()}},wn)}))()}})}function Ui(){gt({type:un.SET_SHOW_NOTE,payload:!0})}function Vn(){gt({type:un.SET_SHOW_NOTE,payload:!1})}function Ar(Pn){return Br.apply(this,arguments)}function Br(){return Br=Object(p.a)(i.a.mark(function Pn(wn){return i.a.wrap(function(en){for(;;)switch(en.prev=en.next){case 0:return en.next=2,Object(E.b)(ft,wn);case 2:gt({type:un.GET_DATA,payload:{showNote:!1,data:Object(u.a)(Object(u.a)({},Sn),{},{hack:Object(u.a)(Object(u.a)({},gn),{},{notes:wn.notes})})}});case 3:case"end":return en.stop()}},Pn)})),Br.apply(this,arguments)}var $i={input:Sn==null||((pt=Sn.test_case)===null||pt===void 0)?void 0:pt.input,language:gn==null?void 0:gn.language,code:gn==null?void 0:gn.code,title:"main."+Jn[gn==null?void 0:gn.language],modify_code:gn==null?void 0:gn.modify_code,notes:gn==null?void 0:gn.notes,debugResult:ni,debuging:Un,submitting:mi,executingMessage:gi,id:ft,languageValue:vn,languageList:Kn,onChangeLanguage:fi,onCancelNote:Vn,onAddNote:Ar,showNote:bi,onShowNote:Ui,onSubmitCode:Kr,onChangeCode:ta,onChangeInput:Da,onDebugCode:da,onResetCode:xn,onSyncCode:Yn,onUpdateCode:Rr};function Lr(){return Pi.apply(this,arguments)}function Pi(){return Pi=Object(p.a)(i.a.mark(function Pn(){var wn,$n,en;return i.a.wrap(function(Ei){for(;;)switch(Ei.prev=Ei.next){case 0:return Ei.next=2,Object(E.u)(gn.id,{container_type:"Hack",type:1});case 2:wn=Ei.sent,$n=wn.praise_count,en=Object(u.a)(Object(u.a)({},Sn),{},{hack:Object(u.a)(Object(u.a)({},gn),{},{praises_count:$n,user_praise:!gn.user_praise})}),gt({type:un.SET_DATA,payload:en});case 6:case"end":return Ei.stop()}},Pn)})),Pi.apply(this,arguments)}var or={topicId:ft,submitResult:Ln,submitRecords:Zn,submitting:mi,page:qn,onPageChange:li,hack:gn,user:Sn==null?void 0:Sn.user,onTriggerPraise:Lr};return console.log(Sn,Wt==null?void 0:Wt.current,"data--------"),n.a.createElement(n.a.Fragment,null,n.a.createElement(R.a,{className:"oj-custom-large-spin",size:"large",spinning:Mn},Sn?n.a.createElement("div",{className:"oj-custom-warp"},n.a.createElement("header",{className:b.a.header,style:{minWidth:1200}},n.a.createElement("div",null,n.a.createElement("img",{src:"".concat(_.a.IMG_SERVER,"/images/").concat(qt.image_url),alt:"user",width:30}),n.a.createElement("span",null,qt.name)),n.a.createElement("h2",{className:"flex-wrp flex_box_column flex_box_center"},n.a.createElement("div",null,gn.name),n.a.createElement(wr.a,{onChange:function(wn){},className:"font12 c-grey-999"})),n.a.createElement(_n.CopyToClipboard,{text:"".concat((Kt=window.location)===null||Kt===void 0?void 0:Kt.origin,"/problems/").concat(gn.identifier,"/share"),onCopy:function(){return M.b.success("\u590D\u5236\u9898\u76EE\u94FE\u63A5\u6210\u529F")}},n.a.createElement("span",{className:b.a.btn_back,style:{marginRight:10,cursor:"pointer"}}," ",n.a.createElement("i",{className:"iconfont icon-fenxiang1 font14 mr5"}),"\u5206\u4EAB\u9898\u76EE")),gn.edit_privilege?n.a.createElement(O.a,{className:b.a.btn_back,to:"/problems/".concat(gn.identifier,"/ojedit"),style:{marginRight:10}}," ",n.a.createElement(d.a,null)," \u7F16\u8F91"):null,n.a.createElement(O.a,{className:b.a.btn_back,onClick:function(){},to:"/problems"}," ",n.a.createElement(w.a,null),"\u9000\u51FA")),n.a.createElement(v.a,{hideResize:!0,className:"my-problems oj-problems",leftChild:n.a.createElement(kr,or),rightChild:n.a.createElement(oi,$i)})):null),n.a.createElement(I.a,{centered:!0,closable:!1,width:680,footer:null,visible:Qt,className:"oj-modal"},n.a.createElement("section",{className:"oj-modal-content"},n.a.createElement("div",{className:"oj-modal-head"},n.a.createElement("img",{src:vr.a,alt:""}),n.a.createElement("i",{onClick:function(){return on(!1)},className:"iconfont icon-guanbi1"})),n.a.createElement("aside",null,n.a.createElement("img",{className:"mr30",src:Jr.a}),"\u8FD0\u884C\u65F6\u95F4:\xA0",n.a.createElement("span",{style:{color:"#75d6ba",marginRight:100}},Ln==null?void 0:Ln.execute_time,"s"),"\u4F18\u4E8E",n.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(Ln==null?void 0:Ln.time_better_than)||100,"%"),"\u7684\u7528\u6237"),n.a.createElement("aside",{className:"mb50"},n.a.createElement("img",{src:$r.a,className:"mr30"}),n.a.createElement("span",{className:"oj-modal-tt"},n.a.createElement("span",null,n.a.createElement("span",null,"\u5360\u7528\u5185\u5B58:\xA0"),n.a.createElement("span",{className:"c-light-primary"},Ln==null?void 0:Ln.execute_memory,"mb")),n.a.createElement("span",null,n.a.createElement("span",null))),"\u4F18\u4E8E",n.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(Ln==null?void 0:Ln.memory_better_than)||100,"%"),"\u7684\u7528\u6237"),n.a.createElement("div",{id:"oj-modal-next",className:"oj-modal-btn"},"\u8FDB\u5165\u4E0B\u4E00\u9898"))))};function _r(Ye){var pt=Ye.languageValue,Kt=Ye.languageList,fn=Ye.onChangeLanguage,tn=Ye.title,Xt=Ye.modify_code,nt=Ye.onSyncCode,gt=Ye.onShowCodeSetting,cn=Ye.onResetCode,ft=Object(T.h)(),hn=function(){I.a.confirm({title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",icon:n.a.createElement(f.a,null),content:"\u4F60\u5728\u672C\u6587\u4EF6\u4E2D\u4FEE\u6539\u7684\u5185\u5BB9\u5C06\u4E22\u5931\uFF0C\u662F\u5426\u786E\u5B9A\u91CD\u65B0\u52A0\u8F7D\u521D\u59CB\u4EE3\u7801\uFF1F",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:cn})};return n.a.createElement("div",{className:"action-bar"},n.a.createElement(Y.a,{className:"oj-select",value:pt,style:{width:100},placeholder:"\u9009\u62E9\u8BED\u8A00",onChange:fn},Kt==null?void 0:Kt.map(function(Bt){return n.a.createElement(Y.a.Option,{key:Bt.language,value:Bt.language},Bt.language)})),n.a.createElement("span",null),n.a.createElement("a",{title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",onClick:hn},n.a.createElement("i",{className:"iconfont icon-zhongzhi font-20 "})),n.a.createElement("a",{onClick:gt},n.a.createElement("i",{className:"iconfont icon-shezhi"})))}function oi(Ye){var pt=Ye.id,Kt=Ye.input,fn=Ye.showNote,tn=Ye.onShowNote,Xt=Ye.notes,nt=Ye.onCancelNote,gt=Ye.onAddNote,cn=Ye.debugResult,ft=Ye.language,hn=Ye.debuging,Bt=Ye.submitting,vn=Ye.executingMessage,Kn=Ye.code,Mn=Ye.onSubmitCode,Sn=Ye.onDebugCode,ni=Ye.onChangeCode,Ln=Ye.onChangeInput,Zn=Ye.onUpdateCode,qn=Object(V.a)(Ye,["id","input","showNote","onShowNote","notes","onCancelNote","onAddNote","debugResult","language","debuging","submitting","executingMessage","code","onSubmitCode","onDebugCode","onChangeCode","onChangeInput","onUpdateCode"]);function bi(mi){return n.a.createElement(_r,Object(ee.a)({},qn,{onShowCodeSetting:mi}))}var Un={id:pt,input:Kt,debugResult:cn,debuging:hn,submitting:Bt,executingMessage:vn,onDebugCode:Sn,onChangeCode:ni,onSubmitCode:Mn,onChangeInput:Ln};return n.a.createElement("div",{className:"right-panel"},n.a.createElement(c.a,{language:ft,value:Kn,onChange:ni,ActionBarRender:bi}),n.a.createElement("div",{className:"note-form-area ".concat(fn?"active":"")},n.a.createElement(xe,{onCancel:nt,notes:Xt,callback:gt})),n.a.createElement(F.b,Un))}},WaYH:function(Be,we,k){"use strict";var ee=k("rePB"),V=k("Ff2n"),P=k("VTBJ"),Y=k("1OyB"),W=k("vuIU"),R=k("JX7q"),B=k("Ji7U"),M=k("LK+K"),L=k("q1tI"),I=k("TSYQ"),p=k.n(I),m=k("sboe"),u=k("OZM5"),h=function(O){var E=O.prefixCls,v=O.level,_=O.isStart,f=O.isEnd;if(!v)return null;for(var c="".concat(E,"-indent-unit"),S=[],y=0;y1&&arguments[1]!==void 0?arguments[1]:!1,Ue=Te.getAttribute("id")||Te.getAttribute("data-reactid")||Te.getAttribute("name");if(Oe&&N[Ue])return N[Ue];var De=window.getComputedStyle(Te),be=De.getPropertyValue("box-sizing")||De.getPropertyValue("-moz-box-sizing")||De.getPropertyValue("-webkit-box-sizing"),ge=parseFloat(De.getPropertyValue("padding-bottom"))+parseFloat(De.getPropertyValue("padding-top")),He=parseFloat(De.getPropertyValue("border-bottom-width"))+parseFloat(De.getPropertyValue("border-top-width")),ct=b.map(function(_t){return"".concat(_t,":").concat(De.getPropertyValue(_t))}).join(";"),vt={sizingStyle:ct,paddingSize:ge,borderSize:He,boxSizing:be};return Oe&&Ue&&(N[Ue]=vt),vt}function Z(Te){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ue=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,De=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;F||(F=document.createElement("textarea"),F.setAttribute("tab-index","-1"),F.setAttribute("aria-hidden","true"),document.body.appendChild(F)),Te.getAttribute("wrap")?F.setAttribute("wrap",Te.getAttribute("wrap")):F.removeAttribute("wrap");var be=X(Te,Oe),ge=be.paddingSize,He=be.borderSize,ct=be.boxSizing,vt=be.sizingStyle;F.setAttribute("style","".concat(vt,";").concat(y)),F.value=Te.value||Te.placeholder||"";var _t=Number.MIN_SAFE_INTEGER,yt=Number.MAX_SAFE_INTEGER,et=F.scrollHeight,ht;if(ct==="border-box"?et+=He:ct==="content-box"&&(et-=ge),Ue!==null||De!==null){F.value=" ";var xt=F.scrollHeight-ge;Ue!==null&&(_t=xt*Ue,ct==="border-box"&&(_t=_t+ge+He),et=Math.max(_t,et)),De!==null&&(yt=xt*De,ct==="border-box"&&(yt=yt+ge+He),ht=et>yt?"":"hidden",et=Math.min(yt,et))}return{height:et,minHeight:_t,maxHeight:yt,overflowY:ht,resize:"none"}}var H=k("Gytx"),A=k.n(H),z;(function(Te){Te[Te.NONE=0]="NONE",Te[Te.RESIZING=1]="RESIZING",Te[Te.RESIZED=2]="RESIZED"})(z||(z={}));var ne=function(Te){Object(Y.a)(Ue,Te);var Oe=Object(W.a)(Ue);function Ue(De){var be;return Object(V.a)(this,Ue),be=Oe.call(this,De),be.nextFrameActionId=void 0,be.resizeFrameId=void 0,be.textArea=void 0,be.saveTextArea=function(ge){be.textArea=ge},be.handleResize=function(ge){var He=be.state.resizeStatus,ct=be.props,vt=ct.autoSize,_t=ct.onResize;if(He!==z.NONE)return;typeof _t=="function"&&_t(ge),vt&&be.resizeOnNextFrame()},be.resizeOnNextFrame=function(){cancelAnimationFrame(be.nextFrameActionId),be.nextFrameActionId=requestAnimationFrame(be.resizeTextarea)},be.resizeTextarea=function(){var ge=be.props.autoSize;if(!ge||!be.textArea)return;var He=ge.minRows,ct=ge.maxRows,vt=Z(be.textArea,!1,He,ct);be.setState({textareaStyles:vt,resizeStatus:z.RESIZING},function(){cancelAnimationFrame(be.resizeFrameId),be.resizeFrameId=requestAnimationFrame(function(){be.setState({resizeStatus:z.RESIZED},function(){be.resizeFrameId=requestAnimationFrame(function(){be.setState({resizeStatus:z.NONE}),be.fixFirefoxAutoScroll()})})})})},be.renderTextArea=function(){var ge=be.props,He=ge.prefixCls,ct=He===void 0?"rc-textarea":He,vt=ge.autoSize,_t=ge.onResize,yt=ge.className,et=ge.disabled,ht=be.state,xt=ht.textareaStyles,Tt=ht.resizeStatus,mt=Object(f.a)(be.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ie=S()(ct,yt,Object(M.a)({},"".concat(ct,"-disabled"),et));"value"in mt&&(mt.value=mt.value||"");var je=Object(B.a)(Object(B.a)(Object(B.a)({},be.props.style),xt),Tt===z.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return R.createElement(_,{onResize:be.handleResize,disabled:!(vt||_t)},R.createElement("textarea",Object(ee.a)({},mt,{className:Ie,style:je,ref:be.saveTextArea})))},be.state={textareaStyles:{},resizeStatus:z.NONE},be}return Object(P.a)(Ue,[{key:"componentDidUpdate",value:function(be){(be.value!==this.props.value||!A()(be.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var be=this.textArea.selectionStart,ge=this.textArea.selectionEnd;this.textArea.setSelectionRange(be,ge)}}catch(He){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Ue}(R.Component),ae=ne,me=function(Te){Object(Y.a)(Ue,Te);var Oe=Object(W.a)(Ue);function Ue(De){var be;Object(V.a)(this,Ue),be=Oe.call(this,De),be.resizableTextArea=void 0,be.focus=function(){be.resizableTextArea.textArea.focus()},be.saveTextArea=function(He){be.resizableTextArea=He},be.handleChange=function(He){var ct=be.props.onChange;be.setValue(He.target.value,function(){be.resizableTextArea.resizeTextarea()}),ct&&ct(He)},be.handleKeyDown=function(He){var ct=be.props,vt=ct.onPressEnter,_t=ct.onKeyDown;He.keyCode===13&&vt&&vt(He),_t&&_t(He)};var ge=typeof De.value=="undefined"||De.value===null?De.defaultValue:De.value;return be.state={value:ge},be}return Object(P.a)(Ue,[{key:"setValue",value:function(be,ge){"value"in this.props||this.setState({value:be},ge)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return R.createElement(ae,Object(ee.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(be){return"value"in be?{value:be.value}:null}}]),Ue}(R.Component),xe=we.default=me},Z8dc:function(Be,we,k){Be.exports={flex_box_center:"flex_box_center___3U5jH",flex_space_between:"flex_space_between___10tgP",flex_box_vertical_center:"flex_box_vertical_center___1e5pu",flex_box_center_end:"flex_box_center_end___WDBuM",flex_box_column:"flex_box_column___3TSEG",listForm:"listForm___264Pu",scroll:"scroll___CK9uS",formWrap:"formWrap___2n6e2",btns:"btns___2wuct",main:"main___1WFqr",mainLoading:"mainLoading___1kJWi",tip:"tip___10JaH",proWarp:"proWarp___TMP84",pro:"pro___1CLLm",mainSucceed:"mainSucceed___3NYgf",del:"del___34rdE"}},ZD9Y:function(Be,we,k){"use strict";var ee=k("BoS7"),V=k("Sdc0"),P=k("OaEy"),Y=k("2fM7"),W=k("q1tI"),R=k.n(W),B=k("lOMy"),M=k.n(B),L=Y.a.Option;we.a=function(I){var p=I.onFontSizeChange,m=I.cmFontSize,u=I.cmCodeMode,h=I.onCodeModeChange,s=I.onTabToSpace,l=I.className,i=l===void 0?"":l,r=I.tabToSpace,n=I.children;return R.a.createElement("div",{className:"tpi-code-setting ".concat(i)},R.a.createElement("h3",null,"\u4EE3\u7801\u683C\u5F0F"),R.a.createElement("section",null,R.a.createElement("div",{className:"file-item"},R.a.createElement("b",null,"\u663E\u793A\u6A21\u5F0F"),R.a.createElement(Y.a,{bordered:!1,size:"small",value:u,onChange:h},R.a.createElement(L,{value:"vs"},"\u767D\u8272\u80CC\u666F"),R.a.createElement(L,{value:"vs-dark"},"\u9ED1\u8272\u80CC\u666F"))),R.a.createElement("div",{className:"file-item"},R.a.createElement("b",null,"\u5B57\u4F53\u5927\u5C0F"),R.a.createElement(Y.a,{bordered:!1,size:"small",value:m,onChange:p},R.a.createElement(L,{value:12},"12px"),R.a.createElement(L,{value:14},"14px"),R.a.createElement(L,{value:16},"16px"),R.a.createElement(L,{value:18},"18px"),R.a.createElement(L,{value:20},"20px"),R.a.createElement(L,{value:22},"22px"))),R.a.createElement("div",{className:"file-item"},R.a.createElement("b",null,"Tab\u8F6C\u6362"),R.a.createElement(V.a,{checked:r,onChange:s}))),R.a.createElement("h3",null,"\u5FEB\u6377\u952E"),R.a.createElement("section",null,R.a.createElement("div",{className:"file-item"},R.a.createElement("b",null,"\u4FDD\u5B58\u4EE3\u7801"),R.a.createElement("span",null,"Ctrl + S")),R.a.createElement("div",{className:"file-item"},R.a.createElement("b",null,"\u5524\u51FA\u5FEB\u6377\u952E\u5217\u8868"),R.a.createElement("span",null,"F1 / Alt + F1")),R.a.createElement("div",{className:"file-item"},R.a.createElement("b",null,"\u5DE6\u53F3\u7F29\u8FDB"),R.a.createElement("span",null,"Ctrl + ]/[")),R.a.createElement("div",{className:"file-item"},R.a.createElement("b",null,"\u8DF3\u5230\u5339\u914D\u7684\u62EC\u53F7"),R.a.createElement("span",null,"Ctrl + Shift + \\")),R.a.createElement("div",{className:"file-item"},R.a.createElement("b",null,"\u8F6C\u5230\u884C\u9996"),R.a.createElement("span",null,"Home")),R.a.createElement("div",{className:"file-item"},R.a.createElement("b",null,"\u8F6C\u5230\u884C\u5C3E"),R.a.createElement("span",null,"End"))),n)}},ZW9T:function(Be,we,k){"use strict";k.d(we,"a",function(){return Z});var ee=k("k1fw"),V=k("miYZ"),P=k("tsqr"),Y=k("rAM+"),W=k("tJVT"),R=k("PpiC"),B=k("q1tI"),M=k.n(B),L=k("bdgK"),I=k("oBTY"),p=k("9og8"),m=k("WmNS"),u=k.n(m),h={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},s={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(` `)},{label:"System.out.println",content:["System.out.println($0)"].join(` `)},{label:"System.out.print",content:["System.out.print($0)"].join(` `)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},l={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","for","friend","gcnew","generic","goto","if","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(` `)},{label:"#include",content:'include "$0"'},{label:"printf",content:"printf($0)"},{label:"main",content:["int main () {"," $0","}"].join(` `)},{label:"for",content:["for( ; ; ){"," $0","}"].join(` `)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(` `)},{label:"using namespace std;",content:["using namespace std;"].join(` `)},{label:"#include ",content:["#include "].join(` `)},{label:"#include ",content:["#include "].join(` `)},{label:"#include ",content:["#include "].join(` `)},{label:"#include ",content:["#include "].join(` `)},{label:"#include ",content:["#include "].join(` `)}]},i={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(` `)}]},r=k("5VLF"),n=k.n(r),d={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},w=function(A,z){return z.map(function(ne){return{label:ne,kind:A.languages.CompletionItemKind.Keyword,insertText:ne}})},T=function(A){return Object.keys(d.tables).map(function(z){return{label:z,kind:A.languages.CompletionItemKind.Variable,insertText:z}})},x=function(A,z){var ne=d.tables[A];return ne?ne.map(function(ae){return{label:ae,kind:z.languages.CompletionItemKind.Field,insertText:ae}}):[]};function O(H,A,z,ne,ae){var me=A.getWordUntilPosition(z),xe={startLineNumber:z.lineNumber,endLineNumber:z.lineNumber,startColumn:me.startColumn,endColumn:me.endColumn},Te=ne.map(function(Oe){return{label:Oe,kind:H.languages.CompletionItemKind.Keyword,insertText:Oe,insertTextRules:H.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:xe}});return ae.map(function(Oe){Te.push(Object(ee.a)(Object(ee.a)({},Oe),{},{range:xe}))}),Te}var E=function(H){d.languages.map(function(ae){return H.languages.registerDocumentFormattingEditProvider(ae,{provideDocumentFormattingEdits:function(xe,Te,Oe){return Object(p.a)(u.a.mark(function Ue(){var De;return u.a.wrap(function(ge){for(;;)switch(ge.prev=ge.next){case 0:return De=n()(xe.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),ge.abrupt("return",[{range:xe.getFullModelRange(),text:De}]);case 2:case"end":return ge.stop()}},Ue)}))()}}),ae});var A=l.quickKey.map(function(ae){return{label:ae.label,kind:H.languages.CompletionItemKind.Method,insertText:ae.content,insertTextRules:H.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),z=i.quickKey.map(function(ae){return{label:ae.label,kind:H.languages.CompletionItemKind.Method,insertText:ae.content,insertTextRules:H.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ne=s.quickKey.map(function(ae){return{label:ae.label,kind:H.languages.CompletionItemKind.Method,insertText:ae.content,insertTextRules:H.languages.CompletionItemInsertTextRule.InsertAsSnippet}});H.languages.registerCompletionItemProvider("cpp",{triggerCharacters:["."," ","#"].concat(Object(I.a)(l.keywords),Object(I.a)(l.quickKey.map(function(ae){return ae.label}))),provideCompletionItems:function(me,xe){var Te=me.getValueInRange({startLineNumber:xe.lineNumber,startColumn:1,endLineNumber:xe.lineNumber,endColumn:xe.column}),Oe=Te.match(/cu/gim);console.log("match:",Oe,xe,Te,me);var Ue=[],De=xe.lineNumber,be=xe.column,ge=me.getValueInRange({startLineNumber:De,startColumn:0,endLineNumber:De,endColumn:be}),He=ge.trim().split(/\s+/),ct=He[He.length-1];if(ct.endsWith(".")){var vt=ct.slice(0,ct.length-1);Object.keys(d.tables).includes(vt)&&(Ue=Object(I.a)(x(vt,H)))}else ct==="."?Ue=[]:Ue=[].concat(Object(I.a)(T(H)),Object(I.a)(w(H,l.keywords)),Object(I.a)(A));return{suggestions:Ue}}}),H.languages.registerCompletionItemProvider("c",{triggerCharacters:["."," ","#"].concat(Object(I.a)(h.keywords)),provideCompletionItems:function(me,xe){var Te=me.getValueInRange({startLineNumber:xe.lineNumber,startColumn:1,endLineNumber:xe.lineNumber,endColumn:xe.column}),Oe=Te.match(/cu/gim);console.log("match:",Oe,xe,Te,me);var Ue=[],De=xe.lineNumber,be=xe.column,ge=me.getValueInRange({startLineNumber:De,startColumn:0,endLineNumber:De,endColumn:be}),He=ge.trim().split(/\s+/),ct=He[He.length-1];if(ct.endsWith(".")){var vt=ct.slice(0,ct.length-1);Object.keys(d.tables).includes(vt)&&(Ue=Object(I.a)(x(vt,H)))}else ct==="."?Ue=[]:Ue=[].concat(Object(I.a)(T(H)),Object(I.a)(w(H,h.keywords)));return{suggestions:Ue}}}),H.languages.registerCompletionItemProvider("java",{triggerCharacters:["."," "].concat(Object(I.a)(s.keywords)),provideCompletionItems:function(me,xe){var Te=[],Oe=xe.lineNumber,Ue=xe.column,De=me.getValueInRange({startLineNumber:Oe,startColumn:0,endLineNumber:Oe,endColumn:Ue}),be=De.trim().split(/\s+/),ge=be[be.length-1];if(ge.endsWith(".")){var He=ge.slice(0,ge.length-1);Object.keys(d.tables).includes(He)&&(Te=Object(I.a)(x(He,H)))}else ge==="."?Te=[]:Te=[].concat(Object(I.a)(T(H)),Object(I.a)(w(H,s.keywords)),Object(I.a)(ne));return{suggestions:Te}}}),H.languages.registerCompletionItemProvider("python",{triggerCharacters:["."," "].concat(Object(I.a)(i.keywords)),provideCompletionItems:function(me,xe){var Te=[],Oe=xe.lineNumber,Ue=xe.column,De=me.getValueInRange({startLineNumber:Oe,startColumn:0,endLineNumber:Oe,endColumn:Ue}),be=De.trim().split(/\s+/),ge=be[be.length-1];if(ge.endsWith(".")){var He=ge.slice(0,ge.length-1);Object.keys(d.tables).includes(He)&&(Te=Object(I.a)(x(He,H)))}else ge==="."?Te=[]:Te=[].concat(Object(I.a)(T(H)),Object(I.a)(w(H,i.keywords)),Object(I.a)(z));return{suggestions:Te}}})},v="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",_=k("LvDl"),f=k("+ua5");function c(H){return/^\d+$/.test(H)?"".concat(H,"px"):H}function S(){}var y=!1,b={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function N(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],A=H;if(Array.isArray(H)){for(var z=0;z0||$t.target.offsetWidth>0)&&Fe.current.instance.layout()}}catch(fe){Rt.e(fe)}finally{Rt.f()}}),ke.observe(rt.current)),ke}function Ce(){P.b.warn(decodeURIComponent(v))}var Ke=function(){var qe=Fe.current.instance;if(me!=null&&qe&&de){var Rt=qe.getModel();Rt&&me!==Rt.getValue()&&(y=!0,Rt.setValue(me),qe.layout(),y=!1)}};Object(B.useEffect)(function(){Je.current&&clearTimeout(Je.current),Je.current=setTimeout(function(){Ke()},500)},[me,de,Fe.current]),Object(B.useEffect)(function(){if(jt&&Fe.current&&Fe.current.instance){var ke=Fe.current.instance;ke.changeViewZones(function(Rt){var Pt=document.createElement("div");Pt.style.padding="10px 20px",Pt.style.width="calc(100% - 20px)",Pt.className="my-error-line-wrp",Pt.innerHTML=Pe,Rt.addZone({afterLineNumber:jt||11,heightInLines:3,domNode:Pt})});var qe={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};ke.addOverlayWidget(qe),ke.revealPositionInCenter({lineNumber:20,column:1})}},[jt,Fe.current,de]);function st(){var ke=Fe.current.instance;if(ke){var qe=ke.getSelection(),Rt=Fe.current.pastePos||{},Pt=new F.Range(Rt.startLineNumber||qe.endLineNumber,Rt.startColumn||qe.endColumn,Rt.endLineNumber||qe.endLineNumber,Rt.endColumn||qe.endColumn);setTimeout(function(){ke.executeEdits("",[{range:Pt,text:""}])},300)}}function At(ke){(window.navigator.platform.match("Mac")?ke.metaKey:ke.ctrlKey)&&ke.keyCode==83&&(ke.preventDefault(),yt())}var Ft=function(){if(ht&&Fe.current.instance){var qe=Fe.current.instance.getContentHeight();Lt(qe0||je.target.offsetWidth>0)&&ht.layout()}}catch($e){mt.e($e)}finally{mt.f()}}),xt.observe(De.current)),xt}Object(B.useEffect)(function(){De.current&&k.e(27).then(k.t.bind(null,"M/lh",7)).then(function(ht){F=ht;var xt=F.editor.createDiffEditor(De.current,Object(ee.a)(Object(ee.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},Ue),{},{wordWrap:!0}));ct(xt);var Tt=vt(xt);return function(){xt.dispose();var mt=xt.getModel();mt&&mt.dispose(),Tt.unobserve(De.current)}})},[]),Object(B.useEffect)(function(){He&&He.setModel({original:F.editor.createModel(me,Te),modified:F.editor.createModel(xe,Te)})},[me,xe,Te,He]);var _t=c(z),yt=c(ae),et={width:_t,height:yt};return M.a.createElement("div",{className:"my-diff-editor",ref:De,style:et})}},ZpRC:function(Be,we,k){"use strict";function ee(p){return typeof p=="object"&&p!=null&&p.nodeType===1}function V(p,m){return(!m||p!=="hidden")&&p!=="visible"&&p!=="clip"}function P(p,m){if(p.clientHeightm||l>p&&i=m&&r>=u?l-p-h:i>m&&ru?i-m+s:0}var W=function(p,m){var u=window,h=m.scrollMode,s=m.block,l=m.inline,i=m.boundary,r=m.skipOverflowHiddenElements,n=typeof i=="function"?i:function(xt){return xt!==i};if(!ee(p))throw new TypeError("Invalid target");for(var d=document.scrollingElement||document.documentElement,w=[],T=p;ee(T)&&n(T);){if((T=T.parentElement)===d){w.push(T);break}T!=null&&T===document.body&&P(T)&&!P(document.documentElement)||T!=null&&P(T,r)&&w.push(T)}for(var x=u.visualViewport?u.visualViewport.width:innerWidth,O=u.visualViewport?u.visualViewport.height:innerHeight,E=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,_=p.getBoundingClientRect(),f=_.height,c=_.width,S=_.top,y=_.right,b=_.bottom,N=_.left,F=s==="start"||s==="nearest"?S:s==="end"?b:S+f/2,X=l==="center"?N+c/2:l==="end"?y:N,Z=[],H=0;H=0&&N>=0&&b<=O&&y<=x&&S>=me&&b<=Te&&N>=Oe&&y<=xe)return Z;var Ue=getComputedStyle(A),De=parseInt(Ue.borderLeftWidth,10),be=parseInt(Ue.borderTopWidth,10),ge=parseInt(Ue.borderRightWidth,10),He=parseInt(Ue.borderBottomWidth,10),ct=0,vt=0,_t="offsetWidth"in A?A.offsetWidth-A.clientWidth-De-ge:0,yt="offsetHeight"in A?A.offsetHeight-A.clientHeight-be-He:0;if(d===A)ct=s==="start"?F:s==="end"?F-O:s==="nearest"?Y(v,v+O,O,be,He,v+F,v+F+f,f):F-O/2,vt=l==="start"?X:l==="center"?X-x/2:l==="end"?X-x:Y(E,E+x,x,De,ge,E+X,E+X+c,c),ct=Math.max(0,ct+v),vt=Math.max(0,vt+E);else{ct=s==="start"?F-me-be:s==="end"?F-Te+He+yt:s==="nearest"?Y(me,Te,ne,be,He+yt,F,F+f,f):F-(me+ne/2)+yt/2,vt=l==="start"?X-Oe-De:l==="center"?X-(Oe+ae/2)+_t/2:l==="end"?X-xe+ge+_t:Y(Oe,xe,ae,De,ge+_t,X,X+c,c);var et=A.scrollLeft,ht=A.scrollTop;F+=ht-(ct=Math.max(0,Math.min(ht+ct,A.scrollHeight-ne+yt))),X+=et-(vt=Math.max(0,Math.min(et+vt,A.scrollWidth-ae+_t)))}Z.push({el:A,top:ct,left:vt})}return Z};function R(p){return p===Object(p)&&Object.keys(p).length!==0}function B(p,m){m===void 0&&(m="auto");var u="scrollBehavior"in document.body.style;p.forEach(function(h){var s=h.el,l=h.top,i=h.left;s.scroll&&u?s.scroll({top:l,left:i,behavior:m}):(s.scrollTop=l,s.scrollLeft=i)})}function M(p){return p===!1?{block:"end",inline:"nearest"}:R(p)?p:{block:"start",inline:"nearest"}}function L(p,m){var u=!p.ownerDocument.documentElement.contains(p);if(R(m)&&typeof m.behavior=="function")return m.behavior(u?[]:W(p,m));if(u)return;var h=M(m);return B(W(p,h),h.behavior)}var I=we.a=L},ZsLC:function(Be,we,k){Be.exports={"left-panel":"left-panel___FTwwW","tab-panel-body":"tab-panel-body___2YSOx",b1:"b1___3qx3o","oj-mr":"oj-mr___1GA9N","oj-width-input":"oj-width-input___3GkyP","s-navs":"s-navs___1fGGf","bg-white":"bg-white___1ZAy0",active:"active___39N6D"}},bCnd:function(Be,we,k){"use strict";k.d(we,"b",function(){return Y}),k.d(we,"a",function(){return W});var ee=k("je13"),V=k.n(ee),P=!1;function Y(R,B){var M=V.a.get("__ec");M||(M={}),M[R]=B,V.a.set("__ec",M)}function W(R,B){var M=V.a.get("__ec");return M?M[R]===void 0?B:M[R]:B}},bT9E:function(Be,we,k){"use strict";k.d(we,"a",function(){return V});var ee=k("VTBJ");function V(P,Y){var W=Object(ee.a)({},P);return Array.isArray(Y)&&Y.forEach(function(R){delete W[R]}),W}},bdLU:function(Be,we,k){"use strict";k.d(we,"a",function(){return ee});var ee;(function(V){V[V.NOMATCH=-1]="NOMATCH",V[V.OK=0]="OK",V[V.TIMEOUT=2]="TIMEOUT",V[V.PODFAILURE=3]="PODFAILURE",V[V.COMPILEFAILURE=4]="COMPILEFAILURE",V[V.EXECUTEFAILURE=5]="EXECUTEFAILURE"})(ee||(ee={}))},biw7:function(Be,we,k){"use strict";var ee=k("q1tI"),V=k.n(ee),P=ee.createContext(null);we.a=P},c5Ni:function(Be,we,k){},cDPC:function(Be,we,k){"use strict";var ee=k("tJVT"),V=k("q1tI"),P=k.n(V),Y=k("i3hx"),W=k.n(Y);we.a=function(R){var B=R.defaultX,M=B===void 0?"40%":B,L=R.leftChild,I=R.rightChild,p=R.className,m=R.hideResize,u=m===void 0?!1:m,h=Object(V.useState)(M),s=Object(ee.a)(h,2),l=s[0],i=s[1],r=Object(V.useRef)();function n(){r.current=!0}Object(V.useEffect)(function(){function T(O){r.current&&i(O.pageX)}function x(){r.current=!1}return window.addEventListener("mousemove",T),window.addEventListener("mouseup",x),function(){window.removeEventListener("mousemove",T),window.removeEventListener("mouseup",x)}},[]);var d=typeof l=="number"&&l!==.01?"".concat(l,"px"):M,w="calc(100% - ".concat(u?"0px":"4px"," - ").concat(d,")");return P.a.createElement("div",{className:"split-panel-container ".concat(p)},P.a.createElement("section",{style:{width:d,display:l===.01?"none":""}},L),P.a.createElement("section",{className:"resize-x-bar",onMouseDown:n},P.a.createElement("a",{className:"btn-resize"},P.a.createElement("svg",{width:"16",height:"13",viewBox:"0 0 16 13"},P.a.createElement("path",{d:"M12.245 7.53H5.647v1.882h6.598v2.823L16 8.471l-3.755-3.765V7.53zM10.353 4.706H3.755v2.823L0 3.765 3.755 0v2.824h6.598v1.882z"})))),P.a.createElement("section",{style:{width:w}},I))}},dejd:function(Be,we,k){},dmUQ:function(Be,we,k){"use strict";var ee=k("Ff2n"),V=k("rePB"),P=k("1OyB"),Y=k("vuIU"),W=k("Ji7U"),R=k("md7G"),B=k("foSv"),M=k("q1tI"),L=k.n(M),I=k("TSYQ"),p=k.n(I),m=k("4IlW");function u(f,c){var S=Object.keys(f);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(f);c&&(y=y.filter(function(b){return Object.getOwnPropertyDescriptor(f,b).enumerable})),S.push.apply(S,y)}return S}function h(f){for(var c=1;c1?ae-1:0),xe=1;xe1?H-1:0),z=1;z=0)return parseInt(Z.slice(Z.indexOf("e-")+2),10);var H=0;return Z.indexOf(".")>=0&&(H=Z.length-Z.indexOf(".")-1),H},b.getInputDisplayValue=function(X){var Z=X||b.state,H=Z.focused,A=Z.inputValue,z=Z.value,ne;H?ne=A:ne=b.toPrecisionAsStep(z),ne==null&&(ne="");var ae=b.formatWrapper(ne);return x(b.props.decimalSeparator)&&(ae=ae.toString().replace(".",b.props.decimalSeparator)),ae},b.recordCursorPosition=function(){try{b.cursorStart=b.input.selectionStart,b.cursorEnd=b.input.selectionEnd,b.currentValue=b.input.value,b.cursorBefore=b.input.value.substring(0,b.cursorStart),b.cursorAfter=b.input.value.substring(b.cursorEnd)}catch(X){}},b.restoreByAfter=function(X){if(X===void 0)return!1;var Z=b.input.value,H=Z.lastIndexOf(X);if(H===-1)return!1;var A=b.cursorBefore.length;return b.lastKeyCode===m.a.DELETE&&b.cursorBefore.charAt(A-1)===X[0]?(b.fixCaret(A,A),!0):H+X.length===Z.length?(b.fixCaret(H,H),!0):!1},b.partRestoreByAfter=function(X){return X===void 0?!1:Array.prototype.some.call(X,function(Z,H){var A=X.substring(H);return b.restoreByAfter(A)})},b.isNotCompleteNumber=function(X){return isNaN(X)||X===""||X===null||X&&X.toString().indexOf(".")===X.toString().length-1},b.stop=function(){b.autoStepTimer&&clearTimeout(b.autoStepTimer)},b.down=function(X,Z,H){b.pressingUpOrDown=!0,b.step("down",X,Z,H)},b.up=function(X,Z,H){b.pressingUpOrDown=!0,b.step("up",X,Z,H)},b.saveInput=function(X){b.input=X};var N=y.value;N===void 0&&(N=y.defaultValue),b.state={focused:y.autoFocus};var F=b.getValidValue(b.toNumber(N));return b.state=h(h({},b.state),{},{inputValue:b.toPrecisionAsStep(F),value:F}),b}return Object(Y.a)(S,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(b){var N=this.props,F=N.value,X=N.onChange,Z=N.max,H=N.min,A=this.state.focused;if(b){if(!O(b.value,F)||!O(b.max,Z)||!O(b.min,H)){var z=A?F:this.getValidValue(F),ne;this.pressingUpOrDown?ne=z:this.inputting?ne=this.rawInput:ne=this.toPrecisionAsStep(z),this.setState({value:z,inputValue:ne})}var ae="value"in this.props?F:this.state.value;"max"in this.props&&b.max!==Z&&typeof ae=="number"&&ae>Z&&X&&X(Z),"min"in this.props&&b.min!==H&&typeof ae=="number"&&ae1&&arguments[1]!==void 0?arguments[1]:this.props.min,F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,X=parseFloat(b);return isNaN(X)?b:(XF&&(X=F),X)}},{key:"setValue",value:function(b,N){var F=this.props.precision,X=this.isNotCompleteNumber(parseFloat(b))?null:parseFloat(b),Z=this.state.value,H=Z===void 0?null:Z,A=this.state.inputValue,z=A===void 0?null:A,ne=typeof X=="number"?X.toFixed(F):"".concat(X),ae=X!==H||ne!=="".concat(z);return"value"in this.props?(z=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:z},N)):this.setState({value:X,inputValue:this.toPrecisionAsStep(b)},N),ae&&this.props.onChange(X),X}},{key:"getMaxPrecision",value:function(b){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.props,X=F.precision,Z=F.step;if(x(X))return X;var H=this.getPrecision(N),A=this.getPrecision(Z),z=this.getPrecision(b);return b?Math.max(z,H+A):H+A}},{key:"getPrecisionFactor",value:function(b){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.getMaxPrecision(b,N);return Math.pow(10,F)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(b){return this.props.formatter?this.props.formatter(b):b}},{key:"toPrecisionAsStep",value:function(b){if(this.isNotCompleteNumber(b)||b==="")return b;var N=Math.abs(this.getMaxPrecision(b));return isNaN(N)?b.toString():Number(b).toFixed(N)}},{key:"toNumber",value:function(b){var N=this.props.precision,F=this.state.focused,X=b&&b.length>16&&F;return this.isNotCompleteNumber(b)||X?b:x(N)?Math.round(b*Math.pow(10,N))/Math.pow(10,N):Number(b)}},{key:"upStep",value:function(b,N){var F=this.props.step,X=this.getPrecisionFactor(b,N),Z=Math.abs(this.getMaxPrecision(b,N)),H=((X*b+X*F*N)/X).toFixed(Z);return this.toNumber(H)}},{key:"downStep",value:function(b,N){var F=this.props.step,X=this.getPrecisionFactor(b,N),Z=Math.abs(this.getMaxPrecision(b,N)),H=((X*b-X*F*N)/X).toFixed(Z);return this.toNumber(H)}},{key:"step",value:function(b,N){var F=this,X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,Z=arguments.length>3?arguments[3]:void 0;this.stop(),N&&(N.persist(),N.preventDefault());var H=this.props;if(H.disabled)return;var A=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(A))return;var z=this["".concat(b,"Step")](A,X),ne=z>H.max||zH.max?z=H.max:z=me),Je=(Mt||Mt===0)&&(isNaN(Mt)||Number(Mt)<=xe),Ee=Fe||X||Z,ye=Je||X||Z,_e=p()("".concat(F,"-handler"),"".concat(F,"-handler-up"),Object(V.a)({},"".concat(F,"-handler-up-disabled"),Ee)),le=p()("".concat(F,"-handler"),"".concat(F,"-handler-down"),Object(V.a)({},"".concat(F,"-handler-down-disabled"),ye)),de=H?{onTouchStart:Ee?i:this.up,onTouchEnd:this.stop}:{onMouseDown:Ee?i:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},ve=H?{onTouchStart:ye?i:this.down,onTouchEnd:this.stop}:{onMouseDown:ye?i:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return L.a.createElement("div",{className:Me,style:Te,title:Oe,onMouseEnter:Ue,onMouseLeave:De,onMouseOver:be,onMouseOut:ge,onFocus:function(){return null},onBlur:function(){return null}},L.a.createElement("div",{className:"".concat(F,"-handler-wrap")},L.a.createElement("span",Object.assign({unselectable:"on"},de,{role:"button","aria-label":"Increase Value","aria-disabled":Ee,className:_e}),z||L.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-up-inner"),onClick:r})),L.a.createElement("span",Object.assign({unselectable:"on"},ve,{role:"button","aria-label":"Decrease Value","aria-disabled":ye,className:le}),ne||L.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-down-inner"),onClick:r}))),L.a.createElement("div",{className:"".concat(F,"-input-wrap")},L.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":xe,"aria-valuemax":me,"aria-valuenow":Mt,required:He,type:_t,placeholder:yt,onPaste:$e,onClick:ct,onMouseUp:this.onMouseUp,className:"".concat(F,"-input"),tabIndex:vt,autoComplete:A,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:tt?this.onKeyDown:i,onKeyUp:tt?this.onKeyUp:i,autoFocus:Ie,maxLength:mt,readOnly:Z,disabled:X,max:me,min:xe,step:Tt,name:je,title:Oe,id:et,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(rt),pattern:xt,inputMode:ht,onInput:at},Pe))))}}]),S}(L.a.Component);E.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:T,min:-T,step:1,style:{},onChange:i,onKeyDown:i,onPressEnter:i,onFocus:i,onBlur:i,parser:n,required:!1,autoComplete:"off"};var v=E,_=we.a=v},fcSX:function(Be,we,k){"use strict";var ee=k("Ff2n"),V=k("1OyB"),P=k("vuIU"),Y=k("Ji7U"),W=k("md7G"),R=k("foSv"),B=k("1W/9"),M=k("q1tI"),L=k("rePB"),I=k("JX7q"),p=k("TSYQ"),m=k.n(p),u=k("qx4F"),h=k("4IlW");function s(X){return Array.isArray(X)?X:[X]}var l={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},i=Object.keys(l).filter(function(X){if(typeof document=="undefined")return!1;var Z=document.getElementsByTagName("html")[0];return X in(Z?Z.style:{})})[0],r=l[i];function n(X,Z,H,A){X.addEventListener?X.addEventListener(Z,H,A):X.attachEvent&&X.attachEvent("on".concat(Z),H)}function d(X,Z,H,A){X.removeEventListener?X.removeEventListener(Z,H,A):X.attachEvent&&X.detachEvent("on".concat(Z),H)}function w(X,Z){var H=typeof X=="function"?X(Z):X;return Array.isArray(H)?H.length===2?H:[H[0],H[1]]:[H]}var T=function(Z){return!isNaN(parseFloat(Z))&&isFinite(Z)},x=!(typeof window!="undefined"&&window.document&&window.document.createElement),O=function X(Z,H,A,z){if(!H||H===document||H instanceof Document)return!1;if(H===Z.parentNode)return!0;var ne=Math.max(Math.abs(A),Math.abs(z))===Math.abs(z),ae=Math.max(Math.abs(A),Math.abs(z))===Math.abs(A),me=H.scrollHeight-H.clientHeight,xe=H.scrollWidth-H.clientWidth,Te=document.defaultView.getComputedStyle(H),Oe=Te.overflowY==="auto"||Te.overflowY==="scroll",Ue=Te.overflowX==="auto"||Te.overflowX==="scroll",De=me&&Oe,be=xe&&Ue;return ne&&(!De||De&&(H.scrollTop>=me&&z<0||H.scrollTop<=0&&z>0))||ae&&(!be||be&&(H.scrollLeft>=xe&&A<0||H.scrollLeft<=0&&A>0))?X(Z,H.parentNode,A,z):!1};function E(X){var Z=v();return function(){var A=Object(R.a)(X),z;if(Z){var ne=Object(R.a)(this).constructor;z=Reflect.construct(A,arguments,ne)}else z=A.apply(this,arguments);return Object(W.a)(this,z)}}function v(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(X){return!1}}var _={},f=function(X){Object(Y.a)(H,X);var Z=E(H);function H(A){var z;return Object(V.a)(this,H),z=Z.call(this,A),z.domFocus=function(){z.dom&&z.dom.focus()},z.removeStartHandler=function(ne){if(ne.touches.length>1)return;z.startPos={x:ne.touches[0].clientX,y:ne.touches[0].clientY}},z.removeMoveHandler=function(ne){if(ne.changedTouches.length>1)return;var ae=ne.currentTarget,me=ne.changedTouches[0].clientX-z.startPos.x,xe=ne.changedTouches[0].clientY-z.startPos.y;(ae===z.maskDom||ae===z.handlerDom||ae===z.contentDom&&O(ae,ne.target,me,xe))&&ne.cancelable&&ne.preventDefault()},z.transitionEnd=function(ne){var ae=ne.target;d(ae,r,z.transitionEnd),ae.style.transition=""},z.onKeyDown=function(ne){if(ne.keyCode===h.a.ESC){var ae=z.props.onClose;ne.stopPropagation(),ae&&ae(ne)}},z.onWrapperTransitionEnd=function(ne){var ae=z.props,me=ae.open,xe=ae.afterVisibleChange;ne.target===z.contentWrapper&&ne.propertyName.match(/transform$/)&&(z.dom.style.transition="",!me&&z.getCurrentDrawerSome()&&(document.body.style.overflowX="",z.maskDom&&(z.maskDom.style.left="",z.maskDom.style.width="")),xe&&xe(!!me))},z.openLevelTransition=function(){var ne=z.props,ae=ne.open,me=ne.width,xe=ne.height,Te=z.getHorizontalBoolAndPlacementName(),Oe=Te.isHorizontal,Ue=Te.placementName,De=z.contentDom?z.contentDom.getBoundingClientRect()[Oe?"width":"height"]:0,be=(Oe?me:xe)||De;z.setLevelAndScrolling(ae,Ue,be)},z.setLevelTransform=function(ne,ae,me,xe){var Te=z.props,Oe=Te.placement,Ue=Te.levelMove,De=Te.duration,be=Te.ease,ge=Te.showMask;z.levelDom.forEach(function(He){He.style.transition="transform ".concat(De," ").concat(be),n(He,r,z.transitionEnd);var ct=ne?me:0;if(Ue){var vt=w(Ue,{target:He,open:ne});ct=ne?vt[0]:vt[1]||0}var _t=typeof ct=="number"?"".concat(ct,"px"):ct,yt=Oe==="left"||Oe==="top"?_t:"-".concat(_t);yt=ge&&Oe==="right"&&xe?"calc(".concat(yt," + ").concat(xe,"px)"):yt,He.style.transform=ct?"".concat(ae,"(").concat(yt,")"):""})},z.setLevelAndScrolling=function(ne,ae,me){var xe=z.props.onChange;if(!x){var Te=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(u.a)(!0):0;z.setLevelTransform(ne,ae,me,Te),z.toggleScrollingToDrawerAndBody(Te)}xe&&xe(ne)},z.toggleScrollingToDrawerAndBody=function(ne){var ae=z.props,me=ae.getOpenCount,xe=ae.getContainer,Te=ae.showMask,Oe=ae.open,Ue=xe&&xe(),De=me&&me();if(Ue&&Ue.parentNode===document.body&&Te){var be=["touchstart"],ge=[document.body,z.maskDom,z.handlerDom,z.contentDom];Oe&&document.body.style.overflow!=="hidden"?(ne&&z.addScrollingEffect(ne),De===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",ge.forEach(function(He,ct){if(!He)return;n(He,be[ct]||"touchmove",ct?z.removeMoveHandler:z.removeStartHandler,z.passive)})):z.getCurrentDrawerSome()&&(De||(document.body.style.overflow=""),document.body.style.touchAction="",ne&&z.remScrollingEffect(ne),ge.forEach(function(He,ct){if(!He)return;d(He,be[ct]||"touchmove",ct?z.removeMoveHandler:z.removeStartHandler,z.passive)}))}},z.addScrollingEffect=function(ne){var ae=z.props,me=ae.placement,xe=ae.duration,Te=ae.ease,Oe=ae.getOpenCount,Ue=ae.switchScrollingEffect,De=Oe&&Oe();De===1&&Ue();var be="width ".concat(xe," ").concat(Te),ge="transform ".concat(xe," ").concat(Te);z.dom.style.transition="none";switch(me){case"right":z.dom.style.transform="translateX(-".concat(ne,"px)");break;case"top":case"bottom":z.dom.style.width="calc(100% - ".concat(ne,"px)"),z.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(z.timeout),z.timeout=setTimeout(function(){z.dom&&(z.dom.style.transition="".concat(ge,",").concat(be),z.dom.style.width="",z.dom.style.transform="")})},z.remScrollingEffect=function(ne){var ae=z.props,me=ae.placement,xe=ae.duration,Te=ae.ease,Oe=ae.getOpenCount,Ue=ae.switchScrollingEffect,De=Oe&&Oe();De||Ue(!0),i&&(document.body.style.overflowX="hidden"),z.dom.style.transition="none";var be,ge="width ".concat(xe," ").concat(Te),He="transform ".concat(xe," ").concat(Te);switch(me){case"left":{z.dom.style.width="100%",ge="width 0s ".concat(Te," ").concat(xe);break}case"right":{z.dom.style.transform="translateX(".concat(ne,"px)"),z.dom.style.width="100%",ge="width 0s ".concat(Te," ").concat(xe),z.maskDom&&(z.maskDom.style.left="-".concat(ne,"px"),z.maskDom.style.width="calc(100% + ".concat(ne,"px)"));break}case"top":case"bottom":{z.dom.style.width="calc(100% + ".concat(ne,"px)"),z.dom.style.height="100%",z.dom.style.transform="translateZ(0)",be="height 0s ".concat(Te," ").concat(xe);break}default:break}clearTimeout(z.timeout),z.timeout=setTimeout(function(){z.dom&&(z.dom.style.transition="".concat(He,",").concat(be?"".concat(be,","):"").concat(ge),z.dom.style.transform="",z.dom.style.width="",z.dom.style.height="")})},z.getCurrentDrawerSome=function(){return!Object.keys(_).some(function(ne){return _[ne]})},z.getLevelDom=function(ne){var ae=ne.level,me=ne.getContainer;if(x)return;var xe=me&&me(),Te=xe?xe.parentNode:null;if(z.levelDom=[],ae==="all"){var Oe=Te?Array.prototype.slice.call(Te.children):[];Oe.forEach(function(Ue){Ue.nodeName!=="SCRIPT"&&Ue.nodeName!=="STYLE"&&Ue.nodeName!=="LINK"&&Ue!==xe&&z.levelDom.push(Ue)})}else ae&&s(ae).forEach(function(Ue){document.querySelectorAll(Ue).forEach(function(De){z.levelDom.push(De)})})},z.getHorizontalBoolAndPlacementName=function(){var ne=z.props.placement,ae=ne==="left"||ne==="right",me="translate".concat(ae?"X":"Y");return{isHorizontal:ae,placementName:me}},z.state={_self:Object(I.a)(z)},z}return Object(P.a)(H,[{key:"componentDidMount",value:function(){var z=this;if(!x){var ne=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return ne=!0,null}}))}catch(Oe){}this.passive=ne?{passive:!1}:!1}var ae=this.props,me=ae.open,xe=ae.getContainer,Te=xe&&xe();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),me&&(Te&&Te.parentNode===document.body&&(_[this.drawerId]=me),this.openLevelTransition(),this.forceUpdate(function(){z.domFocus()}))}},{key:"componentDidUpdate",value:function(z){var ne=this.props,ae=ne.open,me=ne.getContainer,xe=me&&me();ae!==z.open&&(ae&&this.domFocus(),xe&&xe.parentNode===document.body&&(_[this.drawerId]=!!ae),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var z=this.props,ne=z.getOpenCount,ae=z.open,me=z.switchScrollingEffect,xe=typeof ne=="function"&&ne();delete _[this.drawerId],ae&&(this.setLevelTransform(!1),document.body.style.touchAction=""),xe||(document.body.style.overflow="",me(!0))}},{key:"render",value:function(){var z,ne=this,ae=this.props,me=ae.className,xe=ae.children,Te=ae.style,Oe=ae.width,Ue=ae.height,De=ae.defaultOpen,be=ae.open,ge=ae.prefixCls,He=ae.placement,ct=ae.level,vt=ae.levelMove,_t=ae.ease,yt=ae.duration,et=ae.getContainer,ht=ae.handler,xt=ae.onChange,Tt=ae.afterVisibleChange,mt=ae.showMask,Ie=ae.maskClosable,je=ae.maskStyle,$e=ae.onClose,at=ae.onHandleClick,lt=ae.keyboard,bt=ae.getOpenCount,Mt=ae.switchScrollingEffect,jt=Object(ee.a)(ae,["className","children","style","width","height","defaultOpen","open","prefixCls","placement","level","levelMove","ease","duration","getContainer","handler","onChange","afterVisibleChange","showMask","maskClosable","maskStyle","onClose","onHandleClick","keyboard","getOpenCount","switchScrollingEffect"]),Me=this.dom?be:!1,Pe=m()(ge,(z={},Object(L.a)(z,"".concat(ge,"-").concat(He),!0),Object(L.a)(z,"".concat(ge,"-open"),Me),Object(L.a)(z,me||"",!!me),Object(L.a)(z,"no-mask",!mt),z)),tt=this.getHorizontalBoolAndPlacementName(),rt=tt.placementName,Fe=He==="left"||He==="top"?"-100%":"100%",Je=Me?"":"".concat(rt,"(").concat(Fe,")"),Ee=ht&&M.cloneElement(ht,{onClick:function(_e){ht.props.onClick&&ht.props.onClick(),at&&at(_e)},ref:function(_e){ne.handlerDom=_e}});return M.createElement("div",Object.assign({},jt,{tabIndex:-1,className:Pe,style:Te,ref:function(_e){ne.dom=_e},onKeyDown:Me&<?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),mt&&M.createElement("div",{className:"".concat(ge,"-mask"),onClick:Ie?$e:void 0,style:je,ref:function(_e){ne.maskDom=_e}}),M.createElement("div",{className:"".concat(ge,"-content-wrapper"),style:{transform:Je,msTransform:Je,width:T(Oe)?"".concat(Oe,"px"):Oe,height:T(Ue)?"".concat(Ue,"px"):Ue},ref:function(_e){ne.contentWrapper=_e}},M.createElement("div",{className:"".concat(ge,"-content"),ref:function(_e){ne.contentDom=_e},onTouchStart:Me&&mt?this.removeStartHandler:void 0,onTouchMove:Me&&mt?this.removeMoveHandler:void 0},xe),Ee))}}],[{key:"getDerivedStateFromProps",value:function(z,ne){var ae=ne.prevProps,me=ne._self,xe={prevProps:z};if(ae!==void 0){var Te=z.placement,Oe=z.level;Te!==ae.placement&&(me.contentDom=null),Oe!==ae.level&&me.getLevelDom(z)}return xe}}]),H}(M.Component);f.defaultProps={switchScrollingEffect:function(){}};var c=f;function S(X){var Z=y();return function(){var A=Object(R.a)(X),z;if(Z){var ne=Object(R.a)(this).constructor;z=Reflect.construct(A,arguments,ne)}else z=A.apply(this,arguments);return Object(W.a)(this,z)}}function y(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(X){return!1}}var b=function(X){Object(Y.a)(H,X);var Z=S(H);function H(A){var z;Object(V.a)(this,H),z=Z.call(this,A),z.onHandleClick=function(ae){var me=z.props,xe=me.onHandleClick,Te=me.open;if(xe&&xe(ae),typeof Te=="undefined"){var Oe=z.state.open;z.setState({open:!Oe})}},z.onClose=function(ae){var me=z.props,xe=me.onClose,Te=me.open;xe&&xe(ae),typeof Te=="undefined"&&z.setState({open:!1})};var ne=typeof A.open!="undefined"?A.open:!!A.defaultOpen;return z.state={open:ne},"onMaskClick"in A&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),z}return Object(P.a)(H,[{key:"render",value:function(){var z=this,ne=this.props,ae=ne.defaultOpen,me=ne.getContainer,xe=ne.wrapperClassName,Te=ne.forceRender,Oe=ne.handler,Ue=Object(ee.a)(ne,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),De=this.state.open;if(!me)return M.createElement("div",{className:xe,ref:function(He){z.dom=He}},M.createElement(c,Object.assign({},Ue,{open:De,handler:Oe,getContainer:function(){return z.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var be=!!Oe||Te;return M.createElement(B.a,{visible:De,forceRender:be,getContainer:me,wrapperClassName:xe},function(ge){var He=ge.visible,ct=ge.afterClose,vt=Object(ee.a)(ge,["visible","afterClose"]);return M.createElement(c,Object.assign({},Ue,vt,{open:He!==void 0?He:De,afterVisibleChange:ct!==void 0?ct:Ue.afterVisibleChange,handler:Oe,onClose:z.onClose,onHandleClick:z.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(z,ne){var ae=ne.prevProps,me={prevProps:z};return typeof ae!="undefined"&&z.open!==ae.open&&(me.open=z.open),me}}]),H}(M.Component);b.defaultProps={prefixCls:"drawer",placement:"left",getContainer:"body",defaultOpen:!1,level:"all",duration:".3s",ease:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",onChange:function(){},afterVisibleChange:function(){},handler:M.createElement("div",{className:"drawer-handle"},M.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var N=b,F=we.a=N},fcyK:function(Be,we,k){},fyJ8:function(Be,we,k){"use strict";var ee=k("rePB"),V=k("VTBJ"),P=k("Ff2n"),Y=k("U8pU"),W=k("q1tI"),R=k.n(W),B=k("TSYQ"),M=k.n(B),L=k("c+Xe"),I=k("sR1s");function p(l){return l&&Object(Y.a)(l)==="object"&&!Array.isArray(l)&&!W.isValidElement(l)}function m(l){return typeof l=="string"?!0:Object(L.c)(l)}function u(l,i){var r,n=l.prefixCls,d=l.className,w=l.record,T=l.index,x=l.dataIndex,O=l.render,E=l.children,v=l.component,_=v===void 0?"td":v,f=l.colSpan,c=l.rowSpan,S=l.fixLeft,y=l.fixRight,b=l.firstFixLeft,N=l.lastFixLeft,F=l.firstFixRight,X=l.lastFixRight,Z=l.appendNode,H=l.additionalProps,A=H===void 0?{}:H,z=l.ellipsis,ne=l.align,ae=l.rowType,me=l.isSticky,xe="".concat(n,"-cell"),Te,Oe;if(E)Oe=E;else{var Ue=Object(I.b)(w,x);if(Oe=Ue,O){var De=O(Ue,w,T);p(De)?(Oe=De.children,Te=De.props):Oe=De}}Object(Y.a)(Oe)==="object"&&!Array.isArray(Oe)&&!W.isValidElement(Oe)&&(Oe=null),z&&(N||F)&&(Oe=W.createElement("span",{className:"".concat(xe,"-content")},Oe));var be=Te||{},ge=be.colSpan,He=be.rowSpan,ct=be.style,vt=be.className,_t=Object(P.a)(be,["colSpan","rowSpan","style","className"]),yt=ge!==void 0?ge:f,et=He!==void 0?He:c;if(yt===0||et===0)return null;var ht={},xt=typeof S=="number",Tt=typeof y=="number";xt&&(ht.position="sticky",ht.left=S),Tt&&(ht.position="sticky",ht.right=y);var mt={};ne&&(mt.textAlign=ne);var Ie,je=z===!0?{showTitle:!0}:z;je&&(je.showTitle||ae==="header")&&(typeof Oe=="string"||typeof Oe=="number"?Ie=Oe.toString():W.isValidElement(Oe)&&typeof Oe.props.children=="string"&&(Ie=Oe.props.children));var $e=Object(V.a)(Object(V.a)(Object(V.a)({title:Ie},_t),A),{},{colSpan:yt&&yt!==1?yt:null,rowSpan:et&&et!==1?et:null,className:M()(xe,d,(r={},Object(ee.a)(r,"".concat(xe,"-fix-left"),xt),Object(ee.a)(r,"".concat(xe,"-fix-left-first"),b),Object(ee.a)(r,"".concat(xe,"-fix-left-last"),N),Object(ee.a)(r,"".concat(xe,"-fix-right"),Tt),Object(ee.a)(r,"".concat(xe,"-fix-right-first"),F),Object(ee.a)(r,"".concat(xe,"-fix-right-last"),X),Object(ee.a)(r,"".concat(xe,"-ellipsis"),z),Object(ee.a)(r,"".concat(xe,"-with-append"),Z),Object(ee.a)(r,"".concat(xe,"-fix-sticky"),(xt||Tt)&&me),r),A.className,vt),style:Object(V.a)(Object(V.a)(Object(V.a)(Object(V.a)({},A.style),mt),ht),ct),ref:m(_)?i:null});return W.createElement(_,Object.assign({},$e),Z,Oe)}var h=W.forwardRef(u);h.displayName="Cell";var s=W.memo(h,function(l,i){return i.shouldCellUpdate?!i.shouldCellUpdate(i.record,l.record):!1});we.a=s},gRFJ:function(Be,we,k){Be.exports=[k("rdUC"),k("ynwM"),k("RELg"),k("DlR+"),k("CrYA"),k("PD8m")]},gaXo:function(module,exports){typeof JSON!="object"&&(JSON={}),function(){"use strict";var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;function f(Be){return Be<10?"0"+Be:Be}function this_value(){return this.valueOf()}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value);var gap,indent,meta,rep;function quote(Be){return rx_escapable.lastIndex=0,rx_escapable.test(Be)?'"'+Be.replace(rx_escapable,function(we){var k=meta[we];return typeof k=="string"?k:"\\u"+("0000"+we.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+Be+'"'}function str(Be,we){var k,ee,V,P,Y=gap,W,R=we[Be];R&&typeof R=="object"&&typeof R.toJSON=="function"&&(R=R.toJSON(Be)),typeof rep=="function"&&(R=rep.call(we,Be,R));switch(typeof R){case"string":return quote(R);case"number":return isFinite(R)?String(R):"null";case"boolean":case"null":return String(R);case"object":if(!R)return"null";if(gap+=indent,W=[],Object.prototype.toString.apply(R)==="[object Array]"){for(P=R.length,k=0;k0&&!this.paused&&!this.ended&&this.readyState>2}});function r(w,T){return w-T}function n(w){w.sort(r);for(var T=0,x=0;x1&&arguments[1]!==void 0?arguments[1]:!1,_e={point:ae.current.currentTime};$e?(_e.log_id=$e,_e.watch_duration=n(Me),_e.total_duration=Ie):(c?(_e.video_id=parseInt(v,10),_e.course_id=c):_e.video_id=v,_e.duration=mt,_e.device=ht),ye&&(_e.ed="1");function le(){return de.apply(this,arguments)}function de(){return de=Object(P.a)(W.a.mark(function ve(){var pe;return W.a.wrap(function(Ke){for(;;)switch(Ke.prev=Ke.next){case 0:return Mt=!0,Ke.next=3,_(_e);case 3:pe=Ke.sent,$e=pe,Mt=!1,Ee&&Ee();case 7:case"end":return Ke.stop()}},ve)})),de.apply(this,arguments)}le()},[v,c]);Object(R.useEffect)(function(){V.b.destroy();var Ee=null;return M.a.isSupported&&ne&&O&&(O==null?void 0:O.indexOf(".m3u8"))<0?(Ee=M.a.createPlayer({type:"flv",volume:.8,cors:!0,url:O,muted:!1}),ae.current&&(Ee.attachMediaElement(ae.current),Ee.load())):ae.current.setAttribute("src",O),rt(),function(){Ee&&(Ee.unload(),Ee.pause(),Ee.destroy(),Ee=null)}},[ae,ne,O]);function tt(){ae.current.paused?(Te.current.style.display="none",Oe.current.style.display="block"):(Te.current.style.display="block",Oe.current.style.display="none")}function rt(){ct.current.style.display="none",_t.current.style.display="none",vt.current.style.display="none",ae.current.muted||ae.current.volume===0?ct.current.style.display="block":ae.current.volume>0&&ae.current.volume<=.5?_t.current.style.display="block":vt.current.style.display="block"}Object(R.useEffect)(function(){var Ee=document.getElementById("play"),ye=document.querySelectorAll(".playback-icons use");function _e(){F(),S&&!xt.current&&(ae.current.currentTime=S),xt.current=!0,Me.push(ae.current.currentTime),at||(at=!0,E&&Pe())}function le(){return de.apply(this,arguments)}function de(){return de=Object(P.a)(W.a.mark(function We(){return W.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:tt(),Me.push(ae.current.currentTime),E&&Pe(function(){$e=null,je=0,at=!1,Mt=!1,jt=!1,Me=[],Ie=0,bt=1},!0);case 3:case"end":return Se.stop()}},We)})),de.apply(this,arguments)}function ve(){Ue.current.value=Math.round(ae.current.currentTime),De.current.value=Math.round(ae.current.currentTime)}function pe(){var We=i(Math.round(ae.current.currentTime));ge.current.innerText="".concat(We.hour>0?We.hour+":":"").concat(We.minutes,":").concat(We.seconds),ge.current.setAttribute("datetime","".concat(We.hour>0?" "+We.hour+" ":"").concat(We.minutes,"m ").concat(We.seconds,"s"))}function Ce(){var We=Math.round(ae.current.duration);Ue.current.setAttribute("max",We),De.current.setAttribute("max",We);var ce=i(We);be.current.innerText="".concat(ce.hour>0?ce.hour+":":"").concat(ce.minutes,":").concat(ce.seconds),be.current.setAttribute("datetime","".concat(ce.hour>0?" "+ce.hour+" ":"").concat(ce.minutes,"m ").concat(ce.seconds,"s"))}function Ke(){var We=Math.round(ae.current.duration);Ue.current.setAttribute("max",We),De.current.setAttribute("max",We);var ce=i(We);be.current.innerText="".concat(ce.hour>0?ce.hour+":":"").concat(ce.minutes,":").concat(ce.seconds),be.current.setAttribute("datetime","".concat(ce.hour>0?" "+ce.hour+" ":"").concat(ce.minutes,"m ").concat(ce.seconds,"s")),ve(),pe();var Se=me.current.getBoundingClientRect(),ot=Se.width,ze=Se.height,Lt=Se.x,Dt=Se.y;if(Lt<0||Dt<0||!ot)return;if(!jt){var ke=ae.current.currentTime,qe=ke-je;Math.abs(qe)<10?(Ie+=Math.abs(qe),je=ke,Mt||Ie-bt*lt>=0&&(bt++,Me.push(je),E&&Pe())):(je=ke,E&&Pe())}}function st(){jt=!0}function At(){ae.current.playing&&Me.push(ae.current.currentTime,je),je=ae.current.currentTime,jt=!1}function Ft(){mt=ae.current.duration,mt<=20&&(lt=mt/3),ae.current.addEventListener("play",_e)}function kt(We){We.preventDefault(),Object(h.a)()?(ae.current.style.width="100%",ae.current.style.height="100%"):ae.current.style.cssText=""}function wt(){b()}function Qe(We){var ce=We.target.dataset.seek?We.target.dataset.seek:We.target.value;ae.current.currentTime=ce,De.current.value=ce,Ue.current.value=ce}function it(We){var ce=Math.round(We.offsetX/We.target.clientWidth*parseInt(We.target.getAttribute("max"),10));Ue.current.setAttribute("data-seek",ce);var Se=i(ce);He.current.textContent="".concat(Se.hour>0?Se.hour+":":"").concat(Se.minutes,":").concat(Se.seconds);var ot=ae.current.getBoundingClientRect();He.current.style.left="".concat(We.pageX-ot.left,"px")}return xe.current.addEventListener(Object(h.c)(),kt),ae.current.addEventListener("canplay",Ft),ae.current.addEventListener("ended",le),ae.current.addEventListener("seeking",st),ae.current.addEventListener("seeked",At),ae.current.addEventListener("loadedmetadata",Ce),Ue.current.addEventListener("mousemove",it),Ue.current.addEventListener("input",Qe),ae.current.addEventListener("timeupdate",Ke),ae.current.addEventListener("pause",wt),ae.current.addEventListener("volumechange",rt),function(){ae.current.removeEventListener("canplay",Ft),ae.current.removeEventListener("play",_e),ae.current.removeEventListener("ended",le),ae.current.removeEventListener("seeking",st),ae.current.removeEventListener("seeked",At),Ue.current.removeEventListener("mousemove",it),Ue.current.removeEventListener("input",Qe),ae.current.removeEventListener("timeupdate",Ke),ae.current.removeEventListener("pause",wt),ae.current.removeEventListener("loadedmetadata",Ce),ae.current.removeEventListener("volumechange",rt),ae.current.playing&&(Me.push(je,ae.current.currentTime),E&&Pe())}},[ae,O]),Object(R.useEffect)(function(){if(ae.current.onended=function(){Z(ae)},ae.current.oncontextmenu=function(){return!1},(O==null?void 0:O.indexOf(".m3u8"))>-1){if(ae.current.canPlayType("application/vnd.apple.mpegurl"))ae.current.src=O;else if(I.a.isSupported()){var Ee=new I.a;Ee.loadSource(O),Ee.attachMedia(ae.current)}}},[O]),Object(R.useEffect)(function(){ae.current.playbackRate=A},[A]);var Fe=function(){ae.current.paused||ae.current.ended?ae.current.play():ae.current.pause(),tt()};function Je(){ae.current.muted=!ae.current.muted,ae.current.muted?(yt.current.setAttribute("data-volume",volume.value),yt.current.value=0):yt.current.value=yt.current.dataset.volume}return B.a.createElement("div",{style:{position:"relative"},ref:xe},B.a.createElement("div",{ref:me,className:"".concat(l.a.watermark," animated_alternate animate__animated_10s animate__infinite animate__stepstart ").concat(l.a.animate__loop)},Tt?Tt.login:" "),B.a.createElement("div",{className:l.a.container},B.a.createElement("div",{className:l.a["video-container"],id:"video-container"},B.a.createElement("div",{className:l.a["playback-animation"],id:"playback-animation"},B.a.createElement("svg",{className:l.a["playback-icons"]},B.a.createElement("use",{className:"hidden",href:"#play-icon"}),B.a.createElement("use",{href:"#pause"}))),B.a.createElement("video",{className:l.a.video,id:"video",preload:"auto",disablePictureInPicture:!0,ref:ae,autoPlay:!1}),B.a.createElement("div",{className:"".concat(l.a["video-controls"]," "),id:"video-controls"},B.a.createElement("div",{className:l.a["bottom-controls"]},B.a.createElement("div",{className:l.a["left-controls"]},B.a.createElement("button",{"data-title":"\u64AD\u653E/\u6682\u505C",id:"play",onClick:Fe},B.a.createElement("svg",{className:l.a["playback-icons"]},B.a.createElement("use",{ref:Oe,href:"#play-icon"}),B.a.createElement("use",{ref:Te,style:{display:"none"},href:"#pause"}))),B.a.createElement("div",{className:l.a.time},B.a.createElement("time",{id:"time-elapsed",ref:ge},"00:00"),B.a.createElement("span",null," / "),B.a.createElement("time",{id:"duration",ref:be},"00:00"))),B.a.createElement("div",{className:l.a["right-controls"]},B.a.createElement(m.CopyToClipboard,{text:O,onCopy:function(){return V.b.success("\u590D\u5236\u6210\u529F")}},B.a.createElement("button",{"data-title":"\u590D\u5236\u94FE\u63A5"},B.a.createElement("i",{className:"icon-lianjie2 iconfont",style:{fontSize:"12px",color:"white"}}))),B.a.createElement("div",{className:l.a["volume-controls"]},B.a.createElement("button",{"data-title":"\u5F00\u542F/\u5173\u95ED\u58F0\u97F3",className:l.a["volume-button"],id:"volume-button",onClick:Je},B.a.createElement("i",{ref:ct,className:"icon-a-bianzu8 iconfont",style:{fontSize:"14px",color:"white"}}),B.a.createElement("i",{ref:_t,className:"icon-shengyinkaibeifen iconfont",style:{fontSize:"14px",color:"white"}}),B.a.createElement("i",{ref:vt,className:"icon-shengyinkai iconfont",style:{fontSize:"14px",color:"white"}})),B.a.createElement("input",{className:l.a.volume,id:"volume",value:"1","data-mute":"0.5",type:"range",max:"1",min:"0",step:"0.01",ref:yt,style:{display:"none"},onClick:rt})),B.a.createElement("button",{"data-title":"\u5168\u5C4F/\u9000\u51FA\u5168\u5C4F",className:l.a["fullscreen-button"],onClick:function(){Object(h.a)()?Object(h.b)():Object(h.d)(xe.current)}},B.a.createElement("i",{className:"icon-fangda1 iconfont",style:{fontSize:"12px",color:"white"}})))),B.a.createElement("div",{className:l.a["video-progress"]},B.a.createElement("progress",{ref:De,value:"0",min:"0"}),B.a.createElement("input",{className:l.a.seek,ref:Ue,value:"0",min:"0",type:"range",step:"1"}),B.a.createElement("div",{className:l.a["seek-tooltip"],ref:He,id:"seek-tooltip"},"00:00"))))),B.a.createElement("svg",{style:{display:"none"}},B.a.createElement("defs",null,B.a.createElement("symbol",{id:"pause",viewBox:"0 0 24 24"},B.a.createElement("path",{d:"M14.016 5.016h3.984v13.969h-3.984v-13.969zM6 18.984v-13.969h3.984v13.969h-3.984z"})),B.a.createElement("symbol",{id:"play-icon",viewBox:"0 0 24 24"},B.a.createElement("path",{d:"M8.016 5.016l10.969 6.984-10.969 6.984v-13.969z"})),B.a.createElement("symbol",{id:"volume-high",viewBox:"0 0 24 24"},B.a.createElement("path",{d:"M14.016 3.234q3.047 0.656 5.016 3.117t1.969 5.648-1.969 5.648-5.016 3.117v-2.063q2.203-0.656 3.586-2.484t1.383-4.219-1.383-4.219-3.586-2.484v-2.063zM16.5 12q0 2.813-2.484 4.031v-8.063q1.031 0.516 1.758 1.688t0.727 2.344zM3 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6z"})),B.a.createElement("symbol",{id:"volume-low",viewBox:"0 0 24 24"},B.a.createElement("path",{d:"M5.016 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6zM18.516 12q0 2.766-2.531 4.031v-8.063q1.031 0.516 1.781 1.711t0.75 2.32z"})),B.a.createElement("symbol",{id:"volume-mute",viewBox:"0 0 24 24"},B.a.createElement("path",{d:"M12 3.984v4.219l-2.109-2.109zM4.266 3l16.734 16.734-1.266 1.266-2.063-2.063q-1.547 1.313-3.656 1.828v-2.063q1.172-0.328 2.25-1.172l-4.266-4.266v6.75l-5.016-5.016h-3.984v-6h4.734l-4.734-4.734zM18.984 12q0-2.391-1.383-4.219t-3.586-2.484v-2.063q3.047 0.656 5.016 3.117t1.969 5.648q0 2.203-1.031 4.172l-1.5-1.547q0.516-1.266 0.516-2.625zM16.5 12q0 0.422-0.047 0.609l-2.438-2.438v-2.203q1.031 0.516 1.758 1.688t0.727 2.344z"})),B.a.createElement("symbol",{id:"fullscreen",viewBox:"0 0 24 24"},B.a.createElement("path",{d:"M14.016 5.016h4.969v4.969h-1.969v-3h-3v-1.969zM17.016 17.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 9.984v-4.969h4.969v1.969h-3v3h-1.969zM6.984 14.016v3h3v1.969h-4.969v-4.969h1.969z"})),B.a.createElement("symbol",{id:"fullscreen-exit",viewBox:"0 0 24 24"},B.a.createElement("path",{d:"M15.984 8.016h3v1.969h-4.969v-4.969h1.969v3zM14.016 18.984v-4.969h4.969v1.969h-3v3h-1.969zM8.016 8.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 15.984v-1.969h4.969v4.969h-1.969v-3h-3z"})),B.a.createElement("symbol",{id:"pip",viewBox:"0 0 24 24"},B.a.createElement("path",{d:"M21 19.031v-14.063h-18v14.063h18zM23.016 18.984q0 0.797-0.609 1.406t-1.406 0.609h-18q-0.797 0-1.406-0.609t-0.609-1.406v-14.016q0-0.797 0.609-1.383t1.406-0.586h18q0.797 0 1.406 0.586t0.609 1.383v14.016zM18.984 11.016v6h-7.969v-6h7.969z"})))))})},i3hx:function(Be,we,k){},je13:function(Be,we,k){var ee=k("5nXd"),V=k("gRFJ"),P=[k("uQRt")];Be.exports=ee.createStore(V,P)},kSUc:function(Be,we,k){},"kaH+":function(Be,we,k){"use strict";var ee=k("+L6B"),V=k("2/Rp"),P=k("tJVT"),Y=k("q1tI"),W=k.n(Y),R=k("UZu5"),B=k.n(R),M=k("dhSg"),L=k("rLCj"),I=k("dF/Y"),p=k("4i/N");we.a=function(){var m=Object(Y.useState)(""),u=Object(P.a)(m,2),h=u[0],s=u[1],l=Object(Y.useState)(0),i=Object(P.a)(l,2),r=i[0],n=i[1],d=Object(Y.useRef)("");Object(Y.useEffect)(function(){var _=M.a.subscribe("preview-image",function(f){s(f),document.body.style.overflow="hidden"});return _},[]),Object(Y.useEffect)(function(){return document.addEventListener("keydown",w),function(){document.removeEventListener("keydown",w)}},[]),Object(Y.useEffect)(function(){d.current=h},[h]);function w(_){_.keyCode==27&&d.current&&T()}function T(){document.body.style.overflow="auto",s("")}function x(){n(r+90)}var O=Object(Y.useRef)(),E=Object(Y.useRef)(),v=function(f){(f.nativeEvent.target===O.current||f.nativeEvent.target===E.current)&&T()};return W.a.createElement(Y.Fragment,null,h?W.a.createElement("div",{className:"image-preview-container",ref:O,onClick:v},W.a.createElement("div",{className:"button-group"},W.a.createElement(V.a,{onClick:x},"\u65CB\u8F6C",W.a.createElement(L.a,null)),W.a.createElement(V.a,{href:h},"\u4E0B\u8F7D",W.a.createElement(I.a,null)),W.a.createElement(V.a,{onClick:T},"\u5173\u95ED",W.a.createElement(p.a,null))),W.a.createElement("div",{className:"preview-wrp-group",ref:E},W.a.createElement("img",{className:"image-preview",src:h,alt:"\u9884\u89C8\u5927\u56FE",style:{transform:"rotate(".concat(r,"deg)")}}))):null)}},kovY:function(Be,we,k){Be.exports=k.p+"static/e.eabfa286.svg"},lOMy:function(Be,we,k){},lZu9:function(Be,we,k){(function(ee){ee(k("VrN/"),k("1eCo"),k("8EBN"))})(function(ee){"use strict";ee.defineMode("markdown",function(V,P){var Y=ee.getMode(V,"text/html"),W=Y.name=="null";function R(H){if(ee.findModeByName){var A=ee.findModeByName(H);A&&(H=A.mime||A.mimes[0])}var z=ee.getMode(V,H);return z.name=="null"?null:z}P.highlightFormatting===void 0&&(P.highlightFormatting=!1),P.maxBlockquoteDepth===void 0&&(P.maxBlockquoteDepth=0),P.taskLists===void 0&&(P.taskLists=!1),P.strikethrough===void 0&&(P.strikethrough=!1),P.emoji===void 0&&(P.emoji=!1),P.fencedCodeBlockHighlighting===void 0&&(P.fencedCodeBlockHighlighting=!0),P.fencedCodeBlockDefaultMode===void 0&&(P.fencedCodeBlockDefaultMode="text/plain"),P.xml===void 0&&(P.xml=!0),P.tokenTypeOverrides===void 0&&(P.tokenTypeOverrides={});var B={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var M in B)B.hasOwnProperty(M)&&P.tokenTypeOverrides[M]&&(B[M]=P.tokenTypeOverrides[M]);var L=/^([*\-_])(?:\s*\1){2,}\s*$/,I=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,p=/^\[(x| )\](?=\s)/i,m=P.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,u=/^ {0,3}(?:\={1,}|-{2,})\s*$/,h=/^[^#!\[\]*_\\<>` "'(~:]+/,s=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,l=/^\s*\[[^\]]+?\]:.*$/,i=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,r=" ";function n(H,A,z){return A.f=A.inline=z,z(H,A)}function d(H,A,z){return A.f=A.block=z,z(H,A)}function w(H){return!H||!/\S/.test(H.string)}function T(H){if(H.linkTitle=!1,H.linkHref=!1,H.linkText=!1,H.em=!1,H.strong=!1,H.strikethrough=!1,H.quote=0,H.indentedCode=!1,H.f==O){var A=W;if(!A){var z=ee.innerMode(Y,H.htmlState);A=z.mode.name=="xml"&&z.state.tagStart===null&&!z.state.context&&z.state.tokenize.isInText}A&&(H.f=f,H.block=x,H.htmlState=null)}return H.trailingSpace=0,H.trailingSpaceNewLine=!1,H.prevLine=H.thisLine,H.thisLine={stream:null},null}function x(H,A){var z=H.column()===A.indentation,ne=w(A.prevLine.stream),ae=A.indentedCode,me=A.prevLine.hr,xe=A.list!==!1,Te=(A.listStack[A.listStack.length-1]||0)+3;A.indentedCode=!1;var Oe=A.indentation;if(A.indentationDiff===null&&(A.indentationDiff=A.indentation,xe)){for(A.list=null;Oe=4&&(ae||A.prevLine.fencedCodeEnd||A.prevLine.header||ne))return H.skipToEnd(),A.indentedCode=!0,B.code;if(H.eatSpace())return null;if(z&&A.indentation<=Te&&(be=H.match(m))&&be[1].length<=6)return A.quote=0,A.header=be[1].length,A.thisLine.header=!0,P.highlightFormatting&&(A.formatting="header"),A.f=A.inline,v(A);if(A.indentation<=Te&&H.eat(">"))return A.quote=z?1:A.quote+1,P.highlightFormatting&&(A.formatting="quote"),H.eatSpace(),v(A);if(!De&&!A.setext&&z&&A.indentation<=Te&&(be=H.match(I))){var ge=be[1]?"ol":"ul";return A.indentation=Oe+H.current().length,A.list=!0,A.quote=0,A.listStack.push(A.indentation),A.em=!1,A.strong=!1,A.code=!1,A.strikethrough=!1,P.taskLists&&H.match(p,!1)&&(A.taskList=!0),A.f=A.inline,P.highlightFormatting&&(A.formatting=["list","list-"+ge]),v(A)}else{if(z&&A.indentation<=Te&&(be=H.match(s,!0)))return A.quote=0,A.fencedEndRE=new RegExp(be[1]+"+ *$"),A.localMode=P.fencedCodeBlockHighlighting&&R(be[2]||P.fencedCodeBlockDefaultMode),A.localMode&&(A.localState=ee.startState(A.localMode)),A.f=A.block=E,P.highlightFormatting&&(A.formatting="code-block"),A.code=-1,v(A);if(A.setext||(!Ue||!xe)&&!A.quote&&A.list===!1&&!A.code&&!De&&!l.test(H.string)&&(be=H.lookAhead(1))&&(be=be.match(u)))return A.setext?(A.header=A.setext,A.setext=0,H.skipToEnd(),P.highlightFormatting&&(A.formatting="header")):(A.header=be[0].charAt(0)=="="?1:2,A.setext=A.header),A.thisLine.header=!0,A.f=A.inline,v(A);if(De)return H.skipToEnd(),A.hr=!0,A.thisLine.hr=!0,B.hr;if(H.peek()==="[")return n(H,A,N)}return n(H,A,A.inline)}function O(H,A){var z=Y.token(H,A.htmlState);if(!W){var ne=ee.innerMode(Y,A.htmlState);(ne.mode.name=="xml"&&ne.state.tagStart===null&&!ne.state.context&&ne.state.tokenize.isInText||A.md_inside&&H.current().indexOf(">")>-1)&&(A.f=f,A.block=x,A.htmlState=null)}return z}function E(H,A){var z=A.listStack[A.listStack.length-1]||0,ne=A.indentation=H.quote?A.push(B.formatting+"-"+H.formatting[z]+"-"+H.quote):A.push("error"))}if(H.taskOpen)return A.push("meta"),A.length?A.join(" "):null;if(H.taskClosed)return A.push("property"),A.length?A.join(" "):null;if(H.linkHref?A.push(B.linkHref,"url"):(H.strong&&A.push(B.strong),H.em&&A.push(B.em),H.strikethrough&&A.push(B.strikethrough),H.emoji&&A.push(B.emoji),H.linkText&&A.push(B.linkText),H.code&&A.push(B.code),H.image&&A.push(B.image),H.imageAltText&&A.push(B.imageAltText,"link"),H.imageMarker&&A.push(B.imageMarker)),H.header&&A.push(B.header,B.header+"-"+H.header),H.quote&&(A.push(B.quote),!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=H.quote?A.push(B.quote+"-"+H.quote):A.push(B.quote+"-"+P.maxBlockquoteDepth)),H.list!==!1){var ne=(H.listStack.length-1)%3;ne?ne===1?A.push(B.list2):A.push(B.list3):A.push(B.list1)}return H.trailingSpaceNewLine?A.push("trailing-space-new-line"):H.trailingSpace&&A.push("trailing-space-"+(H.trailingSpace%2?"a":"b")),A.length?A.join(" "):null}function _(H,A){return H.match(h,!0)?v(A):void 0}function f(H,A){var z=A.text(H,A);if(typeof z!="undefined")return z;if(A.list)return A.list=null,v(A);if(A.taskList){var ne=H.match(p,!0)[1]===" ";return ne?A.taskOpen=!0:A.taskClosed=!0,P.highlightFormatting&&(A.formatting="task"),A.taskList=!1,v(A)}if(A.taskOpen=!1,A.taskClosed=!1,A.header&&H.match(/^#+$/,!0))return P.highlightFormatting&&(A.formatting="header"),v(A);var ae=H.next();if(A.linkTitle){A.linkTitle=!1;var me=ae;ae==="("&&(me=")"),me=(me+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var xe="^\\s*(?:[^"+me+"\\\\]+|\\\\\\\\|\\\\.)"+me;if(H.match(new RegExp(xe),!0))return B.linkHref}if(ae==="`"){var Te=A.formatting;P.highlightFormatting&&(A.formatting="code"),H.eatWhile("`");var Oe=H.current().length;if(A.code==0&&(!A.quote||Oe==1))return A.code=Oe,v(A);if(Oe==A.code){var Ue=v(A);return A.code=0,Ue}else return A.formatting=Te,v(A)}else if(A.code)return v(A);if(ae==="\\"&&(H.next(),P.highlightFormatting)){var De=v(A),be=B.formatting+"-escape";return De?De+" "+be:be}if(ae==="!"&&H.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return A.imageMarker=!0,A.image=!0,P.highlightFormatting&&(A.formatting="image"),v(A);if(ae==="["&&A.imageMarker&&H.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return A.imageMarker=!1,A.imageAltText=!0,P.highlightFormatting&&(A.formatting="image"),v(A);if(ae==="]"&&A.imageAltText){P.highlightFormatting&&(A.formatting="image");var De=v(A);return A.imageAltText=!1,A.image=!1,A.inline=A.f=S,De}if(ae==="["&&!A.image)return A.linkText&&H.match(/^.*?\]/)||(A.linkText=!0,P.highlightFormatting&&(A.formatting="link")),v(A);if(ae==="]"&&A.linkText){P.highlightFormatting&&(A.formatting="link");var De=v(A);return A.linkText=!1,A.inline=A.f=H.match(/\(.*?\)| ?\[.*?\]/,!1)?S:f,De}if(ae==="<"&&H.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){A.f=A.inline=c,P.highlightFormatting&&(A.formatting="link");var De=v(A);return De?De+=" ":De="",De+B.linkInline}if(ae==="<"&&H.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){A.f=A.inline=c,P.highlightFormatting&&(A.formatting="link");var De=v(A);return De?De+=" ":De="",De+B.linkEmail}if(P.xml&&ae==="<"&&H.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ge=H.string.indexOf(">",H.pos);if(ge!=-1){var He=H.string.substring(H.start,ge);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(He)&&(A.md_inside=!0)}return H.backUp(1),A.htmlState=ee.startState(Y),d(H,A,O)}if(P.xml&&ae==="<"&&H.match(/^\/\w*?>/))return A.md_inside=!1,"tag";if(ae==="*"||ae==="_"){for(var ct=1,vt=H.pos==1?" ":H.string.charAt(H.pos-2);ct<3&&H.eat(ae);)ct++;var _t=H.peek()||" ",yt=!/\s/.test(_t)&&(!i.test(_t)||/\s/.test(vt)||i.test(vt)),et=!/\s/.test(vt)&&(!i.test(vt)||/\s/.test(_t)||i.test(_t)),ht=null,xt=null;if(ct%2&&(!A.em&&yt&&(ae==="*"||!et||i.test(vt))?ht=!0:A.em==ae&&et&&(ae==="*"||!yt||i.test(_t))&&(ht=!1)),ct>1&&(!A.strong&&yt&&(ae==="*"||!et||i.test(vt))?xt=!0:A.strong==ae&&et&&(ae==="*"||!yt||i.test(_t))&&(xt=!1)),xt!=null||ht!=null){P.highlightFormatting&&(A.formatting=ht==null?"strong":xt==null?"em":"strong em"),ht===!0&&(A.em=ae),xt===!0&&(A.strong=ae);var Ue=v(A);return ht===!1&&(A.em=!1),xt===!1&&(A.strong=!1),Ue}}else if(ae===" "&&(H.eat("*")||H.eat("_"))){if(H.peek()===" ")return v(A);H.backUp(1)}if(P.strikethrough){if(ae==="~"&&H.eatWhile(ae)){if(A.strikethrough){P.highlightFormatting&&(A.formatting="strikethrough");var Ue=v(A);return A.strikethrough=!1,Ue}else if(H.match(/^[^\s]/,!1))return A.strikethrough=!0,P.highlightFormatting&&(A.formatting="strikethrough"),v(A)}else if(ae===" "&&H.match(/^~~/,!0)){if(H.peek()===" ")return v(A);H.backUp(2)}}if(P.emoji&&ae===":"&&H.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){A.emoji=!0,P.highlightFormatting&&(A.formatting="emoji");var Tt=v(A);return A.emoji=!1,Tt}return ae===" "&&(H.match(/^ +$/,!1)?A.trailingSpace++:A.trailingSpace&&(A.trailingSpaceNewLine=!0)),v(A)}function c(H,A){var z=H.next();if(z===">"){A.f=A.inline=f,P.highlightFormatting&&(A.formatting="link");var ne=v(A);return ne?ne+=" ":ne="",ne+B.linkInline}return H.match(/^[^>]+/,!0),B.linkInline}function S(H,A){if(H.eatSpace())return null;var z=H.next();return z==="("||z==="["?(A.f=A.inline=b(z==="("?")":"]"),P.highlightFormatting&&(A.formatting="link-string"),A.linkHref=!0,v(A)):"error"}var y={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function b(H){return function(A,z){var ne=A.next();if(ne===H){z.f=z.inline=f,P.highlightFormatting&&(z.formatting="link-string");var ae=v(z);return z.linkHref=!1,ae}return A.match(y[H]),z.linkHref=!0,v(z)}}function N(H,A){return H.match(/^([^\]\\]|\\.)*\]:/,!1)?(A.f=F,H.next(),P.highlightFormatting&&(A.formatting="link"),A.linkText=!0,v(A)):n(H,A,f)}function F(H,A){if(H.match(/^\]:/,!0)){A.f=A.inline=X,P.highlightFormatting&&(A.formatting="link");var z=v(A);return A.linkText=!1,z}return H.match(/^([^\]\\]|\\.)+/,!0),B.linkText}function X(H,A){return H.eatSpace()?null:(H.match(/^[^\s]+/,!0),H.peek()===void 0?A.linkTitle=!0:H.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),A.f=A.inline=f,B.linkHref+" url")}var Z={startState:function(){return{f:x,prevLine:{stream:null},thisLine:{stream:null},block:x,htmlState:null,indentation:0,inline:f,text:_,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(H){return{f:H.f,prevLine:H.prevLine,thisLine:H.thisLine,block:H.block,htmlState:H.htmlState&&ee.copyState(Y,H.htmlState),indentation:H.indentation,localMode:H.localMode,localState:H.localMode?ee.copyState(H.localMode,H.localState):null,inline:H.inline,text:H.text,formatting:!1,linkText:H.linkText,linkTitle:H.linkTitle,linkHref:H.linkHref,code:H.code,em:H.em,strong:H.strong,strikethrough:H.strikethrough,emoji:H.emoji,header:H.header,setext:H.setext,hr:H.hr,taskList:H.taskList,list:H.list,listStack:H.listStack.slice(0),quote:H.quote,indentedCode:H.indentedCode,trailingSpace:H.trailingSpace,trailingSpaceNewLine:H.trailingSpaceNewLine,md_inside:H.md_inside,fencedEndRE:H.fencedEndRE}},token:function(H,A){if(A.formatting=!1,H!=A.thisLine.stream){if(A.header=0,A.hr=!1,H.match(/^\s*$/,!0))return T(A),null;if(A.prevLine=A.thisLine,A.thisLine={stream:H},A.taskList=!1,A.trailingSpace=0,A.trailingSpaceNewLine=!1,!A.localState&&(A.f=A.block,A.f!=O)){var z=H.match(/^\s*/,!0)[0].replace(/\t/g,r).length;if(A.indentation=z,A.indentationDiff=null,z>0)return null}}return A.f(H,A)},innerMode:function(H){return H.block==O?{state:H.htmlState,mode:Y}:H.localState?{state:H.localState,mode:H.localMode}:{state:H,mode:Z}},indent:function(H,A,z){return H.block==O&&Y.indent?Y.indent(H.htmlState,A,z):H.localState&&H.localMode.indent?H.localMode.indent(H.localState,A,z):ee.Pass},blankLine:T,getType:v,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return Z},"xml"),ee.defineMIME("text/markdown","markdown"),ee.defineMIME("text/x-markdown","markdown")})},n6Qo:function(Be,we,k){"use strict";k.d(we,"a",function(){return M});var ee=k("q1tI"),V=k("biw7"),P=k("fyJ8");function Y(L){var I=L.className,p=L.index,m=L.children,u=L.colSpan,h=L.rowSpan,s=ee.useContext(V.a),l=s.prefixCls,i=s.fixedInfoList,r=i[p];return ee.createElement(P.a,Object.assign({className:I,index:p,component:"td",prefixCls:l,record:null,dataIndex:null,render:function(){return{children:m,props:{colSpan:u,rowSpan:h}}}},r))}function W(L){return ee.createElement("tr",Object.assign({},L))}function R(L){var I=L.children,p=ee.useContext(V.a),m=p.prefixCls;return ee.createElement("tfoot",{className:"".concat(m,"-summary")},I)}var B=we.b=R,M={Cell:Y,Row:W}},nCk5:function(Be,we,k){Be.exports=k.p+"static/d.53bf6ae3.svg"},nWbc:function(Be,we,k){},oE5q:function(Be,we,k){Be.exports=k.p+"static/t.0b94c5c3.svg"},oFv4:function(Be,we,k){Be.exports=k.p+"static/internal.da228387.png"},osHv:function(Be,we,k){(function(ee){ee(k("VrN/"))})(function(ee){"use strict";var V=ee.Pos;function P(i,r){return i.line-r.line||i.ch-r.ch}var Y="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",W=Y+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",R=new RegExp("<(/?)(["+Y+"]["+W+"]*)","g");function B(i,r,n,d){this.line=r,this.ch=n,this.cm=i,this.text=i.getLine(r),this.min=d?Math.max(d.from,i.firstLine()):i.firstLine(),this.max=d?Math.min(d.to-1,i.lastLine()):i.lastLine()}function M(i,r){var n=i.cm.getTokenTypeAt(V(i.line,r));return n&&/\btag\b/.test(n)}function L(i){return i.line>=i.max?void 0:(i.ch=0,i.text=i.cm.getLine(++i.line),!0)}function I(i){return i.line<=i.min?void 0:(i.text=i.cm.getLine(--i.line),i.ch=i.text.length,!0)}function p(i){for(;;){var r=i.text.indexOf(">",i.ch);if(r==-1){if(L(i))continue;return}if(!M(i,r+1)){i.ch=r+1;continue}var n=i.text.lastIndexOf("/",r),d=n>-1&&!/\S/.test(i.text.slice(n+1,r));return i.ch=r+1,d?"selfClose":"regular"}}function m(i){for(;;){var r=i.ch?i.text.lastIndexOf("<",i.ch-1):-1;if(r==-1){if(I(i))continue;return}if(!M(i,r+1)){i.ch=r;continue}R.lastIndex=r,i.ch=r;var n=R.exec(i.text);if(n&&n.index==r)return n}}function u(i){for(;;){R.lastIndex=i.ch;var r=R.exec(i.text);if(!r){if(L(i))continue;return}if(!M(i,r.index+1)){i.ch=r.index+1;continue}return i.ch=r.index+r[0].length,r}}function h(i){for(;;){var r=i.ch?i.text.lastIndexOf(">",i.ch-1):-1;if(r==-1){if(I(i))continue;return}if(!M(i,r+1)){i.ch=r;continue}var n=i.text.lastIndexOf("/",r),d=n>-1&&!/\S/.test(i.text.slice(n+1,r));return i.ch=r+1,d?"selfClose":"regular"}}function s(i,r){for(var n=[];;){var d=u(i),w,T=i.line,x=i.ch-(d?d[0].length:0);if(!d||!(w=p(i)))return;if(w=="selfClose")continue;if(d[1]){for(var O=n.length-1;O>=0;--O)if(n[O]==d[2]){n.length=O;break}if(O<0&&(!r||r==d[2]))return{tag:d[2],from:V(T,x),to:V(i.line,i.ch)}}else n.push(d[2])}}function l(i,r){for(var n=[];;){var d=h(i);if(!d)return;if(d=="selfClose"){m(i);continue}var w=i.line,T=i.ch,x=m(i);if(!x)return;if(x[1])n.push(x[2]);else{for(var O=n.length-1;O>=0;--O)if(n[O]==x[2]){n.length=O;break}if(O<0&&(!r||r==x[2]))return{tag:x[2],from:V(i.line,i.ch),to:V(w,T)}}}}ee.registerHelper("fold","xml",function(i,r){for(var n=new B(i,r.line,0);;){var d=u(n);if(!d||n.line!=r.line)return;var w=p(n);if(!w)return;if(!d[1]&&w!="selfClose"){var T=V(n.line,n.ch),x=s(n,d[2]);return x&&P(x.from,T)>0?{from:T,to:x.from}:null}}}),ee.findMatchingTag=function(i,r,n){var d=new B(i,r.line,r.ch,n);if(d.text.indexOf(">")==-1&&d.text.indexOf("<")==-1)return;var w=p(d),T=w&&V(d.line,d.ch),x=w&&m(d);if(!w||!x||P(d,r)>0)return;var O={from:V(d.line,d.ch),to:T,tag:x[2]};return w=="selfClose"?{open:O,close:null,at:"open"}:x[1]?{open:l(d,x[2]),close:O,at:"close"}:(d=new B(i,T.line,T.ch,n),{open:O,close:s(d,x[2]),at:"open"})},ee.findEnclosingTag=function(i,r,n,d){for(var w=new B(i,r.line,r.ch,n);;){var T=l(w,d);if(!T)break;var x=new B(i,r.line,r.ch,n),O=s(x,T.tag);if(O)return{open:T,close:O}}},ee.scanForClosingTag=function(i,r,n,d){var w=new B(i,r.line,r.ch,d?{from:0,to:d}:null);return s(w,n)}})},p5ED:function(Be,we,k){"use strict";var ee=k("+L6B"),V=k("2/Rp"),P=k("5Dmo"),Y=k("3S7+"),W=k("k1fw"),R=k("tJVT"),B=k("q1tI"),M=k.n(B),L=k("vHTk"),I=k.n(L),p=k("yEEn"),m=k("ZW9T"),u=k("1vsH");we.a=function(h){var s=h.name,l=h.data,i=h.theme,r=h.type,n=h.filename,d=h.monacoEditor,w=h.className,T=h.style,x=h.close,O=h.onClose,E=h.hasMask,v=Object(B.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),_=Object(R.a)(v,2),f=_[0],c=_[1],S=Object(B.useState)(""),y=Object(R.a)(S,2),b=y[0],N=y[1],F,X=1024*1024,Z=10*X,H=Object(B.useRef)();r==="office"&&(F=Object(u.T)(l).filesize,F>Z&&(r="other")),n&&(d.filename=n),Object(B.useEffect)(function(){var ne,ae,me=(ne=document.cookie)===null||ne===void 0||((ae=ne.replace(/\s/g,""))===null||ae===void 0)?void 0:ae.split(";");me==null||me.map(function(xe){var Te=xe.split("=");Te[0]==="_educoder_session"&&N(Te[1])})},[]);var A=function(){if(l.startsWith("http")||l.startsWith("/")){z();return}Object(u.z)(n||"educoder",l,n)},z=function(){Object(u.x)(n||s,l)};return console.log("data:",l,"fileanme:",n," name:",s),M.a.createElement("div",{style:Object(W.a)({},T||{}),className:"".concat(E&&I.a.bgBlack," ").concat(r?I.a.wrp:"hide")},x&&M.a.createElement("div",{className:I.a.close,ref:H},M.a.createElement(Y.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return H.current}},M.a.createElement("span",{onClick:z},M.a.createElement("i",{className:"icon-quxiaozhiding"}))),M.a.createElement(Y.a,{title:"\u5173\u95ED",getPopupContainer:function(){return H.current}},M.a.createElement("span",{className:"",onClick:O},M.a.createElement("i",{className:"icon-guanbi1"})))),M.a.createElement("div",{className:"".concat(I.a[w]," ").concat(w," ").concat(I.a.monaco," ").concat(r==="txt"?"show":"hide")},r==="txt"&&M.a.createElement(m.b,d)),r==="audio"&&M.a.createElement("audio",{src:"".concat(l!=null&&l.startsWith("/")||(l==null?void 0:l.indexOf("https://"))>-1?l:"data:audio/mp3;base64,").concat(l),autoPlay:!0}),r==="video"&&M.a.createElement(M.a.Fragment,null,l!=null&&l.startsWith("/")?M.a.createElement("video",{controls:!0,src:"".concat(l),autoPlay:!0}):M.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(l),autoPlay:!0})),r==="html"&&M.a.createElement("iframe",{src:l+"&disposition=inline"}),r==="pdf"&&M.a.createElement("embed",{className:I.a.embed,src:l}),r==="image"&&M.a.createElement(M.a.Fragment,null,M.a.createElement("img",{src:"".concat(l!=null&&l.startsWith("/")||(l==null?void 0:l.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(l)})),r==="other"&&M.a.createElement("div",null,M.a.createElement(V.a,{type:"primary",size:"large",onClick:A},M.a.createElement(p.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(r==="download"||r==="office")&&M.a.createElement(V.a,{type:"primary",size:"large",onClick:A},M.a.createElement(p.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Be,we,k){},pYxM:function(Be,we,k){Be.exports={flex_box_center:"flex_box_center___v-DUT",flex_space_between:"flex_space_between___1bRJc",flex_box_vertical_center:"flex_box_vertical_center___k_OZG",flex_box_center_end:"flex_box_center_end___2lt4j",flex_box_column:"flex_box_column___3fVE5",active:"active___-vjVj",line:"line___3pg8N",list:"list___3yqVJ",left:"left___2dr70",mask:"mask___186YH",right:"right___17A6Y",name:"name___v6M7T",title:"title___1BhMz",a:"a___3T4cN",b:"b___1z1Bk",des:"des___29QAn",tag:"tag___FfUI2"}},ps8w:function(Be,we,k){Be.exports=k.p+"static/show.6268a056.svg"},psGv:function(Be,we,k){var ee,V;(function(){var P;(function(){"use strict";var B=[,,function(p){function m(s){this.__parent=s,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}m.prototype.clone_empty=function(){var s=new m(this.__parent);return s.set_indent(this.__indent_count,this.__alignment_count),s},m.prototype.item=function(s){return s<0?this.__items[this.__items.length+s]:this.__items[s]},m.prototype.has_match=function(s){for(var l=this.__items.length-1;l>=0;l--)if(this.__items[l].match(s))return!0;return!1},m.prototype.set_indent=function(s,l){this.is_empty()&&(this.__indent_count=s||0,this.__alignment_count=l||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},m.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},m.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},m.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var s=this.__parent.current_line;return s.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),s.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),s.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,s.__items[0]===" "&&(s.__items.splice(0,1),s.__character_count-=1),!0}return!1},m.prototype.is_empty=function(){return this.__items.length===0},m.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},m.prototype.push=function(s){this.__items.push(s);var l=s.lastIndexOf(` `);l!==-1?this.__character_count=s.length-l:this.__character_count+=s.length},m.prototype.pop=function(){var s=null;return this.is_empty()||(s=this.__items.pop(),this.__character_count-=s.length),s},m.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},m.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},m.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},m.prototype.toString=function(){var s="";return this.is_empty()?this.__parent.indent_empty_lines&&(s=this.__parent.get_indent_string(this.__indent_count)):(s=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),s+=this.__items.join("")),s};function u(s,l){this.__cache=[""],this.__indent_size=s.indent_size,this.__indent_string=s.indent_char,s.indent_with_tabs||(this.__indent_string=new Array(s.indent_size+1).join(s.indent_char)),l=l||"",s.indent_level>0&&(l=new Array(s.indent_level+1).join(this.__indent_string)),this.__base_string=l,this.__base_string_length=l.length}u.prototype.get_indent_size=function(s,l){var i=this.__base_string_length;return l=l||0,s<0&&(i=0),i+=s*this.__indent_size,i+=l,i},u.prototype.get_indent_string=function(s,l){var i=this.__base_string;return l=l||0,s<0&&(s=0,i=""),l+=s*this.__indent_size,this.__ensure_cache(l),i+=this.__cache[l],i},u.prototype.__ensure_cache=function(s){for(;s>=this.__cache.length;)this.__add_column()},u.prototype.__add_column=function(){var s=this.__cache.length,l=0,i="";this.__indent_size&&s>=this.__indent_size&&(l=Math.floor(s/this.__indent_size),s-=l*this.__indent_size,i=new Array(l+1).join(this.__indent_string)),s&&(i+=new Array(s+1).join(" ")),this.__cache.push(i)};function h(s,l){this.__indent_cache=new u(s,l),this.raw=!1,this._end_with_newline=s.end_with_newline,this.indent_size=s.indent_size,this.wrap_line_length=s.wrap_line_length,this.indent_empty_lines=s.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new m(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}h.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},h.prototype.get_line_number=function(){return this.__lines.length},h.prototype.get_indent_string=function(s,l){return this.__indent_cache.get_indent_string(s,l)},h.prototype.get_indent_size=function(s,l){return this.__indent_cache.get_indent_size(s,l)},h.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},h.prototype.add_new_line=function(s){return this.is_empty()||!s&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},h.prototype.get_code=function(s){this.trim(!0);var l=this.current_line.pop();l&&(l[l.length-1]===` `&&(l=l.replace(/\n+$/g,"")),this.current_line.push(l)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join(` `);return s!==` `&&(i=i.replace(/[\n]/g,s)),i},h.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},h.prototype.set_indent=function(s,l){return s=s||0,l=l||0,this.next_line.set_indent(s,l),this.__lines.length>1?(this.current_line.set_indent(s,l),!0):(this.current_line.set_indent(),!1)},h.prototype.add_raw_token=function(s){for(var l=0;l1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},h.prototype.just_added_newline=function(){return this.current_line.is_empty()},h.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},h.prototype.ensure_empty_line_above=function(s,l){for(var i=this.__lines.length-2;i>=0;){var r=this.__lines[i];if(r.is_empty())break;if(r.item(0).indexOf(s)!==0&&r.item(-1)!==l){this.__lines.splice(i+1,0,new m(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},p.exports.Output=h},function(p){function m(u,h,s,l){this.type=u,this.text=h,this.comments_before=null,this.newlines=s||0,this.whitespace_before=l||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}p.exports.Token=m},,,function(p){function m(s,l){this.raw_options=u(s,l),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}m.prototype._get_array=function(s,l){var i=this.raw_options[s],r=l||[];return typeof i=="object"?i!==null&&typeof i.concat=="function"&&(r=i.concat()):typeof i=="string"&&(r=i.split(/[^a-zA-Z0-9_\/\-]+/)),r},m.prototype._get_boolean=function(s,l){var i=this.raw_options[s],r=i===void 0?!!l:!!i;return r},m.prototype._get_characters=function(s,l){var i=this.raw_options[s],r=l||"";return typeof i=="string"&&(r=i.replace(/\\r/,"\r").replace(/\\n/,` `).replace(/\\t/," ")),r},m.prototype._get_number=function(s,l){var i=this.raw_options[s];l=parseInt(l,10),isNaN(l)&&(l=0);var r=parseInt(i,10);return isNaN(r)&&(r=l),r},m.prototype._get_selection=function(s,l,i){var r=this._get_selection_list(s,l,i);if(r.length!==1)throw new Error("Invalid Option Value: The option '"+s+`' can only be one of the following values: `+l+` You passed in: '`+this.raw_options[s]+"'");return r[0]},m.prototype._get_selection_list=function(s,l,i){if(!l||l.length===0)throw new Error("Selection list cannot be empty.");if(i=i||[l[0]],!this._is_valid_selection(i,l))throw new Error("Invalid Default Value!");var r=this._get_array(s,i);if(!this._is_valid_selection(r,l))throw new Error("Invalid Option Value: The option '"+s+`' can contain only the following values: `+l+` You passed in: '`+this.raw_options[s]+"'");return r},m.prototype._is_valid_selection=function(s,l){return s.length&&l.length&&!s.some(function(i){return l.indexOf(i)===-1})};function u(s,l){var i={};s=h(s);var r;for(r in s)r!==l&&(i[r]=s[r]);if(l&&s[l])for(r in s[l])i[r]=s[l][r];return i}function h(s){var l={},i;for(i in s){var r=i.replace(/-/g,"_");l[r]=s[i]}return l}p.exports.Options=m,p.exports.normalizeOpts=h,p.exports.mergeOpts=u},,function(p){var m=RegExp.prototype.hasOwnProperty("sticky");function u(h){this.__input=h||"",this.__input_length=this.__input.length,this.__position=0}u.prototype.restart=function(){this.__position=0},u.prototype.back=function(){this.__position>0&&(this.__position-=1)},u.prototype.hasNext=function(){return this.__position=0&&h=0&&s=h.length&&this.__input.substring(s-h.length,s).toLowerCase()===h},p.exports.InputScanner=u},function(p,m,u){var h=u(8).InputScanner,s=u(3).Token,l=u(10).TokenStream,i=u(11).WhitespacePattern,r={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},n=function(d,w){this._input=new h(d),this._options=w||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new i(this._input)};n.prototype.tokenize=function(){this._input.restart(),this.__tokens=new l,this._reset();for(var d,w=new s(r.START,""),T=null,x=[],O=new l;w.type!==r.EOF;){for(d=this._get_next_token(w,T);this._is_comment(d);)O.add(d),d=this._get_next_token(w,T);O.isEmpty()||(d.comments_before=O,O=new l),d.parent=T,this._is_opening(d)?(x.push(T),T=d):T&&this._is_closing(d,T)&&(d.opened=T,T.closed=d,T=x.pop(),d.parent=T),d.previous=w,w.next=d,this.__tokens.add(d),w=d}return this.__tokens},n.prototype._is_first_token=function(){return this.__tokens.isEmpty()},n.prototype._reset=function(){},n.prototype._get_next_token=function(d,w){this._readWhitespace();var T=this._input.read(/.+/g);return T?this._create_token(r.RAW,T):this._create_token(r.EOF,"")},n.prototype._is_comment=function(d){return!1},n.prototype._is_opening=function(d){return!1},n.prototype._is_closing=function(d,w){return!1},n.prototype._create_token=function(d,w){var T=new s(d,w,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return T},n.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},p.exports.Tokenizer=n,p.exports.TOKEN=r},function(p){function m(u){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=u}m.prototype.restart=function(){this.__position=0},m.prototype.isEmpty=function(){return this.__tokens_length===0},m.prototype.hasNext=function(){return this.__position=0&&u/),erb:n.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:n.starting_with(/{%/).until_after(/%}/),django_value:n.starting_with(/{{/).until_after(/}}/),django_comment:n.starting_with(/{#/).until_after(/#}/),smarty:n.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:n.starting_with(/{\*/).until_after(/\*}/),smarty_literal:n.starting_with(/{literal}/).until_after(/{\/literal}/)}}l.prototype=new h,l.prototype._create=function(){return new l(this._input,this)},l.prototype._update=function(){this.__set_templated_pattern()},l.prototype.disable=function(i){var r=this._create();return r._disabled[i]=!0,r._update(),r},l.prototype.read_options=function(i){var r=this._create();for(var n in s)r._disabled[n]=i.templating.indexOf(n)===-1;return r._update(),r},l.prototype.exclude=function(i){var r=this._create();return r._excluded[i]=!0,r._update(),r},l.prototype.read=function(){var i="";this._match_pattern?i=this._input.read(this._starting_pattern):i=this._input.read(this._starting_pattern,this.__template_pattern);for(var r=this._read_template();r;)this._match_pattern?r+=this._input.read(this._match_pattern):r+=this._input.readUntil(this.__template_pattern),i+=r,r=this._read_template();return this._until_after&&(i+=this._input.readUntilAfter(this._until_pattern)),i},l.prototype.__set_templated_pattern=function(){var i=[];this._disabled.php||i.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||i.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||i.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(i.push(this.__patterns.django._starting_pattern.source),i.push(this.__patterns.django_value._starting_pattern.source),i.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||i.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&i.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+i.join("|")+")")},l.prototype._read_template=function(){var i="",r=this._input.peek();if(r==="<"){var n=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&n==="?"&&(i=i||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&n==="%"&&(i=i||this.__patterns.erb.read())}else r==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(i=i||this.__patterns.handlebars_comment.read(),i=i||this.__patterns.handlebars_unescaped.read(),i=i||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(i=i||this.__patterns.django_value.read()),this._excluded.django||(i=i||this.__patterns.django_comment.read(),i=i||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(i=i||this.__patterns.smarty_comment.read(),i=i||this.__patterns.smarty_literal.read(),i=i||this.__patterns.smarty.read()));return i},p.exports.TemplatablePattern=l},,,,function(p,m,u){var h=u(19).Beautifier,s=u(20).Options;function l(i,r,n,d){var w=new h(i,r,n,d);return w.beautify()}p.exports=l,p.exports.defaultOptions=function(){return new s}},function(p,m,u){var h=u(20).Options,s=u(2).Output,l=u(21).Tokenizer,i=u(21).TOKEN,r=/\r\n|[\r\n]/,n=/\r\n|[\r\n]/g,d=function(S,y){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=S.max_preserve_newlines,this.preserve_newlines=S.preserve_newlines,this._output=new s(S,y)};d.prototype.current_line_has_match=function(S){return this._output.current_line.has_match(S)},d.prototype.set_space_before_token=function(S,y){this._output.space_before_token=S,this._output.non_breaking_space=y},d.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},d.prototype.add_raw_token=function(S){this._output.add_raw_token(S)},d.prototype.print_preserved_newlines=function(S){var y=0;S.type!==i.TEXT&&S.previous.type!==i.TEXT&&(y=S.newlines?1:0),this.preserve_newlines&&(y=S.newlines0);return y!==0},d.prototype.traverse_whitespace=function(S){return S.whitespace_before||S.newlines?(this.print_preserved_newlines(S)||(this._output.space_before_token=!0),!0):!1},d.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},d.prototype.print_newline=function(S){this._output.add_new_line(S)},d.prototype.print_token=function(S){S.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(S.text))},d.prototype.indent=function(){this.indent_level++},d.prototype.get_full_indent=function(S){return S=this.indent_level+(S||0),S<1?"":this._output.get_indent_string(S)};var w=function(S){for(var y=null,b=S.next;b.type!==i.EOF&&S.closed!==b;){if(b.type===i.ATTRIBUTE&&b.text==="type"){b.next&&b.next.type===i.EQUALS&&b.next.next&&b.next.next.type===i.VALUE&&(y=b.next.next.text);break}b=b.next}return y},T=function(S,y){var b=null,N=null;return y.closed?(S==="script"?b="text/javascript":S==="style"&&(b="text/css"),b=w(y)||b,b.search("text/css")>-1?N="css":b.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?N="javascript":b.search(/(text|application|dojo)\/(x-)?(html)/)>-1?N="html":b.search(/test\/null/)>-1&&(N="null"),N):null};function x(S,y){return y.indexOf(S)!==-1}function O(S,y,b){this.parent=S||null,this.tag=y?y.tag_name:"",this.indent_level=b||0,this.parser_token=y||null}function E(S){this._printer=S,this._current_frame=null}E.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},E.prototype.record_tag=function(S){var y=new O(this._current_frame,S,this._printer.indent_level);this._current_frame=y},E.prototype._try_pop_frame=function(S){var y=null;return S&&(y=S.parser_token,this._printer.indent_level=S.indent_level,this._current_frame=S.parent),y},E.prototype._get_frame=function(S,y){for(var b=this._current_frame;b&&!(S.indexOf(b.tag)!==-1);){if(y&&y.indexOf(b.tag)!==-1){b=null;break}b=b.parent}return b},E.prototype.try_pop=function(S,y){var b=this._get_frame([S],y);return this._try_pop_frame(b)},E.prototype.indent_to_tag=function(S){var y=this._get_frame(S);y&&(this._printer.indent_level=y.indent_level)};function v(S,y,b,N){this._source_text=S||"",y=y||{},this._js_beautify=b,this._css_beautify=N,this._tag_stack=null;var F=new h(y,"html");this._options=F,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}v.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var S=this._source_text,y=this._options.eol;this._options.eol==="auto"&&(y=` `,S&&r.test(S)&&(y=S.match(r)[0])),S=S.replace(n,` `);var b=S.match(/^[\t ]*/)[0],N={text:"",type:""},F=new _,X=new d(this._options,b),Z=new l(S,this._options).tokenize();this._tag_stack=new E(X);for(var H=null,A=Z.next();A.type!==i.EOF;)A.type===i.TAG_OPEN||A.type===i.COMMENT?(H=this._handle_tag_open(X,A,F,N),F=H):A.type===i.ATTRIBUTE||A.type===i.EQUALS||A.type===i.VALUE||A.type===i.TEXT&&!F.tag_complete?H=this._handle_inside_tag(X,A,F,Z):A.type===i.TAG_CLOSE?H=this._handle_tag_close(X,A,F):A.type===i.TEXT?H=this._handle_text(X,A,F):X.add_raw_token(A),N=H,A=Z.next();var z=X._output.get_code(y);return z},v.prototype._handle_tag_close=function(S,y,b){var N={text:y.text,type:y.type};return S.alignment_size=0,b.tag_complete=!0,S.set_space_before_token(y.newlines||y.whitespace_before!=="",!0),b.is_unformatted?S.add_raw_token(y):(b.tag_start_char==="<"&&(S.set_space_before_token(y.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&b.has_wrapped_attrs&&S.print_newline(!1)),S.print_token(y)),b.indent_content&&!(b.is_unformatted||b.is_content_unformatted)&&(S.indent(),b.indent_content=!1),!b.is_inline_element&&!(b.is_unformatted||b.is_content_unformatted)&&S.set_wrap_point(),N},v.prototype._handle_inside_tag=function(S,y,b,N){var F=b.has_wrapped_attrs,X={text:y.text,type:y.type};if(S.set_space_before_token(y.newlines||y.whitespace_before!=="",!0),b.is_unformatted)S.add_raw_token(y);else if(b.tag_start_char==="{"&&y.type===i.TEXT)S.print_preserved_newlines(y)?(y.newlines=0,S.add_raw_token(y)):S.print_token(y);else{if(y.type===i.ATTRIBUTE?(S.set_space_before_token(!0),b.attr_count+=1):(y.type===i.EQUALS||y.type===i.VALUE&&y.previous.type===i.EQUALS)&&S.set_space_before_token(!1),y.type===i.ATTRIBUTE&&b.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(S.traverse_whitespace(y),F=F||y.newlines!==0),this._is_wrap_attributes_force)){var Z=b.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&b.attr_count===1){var H=!0,A=0,z;do{if(z=N.peek(A),z.type===i.ATTRIBUTE){H=!1;break}A+=1}while(A<4&&z.type!==i.EOF&&z.type!==i.TAG_CLOSE);Z=!H}Z&&(S.print_newline(!1),F=!0)}S.print_token(y),F=F||S.previous_token_wrapped(),b.has_wrapped_attrs=F}return X},v.prototype._handle_text=function(S,y,b){var N={text:y.text,type:"TK_CONTENT"};return b.custom_beautifier_name?this._print_custom_beatifier_text(S,y,b):b.is_unformatted||b.is_content_unformatted?S.add_raw_token(y):(S.traverse_whitespace(y),S.print_token(y)),N},v.prototype._print_custom_beatifier_text=function(S,y,b){var N=this;if(y.text!==""){var F=y.text,X,Z=1,H="",A="";b.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?X=this._js_beautify:b.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?X=this._css_beautify:b.custom_beautifier_name==="html"&&(X=function(Te,Oe){var Ue=new v(Te,Oe,N._js_beautify,N._css_beautify);return Ue.beautify()}),this._options.indent_scripts==="keep"?Z=0:this._options.indent_scripts==="separate"&&(Z=-S.indent_level);var z=S.get_full_indent(Z);if(F=F.replace(/\n[ \t]*$/,""),b.custom_beautifier_name!=="html"&&F[0]==="<"&&F.match(/^(|]]>)$/.exec(F);if(!ne){S.add_raw_token(y);return}H=z+ne[1]+` `,F=ne[4],ne[5]&&(A=z+ne[5]),F=F.replace(/\n[ \t]*$/,""),(ne[2]||ne[3].indexOf(` `)!==-1)&&(ne=ne[3].match(/[ \t]+$/),ne&&(y.whitespace_before=ne[0]))}if(F)if(X){var ae=function(){this.eol=` `};ae.prototype=this._options.raw_options;var me=new ae;F=X(z+F,me)}else{var xe=y.whitespace_before;xe&&(F=F.replace(new RegExp(` (`+xe+")?","g"),` `)),F=z+F.replace(/\n/g,` `+z)}H&&(F?F=H+F+` `+A:F=H+A),S.print_newline(!1),F&&(y.text=F,y.whitespace_before="",y.newlines=0,S.add_raw_token(y),S.print_newline(!0))}},v.prototype._handle_tag_open=function(S,y,b,N){var F=this._get_tag_open_token(y);return(b.is_unformatted||b.is_content_unformatted)&&!b.is_empty_element&&y.type===i.TAG_OPEN&&y.text.indexOf("]*)/),this.tag_check=b?b[1]:""):(b=y.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=b?b[1]:"",(y.text.startsWith("{{#>")||y.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&y.next!==null?this.tag_check=y.next.text.split(" ")[0]:this.tag_check=y.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),y.type===i.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||y.closed&&y.closed.text==="/>";var N=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(N=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(N)))}};v.prototype._get_tag_open_token=function(S){var y=new _(this._tag_stack.get_parser_token(),S);return y.alignment_size=this._options.wrap_attributes_indent_size,y.is_end_tag=y.is_end_tag||x(y.tag_check,this._options.void_elements),y.is_empty_element=y.tag_complete||y.is_start_tag&&y.is_end_tag,y.is_unformatted=!y.tag_complete&&x(y.tag_check,this._options.unformatted),y.is_content_unformatted=!y.is_empty_element&&x(y.tag_check,this._options.content_unformatted),y.is_inline_element=x(y.tag_name,this._options.inline)||y.tag_name.includes("-")||y.tag_start_char==="{",y},v.prototype._set_tag_position=function(S,y,b,N,F){if(b.is_empty_element||(b.is_end_tag?b.start_tag_token=this._tag_stack.try_pop(b.tag_name):(this._do_optional_end_element(b)&&(b.is_inline_element||S.print_newline(!1)),this._tag_stack.record_tag(b),(b.tag_name==="script"||b.tag_name==="style")&&!(b.is_unformatted||b.is_content_unformatted)&&(b.custom_beautifier_name=T(b.tag_check,y)))),x(b.tag_check,this._options.extra_liners)&&(S.print_newline(!1),S._output.just_added_blankline()||S.print_newline(!0)),b.is_empty_element){if(b.tag_start_char==="{"&&b.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),b.indent_content=!0;var X=S.current_line_has_match(/{{#if/);X||S.print_newline(!1)}b.tag_name==="!--"&&F.type===i.TAG_CLOSE&&N.is_end_tag&&b.text.indexOf(` `)===-1||(b.is_inline_element||b.is_unformatted||S.print_newline(!1),this._calcluate_parent_multiline(S,b))}else if(b.is_end_tag){var Z=!1;Z=b.start_tag_token&&b.start_tag_token.multiline_content,Z=Z||!b.is_inline_element&&!(N.is_inline_element||N.is_unformatted)&&!(F.type===i.TAG_CLOSE&&b.start_tag_token===N)&&F.type!=="TK_CONTENT",(b.is_content_unformatted||b.is_unformatted)&&(Z=!1),Z&&S.print_newline(!1)}else b.indent_content=!b.custom_beautifier_name,b.tag_start_char==="<"&&(b.tag_name==="html"?b.indent_content=this._options.indent_inner_html:b.tag_name==="head"?b.indent_content=this._options.indent_head_inner_html:b.tag_name==="body"&&(b.indent_content=this._options.indent_body_inner_html)),!(b.is_inline_element||b.is_unformatted)&&(F.type!=="TK_CONTENT"||b.is_content_unformatted)&&S.print_newline(!1),this._calcluate_parent_multiline(S,b)},v.prototype._calcluate_parent_multiline=function(S,y){y.parent&&S._output.just_added_newline()&&!((y.is_inline_element||y.is_unformatted)&&y.parent.is_inline_element)&&(y.parent.multiline_content=!0)};var f=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],c=["a","audio","del","ins","map","noscript","video"];v.prototype._do_optional_end_element=function(S){var y=null;if(S.is_empty_element||!S.is_start_tag||!S.parent)return;if(S.tag_name==="body")y=y||this._tag_stack.try_pop("head");else if(S.tag_name==="li")y=y||this._tag_stack.try_pop("li",["ol","ul"]);else if(S.tag_name==="dd"||S.tag_name==="dt")y=y||this._tag_stack.try_pop("dt",["dl"]),y=y||this._tag_stack.try_pop("dd",["dl"]);else if(S.parent.tag_name==="p"&&f.indexOf(S.tag_name)!==-1){var b=S.parent.parent;(!b||c.indexOf(b.tag_name)===-1)&&(y=y||this._tag_stack.try_pop("p"))}else S.tag_name==="rp"||S.tag_name==="rt"?(y=y||this._tag_stack.try_pop("rt",["ruby","rtc"]),y=y||this._tag_stack.try_pop("rp",["ruby","rtc"])):S.tag_name==="optgroup"?y=y||this._tag_stack.try_pop("optgroup",["select"]):S.tag_name==="option"?y=y||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):S.tag_name==="colgroup"?y=y||this._tag_stack.try_pop("caption",["table"]):S.tag_name==="thead"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"])):S.tag_name==="tbody"||S.tag_name==="tfoot"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"]),y=y||this._tag_stack.try_pop("thead",["table"]),y=y||this._tag_stack.try_pop("tbody",["table"])):S.tag_name==="tr"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"]),y=y||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(S.tag_name==="th"||S.tag_name==="td")&&(y=y||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),y=y||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return S.parent=this._tag_stack.get_parser_token(),y},p.exports.Beautifier=v},function(p,m,u){var h=u(6).Options;function s(l){h.call(this,l,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}s.prototype=new h,p.exports.Options=s},function(p,m,u){var h=u(9).Tokenizer,s=u(9).TOKEN,l=u(13).Directives,i=u(14).TemplatablePattern,r=u(12).Pattern,n={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:s.START,RAW:s.RAW,EOF:s.EOF},d=new l(/<\!--/,/-->/),w=function(T,x){h.call(this,T,x),this._current_tag_name="";var O=new i(this._input).read_options(this._options),E=new r(this._input);if(this.__patterns={word:O.until(/[\n\r\t <]/),single_quote:O.until_after(/'/),double_quote:O.until_after(/"/),attribute:O.until(/[\n\r\t =>]|\/>/),element_name:O.until(/[\n\r\t >\/]/),handlebars_comment:E.starting_with(/{{!--/).until_after(/--}}/),handlebars:E.starting_with(/{{/).until_after(/}}/),handlebars_open:E.until(/[\n\r\t }]/),handlebars_raw_close:E.until(/}}/),comment:E.starting_with(//),cdata:E.starting_with(//),conditional_comment:E.starting_with(//),processing:E.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var v=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=E.matching(v).until_after(v)}};w.prototype=new h,w.prototype._is_comment=function(T){return!1},w.prototype._is_opening=function(T){return T.type===n.TAG_OPEN},w.prototype._is_closing=function(T,x){return T.type===n.TAG_CLOSE&&x&&((T.text===">"||T.text==="/>")&&x.text[0]==="<"||T.text==="}}"&&x.text[0]==="{"&&x.text[1]==="{")},w.prototype._reset=function(){this._current_tag_name=""},w.prototype._get_next_token=function(T,x){var O=null;this._readWhitespace();var E=this._input.peek();return E===null?this._create_token(n.EOF,""):(O=O||this._read_open_handlebars(E,x),O=O||this._read_attribute(E,T,x),O=O||this._read_close(E,x),O=O||this._read_raw_content(E,T,x),O=O||this._read_content_word(E),O=O||this._read_comment_or_cdata(E),O=O||this._read_processing(E),O=O||this._read_open(E,x),O=O||this._create_token(n.UNKNOWN,this._input.next()),O)},w.prototype._read_comment_or_cdata=function(T){var x=null,O=null,E=null;if(T==="<"){var v=this._input.peek(1);v==="!"&&(O=this.__patterns.comment.read(),O?(E=d.get_directives(O),E&&E.ignore==="start"&&(O+=d.readIgnored(this._input))):O=this.__patterns.cdata.read()),O&&(x=this._create_token(n.COMMENT,O),x.directives=E)}return x},w.prototype._read_processing=function(T){var x=null,O=null,E=null;if(T==="<"){var v=this._input.peek(1);(v==="!"||v==="?")&&(O=this.__patterns.conditional_comment.read(),O=O||this.__patterns.processing.read()),O&&(x=this._create_token(n.COMMENT,O),x.directives=E)}return x},w.prototype._read_open=function(T,x){var O=null,E=null;return x||T==="<"&&(O=this._input.next(),this._input.peek()==="/"&&(O+=this._input.next()),O+=this.__patterns.element_name.read(),E=this._create_token(n.TAG_OPEN,O)),E},w.prototype._read_open_handlebars=function(T,x){var O=null,E=null;return x||this._options.indent_handlebars&&T==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(O=this.__patterns.handlebars_comment.read(),O=O||this.__patterns.handlebars.read(),E=this._create_token(n.COMMENT,O)):(O=this.__patterns.handlebars_open.read(),E=this._create_token(n.TAG_OPEN,O))),E},w.prototype._read_close=function(T,x){var O=null,E=null;return x&&(x.text[0]==="<"&&(T===">"||T==="/"&&this._input.peek(1)===">")?(O=this._input.next(),T==="/"&&(O+=this._input.next()),E=this._create_token(n.TAG_CLOSE,O)):x.text[0]==="{"&&T==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),E=this._create_token(n.TAG_CLOSE,"}}"))),E},w.prototype._read_attribute=function(T,x,O){var E=null,v="";if(O&&O.text[0]==="<")if(T==="=")E=this._create_token(n.EQUALS,this._input.next());else if(T==='"'||T==="'"){var _=this._input.next();T==='"'?_+=this.__patterns.double_quote.read():_+=this.__patterns.single_quote.read(),E=this._create_token(n.VALUE,_)}else v=this.__patterns.attribute.read(),v&&(x.type===n.EQUALS?E=this._create_token(n.VALUE,v):E=this._create_token(n.ATTRIBUTE,v));return E},w.prototype._is_content_unformatted=function(T){return this._options.void_elements.indexOf(T)===-1&&(this._options.content_unformatted.indexOf(T)!==-1||this._options.unformatted.indexOf(T)!==-1)},w.prototype._read_raw_content=function(T,x,O){var E="";if(O&&O.text[0]==="{")E=this.__patterns.handlebars_raw_close.read();else if(x.type===n.TAG_CLOSE&&x.opened.text[0]==="<"&&x.text[0]!=="/"){var v=x.opened.text.substr(1).toLowerCase();if(v==="script"||v==="style"){var _=this._read_comment_or_cdata(T);if(_)return _.type=n.TEXT,_;E=this._input.readUntil(new RegExp("","ig"))}else this._is_content_unformatted(v)&&(E=this._input.readUntil(new RegExp("","ig")))}return E?this._create_token(n.TEXT,E):null},w.prototype._read_content_word=function(T){var x="";if(this._options.unformatted_content_delimiter&&(T===this._options.unformatted_content_delimiter[0]&&(x=this.__patterns.unformatted_content_delimiter.read())),x||(x=this.__patterns.word.read()),x)return this._create_token(n.TEXT,x)},p.exports.Tokenizer=w,p.exports.TOKEN=n}],M={};function L(p){var m=M[p];if(m!==void 0)return m.exports;var u=M[p]={exports:{}};return B[p](u,u.exports,L),u.exports}var I=L(18);P=I})();var Y=P;if(!0)!(ee=[k,k("6UM0"),k("TXwP")],V=function(B){var M=k("6UM0"),L=k("TXwP");return{html_beautify:function(I,p){return Y(I,p,M.js_beautify,L.css_beautify)}}}.apply(we,ee),V!==void 0&&(Be.exports=V));else var W,R})()},"rAM+":function(Be,we,k){"use strict";k.d(we,"a",function(){return V});var ee=k("Qw5x");function V(P,Y){var W;if(typeof Symbol=="undefined"||P[Symbol.iterator]==null){if(Array.isArray(P)||(W=Object(ee.a)(P))||Y&&P&&typeof P.length=="number"){W&&(P=W);var R=0,B=function(){};return{s:B,n:function(){return R>=P.length?{done:!0}:{done:!1,value:P[R++]}},e:function(m){throw m},f:B}}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 M=!0,L=!1,I;return{s:function(){W=P[Symbol.iterator]()},n:function(){var m=W.next();return M=m.done,m},e:function(m){L=!0,I=m},f:function(){try{!M&&W.return!=null&&W.return()}finally{if(L)throw I}}}}},rHrb:function(Be,we,k){"use strict";Object.defineProperty(we,"__esModule",{value:!0}),we.CopyToClipboard=void 0;var ee=P(k("q1tI")),V=P(k("+QRC"));function P(n){return n&&n.__esModule?n:{default:n}}function Y(n){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Y=function(w){return typeof w}:Y=function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},Y(n)}function W(n,d){var w=Object.keys(n);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(n);d&&(T=T.filter(function(x){return Object.getOwnPropertyDescriptor(n,x).enumerable})),w.push.apply(w,T)}return w}function R(n){for(var d=1;d=0)continue;if(!Object.prototype.propertyIsEnumerable.call(n,T))continue;w[T]=n[T]}}return w}function M(n,d){if(n==null)return{};var w={},T=Object.keys(n),x,O;for(O=0;O=0)continue;w[x]=n[x]}return w}function L(n,d){if(!(n instanceof d))throw new TypeError("Cannot call a class as a function")}function I(n,d){for(var w=0;w"']/,ee=/[&<>"']/g,V=/[<>"']|&(?!#?\w+;)/,P=/[<>"']|&(?!#?\w+;)/g,Y={"&":"&","<":"<",">":">",'"':""","'":"'"},W=E=>Y[E];function R(E,v){if(v){if(k.test(E))return E.replace(ee,W)}else if(V.test(E))return E.replace(P,W);return E}const B=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function M(E){return E.replace(B,(v,_)=>(_=_.toLowerCase(),_==="colon"?":":_.charAt(0)==="#"?_.charAt(1)==="x"?String.fromCharCode(parseInt(_.substring(2),16)):String.fromCharCode(+_.substring(1)):""))}const L=/(^|[^\[])\^/g;function I(E,v){E=E.source||E,v=v||"";const _={replace:(f,c)=>(c=c.source||c,c=c.replace(L,"$1"),E=E.replace(f,c),_),getRegex:()=>new RegExp(E,v)};return _}const p=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function u(E,v,_){if(E){let f;try{f=decodeURIComponent(M(_)).replace(p,"").toLowerCase()}catch(c){return null}if(f.indexOf("javascript:")===0||f.indexOf("vbscript:")===0||f.indexOf("data:")===0)return null}v&&!m.test(_)&&(_=r(v,_));try{_=encodeURI(_).replace(/%25/g,"%")}catch(f){return null}return _}const h={},s=/^[^:]+:\/*[^/]*$/,l=/^([^:]+:)[\s\S]*$/,i=/^([^:]+:\/*[^/]*)[\s\S]*$/;function r(E,v){h[" "+E]||(s.test(E)?h[" "+E]=E+"/":h[" "+E]=T(E,"/",!0)),E=h[" "+E];const _=E.indexOf(":")===-1;return v.substring(0,2)==="//"?_?v:E.replace(l,"$1")+v:v.charAt(0)==="/"?_?v:E.replace(i,"$1")+v:E+v}const n={exec:function(){}};function d(E){let v=1,_,f;for(;v{let N=!1,F=y;for(;--F>=0&&b[F]==="\\";)N=!N;return N?"|":" |"}),f=_.split(/ \|/);let c=0;if(f.length>v)f.splice(v);else for(;f.length=0;I--){var p=P().key(I);L(Y(p),p)}}function B(L){return P().removeItem(L)}function M(){return P().clear()}},"s8/Y":function(Be,we,k){Be.exports=k.p+"static/jx.6713fc81.svg"},"sB/4":function(Be,we,k){Be.exports=k.p+"static/b.7405990c.svg"},sNtx:function(Be,we,k){},sR1s:function(Be,we,k){"use strict";k.d(we,"b",function(){return Y}),k.d(we,"a",function(){return W}),k.d(we,"c",function(){return R}),k.d(we,"d",function(){return B});var ee=k("U8pU"),V="RC_TABLE_KEY";function P(M){return M==null?[]:Array.isArray(M)?M:[M]}function Y(M,L){if(!L&&typeof L!="number")return M;for(var I=P(L),p=M,m=0;m1)Object(I.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(d.length===0)return Object(I.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var w=d[0];if(R.isValidElement(w)&&Object(p.c)(w)){var T=w.ref;d[0]=R.cloneElement(w,{ref:Object(p.a)(T,this.setChildNode)})}return d.length===1?d[0]:d.map(function(x,O){return!R.isValidElement(x)||"key"in x&&x.key!==null?x:R.cloneElement(x,{key:"".concat(u,"-").concat(O)})})}}]),i}(R.Component);h.displayName="ResizeObserver",we.a=h},twBr:function(Be,we,k){Be.exports=k.p+"static/s.1f286590.svg"},uMZB:function(Be,we,k){Be.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(Be,we,k){Be.exports=ee;function ee(){return k("gaXo"),{}}},ulZh:function(Be,we,k){typeof window!="undefined"&&function(V,P){Be.exports=P()}(this,function(){return function(ee){var V={};function P(Y){if(V[Y])return V[Y].exports;var W=V[Y]={i:Y,l:!1,exports:{}};return ee[Y].call(W.exports,W,W.exports,P),W.l=!0,W.exports}return P.m=ee,P.c=V,P.d=function(Y,W,R){P.o(Y,W)||Object.defineProperty(Y,W,{enumerable:!0,get:R})},P.r=function(Y){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(Y,"__esModule",{value:!0})},P.t=function(Y,W){if(W&1&&(Y=P(Y)),W&8)return Y;if(W&4&&typeof Y=="object"&&Y&&Y.__esModule)return Y;var R=Object.create(null);if(P.r(R),Object.defineProperty(R,"default",{enumerable:!0,value:Y}),W&2&&typeof Y!="string")for(var B in Y)P.d(R,B,function(M){return Y[M]}.bind(null,B));return R},P.n=function(Y){var W=Y&&Y.__esModule?function(){return Y.default}:function(){return Y};return P.d(W,"a",W),W},P.o=function(Y,W){return Object.prototype.hasOwnProperty.call(Y,W)},P.p="/dist/",P(P.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ee,V,P){"use strict";var Y=Object.prototype.hasOwnProperty,W="~";function R(){}Object.create&&(R.prototype=Object.create(null),new R().__proto__||(W=!1));function B(p,m,u){this.fn=p,this.context=m,this.once=u||!1}function M(p,m,u,h,s){if(typeof u!="function")throw new TypeError("The listener must be a function");var l=new B(u,h||p,s),i=W?W+m:m;return p._events[i]?p._events[i].fn?p._events[i]=[p._events[i],l]:p._events[i].push(l):(p._events[i]=l,p._eventsCount++),p}function L(p,m){--p._eventsCount===0?p._events=new R:delete p._events[m]}function I(){this._events=new R,this._eventsCount=0}I.prototype.eventNames=function(){var m=[],u,h;if(this._eventsCount===0)return m;for(h in u=this._events)Y.call(u,h)&&m.push(W?h.slice(1):h);return Object.getOwnPropertySymbols?m.concat(Object.getOwnPropertySymbols(u)):m},I.prototype.listeners=function(m){var u=W?W+m:m,h=this._events[u];if(!h)return[];if(h.fn)return[h.fn];for(var s=0,l=h.length,i=new Array(l);s0},!1)}function p(m,u){for(var h={main:[u]},s={main:[]},l={main:{}};I(h);)for(var i=Object.keys(h),r=0;r=2*O/v||b<=F)return;var X=Number.POSITIVE_INFINITY,Z;for(Z=i.level-1;Z>f;Z--){var H=_[Z].maxBitrate;if(X=O*H/(8*.8*y),X=b)return;var A=this.bwEstimator.getEstimate();I.logger.warn("Fragment "+i.sn+(r?" part "+r.index:"")+" of level "+i.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+Z+` Current BW estimate: `+(Object(Y.isFiniteNumber)(A)?(A/1024).toFixed(3):"Unknown")+` Kb/s Estimated load time for current fragment: `+b.toFixed(3)+` s Estimated load time for the next fragment: `+X.toFixed(3)+` s Time to underbuffer: `+F.toFixed(3)+" s"),n.nextLoadLevel=Z,this.bwEstimator.sample(E,x.loaded),this.clearTimer(),i.loader&&(this.fragCurrent=this.partCurrent=null,i.loader.abort()),n.trigger(R.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:r,stats:x})},s.onFragLoaded=function(i,r){var n=r.frag,d=r.part;if(n.type===L.PlaylistLevelType.MAIN&&Object(Y.isFiniteNumber)(n.sn)){var w=d?d.stats:n.stats,T=d?d.duration:n.duration;if(this.clearTimer(),this.lastLoadedFragLevel=n.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var x=this.hls.levels[n.level],O=(x.loaded?x.loaded.bytes:0)+w.loaded,E=(x.loaded?x.loaded.duration:0)+T;x.loaded={bytes:O,duration:E},x.realBitrate=Math.round(8*O/E)}if(n.bitrateTest){var v={stats:w,frag:n,part:d,id:n.type};this.onFragBuffered(R.Events.FRAG_BUFFERED,v),n.bitrateTest=!1}}},s.onFragBuffered=function(i,r){var n=r.frag,d=r.part,w=d?d.stats:n.stats;if(w.aborted)return;if(n.type!==L.PlaylistLevelType.MAIN||n.sn==="initSegment")return;var T=w.parsing.end-w.loading.start;this.bwEstimator.sample(T,w.loaded),w.bwEstimate=this.bwEstimator.getEstimate(),n.bitrateTest?this.bitrateTestDelay=T/1e3:this.bitrateTestDelay=0},s.onError=function(i,r){switch(r.details){case M.ErrorDetails.FRAG_LOAD_ERROR:case M.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,r=this.partCurrent,n=this.hls,d=n.maxAutoLevel,w=n.config,T=n.minAutoLevel,x=n.media,O=r?r.duration:i?i.duration:0,E=x?x.currentTime:0,v=x&&x.playbackRate!==0?Math.abs(x.playbackRate):1,_=this.bwEstimator?this.bwEstimator.getEstimate():w.abrEwmaDefaultEstimate,f=(B.BufferHelper.bufferInfo(x,E,w.maxBufferHole).end-E)/v,c=this.findBestLevel(_,T,d,f,w.abrBandWidthFactor,w.abrBandWidthUpFactor);if(c>=0)return c;I.logger.trace((f?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var S=O?Math.min(O,w.maxStarvationDelay):w.maxStarvationDelay,y=w.abrBandWidthFactor,b=w.abrBandWidthUpFactor;if(!f){var N=this.bitrateTestDelay;if(N){var F=O?Math.min(O,w.maxLoadingDelay):w.maxLoadingDelay;S=F-N,I.logger.trace("bitrate test took "+Math.round(1e3*N)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*S)+" ms"),y=b=1}}return c=this.findBestLevel(_,T,d,f+S,y,b),Math.max(c,0)},s.findBestLevel=function(i,r,n,d,w,T){for(var x,O=this.fragCurrent,E=this.partCurrent,v=this.lastLoadedFragLevel,_=this.hls.levels,f=_[v],c=!!(f!=null&&(x=f.details)!==null&&x!==void 0&&x.live),S=f==null?void 0:f.codecSet,y=E?E.duration:O?O.duration:0,b=n;b>=r;b--){var N=_[b];if(!N||S&&N.codecSet!==S)continue;var F=N.details,X=(E?F==null?void 0:F.partTarget:F==null?void 0:F.averagetargetduration)||y,Z=void 0;b<=v?Z=w*i:Z=T*i;var H=_[b].maxBitrate,A=H*X/Z;if(I.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+b+"/"+Math.round(Z)+"/"+H+"/"+X+"/"+d+"/"+A),Z>H&&(!A||c&&!this.bitrateTestDelay||A0&&f===-1?(this.log("Override startPosition with lastCurrentTime @"+c.toFixed(3)),this.state=W.State.IDLE):(this.loadedmetadata=!1,this.state=W.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=f,this.tick()},v.doTick=function(){switch(this.state){case W.State.IDLE:this.doTickIdle();break;case W.State.WAITING_TRACK:{var f,c=this.levels,S=this.trackId,y=c==null||((f=c[S])===null||f===void 0)?void 0:f.details;if(y){if(this.waitForCdnTuneIn(y))break;this.state=W.State.WAITING_INIT_PTS}break}case W.State.FRAG_LOADING_WAITING_RETRY:{var b,N=performance.now(),F=this.retryDate;(!F||N>=F||(b=this.media)!==null&&b!==void 0&&b.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=W.State.IDLE);break}case W.State.WAITING_INIT_PTS:{var X=this.waitingData;if(X){var Z=X.frag,H=X.part,A=X.cache,z=X.complete;if(this.initPTS[Z.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=W.State.FRAG_LOADING;var ne=A.flush(),ae={frag:Z,part:H,payload:ne,networkDetails:null};this._handleFragmentLoadProgress(ae),z&&O.prototype._handleFragmentLoadComplete.call(this,ae)}else if(this.videoTrackCC!==this.waitingVideoCC)r.logger.log("Waiting fragment cc ("+Z.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var me=this.getLoadPosition(),xe=B.BufferHelper.bufferInfo(this.mediaBuffer,me,this.config.maxBufferHole),Te=Object(s.fragmentWithinToleranceTest)(xe.end,this.config.maxFragLookUpTolerance,Z);Te<0&&(r.logger.log("Waiting fragment cc ("+Z.cc+") @ "+Z.start+" cancelled because another fragment at "+xe.end+" is needed"),this.clearWaitingFragment())}}else this.state=W.State.IDLE}}this.onTickEnd()},v.clearWaitingFragment=function(){var f=this.waitingData;f&&(this.fragmentTracker.removeFragment(f.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=W.State.IDLE)},v.onTickEnd=function(){var f=this.media;if(!f||!f.readyState)return;var c=this.mediaBuffer?this.mediaBuffer:f,S=c.buffered;!this.loadedmetadata&&S.length&&(this.loadedmetadata=!0),this.lastCurrentTime=f.currentTime},v.doTickIdle=function(){var f,c,S=this.hls,y=this.levels,b=this.media,N=this.trackId,F=S.config;if(!y||!y[N])return;if(!b&&(this.startFragRequested||!F.startFragPrefetch))return;var X=y[N],Z=X.details;if(!Z||Z.live&&this.levelLastLoaded!==N||this.waitForCdnTuneIn(Z)){this.state=W.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,p.ElementaryStreamTypes.AUDIO,I.PlaylistLevelType.AUDIO));var H=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,I.PlaylistLevelType.AUDIO);if(H===null)return;var A=H.len,z=this.getMaxBufferLength(),ne=this.audioSwitch;if(A>=z&&!ne)return;if(!ne&&this._streamEnded(H,Z)){S.trigger(R.Events.BUFFER_EOS,{type:"audio"}),this.state=W.State.ENDED;return}var ae=Z.fragments,me=ae[0].start,xe=H.end;if(ne){var Te=this.getLoadPosition();xe=Te,Z.PTSKnown&&Teme||H.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),b.currentTime=me+.05))}var Oe=this.getNextFragment(xe,Z);if(!Oe){this.bufferFlushed=!0;return}((f=Oe.decryptdata)===null||f===void 0?void 0:f.keyFormat)==="identity"&&!((c=Oe.decryptdata)!==null&&c!==void 0&&c.key)?this.loadKey(Oe,Z):this.loadFragment(Oe,Z,xe)},v.getMaxBufferLength=function(){var f=O.prototype.getMaxBufferLength.call(this),c=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,I.PlaylistLevelType.MAIN);return c===null?f:Math.max(f,c.len)},v.onMediaDetaching=function(){this.videoBuffer=null,O.prototype.onMediaDetaching.call(this)},v.onAudioTracksUpdated=function(f,c){var S=c.audioTracks;this.resetTransmuxer(),this.levels=S.map(function(y){return new L.Level(y)})},v.onAudioTrackSwitching=function(f,c){var S=!!c.url;this.trackId=c.id;var y=this.fragCurrent;y!=null&&y.loader&&y.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),S?this.setInterval(T):this.resetTransmuxer(),S?(this.audioSwitch=!0,this.state=W.State.IDLE):this.state=W.State.STOPPED,this.tick()},v.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},v.onLevelLoaded=function(f,c){this.mainDetails=c.details},v.onAudioTrackLoaded=function(f,c){var S,y=this.levels,b=c.details,N=c.id;if(!y){this.warn("Audio tracks were reset while loading level "+N);return}this.log("Track "+N+" loaded ["+b.startSN+","+b.endSN+"],duration:"+b.totalduration);var F=y[N],X=0;if(b.live||(S=F.details)!==null&&S!==void 0&&S.live){var Z=this.mainDetails;if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed||!Z)return;!F.details&&b.hasProgramDateTime&&Z.hasProgramDateTime?(Object(l.alignMediaPlaylistByPDT)(b,Z),X=b.fragments[0].start):X=this.alignPlaylists(b,F.details)}F.details=b,this.levelLastLoaded=N,!this.startFragRequested&&(this.mainDetails||!b.live)&&this.setStartPosition(F.details,X),this.state===W.State.WAITING_TRACK&&!this.waitForCdnTuneIn(b)&&(this.state=W.State.IDLE),this.tick()},v._handleFragmentLoadProgress=function(f){var c,S=f.frag,y=f.part,b=f.payload,N=this.config,F=this.trackId,X=this.levels;if(!X){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+S.sn+" of level "+S.level+" will not be buffered");return}var Z=X[F];console.assert(Z,"Audio track is defined on fragment load progress");var H=Z.details;console.assert(H,"Audio track details are defined on fragment load progress");var A=N.defaultAudioCodec||Z.audioCodec||"mp4a.40.2",z=this.transmuxer;z||(z=this.transmuxer=new u.default(this.hls,I.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var ne=this.initPTS[S.cc],ae=(c=S.initSegment)===null||c===void 0?void 0:c.data;if(ne!==void 0){var me=!1,xe=y?y.index:-1,Te=xe!==-1,Oe=new h.ChunkMetadata(S.level,S.sn,S.stats.chunkCount,b.byteLength,xe,Te);z.push(b,ae,A,"",S,y,H.totalduration,me,Oe,ne)}else{r.logger.log("Unknown video PTS for cc "+S.cc+", waiting for video PTS before demuxing audio frag "+S.sn+" of ["+H.startSN+" ,"+H.endSN+"],track "+F);var Ue=this.waitingData=this.waitingData||{frag:S,part:y,cache:new m.default,complete:!1},De=Ue.cache;De.push(new Uint8Array(b)),this.waitingVideoCC=this.videoTrackCC,this.state=W.State.WAITING_INIT_PTS}},v._handleFragmentLoadComplete=function(f){if(this.waitingData){this.waitingData.complete=!0;return}O.prototype._handleFragmentLoadComplete.call(this,f)},v.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},v.onBufferCreated=function(f,c){var S=c.tracks.audio;S&&(this.mediaBuffer=S.buffer),c.tracks.video&&(this.videoBuffer=c.tracks.video.buffer)},v.onFragBuffered=function(f,c){var S=c.frag,y=c.part;if(S.type!==I.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(S)){this.warn("Fragment "+S.sn+(y?" p: "+y.index:"")+" of level "+S.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}S.sn!=="initSegment"&&(this.fragPrevious=S,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(R.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(S,y)},v.onError=function(f,c){switch(c.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(I.PlaylistLevelType.AUDIO,c);break;case i.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case i.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==W.State.ERROR&&this.state!==W.State.STOPPED&&(this.state=c.fatal?W.State.ERROR:W.State.IDLE,this.warn(c.details+" while loading frag, switching to "+this.state+" state"));break;case i.ErrorDetails.BUFFER_FULL_ERROR:if(c.parent==="audio"&&(this.state===W.State.PARSING||this.state===W.State.PARSED)){var S=!0,y=this.getFwdBufferInfo(this.mediaBuffer,I.PlaylistLevelType.AUDIO);y&&y.len>.5&&(S=!this.reduceMaxBufferLength(y.len)),S&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,O.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},v.onBufferFlushed=function(f,c){var S=c.type;S===p.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},v._handleTransmuxComplete=function(f){var c,S="audio",y=this.hls,b=f.remuxResult,N=f.chunkMeta,F=this.getCurrentContext(N);if(!F){this.warn("The loading context changed while buffering fragment "+N.sn+" of level "+N.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(N.level);return}var X=F.frag,Z=F.part,H=b.audio,A=b.text,z=b.id3,ne=b.initSegment;if(this.fragContextChanged(X))return;if(this.state=W.State.PARSING,this.audioSwitch&&H&&this.completeAudioSwitch(),ne!=null&&ne.tracks&&(this._bufferInitSegment(ne.tracks,X,N),y.trigger(R.Events.FRAG_PARSING_INIT_SEGMENT,{frag:X,id:S,tracks:ne.tracks})),H){var ae=H.startPTS,me=H.endPTS,xe=H.startDTS,Te=H.endDTS;Z&&(Z.elementaryStreams[p.ElementaryStreamTypes.AUDIO]={startPTS:ae,endPTS:me,startDTS:xe,endDTS:Te}),X.setElementaryStreamInfo(p.ElementaryStreamTypes.AUDIO,ae,me,xe,Te),this.bufferFragmentData(H,X,Z,N)}if(z!=null&&(c=z.samples)!==null&&c!==void 0&&c.length){var Oe=n({frag:X,id:S},z);y.trigger(R.Events.FRAG_PARSING_METADATA,Oe)}if(A){var Ue=n({frag:X,id:S},A);y.trigger(R.Events.FRAG_PARSING_USERDATA,Ue)}},v._bufferInitSegment=function(f,c,S){if(this.state!==W.State.PARSING)return;f.video&&delete f.video;var y=f.audio;if(!y)return;y.levelCodec=y.codec,y.id="audio",this.log("Init audio buffer, container:"+y.container+", codecs[parsed]=["+y.codec+"]"),this.hls.trigger(R.Events.BUFFER_CODECS,f);var b=y.initSegment;if(b!=null&&b.byteLength){var N={type:"audio",frag:c,part:null,chunkMeta:S,parent:c.type,data:b};this.hls.trigger(R.Events.BUFFER_APPENDING,N)}this.tick()},v.loadFragment=function(f,c,S){var y=this.fragmentTracker.getState(f);this.fragCurrent=f,(this.audioSwitch||y===M.FragmentState.NOT_LOADED||y===M.FragmentState.PARTIAL)&&(f.sn==="initSegment"?this._loadInitSegment(f):c.live&&!Object(Y.isFiniteNumber)(this.initPTS[f.cc])?(this.log("Waiting for video PTS in continuity counter "+f.cc+" of live stream before loading audio fragment "+f.sn+" of level "+this.trackId),this.state=W.State.WAITING_INIT_PTS):(this.startFragRequested=!0,O.prototype.loadFragment.call(this,f,c,S)))},v.completeAudioSwitch=function(){var f=this.hls,c=this.media,S=this.trackId;c&&(this.log("Switching audio track : flushing all audio"),O.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,f.trigger(R.Events.AUDIO_TRACK_SWITCHED,{id:S})},E}(W.default);V.default=x},"./src/controller/audio-track-controller.ts":function(ee,V,P){"use strict";P.r(V);var Y=P("./src/events.ts"),W=P("./src/errors.ts"),R=P("./src/controller/base-playlist-controller.ts"),B=P("./src/types/loader.ts");function M(u,h){for(var s=0;s=r.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var n=r[this.trackId];this.log("Now switching to audio-track index "+i);var d=r[i],w=d.id,T=d.groupId,x=T===void 0?"":T,O=d.name,E=d.type,v=d.url;if(this.trackId=i,this.trackName=O,this.selectDefaultTrack=!1,this.hls.trigger(Y.Events.AUDIO_TRACK_SWITCHING,{id:w,groupId:x,name:O,type:E,url:v}),d.details&&!d.details.live)return;var _=this.switchParams(d.url,n==null?void 0:n.details);this.loadPlaylist(_)},s.selectInitialTrack=function(){var i=this.tracksInGroup;console.assert(i.length,"Initial audio track should be selected when tracks are known");var r=this.trackName,n=this.findTrackId(r)||this.findTrackId();n!==-1?this.setAudioTrack(n):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(Y.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},s.findTrackId=function(i){for(var r=this.tracksInGroup,n=0;nh.partTarget&&(d+=1)}if(Object(Y.isFiniteNumber)(n))return new W.HlsUrlParameters(n,Object(Y.isFiniteNumber)(d)?d:void 0,W.HlsSkip.No)}}},p.loadPlaylist=function(u){},p.shouldLoadTrack=function(u){return this.canLoad&&u&&!!u.url&&(!u.details||u.details.live)},p.playlistLoaded=function(u,h,s){var l=this,i=h.details,r=h.stats,n=r.loading.end?Math.max(0,self.performance.now()-r.loading.end):0;if(i.advancedDateTime=Date.now()-n,i.live||s!=null&&s.live){if(i.reloaded(s),s&&this.log("live playlist "+u+" "+(i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:"MISSED")),s&&i.fragments.length>0&&Object(R.mergeDetails)(s,i),!this.canLoad||!i.live)return;var d,w=void 0,T=void 0;if(i.canBlockReload&&i.endSN&&i.advanced){var x=this.hls.config.lowLatencyMode,O=i.lastPartSn,E=i.endSN,v=i.lastPartIndex,_=v!==-1,f=O===E,c=x?0:v;_?(w=f?E+1:O,T=f?c:v+1):w=E+1;var S=i.age,y=S+i.ageHeader,b=Math.min(y-i.partTarget,i.targetduration*1.5);if(b>0){if(s&&b>s.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+s.tuneInGoal+" to: "+b+" with playlist age: "+i.age),b=0;else{var N=Math.floor(b/i.targetduration);if(w+=N,T!==void 0){var F=Math.round(b%i.targetduration/i.partTarget);T+=F}this.log("CDN Tune-in age: "+i.ageHeader+"s last advanced "+S.toFixed(2)+"s goal: "+b+" skip sn "+N+" to part "+T)}i.tuneInGoal=b}if(d=this.getDeliveryDirectives(i,h.deliveryDirectives,w,T),x||!f){this.loadPlaylist(d);return}}else d=this.getDeliveryDirectives(i,h.deliveryDirectives,w,T);var X=Object(R.computeReloadInterval)(i,r);w!==void 0&&i.canBlockReload&&(X-=i.partTarget||1),this.log("reload live playlist "+u+" in "+Math.round(X)+" ms"),this.timer=self.setTimeout(function(){return l.loadPlaylist(d)},X)}else this.clearTimer()},p.getDeliveryDirectives=function(u,h,s,l){var i=Object(W.getSkipValue)(u,s);return h!=null&&h.skip&&u.deltaUpdateFailed&&(s=h.msn,l=h.part,i=W.HlsSkip.No),new W.HlsUrlParameters(s,l,i)},p.retryLoadingOrFail=function(u){var h=this,s=this.hls.config,l=this.retryCount-1&&(i=u.context)!==null&&i!==void 0&&i.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+u.details+'"'),this.loadPlaylist();else{var r=Math.min(Math.pow(2,this.retryCount)*s.levelLoadingRetryDelay,s.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return h.loadPlaylist()},r),this.warn("retry playlist loading #"+this.retryCount+" in "+r+' ms after "'+u.details+'"')}}else this.warn('cannot recover from error "'+u.details+'"'),this.clearTimer(),u.fatal=!0;return l},I}()},"./src/controller/base-stream-controller.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"State",function(){return E}),P.d(V,"default",function(){return v});var Y=P("./src/polyfills/number.ts"),W=P("./src/task-loop.ts"),R=P("./src/controller/fragment-tracker.ts"),B=P("./src/utils/buffer-helper.ts"),M=P("./src/utils/logger.ts"),L=P("./src/events.ts"),I=P("./src/errors.ts"),p=P("./src/types/transmuxer.ts"),m=P("./src/utils/mp4-tools.ts"),u=P("./src/utils/discontinuities.ts"),h=P("./src/controller/fragment-finders.ts"),s=P("./src/controller/level-helper.ts"),l=P("./src/loader/fragment-loader.ts"),i=P("./src/crypt/decrypter.ts"),r=P("./src/utils/time-ranges.ts"),n=P("./src/types/loader.ts");function d(_,f){for(var c=0;cne;(Z0&&Z&&Z.key&&Z.iv&&Z.method==="AES-128"){var H=self.performance.now();return b.decrypter.webCryptoDecrypt(new Uint8Array(X),Z.key.buffer,Z.iv.buffer).then(function(A){var z=self.performance.now();return F.trigger(L.Events.FRAG_DECRYPTED,{frag:y,payload:A,stats:{tstart:H,tdecrypt:z}}),N.payload=A,N})}return N}).then(function(N){var F=b.fragCurrent,X=b.hls,Z=b.levels;if(!Z)throw new Error("init load aborted, missing levels");var H=Z[y.level].details;console.assert(H,"Level details are defined when init segment is loaded");var A=y.stats;b.state=E.IDLE,b.fragLoadError=0,y.data=new Uint8Array(N.payload),A.parsing.start=A.buffering.start=self.performance.now(),A.parsing.end=A.buffering.end=self.performance.now(),N.frag===F&&X.trigger(L.Events.FRAG_BUFFERED,{stats:A,frag:F,part:null,id:y.type}),b.tick()}).catch(function(N){b.warn(N),b.resetFragmentLoading(y)})},c.fragContextChanged=function(y){var b=this.fragCurrent;return!y||!b||y.level!==b.level||y.sn!==b.sn||y.urlId!==b.urlId},c.fragBufferedComplete=function(y,b){var N=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+y.type+" sn: "+y.sn+(b?" part: "+b.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level+" "+r.default.toString(B.BufferHelper.getBuffered(N))),this.state=E.IDLE,this.tick()},c._handleFragmentLoadComplete=function(y){var b=this.transmuxer;if(!b)return;var N=y.frag,F=y.part,X=y.partsLoaded,Z=!X||X.length===0||X.some(function(A){return!A}),H=new p.ChunkMetadata(N.level,N.sn,N.stats.chunkCount+1,0,F?F.index:-1,!Z);b.flush(H)},c._handleFragmentLoadProgress=function(y){},c._doFragLoad=function(y,b,N,F){var X=this;if(N===void 0&&(N=null),!this.levels)throw new Error("frag load aborted, missing levels");if(N=Math.max(y.start,N||0),this.config.lowLatencyMode&&b){var Z=b.partList;if(Z&&F){N>y.end&&b.fragmentHint&&(y=b.fragmentHint);var H=this.getNextPart(Z,y,N);if(H>-1){var A=Z[H];return this.log("Loading part sn: "+y.sn+" p: "+A.index+" cc: "+y.cc+" of playlist ["+b.startSN+"-"+b.endSN+"] parts [0-"+H+"-"+(Z.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(N.toFixed(3))),this.nextLoadPosition=A.start+A.duration,this.state=E.FRAG_LOADING,this.hls.trigger(L.Events.FRAG_LOADING,{frag:y,part:Z[H],targetBufferTime:N}),this.doFragPartsLoad(y,Z,H,F).catch(function(z){return X.handleFragLoadError(z)})}else if(!y.url||this.loadedEndOfParts(Z,N))return Promise.resolve(null)}}return this.log("Loading fragment "+y.sn+" cc: "+y.cc+" "+(b?"of ["+b.startSN+"-"+b.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(N.toFixed(3))),Object(Y.isFiniteNumber)(y.sn)&&!this.bitrateTest&&(this.nextLoadPosition=y.start+y.duration),this.state=E.FRAG_LOADING,this.hls.trigger(L.Events.FRAG_LOADING,{frag:y,targetBufferTime:N}),this.fragmentLoader.load(y,F).catch(function(z){return X.handleFragLoadError(z)})},c.doFragPartsLoad=function(y,b,N,F){var X=this;return new Promise(function(Z,H){var A=[],z=function ne(ae){var me=b[ae];X.fragmentLoader.loadPart(y,me,F).then(function(xe){A[me.index]=xe;var Te=xe.part;X.hls.trigger(L.Events.FRAG_LOADED,xe);var Oe=b[ae+1];if(Oe&&Oe.fragment===y)ne(ae+1);else return Z({frag:y,part:Te,partsLoaded:A})}).catch(H)};z(N)})},c.handleFragLoadError=function(y){var b=y.data;return b&&b.details===I.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(b.frag,b.part):this.hls.trigger(L.Events.ERROR,b),null},c._handleTransmuxerFlush=function(y){var b=this.getCurrentContext(y);if(!b||this.state!==E.PARSING){this.fragCurrent||(this.state=E.IDLE);return}var N=b.frag,F=b.part,X=b.level,Z=self.performance.now();N.stats.parsing.end=Z,F&&(F.stats.parsing.end=Z),this.updateLevelTiming(N,F,X,y.partial)},c.getCurrentContext=function(y){var b=this.levels,N=y.level,F=y.sn,X=y.part;if(!b||!b[N])return this.warn("Levels object was unset while buffering fragment "+F+" of level "+N+". The current chunk will not be buffered."),null;var Z=b[N],H=X>-1?Object(s.getPartWith)(Z,F,X):null,A=H?H.fragment:Object(s.getFragmentWithSN)(Z,F,this.fragCurrent);return A?{frag:A,part:H,level:Z}:null},c.bufferFragmentData=function(y,b,N,F){if(!y||this.state!==E.PARSING)return;var X=y.data1,Z=y.data2,H=X;if(X&&Z&&(H=Object(m.appendUint8Array)(X,Z)),!H||!H.length)return;var A={type:y.type,frag:b,part:N,chunkMeta:F,parent:b.type,data:H};this.hls.trigger(L.Events.BUFFER_APPENDING,A),y.dropped&&y.independent&&!N&&this.flushBufferGap(b)},c.flushBufferGap=function(y){var b=this.media;if(!b)return;if(!B.BufferHelper.isBuffered(b,b.currentTime)){this.flushMainBuffer(0,y.start);return}var N=b.currentTime,F=B.BufferHelper.bufferInfo(b,N,0),X=y.duration,Z=Math.min(this.config.maxFragLookUpTolerance*2,X*.25),H=Math.max(Math.min(y.start-Z,F.end-Z),N+Z);y.start-H>Z&&this.flushMainBuffer(H,y.start)},c.getFwdBufferInfo=function(y,b){var N=this.config,F=this.getLoadPosition();if(!Object(Y.isFiniteNumber)(F))return null;var X=B.BufferHelper.bufferInfo(y,F,N.maxBufferHole);if(X.len===0&&X.nextStart!==void 0){var Z=this.fragmentTracker.getBufferedFrag(F,b);if(Z&&X.nextStart=N?(b.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+b.maxMaxBufferLength+"s"),!0):!1},c.getNextFragment=function(y,b){var N,F,X=b.fragments,Z=X.length;if(!Z)return null;var H=this.config,A=X[0].start,z;if(b.live){var ne=H.initialLiveManifestSize;if(Z-1&&NN.start&&N.loaded},c.getInitialLiveFragment=function(y,b){var N=this.fragPrevious,F=null;if(N){if(y.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+N.programDateTime),F=Object(h.findFragmentByPDT)(b,N.endProgramDateTime,this.config.maxFragLookUpTolerance)),!F){var X=N.sn+1;if(X>=y.startSN&&X<=y.endSN){var Z=b[X-y.startSN];N.cc===Z.cc&&(F=Z,this.log("Live playlist, switching playlist, load frag with next SN: "+F.sn))}F||(F=Object(h.findFragWithCC)(b,N.cc),F&&this.log("Live playlist, switching playlist, load frag with same CC: "+F.sn))}}else{var H=this.hls.liveSyncPosition;H!==null&&(F=this.getFragmentAtPosition(H,this.bitrateTest?y.fragmentEnd:y.edge,y))}return F},c.getFragmentAtPosition=function(y,b,N){var F=this.config,X=this.fragPrevious,Z=N.fragments,H=N.endSN,A=N.fragmentHint,z=F.maxFragLookUpTolerance,ne=!!(F.lowLatencyMode&&N.partList&&A);ne&&A&&!this.bitrateTest&&(Z=Z.concat(A),H=A.sn);var ae;if(yb-z?0:z;ae=Object(h.findFragmentByPTS)(X,Z,y,me)}else ae=Z[Z.length-1];if(ae){var xe=ae.sn-N.startSN,Te=X&&ae.level===X.level,Oe=Z[xe+1],Ue=this.fragmentTracker.getState(ae);if(Ue===R.FragmentState.BACKTRACKED){ae=null;for(var De=xe;Z[De]&&this.fragmentTracker.getState(Z[De])===R.FragmentState.BACKTRACKED;)X?ae=Z[De--]:ae=Z[--De];ae||(ae=Oe)}else X&&ae.sn===X.sn&&!ne&&(Te&&(ae.sn=Z-b.maxFragLookUpTolerance&&X<=H;if(F!==null&&N.duration>F&&(X"+y.startSN+" prev-sn: "+(X?X.sn:"na")+" fragments: "+H),ae}return A},c.waitForCdnTuneIn=function(y){var b=3;return y.live&&y.canBlockReload&&y.tuneInGoal>Math.max(y.partHoldBack,y.partTarget*b)},c.setStartPosition=function(y,b){var N=this.startPosition;if(N"+y))}}]),f}(W.default)},"./src/controller/buffer-controller.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"default",function(){return h});var Y=P("./src/polyfills/number.ts"),W=P("./src/events.ts"),R=P("./src/utils/logger.ts"),B=P("./src/errors.ts"),M=P("./src/utils/buffer-helper.ts"),L=P("./src/utils/mediasource-helper.ts"),I=P("./src/loader/fragment.ts"),p=P("./src/controller/buffer-operation-queue.ts"),m=Object(L.getMediaSource)(),u=/([ha]vc.)(?:\.[^.,]+)+/,h=function(){function s(i){var r=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 n=r.hls,d=r.media,w=r.mediaSource;R.logger.log("[buffer-controller]: Media source opened"),d&&(r.updateMediaElementDuration(),n.trigger(W.Events.MEDIA_ATTACHED,{media:d})),w&&w.removeEventListener("sourceopen",r._onMediaSourceOpen),r.checkPendingTracks()},this._onMediaSourceClose=function(){R.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){R.logger.log("[buffer-controller]: Media source ended")},this.hls=i,this._initSourceBuffer(),this.registerListeners()}var l=s.prototype;return l.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},l.destroy=function(){this.unregisterListeners(),this.details=null},l.registerListeners=function(){var r=this.hls;r.on(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(W.Events.BUFFER_RESET,this.onBufferReset,this),r.on(W.Events.BUFFER_APPENDING,this.onBufferAppending,this),r.on(W.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.on(W.Events.BUFFER_EOS,this.onBufferEos,this),r.on(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),r.on(W.Events.LEVEL_UPDATED,this.onLevelUpdated,this),r.on(W.Events.FRAG_PARSED,this.onFragParsed,this),r.on(W.Events.FRAG_CHANGED,this.onFragChanged,this)},l.unregisterListeners=function(){var r=this.hls;r.off(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(W.Events.BUFFER_RESET,this.onBufferReset,this),r.off(W.Events.BUFFER_APPENDING,this.onBufferAppending,this),r.off(W.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.off(W.Events.BUFFER_EOS,this.onBufferEos,this),r.off(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),r.off(W.Events.LEVEL_UPDATED,this.onLevelUpdated,this),r.off(W.Events.FRAG_PARSED,this.onFragParsed,this),r.off(W.Events.FRAG_CHANGED,this.onFragChanged,this)},l._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new p.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},l.onManifestParsed=function(r,n){var d=2;(n.audio&&!n.video||!n.altAudio)&&(d=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=d,this.details=null,R.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},l.onMediaAttaching=function(r,n){var d=this.media=n.media;if(d&&m){var w=this.mediaSource=new m;w.addEventListener("sourceopen",this._onMediaSourceOpen),w.addEventListener("sourceended",this._onMediaSourceEnded),w.addEventListener("sourceclose",this._onMediaSourceClose),d.src=self.URL.createObjectURL(w),this._objectUrl=d.src}},l.onMediaDetaching=function(){var r=this.media,n=this.mediaSource,d=this._objectUrl;if(n){if(R.logger.log("[buffer-controller]: media source detaching"),n.readyState==="open")try{n.endOfStream()}catch(w){R.logger.warn("[buffer-controller]: onMediaDetaching: "+w.message+" while calling endOfStream")}this.onBufferReset(),n.removeEventListener("sourceopen",this._onMediaSourceOpen),n.removeEventListener("sourceended",this._onMediaSourceEnded),n.removeEventListener("sourceclose",this._onMediaSourceClose),r&&(d&&self.URL.revokeObjectURL(d),r.src===d?(r.removeAttribute("src"),r.load()):R.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(W.Events.MEDIA_DETACHED,void 0)},l.onBufferReset=function(){var r=this;this.getSourceBufferTypes().forEach(function(n){var d=r.sourceBuffer[n];try{d&&(r.removeBufferListeners(n),r.mediaSource&&r.mediaSource.removeSourceBuffer(d),r.sourceBuffer[n]=void 0)}catch(w){R.logger.warn("[buffer-controller]: Failed to reset the "+n+" buffer",w)}}),this._initSourceBuffer()},l.onBufferCodecs=function(r,n){var d=this,w=this.getSourceBufferTypes().length;if(Object.keys(n).forEach(function(T){if(w){var x=d.tracks[T];if(x&&typeof x.buffer.changeType=="function"){var O=n[T],E=O.codec,v=O.levelCodec,_=O.container,f=(x.levelCodec||x.codec).replace(u,"$1"),c=(v||E).replace(u,"$1");if(f!==c){var S=_+";codecs="+(v||E);d.appendChangeType(T,S)}}}else d.pendingTracks[T]=n[T]}),w)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},l.appendChangeType=function(r,n){var d=this,w=this.operationQueue,T={execute:function(){var O=d.sourceBuffer[r];O&&(R.logger.log("[buffer-controller]: changing "+r+" sourceBuffer type to "+n),O.changeType(n)),w.shiftAndExecuteNext(r)},onStart:function(){},onComplete:function(){},onError:function(O){R.logger.warn("[buffer-controller]: Failed to change "+r+" SourceBuffer type",O)}};w.append(T,r)},l.onBufferAppending=function(r,n){var d=this,w=this.hls,T=this.operationQueue,x=this.tracks,O=n.data,E=n.type,v=n.frag,_=n.part,f=n.chunkMeta,c=f.buffering[E],S=self.performance.now();c.start=S;var y=v.stats.buffering,b=_?_.stats.buffering:null;y.start===0&&(y.start=S),b&&b.start===0&&(b.start=S);var N=x.audio,F=E==="audio"&&f.id===1&&(N==null?void 0:N.container)==="audio/mpeg",X={execute:function(){if(c.executeStart=self.performance.now(),F){var H=d.sourceBuffer[E];if(H){var A=v.start-H.timestampOffset;Math.abs(A)>=.1&&(R.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+v.start+" (delta: "+A+") sn: "+v.sn+")"),H.timestampOffset=v.start)}}d.appendExecutor(O,E)},onStart:function(){},onComplete:function(){var H=self.performance.now();c.executeEnd=c.end=H,y.first===0&&(y.first=H),b&&b.first===0&&(b.first=H);var A=d.sourceBuffer,z={};for(var ne in A)z[ne]=M.BufferHelper.getBuffered(A[ne]);d.appendError=0,d.hls.trigger(W.Events.BUFFER_APPENDED,{type:E,frag:v,part:_,chunkMeta:f,parent:v.type,timeRanges:z})},onError:function(H){R.logger.error("[buffer-controller]: Error encountered while trying to append to the "+E+" SourceBuffer",H);var A={type:B.ErrorTypes.MEDIA_ERROR,parent:v.type,details:B.ErrorDetails.BUFFER_APPEND_ERROR,err:H,fatal:!1};H.code===DOMException.QUOTA_EXCEEDED_ERR?A.details=B.ErrorDetails.BUFFER_FULL_ERROR:(d.appendError++,A.details=B.ErrorDetails.BUFFER_APPEND_ERROR,d.appendError>w.config.appendErrorMaxRetry&&(R.logger.error("[buffer-controller]: Failed "+w.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),A.fatal=!0)),w.trigger(W.Events.ERROR,A)}};T.append(X,E)},l.onBufferFlushing=function(r,n){var d=this,w=this.operationQueue,T=function(O){return{execute:d.removeExecutor.bind(d,O,n.startOffset,n.endOffset),onStart:function(){},onComplete:function(){d.hls.trigger(W.Events.BUFFER_FLUSHED,{type:O})},onError:function(v){R.logger.warn("[buffer-controller]: Failed to remove from "+O+" SourceBuffer",v)}}};n.type?w.append(T(n.type),n.type):this.getSourceBufferTypes().forEach(function(x){w.append(T(x),x)})},l.onFragParsed=function(r,n){var d=this,w=n.frag,T=n.part,x=[],O=T?T.elementaryStreams:w.elementaryStreams;O[I.ElementaryStreamTypes.AUDIOVIDEO]?x.push("audiovideo"):(O[I.ElementaryStreamTypes.AUDIO]&&x.push("audio"),O[I.ElementaryStreamTypes.VIDEO]&&x.push("video"));var E=function(){var _=self.performance.now();w.stats.buffering.end=_,T&&(T.stats.buffering.end=_);var f=T?T.stats:w.stats;d.hls.trigger(W.Events.FRAG_BUFFERED,{frag:w,part:T,stats:f,id:w.type})};x.length===0&&R.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+w.type+" level: "+w.level+" sn: "+w.sn),this.blockBuffers(E,x)},l.onFragChanged=function(r,n){this.flushBackBuffer()},l.onBufferEos=function(r,n){var d=this,w=this.getSourceBufferTypes().reduce(function(T,x){var O=d.sourceBuffer[x];return(!n.type||n.type===x)&&(O&&!O.ended&&(O.ended=!0,R.logger.log("[buffer-controller]: "+x+" sourceBuffer now EOS"))),T&&!!(!O||O.ended)},!0);w&&this.blockBuffers(function(){var T=d.mediaSource;if(!T||T.readyState!=="open")return;T.endOfStream()})},l.onLevelUpdated=function(r,n){var d=n.details;if(!d.fragments.length)return;this.details=d,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},l.flushBackBuffer=function(){var r=this.hls,n=this.details,d=this.media,w=this.sourceBuffer;if(!d||n===null)return;var T=this.getSourceBufferTypes();if(!T.length)return;var x=n.live&&r.config.liveBackBufferLength!==null?r.config.liveBackBufferLength:r.config.backBufferLength;if(!Object(Y.isFiniteNumber)(x)||x<0)return;var O=d.currentTime,E=n.levelTargetDuration,v=Math.max(x,E),_=Math.floor(O/E)*E-v;T.forEach(function(f){var c=w[f];if(c){var S=M.BufferHelper.getBuffered(c);S.length>0&&_>S.start(0)&&(r.trigger(W.Events.BACK_BUFFER_REACHED,{bufferEnd:_}),n.live&&r.trigger(W.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:_}),r.trigger(W.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:_,type:f}))}})},l.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var r=this.details,n=this.hls,d=this.media,w=this.mediaSource,T=r.fragments[0].start+r.totalduration,x=d.duration,O=Object(Y.isFiniteNumber)(w.duration)?w.duration:0;r.live&&n.config.liveDurationInfinity?(R.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),w.duration=Infinity,this.updateSeekableRange(r)):(T>O&&T>x||!Object(Y.isFiniteNumber)(x))&&(R.logger.log("[buffer-controller]: Updating Media Source duration to "+T.toFixed(3)),w.duration=T)},l.updateSeekableRange=function(r){var n=this.mediaSource,d=r.fragments,w=d.length;if(w&&r.live&&n!==null&&n!==void 0&&n.setLiveSeekableRange){var T=Math.max(0,d[0].start),x=Math.max(T,T+r.totalduration);n.setLiveSeekableRange(T,x)}},l.checkPendingTracks=function(){var r=this.bufferCodecEventsExpected,n=this.operationQueue,d=this.pendingTracks,w=Object.keys(d).length;if(w&&!r||w===2){this.createSourceBuffers(d),this.pendingTracks={};var T=this.getSourceBufferTypes();if(T.length===0){this.hls.trigger(W.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}T.forEach(function(x){n.executeNext(x)})}},l.createSourceBuffers=function(r){var n=this.sourceBuffer,d=this.mediaSource;if(!d)throw Error("createSourceBuffers called when mediaSource was null");var w=0;for(var T in r)if(!n[T]){var x=r[T];if(!x)throw Error("source buffer exists for track "+T+", however track does not");var O=x.levelCodec||x.codec,E=x.container+";codecs="+O;R.logger.log("[buffer-controller]: creating sourceBuffer("+E+")");try{var v=n[T]=d.addSourceBuffer(E),_=T;this.addBufferListener(_,"updatestart",this._onSBUpdateStart),this.addBufferListener(_,"updateend",this._onSBUpdateEnd),this.addBufferListener(_,"error",this._onSBUpdateError),this.tracks[T]={buffer:v,codec:O,container:x.container,levelCodec:x.levelCodec,id:x.id},w++}catch(f){R.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+f.message),this.hls.trigger(W.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:f,mimeType:E})}}w&&this.hls.trigger(W.Events.BUFFER_CREATED,{tracks:this.tracks})},l._onSBUpdateStart=function(r){var n=this.operationQueue,d=n.current(r);d.onStart()},l._onSBUpdateEnd=function(r){var n=this.operationQueue,d=n.current(r);d.onComplete(),n.shiftAndExecuteNext(r)},l._onSBUpdateError=function(r,n){R.logger.error("[buffer-controller]: "+r+" SourceBuffer error",n),this.hls.trigger(W.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var d=this.operationQueue.current(r);d&&d.onError(n)},l.removeExecutor=function(r,n,d){var w=this.media,T=this.mediaSource,x=this.operationQueue,O=this.sourceBuffer,E=O[r];if(!w||!T||!E){R.logger.warn("[buffer-controller]: Attempting to remove from the "+r+" SourceBuffer, but it does not exist"),x.shiftAndExecuteNext(r);return}var v=Object(Y.isFiniteNumber)(w.duration)?w.duration:Infinity,_=Object(Y.isFiniteNumber)(T.duration)?T.duration:Infinity,f=Math.max(0,n),c=Math.min(d,v,_);c>f?(R.logger.log("[buffer-controller]: Removing ["+f+","+c+"] from the "+r+" SourceBuffer"),console.assert(!E.updating,r+" sourceBuffer must not be updating"),E.remove(f,c)):x.shiftAndExecuteNext(r)},l.appendExecutor=function(r,n){var d=this.operationQueue,w=this.sourceBuffer,T=w[n];if(!T){R.logger.warn("[buffer-controller]: Attempting to append to the "+n+" SourceBuffer, but it does not exist"),d.shiftAndExecuteNext(n);return}T.ended=!1,console.assert(!T.updating,n+" sourceBuffer must not be updating"),T.appendBuffer(r)},l.blockBuffers=function(r,n){var d=this;if(n===void 0&&(n=this.getSourceBufferTypes()),!n.length){R.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(r);return}var w=this.operationQueue,T=n.map(function(x){return w.appendBlocker(x)});Promise.all(T).then(function(){r(),n.forEach(function(x){var O=d.sourceBuffer[x];(!O||!O.updating)&&w.shiftAndExecuteNext(x)})})},l.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},l.addBufferListener=function(r,n,d){var w=this.sourceBuffer[r];if(!w)return;var T=d.bind(this,r);this.listeners[r].push({event:n,listener:T}),w.addEventListener(n,T)},l.removeBufferListeners=function(r){var n=this.sourceBuffer[r];if(!n)return;this.listeners[r].forEach(function(d){n.removeEventListener(d.event,d.listener)})},s}()},"./src/controller/buffer-operation-queue.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"default",function(){return W});var Y=P("./src/utils/logger.ts"),W=function(){function R(M){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=M}var B=R.prototype;return B.append=function(L,I){var p=this.queues[I];p.push(L),p.length===1&&this.buffers[I]&&this.executeNext(I)},B.insertAbort=function(L,I){var p=this.queues[I];p.unshift(L),this.executeNext(I)},B.appendBlocker=function(L){var I,p=new Promise(function(u){I=u}),m={execute:I,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(m,L),p},B.executeNext=function(L){var I=this.buffers,p=this.queues,m=I[L],u=p[L];if(u.length){var h=u[0];try{h.execute()}catch(s){Y.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),h.onError(s),(!m||!m.updating)&&(u.shift(),this.executeNext(L))}}},B.shiftAndExecuteNext=function(L){this.queues[L].shift(),this.executeNext(L)},B.current=function(L){return this.queues[L][0]},R}()},"./src/controller/cap-level-controller.ts":function(ee,V,P){"use strict";P.r(V);var Y=P("./src/events.ts");function W(M,L){for(var I=0;I0&&this.mediaWidth>0){var p=this.hls.levels;if(p.length){var m=this.hls;m.autoLevelCapping=this.getMaxLevel(p.length-1),m.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=m.autoLevelCapping}}},L.getMaxLevel=function(p){var m=this,u=this.hls.levels;if(!u.length)return-1;var h=u.filter(function(s,l){return M.isLevelAllowed(l,m.restrictedLevels)&&l<=p});return this.clientRect=null,M.getMaxLevelByMediaSize(h,this.mediaWidth,this.mediaHeight)},L.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()},L.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},L.getDimensions=function(){if(this.clientRect)return this.clientRect;var p=this.media,m={width:0,height:0};if(p){var u=p.getBoundingClientRect();m.width=u.width,m.height=u.height,!m.width&&!m.height&&(m.width=u.right-u.left||p.width||0,m.height=u.bottom-u.top||p.height||0)}return this.clientRect=m,m},M.isLevelAllowed=function(p,m){return m===void 0&&(m=[]),m.indexOf(p)===-1},M.getMaxLevelByMediaSize=function(p,m,u){if(!p||!p.length)return-1;for(var h=function(n,d){return d?n.width!==d.width||n.height!==d.height:!0},s=p.length-1,l=0;l=m||i.height>=u)&&h(i,p[l+1])){s=l;break}}return s},R(M,[{key:"mediaWidth",get:function(){return this.getDimensions().width*M.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*M.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var p=1;try{p=self.devicePixelRatio}catch(m){}return p}}]),M}();V.default=B},"./src/controller/cmcd-controller.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"default",function(){return h});var Y=P("./src/events.ts"),W=P("./src/types/cmcd.ts"),R=P("./src/utils/buffer-helper.ts"),B=P("./src/utils/logger.ts");function M(s,l){for(var i=0;i=s.length?{done:!0}:{done:!1,value:s[r++]}}}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 p(s,l){if(!s)return;if(typeof s=="string")return m(s,l);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 m(s,l)}function m(s,l){(l==null||l>s.length)&&(l=s.length);for(var i=0,r=new Array(l);in&&(n=x.bitrate)}return n>0?n:NaN},l.getBufferLength=function(r){var n=this.hls.media,d=r===W.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!d||!n)return NaN;var w=R.BufferHelper.bufferInfo(d,n.currentTime,this.config.maxBufferHole);return w.len*1e3},l.createPlaylistLoader=function(){var r=this.config.pLoader,n=this.applyPlaylistData,d=r||this.config.loader;return function(){function w(x){this.loader=void 0,this.loader=new d(x)}var T=w.prototype;return T.destroy=function(){this.loader.destroy()},T.abort=function(){this.loader.abort()},T.load=function(O,E,v){n(O),this.loader.load(O,E,v)},L(w,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),w}()},l.createFragmentLoader=function(){var r=this.config.fLoader,n=this.applyFragmentData,d=r||this.config.loader;return function(){function w(x){this.loader=void 0,this.loader=new d(x)}var T=w.prototype;return T.destroy=function(){this.loader.destroy()},T.abort=function(){this.loader.abort()},T.load=function(O,E,v){n(O),this.loader.load(O,E,v)},L(w,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),w}()},s.uuid=function(){var r=URL.createObjectURL(new Blob),n=r.toString();return URL.revokeObjectURL(r),n.substr(n.lastIndexOf("/")+1)},s.serialize=function(r){for(var n=[],d=function(F){return!Number.isNaN(F)&&F!=null&&F!==""&&F!==!1},w=function(F){return Math.round(F)},T=function(F){return w(F/100)*100},x=function(F){return encodeURIComponent(F)},O={br:w,d:w,bl:T,dl:T,mtp:T,nor:x,rtp:T,tb:w},E=Object.keys(r||{}).sort(),v=I(E),_;!(_=v()).done;){var f=_.value,c=r[f];if(!d(c))continue;if(f==="v"&&c===1)continue;if(f=="pr"&&c===1)continue;var S=O[f];S&&(c=S(c));var y=typeof c,b=void 0;f==="ot"||f==="sf"||f==="st"?b=f+"="+c:y==="boolean"?b=f:y==="number"?b=f+"="+c:b=f+"="+JSON.stringify(c),n.push(b)}return n.join(",")},s.toHeaders=function(r){for(var n=Object.keys(r),d={},w=["Object","Request","Session","Status"],T=[{},{},{},{}],x={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},O=0,E=n;OI){this.hls.trigger(Y.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var x=I-this._requestLicenseFailureCount+1;R.logger.warn("Retrying license request, "+x+" attempts left"),this._requestLicense(n,d)}break}},s._generateLicenseRequestChallenge=function(i,r){switch(i.mediaKeySystemDomain){case B.KeySystems.WIDEVINE:return r}throw new Error("unsupported key-system: "+i.mediaKeySystemDomain)},s._requestLicense=function(i,r){R.logger.log("Requesting content license for key-system");var n=this._mediaKeysList[0];if(!n){R.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(Y.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var d=this.getLicenseServerUrl(n.mediaKeySystemDomain),w=this._createLicenseXhr(d,i,r);R.logger.log("Sending license request to URL: "+d);var T=this._generateLicenseRequestChallenge(n,i);w.send(T)}catch(x){R.logger.error("Failure requesting DRM license: "+x),this.hls.trigger(Y.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},s.onMediaAttached=function(i,r){if(!this._emeEnabled)return;var n=r.media;this._media=n,n.addEventListener("encrypted",this._onMediaEncrypted)},s.onMediaDetached=function(){var i=this._media,r=this._mediaKeysList;if(!i)return;i.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(r.map(function(n){if(n.mediaKeysSession)return n.mediaKeysSession.close().catch(function(){})})).then(function(){return i.setMediaKeys(null)}).catch(function(){})},s.onManifestParsed=function(i,r){if(!this._emeEnabled)return;var n=r.levels.map(function(w){return w.audioCodec}).filter(function(w){return!!w}),d=r.levels.map(function(w){return w.videoCodec}).filter(function(w){return!!w});this._attemptKeySystemAccess(B.KeySystems.WIDEVINE,n,d)},L(h,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),h}();V.default=u},"./src/controller/fps-controller.ts":function(ee,V,P){"use strict";P.r(V);var Y=P("./src/events.ts"),W=P("./src/utils/logger.ts"),R=function(){function B(L){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=L,this.registerListeners()}var M=B.prototype;return M.setStreamController=function(I){this.streamController=I},M.registerListeners=function(){this.hls.on(Y.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},M.unregisterListeners=function(){this.hls.off(Y.Events.MEDIA_ATTACHING,this.onMediaAttaching)},M.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},M.onMediaAttaching=function(I,p){var m=this.hls.config;if(m.capLevelOnFPSDrop){var u=p.media instanceof self.HTMLVideoElement?p.media:null;this.media=u,u&&typeof u.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),m.fpsDroppedMonitoringPeriod)}},M.checkFPS=function(I,p,m){var u=performance.now();if(p){if(this.lastTime){var h=u-this.lastTime,s=m-this.lastDroppedFrames,l=p-this.lastDecodedFrames,i=1e3*s/h,r=this.hls;if(r.trigger(Y.Events.FPS_DROP,{currentDropped:s,currentDecoded:l,totalDroppedFrames:m}),i>0&&s>r.config.fpsDroppedMonitoringThreshold*l){var n=r.currentLevel;W.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+n),n>0&&(r.autoLevelCapping===-1||r.autoLevelCapping>=n)&&(n=n-1,r.trigger(Y.Events.FPS_DROP_LEVEL_CAPPING,{level:n,droppedLevel:r.currentLevel}),r.autoLevelCapping=n,this.streamController.nextLevelSwitch())}}this.lastTime=u,this.lastDroppedFrames=m,this.lastDecodedFrames=p}},M.checkFPSInterval=function(){var I=this.media;if(I)if(this.isVideoPlaybackQualityAvailable){var p=I.getVideoPlaybackQuality();this.checkFPS(I,p.totalVideoFrames,p.droppedVideoFrames)}else this.checkFPS(I,I.webkitDecodedFrameCount,I.webkitDroppedFrameCount)},B}();V.default=R},"./src/controller/fragment-finders.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"findFragmentByPDT",function(){return R}),P.d(V,"findFragmentByPTS",function(){return B}),P.d(V,"fragmentWithinToleranceTest",function(){return M}),P.d(V,"pdtWithinToleranceTest",function(){return L}),P.d(V,"findFragWithCC",function(){return I});var Y=P("./src/polyfills/number.ts"),W=P("./src/utils/binary-search.ts");function R(p,m,u){if(m===null||!Array.isArray(p)||!p.length||!Object(Y.isFiniteNumber)(m))return null;var h=p[0].programDateTime;if(m<(h||0))return null;var s=p[p.length-1].endProgramDateTime;if(m>=(s||0))return null;u=u||0;for(var l=0;lp&&u.start?-1:0}function L(p,m,u){var h=Math.min(m,u.duration+(u.deltaPTS?u.deltaPTS:0))*1e3,s=u.endProgramDateTime||0;return s-h>p}function I(p,m){return W.default.search(p,function(u){return u.ccm?-1:0})}},"./src/controller/fragment-tracker.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"FragmentState",function(){return R}),P.d(V,"FragmentTracker",function(){return B});var Y=P("./src/events.ts"),W=P("./src/types/loader.ts"),R;(function(I){I.NOT_LOADED="NOT_LOADED",I.BACKTRACKED="BACKTRACKED",I.APPENDING="APPENDING",I.PARTIAL="PARTIAL",I.OK="OK"})(R||(R={}));var B=function(){function I(m){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=m,this._registerListeners()}var p=I.prototype;return p._registerListeners=function(){var u=this.hls;u.on(Y.Events.BUFFER_APPENDED,this.onBufferAppended,this),u.on(Y.Events.FRAG_BUFFERED,this.onFragBuffered,this),u.on(Y.Events.FRAG_LOADED,this.onFragLoaded,this)},p._unregisterListeners=function(){var u=this.hls;u.off(Y.Events.BUFFER_APPENDED,this.onBufferAppended,this),u.off(Y.Events.FRAG_BUFFERED,this.onFragBuffered,this),u.off(Y.Events.FRAG_LOADED,this.onFragLoaded,this)},p.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},p.getAppendedFrag=function(u,h){if(h===W.PlaylistLevelType.MAIN){var s=this.activeFragment,l=this.activeParts;if(!s)return null;if(l)for(var i=l.length;i--;){var r=l[i],n=r?r.end:s.appendedPTS;if(r.start<=u&&n!==void 0&&u<=n)return i>9&&(this.activeParts=l.slice(i-9)),r}else if(s.start<=u&&s.appendedPTS!==void 0&&u<=s.appendedPTS)return s}return this.getBufferedFrag(u,h)},p.getBufferedFrag=function(u,h){for(var s=this.fragments,l=Object.keys(s),i=l.length;i--;){var r=s[l[i]];if((r==null?void 0:r.body.type)===h&&r.buffered){var n=r.body;if(n.start<=u&&u<=n.end)return n}}return null},p.detectEvictedFragments=function(u,h,s){var l=this;Object.keys(this.fragments).forEach(function(i){var r=l.fragments[i];if(!r)return;if(!r.buffered){r.body.type===s&&l.removeFragment(r.body);return}var n=r.range[u];if(!n)return;n.time.some(function(d){var w=!l.isTimeBuffered(d.startPTS,d.endPTS,h);return w&&l.removeFragment(r.body),w})})},p.detectPartialFragments=function(u){var h=this,s=this.timeRanges,l=u.frag,i=u.part;if(!s||l.sn==="initSegment")return;var r=L(l),n=this.fragments[r];if(!n)return;Object.keys(s).forEach(function(d){var w=l.elementaryStreams[d];if(!w)return;var T=s[d],x=i!==null||w.partial===!0;n.range[d]=h.getBufferedTimes(l,i,x,T)}),n.backtrack=n.loaded=null,Object.keys(n.range).length?n.buffered=!0:this.removeFragment(n.body)},p.fragBuffered=function(u){var h=L(u),s=this.fragments[h];s&&(s.backtrack=s.loaded=null,s.buffered=!0)},p.getBufferedTimes=function(u,h,s,l){for(var i={time:[],partial:s},r=h?h.start:u.start,n=h?h.end:u.end,d=u.minEndPTS||n,w=u.maxStartPTS||r,T=0;T=x&&d<=O){i.time.push({startPTS:Math.max(r,l.start(T)),endPTS:Math.min(n,l.end(T))});break}else if(rx)i.partial=!0,i.time.push({startPTS:Math.max(r,l.start(T)),endPTS:Math.min(n,l.end(T))});else if(n<=x)break}return i},p.getPartialFragment=function(u){var h=null,s,l,i,r=0,n=this.bufferPadding,d=this.fragments;return Object.keys(d).forEach(function(w){var T=d[w];if(!T)return;M(T)&&(l=T.body.start-n,i=T.body.end+n,u>=l&&u<=i&&(s=Math.min(u-l,i-u),r<=s&&(h=T.body,r=s)))}),h},p.getState=function(u){var h=L(u),s=this.fragments[h];return s?s.buffered?M(s)?R.PARTIAL:R.OK:s.backtrack?R.BACKTRACKED:R.APPENDING:R.NOT_LOADED},p.backtrack=function(u,h){var s=L(u),l=this.fragments[s];if(!l||l.backtrack)return null;var i=l.backtrack=h||l.loaded;return l.loaded=null,i},p.getBacktrackData=function(u){var h=L(u),s=this.fragments[h];if(s){var l,i=s.backtrack;if(i!=null&&(l=i.payload)!==null&&l!==void 0&&l.byteLength)return i;this.removeFragment(u)}return null},p.isTimeBuffered=function(u,h,s){for(var l,i,r=0;r=l&&h<=i)return!0;if(h<=l)return!1}return!1},p.onFragLoaded=function(u,h){var s=h.frag,l=h.part;if(s.sn==="initSegment"||s.bitrateTest||l)return;var i=L(s);this.fragments[i]={body:s,loaded:h,backtrack:null,buffered:!1,range:Object.create(null)}},p.onBufferAppended=function(u,h){var s=this,l=h.frag,i=h.part,r=h.timeRanges;if(l.type===W.PlaylistLevelType.MAIN)if(this.activeFragment=l,i){var n=this.activeParts;n||(this.activeParts=n=[]),n.push(i)}else this.activeParts=null;this.timeRanges=r,Object.keys(r).forEach(function(d){var w=r[d];if(s.detectEvictedFragments(d,w),!i)for(var T=0;Tu&&l.removeFragment(n)}})},p.removeFragment=function(u){var h=L(u);u.stats.loaded=0,u.clearElementaryStreamInfo(),delete this.fragments[h]},p.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},I}();function M(I){var p,m;return I.buffered&&(((p=I.range.video)===null||p===void 0?void 0:p.partial)||((m=I.range.audio)===null||m===void 0?void 0:m.partial))}function L(I){return I.type+"_"+I.level+"_"+I.urlId+"_"+I.sn}},"./src/controller/gap-controller.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"STALL_MINIMUM_DURATION_MS",function(){return M}),P.d(V,"MAX_START_GAP_JUMP",function(){return L}),P.d(V,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return I}),P.d(V,"SKIP_BUFFER_RANGE_START",function(){return p}),P.d(V,"default",function(){return m});var Y=P("./src/utils/buffer-helper.ts"),W=P("./src/errors.ts"),R=P("./src/events.ts"),B=P("./src/utils/logger.ts"),M=250,L=2,I=.1,p=.05,m=function(){function u(s,l,i,r){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=s,this.media=l,this.fragmentTracker=i,this.hls=r}var h=u.prototype;return h.destroy=function(){this.hls=this.fragmentTracker=this.media=null},h.poll=function(l){var i=this.config,r=this.media,n=this.stalled,d=r.currentTime,w=r.seeking,T=this.seeking&&!w,x=!this.seeking&&w;if(this.seeking=w,d!==l){if(this.moved=!0,n!==null){if(this.stallReported){var O=self.performance.now()-n;B.logger.warn("playback not stuck anymore @"+d+", after "+Math.round(O)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((x||T)&&(this.stalled=null),r.paused||r.ended||r.playbackRate===0||!Y.BufferHelper.getBuffered(r).length)return;var E=Y.BufferHelper.bufferInfo(r,d,0),v=E.len>0,_=E.nextStart||0;if(!v&&!_)return;if(w){var f=E.len>L,c=!_||_-d>L&&!this.fragmentTracker.getPartialFragment(d);if(f||c)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var S,y=Math.max(_,E.start||0)-d,b=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,N=b==null||((S=b.details)===null||S===void 0)?void 0:S.live,F=N?b.details.targetduration*2:L;if(y>0&&y<=F){this._trySkipBufferHole(null);return}}var X=self.performance.now();if(n===null){this.stalled=X;return}var Z=X-n;!w&&Z>=M&&this._reportStall(E.len);var H=Y.BufferHelper.bufferInfo(r,d,i.maxBufferHole);this._tryFixBufferStall(H,Z)},h._tryFixBufferStall=function(l,i){var r=this.config,n=this.fragmentTracker,d=this.media,w=d.currentTime,T=n.getPartialFragment(w);if(T){var x=this._trySkipBufferHole(T);if(x)return}l.len>r.maxBufferHole&&i>r.highBufferWatchdogPeriod*1e3&&(B.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},h._reportStall=function(l){var i=this.hls,r=this.media,n=this.stallReported;n||(this.stallReported=!0,B.logger.warn("Playback stalling at @"+r.currentTime+" due to low buffer (buffer="+l+")"),i.trigger(R.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:l}))},h._trySkipBufferHole=function(l){for(var i=this.config,r=this.hls,n=this.media,d=n.currentTime,w=0,T=Y.BufferHelper.getBuffered(n),x=0;x=w&&d.05&&this.forwardBufferLength>1){var x=Math.min(2,Math.max(1,r)),O=Math.round(2/(1+Math.exp(-.75*d-this.edgeStalled))*20)/20;u.playbackRate=Math.min(x,Math.max(1,O))}else u.playbackRate!==1&&u.playbackRate!==0&&(u.playbackRate=1)},p.estimateLiveEdge=function(){var u=this.levelDetails;return u===null?null:u.edge+u.age},p.computeLatency=function(){var u=this.estimateLiveEdge();return u===null?null:u-this.currentTime},M(I,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var u=this.config,h=this.levelDetails;return u.liveMaxLatencyDuration!==void 0?u.liveMaxLatencyDuration:h?u.liveMaxLatencyDurationCount*h.targetduration:0}},{key:"targetLatency",get:function(){var u=this.levelDetails;if(u===null)return null;var h=u.holdBack,s=u.partHoldBack,l=u.targetduration,i=this.config,r=i.liveSyncDuration,n=i.liveSyncDurationCount,d=i.lowLatencyMode,w=this.hls.userConfig,T=d&&s||h;(w.liveSyncDuration||w.liveSyncDurationCount||T===0)&&(T=r!==void 0?r:n*l);var x=l,O=1;return T+Math.min(this.stallCount*O,x)}},{key:"liveSyncPosition",get:function(){var u=this.estimateLiveEdge(),h=this.targetLatency,s=this.levelDetails;if(u===null||h===null||s===null)return null;var l=s.edge,i=u-h-this.edgeStalled,r=l-s.totalduration,n=l-(this.config.lowLatencyMode&&s.partTarget||s.targetduration);return Math.min(Math.max(r,i),n)}},{key:"drift",get:function(){var u=this.levelDetails;return u===null?1:u.drift}},{key:"edgeStalled",get:function(){var u=this.levelDetails;if(u===null)return 0;var h=(this.config.lowLatencyMode&&u.partTarget||u.targetduration)*3;return Math.max(u.age-h,0)}},{key:"forwardBufferLength",get:function(){var u=this.media,h=this.levelDetails;if(!u||!h)return 0;var s=u.buffered.length;return s?u.buffered.end(s-1):h.edge-this.currentTime}}]),I}()},"./src/controller/level-controller.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"default",function(){return i});var Y=P("./src/types/level.ts"),W=P("./src/events.ts"),R=P("./src/errors.ts"),B=P("./src/utils/codecs.ts"),M=P("./src/controller/level-helper.ts"),L=P("./src/controller/base-playlist-controller.ts"),I=P("./src/types/loader.ts");function p(){return p=Object.assign||function(r){for(var n=1;n0){_=O[0].bitrate,O.sort(function(Z,H){return Z.bitrate-H.bitrate}),this._levels=O;for(var N=0;Nthis.hls.config.fragLoadingMaxRetry&&(f=x.frag.level)):f=x.frag.level}break;case R.ErrorDetails.LEVEL_LOAD_ERROR:case R.ErrorDetails.LEVEL_LOAD_TIMEOUT:O&&(O.deliveryDirectives&&(_=!1),f=O.level),v=!0;break;case R.ErrorDetails.REMUX_ALLOC_ERROR:f=x.level,v=!0;break}f!==void 0&&this.recoverLevel(x,f,v,_)},d.recoverLevel=function(T,x,O,E){var v=T.details,_=this._levels[x];if(_.loadError++,O){var f=this.retryLoadingOrFail(T);if(f)T.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(E){var c=_.url.length;if(c>1&&_.loadError1){var E=(x.urlId+1)%O;this.warn("Switching to redundant URL-id "+E),this._levels.forEach(function(v){v.urlId=E}),this.level=T}},d.onFragLoaded=function(T,x){var O=x.frag;if(O!==void 0&&O.type===I.PlaylistLevelType.MAIN){var E=this._levels[O.level];E!==void 0&&(E.fragmentError=0,E.loadError=0)}},d.onLevelLoaded=function(T,x){var O,E=x.level,v=x.details,_=this._levels[E];if(!_){var f;this.warn("Invalid level index "+E),(f=x.deliveryDirectives)!==null&&f!==void 0&&f.skip&&(v.deltaUpdateFailed=!0);return}E===this.currentLevelIndex?(_.fragmentError===0&&(_.loadError=0,this.retryCount=0),this.playlistLoaded(E,x,_.details)):(O=x.deliveryDirectives)!==null&&O!==void 0&&O.skip&&(v.deltaUpdateFailed=!0)},d.onAudioTrackSwitched=function(T,x){var O=this.hls.levels[this.currentLevelIndex];if(!O)return;if(O.audioGroupIds){for(var E=-1,v=this.hls.audioTracks[x.id].groupId,_=0;_0){var E=O.urlId,v=O.url[E];if(T)try{v=T.addDirectives(v)}catch(_){this.warn("Could not construct new URL with HLS Delivery Directives: "+_)}this.log("Attempt loading level index "+x+(T?" at sn "+T.msn+" part "+T.part:"")+" with URL-id "+E+" "+v),this.clearTimer(),this.hls.trigger(W.Events.LEVEL_LOADING,{url:v,level:x,id:E,deliveryDirectives:T||null})}},d.removeLevel=function(T,x){var O=function(_,f){return f!==x},E=this._levels.filter(function(v,_){return _!==T?!0:v.url.length>1&&x!==void 0?(v.url=v.url.filter(O),v.audioGroupIds&&(v.audioGroupIds=v.audioGroupIds.filter(O)),v.textGroupIds&&(v.textGroupIds=v.textGroupIds.filter(O)),v.urlId=0,!0):!1}).map(function(v,_){var f=v.details;return f!=null&&f.fragments&&f.fragments.forEach(function(c){c.level=_}),v});this._levels=E,this.hls.trigger(W.Events.LEVELS_UPDATED,{levels:E})},u(n,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(T){var x,O=this._levels;if(O.length===0)return;if(this.currentLevelIndex===T&&(x=O[T])!==null&&x!==void 0&&x.details)return;if(T<0||T>=O.length){var E=T<0;if(this.hls.trigger(W.Events.ERROR,{type:R.ErrorTypes.OTHER_ERROR,details:R.ErrorDetails.LEVEL_SWITCH_ERROR,level:T,fatal:E,reason:"invalid level idx"}),E)return;T=Math.min(T,O.length-1)}this.clearTimer();var v=this.currentLevelIndex,_=O[v],f=O[T];this.log("switching to level "+T+" from "+v),this.currentLevelIndex=T;var c=p({},f,{level:T,maxBitrate:f.maxBitrate,uri:f.uri,urlId:f.urlId});delete c._urlId,this.hls.trigger(W.Events.LEVEL_SWITCHING,c);var S=f.details;if(!S||S.live){var y=this.switchParams(f.uri,_==null?void 0:_.details);this.loadPlaylist(y)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(T){this.manualLevelIndex=T,this._startLevel===void 0&&(this._startLevel=T),T!==-1&&(this.level=T)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(T){this._firstLevel=T}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var T=this.hls.config.startLevel;return T!==void 0?T:this._firstLevel}else return this._startLevel},set:function(T){this._startLevel=T}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(T){this.level=T,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=T)}}]),n}(L.default)},"./src/controller/level-helper.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"addGroupId",function(){return R}),P.d(V,"assignTrackIdsByGroup",function(){return B}),P.d(V,"updatePTS",function(){return M}),P.d(V,"updateFragPTSDTS",function(){return I}),P.d(V,"mergeDetails",function(){return p}),P.d(V,"mapPartIntersection",function(){return m}),P.d(V,"mapFragmentIntersection",function(){return u}),P.d(V,"adjustSliding",function(){return h}),P.d(V,"addSliding",function(){return s}),P.d(V,"computeReloadInterval",function(){return l}),P.d(V,"getFragmentWithSN",function(){return i}),P.d(V,"getPartWith",function(){return r});var Y=P("./src/polyfills/number.ts"),W=P("./src/utils/logger.ts");function R(n,d,w){switch(d){case"audio":n.audioGroupIds||(n.audioGroupIds=[]),n.audioGroupIds.push(w);break;case"text":n.textGroupIds||(n.textGroupIds=[]),n.textGroupIds.push(w);break}}function B(n){var d={};n.forEach(function(w){var T=w.groupId||"";w.id=d[T]=d[T]||0,d[T]++})}function M(n,d,w){var T=n[d],x=n[w];L(T,x)}function L(n,d){var w=d.startPTS;if(Object(Y.isFiniteNumber)(w)){var T=0,x;d.sn>n.sn?(T=w-n.start,x=n):(T=n.start-w,x=d),x.duration!==T&&(x.duration=T)}else if(d.sn>n.sn){var O=n.cc===d.cc;O&&n.minEndPTS?d.start=n.start+(n.minEndPTS-n.start):d.start=n.start+n.duration}else d.start=Math.max(n.start-d.duration,0)}function I(n,d,w,T,x,O){var E=T-w;E<=0&&(W.logger.warn("Fragment should have a positive duration",d),T=w+d.duration,O=x+d.duration);var v=w,_=T,f=d.startPTS,c=d.endPTS;if(Object(Y.isFiniteNumber)(f)){var S=Math.abs(f-w);Object(Y.isFiniteNumber)(d.deltaPTS)?d.deltaPTS=Math.max(S,d.deltaPTS):d.deltaPTS=S,v=Math.max(w,f),w=Math.min(w,f),x=Math.min(x,d.startDTS),_=Math.min(T,c),T=Math.max(T,c),O=Math.max(O,d.endDTS)}d.duration=T-w;var y=w-d.start;d.appendedPTS=T,d.start=d.startPTS=w,d.maxStartPTS=v,d.startDTS=x,d.endPTS=T,d.minEndPTS=_,d.endDTS=O;var b=d.sn;if(!n||bn.endSN)return 0;var N,F=b-n.startSN,X=n.fragments;for(X[F]=d,N=F;N>0;N--)L(X[N],X[N-1]);for(N=F;N=0;x--){var O=T[x].initSegment;if(O){w=O;break}}n.fragmentHint&&delete n.fragmentHint.endPTS;var E=0,v;if(u(n,d,function(N,F){N.relurl&&(E=N.cc-F.cc),Object(Y.isFiniteNumber)(N.startPTS)&&Object(Y.isFiniteNumber)(N.endPTS)&&(F.start=F.startPTS=N.startPTS,F.startDTS=N.startDTS,F.appendedPTS=N.appendedPTS,F.maxStartPTS=N.maxStartPTS,F.endPTS=N.endPTS,F.endDTS=N.endDTS,F.minEndPTS=N.minEndPTS,F.duration=N.endPTS-N.startPTS,F.duration&&(v=F),d.PTSKnown=d.alignedSliding=!0),F.elementaryStreams=N.elementaryStreams,F.loader=N.loader,F.stats=N.stats,F.urlId=N.urlId,N.initSegment&&(F.initSegment=N.initSegment,w=N.initSegment)}),w){var _=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments;_.forEach(function(N){var F;(!N.initSegment||N.initSegment.relurl===((F=w)===null||F===void 0?void 0:F.relurl))&&(N.initSegment=w)})}if(d.skippedSegments&&(d.deltaUpdateFailed=d.fragments.some(function(N){return!N}),d.deltaUpdateFailed)){W.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var f=d.skippedSegments;f--;)d.fragments.shift();d.startSN=d.fragments[0].sn,d.startCC=d.fragments[0].cc}var c=d.fragments;if(E){W.logger.warn("discontinuity sliding from playlist, take drift into account");for(var S=0;S=T.length)return;s(d,T[w].start)}function s(n,d){if(d){for(var w=n.fragments,T=n.skippedSegments;T0&&x0&&_===-1&&(this.log("Override startPosition with lastCurrentTime @"+f.toFixed(3)),_=f),this.state=W.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=_,this.tick()}else this._forceStartLoad=!0,this.state=W.State.STOPPED},E.stopLoad=function(){this._forceStartLoad=!1,x.prototype.stopLoad.call(this)},E.doTick=function(){switch(this.state){case W.State.IDLE:this.doTickIdle();break;case W.State.WAITING_LEVEL:{var _,f=this.levels,c=this.level,S=f==null||((_=f[c])===null||_===void 0)?void 0:_.details;if(S&&(!S.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(S))break;this.state=W.State.IDLE;break}break}case W.State.FRAG_LOADING_WAITING_RETRY:{var y,b=self.performance.now(),N=this.retryDate;(!N||b>=N||(y=this.media)!==null&&y!==void 0&&y.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=W.State.IDLE)}break;default:break}this.onTickEnd()},E.onTickEnd=function(){x.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},E.doTickIdle=function(){var _,f,c=this.hls,S=this.levelLastLoaded,y=this.levels,b=this.media,N=c.config,F=c.nextLoadLevel;if(S===null||!b&&(this.startFragRequested||!N.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!y||!y[F])return;var X=y[F];this.level=c.nextLoadLevel=F;var Z=X.details;if(!Z||this.state===W.State.WAITING_LEVEL||Z.live&&this.levelLastLoaded!==F){this.state=W.State.WAITING_LEVEL;return}var H=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:b,I.PlaylistLevelType.MAIN);if(H===null)return;var A=H.len,z=this.getMaxBufferLength(X.maxBitrate);if(A>=z)return;if(this._streamEnded(H,Z)){var ne={};this.altAudio&&(ne.type="video"),this.hls.trigger(B.Events.BUFFER_EOS,ne),this.state=W.State.ENDED;return}var ae=H.end,me=this.getNextFragment(ae,Z);if(this.couldBacktrack&&!this.fragPrevious&&me&&me.sn!=="initSegment"){var xe=me.sn-Z.startSN;xe>1&&(me=Z.fragments[xe-1],this.fragmentTracker.removeFragment(me))}if(me&&this.fragmentTracker.getState(me)===L.FragmentState.OK&&this.nextLoadPosition>ae){var Te=this.audioOnly&&!this.altAudio?p.ElementaryStreamTypes.AUDIO:p.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(b,Te,I.PlaylistLevelType.MAIN),me=this.getNextFragment(this.nextLoadPosition,Z)}if(!me)return;me.initSegment&&!me.initSegment.data&&!this.bitrateTest&&(me=me.initSegment),((_=me.decryptdata)===null||_===void 0?void 0:_.keyFormat)==="identity"&&!((f=me.decryptdata)!==null&&f!==void 0&&f.key)?this.loadKey(me,Z):this.loadFragment(me,Z,ae)},E.loadFragment=function(_,f,c){var S,y=this.fragmentTracker.getState(_);if(this.fragCurrent=_,y===L.FragmentState.BACKTRACKED){var b=this.fragmentTracker.getBacktrackData(_);if(b){this._handleFragmentLoadProgress(b),this._handleFragmentLoadComplete(b);return}else y=L.FragmentState.NOT_LOADED}y===L.FragmentState.NOT_LOADED||y===L.FragmentState.PARTIAL?_.sn==="initSegment"?this._loadInitSegment(_):this.bitrateTest?(_.bitrateTest=!0,this.log("Fragment "+_.sn+" of level "+_.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(_)):(this.startFragRequested=!0,x.prototype.loadFragment.call(this,_,f,c)):y===L.FragmentState.APPENDING?this.reduceMaxBufferLength(_.duration)&&this.fragmentTracker.removeFragment(_):((S=this.media)===null||S===void 0?void 0:S.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},E.getAppendedFrag=function(_){var f=this.fragmentTracker.getAppendedFrag(_,I.PlaylistLevelType.MAIN);return f&&"fragment"in f?f.fragment:f},E.getBufferedFrag=function(_){return this.fragmentTracker.getBufferedFrag(_,I.PlaylistLevelType.MAIN)},E.followingBufferedFrag=function(_){return _?this.getBufferedFrag(_.end+.5):null},E.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},E.nextLevelSwitch=function(){var _=this.levels,f=this.media;if(f!=null&&f.readyState){var c,S=this.getAppendedFrag(f.currentTime);if(S&&S.start>1&&this.flushMainBuffer(0,S.start-1),!f.paused&&_){var y=this.hls.nextLoadLevel,b=_[y],N=this.fragLastKbps;N&&this.fragCurrent?c=this.fragCurrent.duration*b.maxBitrate/(1e3*N)+1:c=0}else c=0;var F=this.getBufferedFrag(f.currentTime+c);if(F){var X=this.followingBufferedFrag(F);if(X){this.abortCurrentFrag();var Z=X.maxStartPTS?X.maxStartPTS:X.start,H=X.duration,A=Math.max(F.end,Z+Math.min(Math.max(H-this.config.maxFragLookUpTolerance,H*.5),H*.75));this.flushMainBuffer(A,Number.POSITIVE_INFINITY)}}}},E.abortCurrentFrag=function(){var _=this.fragCurrent;this.fragCurrent=null,_!=null&&_.loader&&_.loader.abort(),this.state===W.State.KEY_LOADING&&(this.state=W.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},E.flushMainBuffer=function(_,f){x.prototype.flushMainBuffer.call(this,_,f,this.altAudio?"video":null)},E.onMediaAttached=function(_,f){x.prototype.onMediaAttached.call(this,_,f);var c=f.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),c.addEventListener("playing",this.onvplaying),c.addEventListener("seeked",this.onvseeked),this.gapController=new h.default(this.config,c,this.fragmentTracker,this.hls)},E.onMediaDetaching=function(){var _=this.media;_&&(_.removeEventListener("playing",this.onvplaying),_.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),x.prototype.onMediaDetaching.call(this)},E.onMediaPlaying=function(){this.tick()},E.onMediaSeeked=function(){var _=this.media,f=_?_.currentTime:null;Object(Y.isFiniteNumber)(f)&&this.log("Media seeked to "+f.toFixed(3)),this.tick()},E.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(B.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},E.onManifestParsed=function(_,f){var c=!1,S=!1,y;f.levels.forEach(function(b){y=b.audioCodec,y&&(y.indexOf("mp4a.40.2")!==-1&&(c=!0),y.indexOf("mp4a.40.5")!==-1&&(S=!0))}),this.audioCodecSwitch=c&&S&&!Object(R.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=f.levels,this.startFragRequested=!1},E.onLevelLoading=function(_,f){var c=this.levels;if(!c||this.state!==W.State.IDLE)return;var S=c[f.level];(!S.details||S.details.live&&this.levelLastLoaded!==f.level||this.waitForCdnTuneIn(S.details))&&(this.state=W.State.WAITING_LEVEL)},E.onLevelLoaded=function(_,f){var c,S=this.levels,y=f.level,b=f.details,N=b.totalduration;if(!S){this.warn("Levels were reset while loading level "+y);return}this.log("Level "+y+" loaded ["+b.startSN+","+b.endSN+"], cc ["+b.startCC+", "+b.endCC+"] duration:"+N);var F=this.fragCurrent;F&&(this.state===W.State.FRAG_LOADING||this.state===W.State.FRAG_LOADING_WAITING_RETRY)&&(F.level!==f.level&&F.loader&&(this.state=W.State.IDLE,F.loader.abort()));var X=S[y],Z=0;if(b.live||(c=X.details)!==null&&c!==void 0&&c.live){if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed)return;Z=this.alignPlaylists(b,X.details)}if(X.details=b,this.levelLastLoaded=y,this.hls.trigger(B.Events.LEVEL_UPDATED,{details:b,level:y}),this.state===W.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(b))return;this.state=W.State.IDLE}this.startFragRequested?b.live&&this.synchronizeToLiveEdge(b):this.setStartPosition(b,Z),this.tick()},E._handleFragmentLoadProgress=function(_){var f,c=_.frag,S=_.part,y=_.payload,b=this.levels;if(!b){this.warn("Levels were reset while fragment load was in progress. Fragment "+c.sn+" of level "+c.level+" will not be buffered");return}var N=b[c.level],F=N.details;if(!F){this.warn("Dropping fragment "+c.sn+" of level "+c.level+" after level details were reset");return}var X=N.videoCodec,Z=F.PTSKnown||!F.live,H=(f=c.initSegment)===null||f===void 0?void 0:f.data,A=this._getAudioCodec(N),z=this.transmuxer=this.transmuxer||new m.default(this.hls,I.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),ne=S?S.index:-1,ae=ne!==-1,me=new u.ChunkMetadata(c.level,c.sn,c.stats.chunkCount,y.byteLength,ne,ae),xe=this.initPTS[c.cc];z.push(y,H,A,X,c,S,F.totalduration,Z,me,xe)},E.onAudioTrackSwitching=function(_,f){var c=this.altAudio,S=!!f.url,y=f.id;if(!S){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var b=this.fragCurrent;b!=null&&b.loader&&(this.log("Switching to main audio track, cancel main fragment load"),b.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var N=this.hls;c&&N.trigger(B.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),N.trigger(B.Events.AUDIO_TRACK_SWITCHED,{id:y})}},E.onAudioTrackSwitched=function(_,f){var c=f.id,S=!!this.hls.audioTracks[c].url;if(S){var y=this.videoBuffer;y&&this.mediaBuffer!==y&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=y)}this.altAudio=S,this.tick()},E.onBufferCreated=function(_,f){var c=f.tracks,S,y,b=!1;for(var N in c){var F=c[N];if(F.id==="main"){if(y=N,S=F,N==="video"){var X=c[N];X&&(this.videoBuffer=X.buffer)}}else b=!0}b&&S?(this.log("Alternate track found, use "+y+".buffered to schedule main fragment loading"),this.mediaBuffer=S.buffer):this.mediaBuffer=this.media},E.onFragBuffered=function(_,f){var c=f.frag,S=f.part;if(c&&c.type!==I.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(c)){this.warn("Fragment "+c.sn+(S?" p: "+S.index:"")+" of level "+c.level+" finished buffering, but was aborted. state: "+this.state),this.state===W.State.PARSED&&(this.state=W.State.IDLE);return}var y=S?S.stats:c.stats;this.fragLastKbps=Math.round(8*y.total/(y.buffering.end-y.loading.first)),c.sn!=="initSegment"&&(this.fragPrevious=c),this.fragBufferedComplete(c,S)},E.onError=function(_,f){switch(f.details){case s.ErrorDetails.FRAG_LOAD_ERROR:case s.ErrorDetails.FRAG_LOAD_TIMEOUT:case s.ErrorDetails.KEY_LOAD_ERROR:case s.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(I.PlaylistLevelType.MAIN,f);break;case s.ErrorDetails.LEVEL_LOAD_ERROR:case s.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==W.State.ERROR&&(f.fatal?(this.warn(""+f.details),this.state=W.State.ERROR):!f.levelRetry&&this.state===W.State.WAITING_LEVEL&&(this.state=W.State.IDLE));break;case s.ErrorDetails.BUFFER_FULL_ERROR:if(f.parent==="main"&&(this.state===W.State.PARSING||this.state===W.State.PARSED)){var c=!0,S=this.getFwdBufferInfo(this.media,I.PlaylistLevelType.MAIN);S&&S.len>.5&&(c=!this.reduceMaxBufferLength(S.len)),c&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},E.checkBuffer=function(){var _=this.media,f=this.gapController;if(!_||!f||!_.readyState)return;var c=M.BufferHelper.getBuffered(_);!this.loadedmetadata&&c.length?(this.loadedmetadata=!0,this.seekToStartPos()):f.poll(this.lastCurrentTime),this.lastCurrentTime=_.currentTime},E.onFragLoadEmergencyAborted=function(){this.state=W.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},E.onBufferFlushed=function(_,f){var c=f.type;if(c!==p.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var S=(c===p.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(S,c,I.PlaylistLevelType.MAIN)}},E.onLevelsUpdated=function(_,f){this.levels=f.levels},E.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},E.seekToStartPos=function(){var _=this.media,f=_.currentTime,c=this.startPosition;if(c>=0&&f0&&(b1&&_.seeking===!1){var c=_.currentTime;if(M.BufferHelper.isBuffered(_,c)?f=this.getAppendedFrag(c):M.BufferHelper.isBuffered(_,c+.1)&&(f=this.getAppendedFrag(c+.1)),f){var S=this.fragPlaying,y=f.level;(!S||f.sn!==S.sn||S.level!==y||f.urlId!==S.urlId)&&(this.hls.trigger(B.Events.FRAG_CHANGED,{frag:f}),(!S||S.level!==y)&&this.hls.trigger(B.Events.LEVEL_SWITCHED,{level:y}),this.fragPlaying=f)}}},r(O,[{key:"nextLevel",get:function(){var _=this.nextBufferedFrag;return _?_.level:-1}},{key:"currentLevel",get:function(){var _=this.media;if(_){var f=this.getAppendedFrag(_.currentTime);if(f)return f.level}return-1}},{key:"nextBufferedFrag",get:function(){var _=this.media;if(_){var f=this.getAppendedFrag(_.currentTime);return this.followingBufferedFrag(f)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),O}(W.default)},"./src/controller/subtitle-stream-controller.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"SubtitleStreamController",function(){return n});var Y=P("./src/events.ts"),W=P("./src/utils/logger.ts"),R=P("./src/utils/buffer-helper.ts"),B=P("./src/controller/fragment-finders.ts"),M=P("./src/utils/discontinuities.ts"),L=P("./src/controller/level-helper.ts"),I=P("./src/controller/fragment-tracker.ts"),p=P("./src/controller/base-stream-controller.ts"),m=P("./src/types/loader.ts"),u=P("./src/types/level.ts");function h(d,w){for(var T=0;T=f[y].start&&S<=f[y].end){c=f[y];break}var b=v.start+v.duration;c?c.end=b:(c={start:S,end:b},f.push(c)),this.fragmentTracker.fragBuffered(v)},T.onBufferFlushing=function(O,E){var v=E.startOffset,_=E.endOffset;if(v===0&&_!==Number.POSITIVE_INFINITY){var f=this.currentTrackId,c=this.levels;if(!c.length||!c[f]||!c[f].details)return;var S=c[f].details,y=S.targetduration,b=_-y;if(b<=0)return;E.endOffsetSubtitles=Math.max(0,b),this.tracksBuffered.forEach(function(N){for(var F=0;F=S.length||f!==c||!y)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,_.live||(v=y.details)!==null&&v!==void 0&&v.live){var b=this.mainDetails;if(_.deltaUpdateFailed||!b)return;var N=b.fragments[0];if(!y.details)_.hasProgramDateTime&&b.hasProgramDateTime?Object(M.alignMediaPlaylistByPDT)(_,b):N&&Object(L.addSliding)(_,N.start);else{var F=this.alignPlaylists(_,y.details);F===0&&N&&Object(L.addSliding)(_,N.start)}}if(y.details=_,this.levelLastLoaded=f,this.tick(),_.live&&!this.fragCurrent&&this.media&&this.state===p.State.IDLE){var X=Object(B.findFragmentByPTS)(null,_.fragments,this.media.currentTime,0);X||(this.warn("Subtitle playlist not aligned with playback"),y.details=void 0)}},T._handleFragmentLoadComplete=function(O){var E=O.frag,v=O.payload,_=E.decryptdata,f=this.hls;if(this.fragContextChanged(E))return;if(v&&v.byteLength>0&&_&&_.key&&_.iv&&_.method==="AES-128"){var c=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(v),_.key.buffer,_.iv.buffer).then(function(S){var y=performance.now();f.trigger(Y.Events.FRAG_DECRYPTED,{frag:E,payload:S,stats:{tstart:c,tdecrypt:y}})})}},T.doTick=function(){if(!this.media){this.state=p.State.IDLE;return}if(this.state===p.State.IDLE){var O,E=this.currentTrackId,v=this.levels;if(!v.length||!v[E]||!v[E].details)return;var _=v[E].details,f=_.targetduration,c=this.config,S=this.media,y=R.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,S.currentTime-f,c.maxBufferHole),b=y.end,N=y.len,F=this.getMaxBufferLength()+f;if(N>F)return;console.assert(_,"Subtitle track details are defined on idle subtitle stream controller tick");var X=_.fragments,Z=X.length,H=_.edge,A,z=this.fragPrevious;if(b-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},l.pollTrackChange=function(r){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,r)},l.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var r=u(this.media.textTracks);r.forEach(function(n){Object(W.clearCurrentCues)(n)}),this.subtitleTrack=-1,this.media=null},l.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},l.onManifestParsed=function(r,n){this.tracks=n.subtitleTracks},l.onSubtitleTrackLoaded=function(r,n){var d=n.id,w=n.details,T=this.trackId,x=this.tracksInGroup[T];if(!x){this.warn("Invalid subtitle track id "+d);return}var O=x.details;x.details=n.details,this.log("subtitle track "+d+" loaded ["+w.startSN+"-"+w.endSN+"]"),d===this.trackId&&(this.retryCount=0,this.playlistLoaded(d,n,O))},l.onLevelLoading=function(r,n){this.switchLevel(n.level)},l.onLevelSwitching=function(r,n){this.switchLevel(n.level)},l.switchLevel=function(r){var n=this.hls.levels[r];if(!(n!=null&&n.textGroupIds))return;var d=n.textGroupIds[n.urlId];if(this.groupId!==d){var w=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,T=this.tracks.filter(function(E){return!d||E.groupId===d});this.tracksInGroup=T;var x=this.findTrackId(w==null?void 0:w.name)||this.findTrackId();this.groupId=d;var O={subtitleTracks:T};this.log("Updating subtitle tracks, "+T.length+' track(s) found in "'+d+'" group-id'),this.hls.trigger(Y.Events.SUBTITLE_TRACKS_UPDATED,O),x!==-1&&this.setSubtitleTrack(x,w)}},l.findTrackId=function(r){for(var n=this.tracksInGroup,d=0;d=w.length)return;this.clearTimer();var T=w[r];if(this.log("Switching to subtitle track "+r),this.trackId=r,T){var x=T.id,O=T.groupId,E=O===void 0?"":O,v=T.name,_=T.type,f=T.url;this.hls.trigger(Y.Events.SUBTITLE_TRACK_SWITCH,{id:x,groupId:E,name:v,type:_,url:f});var c=this.switchParams(T.url,n==null?void 0:n.details);this.loadPlaylist(c)}else this.hls.trigger(Y.Events.SUBTITLE_TRACK_SWITCH,{id:r})},l.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var r=-1,n=u(this.media.textTracks),d=0;d=0&&(_[0]=Math.min(_[0],w),_[1]=Math.max(_[1],T),E=!0,f/(T-w)>.5))return}if(E||O.push([w,T]),this.config.renderTextTracksNatively){var c=this.captionsTracks[d];this.Cues.newCue(c,w,T,x)}else{var S=this.Cues.newCue(null,w,T,x);this.hls.trigger(W.Events.CUES_PARSED,{type:"captions",cues:S,track:d})}},r.onInitPtsFound=function(d,w){var T=this,x=w.frag,O=w.id,E=w.initPTS,v=w.timescale,_=this.unparsedVttFrags;O==="main"&&(this.initPTS[x.cc]=E,this.timescale[x.cc]=v),_.length&&(this.unparsedVttFrags=[],_.forEach(function(f){T.onFragLoaded(W.Events.FRAG_LOADED,f)}))},r.getExistingTrack=function(d){var w=this.media;if(w)for(var T=0;T>>8^v&255^99,I[x]=v,p[v]=x;var _=T[x],f=T[_],c=T[f],S=T[v]*257^v*16843008;u[x]=S<<24|S>>>8,h[x]=S<<16|S>>>16,s[x]=S<<8|S>>>24,l[x]=S,S=c*16843009^f*65537^_*257^x*16843008,r[v]=S<<24|S>>>8,n[v]=S<<16|S>>>16,d[v]=S<<8|S>>>24,w[v]=S,x?(x=_^T[T[T[c^_]]],O^=T[T[O]]):x=O=1}},M.expandKey=function(I){for(var p=this.uint8ArrayToUint32Array_(I),m=!0,u=0;u>>6)+1;var S=(d[w+2]&60)>>>2;if(S>c.length-1){n.trigger(R.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+S});return}return E=(d[w+2]&1)<<2,E|=(d[w+3]&192)>>>6,Y.logger.log("manifest codec:"+T+", ADTS type:"+x+", samplingIndex:"+S),/firefox/i.test(_)?S>=6?(x=5,v=new Array(4),O=S-3):(x=2,v=new Array(2),O=S):_.indexOf("android")!==-1?(x=2,v=new Array(2),O=S):(x=5,v=new Array(4),T&&(T.indexOf("mp4a.40.29")!==-1||T.indexOf("mp4a.40.5")!==-1)||!T&&S>=6?O=S-3:((T&&T.indexOf("mp4a.40.2")!==-1&&(S>=6&&E===1||/vivaldi/i.test(_))||!T&&E===1)&&(x=2,v=new Array(2)),O=S)),v[0]=x<<3,v[0]|=(S&14)>>1,v[1]|=(S&1)<<7,v[1]|=E<<3,x===5&&(v[1]|=(O&14)>>1,v[2]=(O&1)<<7,v[2]|=2<<2,v[3]=0),{config:v,samplerate:c[S],channelCount:E,codec:"mp4a.40."+x,manifestCodec:f}}function M(n,d){return n[d]===255&&(n[d+1]&246)===240}function L(n,d){return n[d+1]&1?7:9}function I(n,d){return(n[d+3]&3)<<11|n[d+4]<<3|(n[d+5]&224)>>>5}function p(n,d){return d+5=n.length)return!1;var T=I(n,d);if(T<=w)return!1;var x=d+T;return x===n.length||m(n,x)}return!1}function s(n,d,w,T,x){if(!n.samplerate){var O=B(d,w,T,x);if(!O)return;n.config=O.config,n.samplerate=O.samplerate,n.channelCount=O.channelCount,n.codec=O.codec,n.manifestCodec=O.manifestCodec,Y.logger.log("parsed codec:"+n.codec+", rate:"+O.samplerate+", channels:"+O.channelCount)}}function l(n){return 1024*9e4/n}function i(n,d,w,T,x){var O=L(n,d),E=I(n,d);if(E-=O,E>0){var v=w+T*x;return{headerLength:O,frameLength:E,stamp:v}}}function r(n,d,w,T,x){var O=l(n.samplerate),E=i(d,w,T,x,O);if(E){var v=E.frameLength,_=E.headerLength,f=E.stamp,c=_+v,S=Math.max(0,w+c-d.length),y;S?(y=new Uint8Array(c-_),y.set(d.subarray(w+_,d.length),0)):y=d.subarray(w+_,w+c);var b={unit:y,pts:f};return S||n.samples.push(b),{sample:b,length:c,missing:S}}}},"./src/demux/base-audio-demuxer.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"initPTSFn",function(){return I});var Y=P("./src/polyfills/number.ts"),W=P("./src/demux/id3.ts"),R=P("./src/demux/dummy-demuxed-track.ts"),B=P("./src/utils/mp4-tools.ts"),M=P("./src/utils/typed-array.ts"),L=function(){function p(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var m=p.prototype;return m.resetInitSegment=function(h,s,l){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},m.resetTimeStamp=function(){},m.resetContiguity=function(){},m.canParse=function(h,s){return!1},m.appendFrame=function(h,s,l){},m.demux=function(h,s){this.cachedData&&(h=Object(B.appendUint8Array)(this.cachedData,h),this.cachedData=null);var l=W.getID3Data(h,0),i=l?l.length:0,r,n,d=this._audioTrack,w=this._id3Track,T=l?W.getTimeStamp(l):void 0,x=h.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=I(T,s)),l&&l.length>0&&w.samples.push({pts:this.initPTS,dts:this.initPTS,data:l}),n=this.initPTS;iL?(this.word<<=L,this.bitsAvailable-=L):(L-=this.bitsAvailable,I=L>>3,L-=I>>3,this.bytesAvailable-=I,this.loadWord(),this.word<<=L,this.bitsAvailable-=L)},B.readBits=function(L){var I=Math.min(this.bitsAvailable,L),p=this.word>>>32-I;return L>32&&Y.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=I,this.bitsAvailable>0?this.word<<=I:this.bytesAvailable>0&&this.loadWord(),I=L-I,I>0&&this.bitsAvailable?p<>>L)!==0)return this.word<<=L,this.bitsAvailable-=L,L;return this.loadWord(),L+this.skipLZ()},B.skipUEG=function(){this.skipBits(1+this.skipLZ())},B.skipEG=function(){this.skipBits(1+this.skipLZ())},B.readUEG=function(){var L=this.skipLZ();return this.readBits(L+1)-1},B.readEG=function(){var L=this.readUEG();return 1&L?1+L>>>1:-1*(L>>>1)},B.readBoolean=function(){return this.readBits(1)===1},B.readUByte=function(){return this.readBits(8)},B.readUShort=function(){return this.readBits(16)},B.readUInt=function(){return this.readBits(32)},B.skipScalingList=function(L){for(var I=8,p=8,m,u=0;u0?x.subarray(E,E+v):void 0},B=function(x,O){var E=0;return E=(x[O]&127)<<21,E|=(x[O+1]&127)<<14,E|=(x[O+2]&127)<<7,E|=x[O+3]&127,E},M=function(x,O){return Y(x,O)&&B(x,O+6)+10<=x.length-O},L=function(x){for(var O=m(x),E=0;E>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:b+=String.fromCharCode(c);break;case 12:case 13:S=x[N++],b+=String.fromCharCode((c&31)<<6|S&63);break;case 14:S=x[N++],y=x[N++],b+=String.fromCharCode((c&15)<<12|(S&63)<<6|(y&63)<<0);break;default:}}return b},n={decodeTextFrame:s},d;function w(){return!d&&typeof self.TextDecoder!="undefined"&&(d=new self.TextDecoder("utf-8")),d}},"./src/demux/mp3demuxer.ts":function(ee,V,P){"use strict";P.r(V);var Y=P("./src/demux/base-audio-demuxer.ts"),W=P("./src/demux/id3.ts"),R=P("./src/utils/logger.ts"),B=P("./src/demux/mpegaudio.ts");function M(p,m){p.prototype=Object.create(m.prototype),p.prototype.constructor=p,L(p,m)}function L(p,m){return L=Object.setPrototypeOf||function(h,s){return h.__proto__=s,h},L(p,m)}var I=function(p){M(m,p);function m(){return p.apply(this,arguments)||this}var u=m.prototype;return u.resetInitSegment=function(s,l,i){p.prototype.resetInitSegment.call(this,s,l,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:s,duration:i,inputTimeScale:9e4,dropped:0}},m.probe=function(s){if(!s)return!1;for(var l=W.getID3Data(s,0)||[],i=l.length,r=s.length;i0},M.demux=function(I){var p=I,m=Object(W.dummyTrack)();if(this.config.progressive){this.remainderData&&(p=Object(Y.appendUint8Array)(this.remainderData,I));var u=Object(Y.segmentValidRange)(p);this.remainderData=u.remainder,m.samples=u.valid||new Uint8Array}else m.samples=p;return{audioTrack:Object(W.dummyTrack)(),avcTrack:m,id3Track:Object(W.dummyTrack)(),textTrack:Object(W.dummyTrack)()}},M.flush=function(){var I=Object(W.dummyTrack)();return I.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(W.dummyTrack)(),avcTrack:I,id3Track:Object(W.dummyTrack)(),textTrack:Object(W.dummyTrack)()}},M.demuxSampleAes=function(I,p,m){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},M.destroy=function(){},B}();R.minProbeByteLength=1024,V.default=R},"./src/demux/mpegaudio.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"appendFrame",function(){return L}),P.d(V,"parseHeader",function(){return I}),P.d(V,"isHeaderPattern",function(){return p}),P.d(V,"isHeader",function(){return m}),P.d(V,"canParse",function(){return u}),P.d(V,"probe",function(){return h});var Y=null,W=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],R=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],B=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],M=[0,1,1,4];function L(s,l,i,r,n){if(i+24>l.length)return;var d=I(l,i);if(d&&i+d.frameLength<=l.length){var w=d.samplesPerFrame*9e4/d.sampleRate,T=r+n*w,x={unit:l.subarray(i,i+d.frameLength),pts:T,dts:T};return s.config=[],s.channelCount=d.channelCount,s.samplerate=d.sampleRate,s.samples.push(x),{sample:x,length:d.frameLength,missing:0}}}function I(s,l){var i=s[l+1]>>3&3,r=s[l+1]>>1&3,n=s[l+2]>>4&15,d=s[l+2]>>2&3;if(i!==1&&n!==0&&n!==15&&d!==3){var w=s[l+2]>>1&1,T=s[l+3]>>6,x=i===3?3-r:r===3?3:4,O=W[x*14+n-1]*1e3,E=i===3?0:i===2?1:2,v=R[E*3+d],_=T===3?1:2,f=B[i][r],c=M[r],S=f*8*c,y=Math.floor(f*O/v+w)*c;if(Y===null){var b=navigator.userAgent||"",N=b.match(/Chrome\/(\d+)/i);Y=N?parseInt(N[1]):0}var F=!!Y&&Y<=87;return F&&r===2&&O>=224e3&&T===0&&(s[l+3]=s[l+3]|128),{sampleRate:v,channelCount:_,frameLength:y,samplesPerFrame:S}}}function p(s,l){return s[l]===255&&(s[l+1]&224)===224&&(s[l+1]&6)!==0}function m(s,l){return l+1=I.length){m();return}if(I[p].unit.length<32)continue;var u=this.decrypter.isSync();if(this.decryptAacSample(I,p,m,u),!u)return}},M.getAvcEncryptedData=function(I){for(var p=Math.floor((I.length-48)/160)*16+16,m=new Int8Array(p),u=0,h=32;h<=I.length-16;h+=160,u+=16)m.set(I.subarray(h,h+16),u);return m},M.getAvcDecryptedUnit=function(I,p){for(var m=new Uint8Array(p),u=0,h=32;h<=I.length-16;h+=160,u+=16)I.set(m.subarray(u,u+16),h);return I},M.decryptAvcSample=function(I,p,m,u,h,s){var l=Object(W.discardEPB)(h.data),i=this.getAvcEncryptedData(l),r=this;this.decryptBuffer(i.buffer,function(n){h.data=r.getAvcDecryptedUnit(l,n),s||r.decryptAvcSamples(I,p,m+1,u)})},M.decryptAvcSamples=function(I,p,m,u){if(I instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;p++,m=0){if(p>=I.length){u();return}for(var h=I[p].units;!(m>=h.length);m++){var s=h[m];if(s.data.length<=48||s.type!==1&&s.type!==5)continue;var l=this.decrypter.isSync();if(this.decryptAvcSample(I,p,m,u,s,l),!l)return}}},B}();V.default=R},"./src/demux/transmuxer-interface.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"default",function(){return h});var Y=P("./node_modules/webworkify-webpack/index.js"),W=P.n(Y),R=P("./src/events.ts"),B=P("./src/demux/transmuxer.ts"),M=P("./src/utils/logger.ts"),L=P("./src/errors.ts"),I=P("./src/utils/mediasource-helper.ts"),p=P("./node_modules/eventemitter3/index.js"),m=P.n(p),u=Object(I.getMediaSource)()||{isTypeSupported:function(){return!1}},h=function(){function s(i,r,n,d){var w=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=i,this.id=r,this.onTransmuxComplete=n,this.onFlush=d;var T=i.config,x=function(f,c){c=c||{},c.frag=w.frag,c.id=w.id,i.trigger(f,c)};this.observer=new p.EventEmitter,this.observer.on(R.Events.FRAG_DECRYPTED,x),this.observer.on(R.Events.ERROR,x);var O={mp4:u.isTypeSupported("video/mp4"),mpeg:u.isTypeSupported("audio/mpeg"),mp3:u.isTypeSupported('audio/mp4; codecs="mp3"')},E=navigator.vendor;if(T.enableWorker&&typeof Worker!="undefined"){M.logger.log("demuxing in webworker");var v;try{v=this.worker=Y("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),v.addEventListener("message",this.onwmsg),v.onerror=function(_){i.trigger(R.Events.ERROR,{type:L.ErrorTypes.OTHER_ERROR,details:L.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(_.message+" ("+_.filename+":"+_.lineno+")")})},v.postMessage({cmd:"init",typeSupported:O,vendor:E,id:r,config:JSON.stringify(T)})}catch(_){M.logger.warn("Error in worker:",_),M.logger.error("Error while initializing DemuxerWorker, fallback to inline"),v&&self.URL.revokeObjectURL(v.objectURL),this.transmuxer=new B.default(this.observer,O,T,E,r),this.worker=null}}else this.transmuxer=new B.default(this.observer,O,T,E,r)}var l=s.prototype;return l.destroy=function(){var r=this.worker;if(r)r.removeEventListener("message",this.onwmsg),r.terminate(),this.worker=null;else{var n=this.transmuxer;n&&(n.destroy(),this.transmuxer=null)}var d=this.observer;d&&d.removeAllListeners(),this.observer=null},l.push=function(r,n,d,w,T,x,O,E,v,_){var f=this;v.transmuxing.start=self.performance.now();var c=this.transmuxer,S=this.worker,y=x?x.start:T.start,b=T.decryptdata,N=this.frag,F=!(N&&T.cc===N.cc),X=!(N&&v.level===N.level),Z=N?v.sn-N.sn:-1,H=this.part?v.part-this.part.index:1,A=!X&&(Z===1||Z===0&&H===1),z=self.performance.now();(X||Z||T.stats.parsing.start===0)&&(T.stats.parsing.start=z),x&&(H||!A)&&(x.stats.parsing.start=z);var ne=new B.TransmuxState(F,A,E,X,y);if(!A||F){M.logger.log("[transmuxer-interface, "+T.type+"]: Starting new transmux session for sn: "+v.sn+" p: "+v.part+" level: "+v.level+" id: "+v.id+` discontinuity: `+F+` trackSwitch: `+X+` contiguous: `+A+` accurateTimeOffset: `+E+` timeOffset: `+y);var ae=new B.TransmuxConfig(d,w,n,O,_);this.configureTransmuxer(ae)}if(this.frag=T,this.part=x,S)S.postMessage({cmd:"demux",data:r,decryptdata:b,chunkMeta:v,state:ne},r instanceof ArrayBuffer?[r]:[]);else if(c){var me=c.push(r,b,v,ne);Object(B.isPromise)(me)?me.then(function(xe){f.handleTransmuxComplete(xe)}):this.handleTransmuxComplete(me)}},l.flush=function(r){var n=this;r.transmuxing.start=self.performance.now();var d=this.transmuxer,w=this.worker;if(w)w.postMessage({cmd:"flush",chunkMeta:r});else if(d){var T=d.flush(r);Object(B.isPromise)(T)?T.then(function(x){n.handleFlushResult(x,r)}):this.handleFlushResult(T,r)}},l.handleFlushResult=function(r,n){var d=this;r.forEach(function(w){d.handleTransmuxComplete(w)}),this.onFlush(n)},l.onWorkerMessage=function(r){var n=r.data,d=this.hls;switch(n.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(n.data);break}case"flush":{this.onFlush(n.data);break}default:{n.data=n.data||{},n.data.frag=this.frag,n.data.id=this.id,d.trigger(n.event,n.data);break}}},l.configureTransmuxer=function(r){var n=this.worker,d=this.transmuxer;n?n.postMessage({cmd:"configure",config:r}):d&&d.configure(r)},l.handleTransmuxComplete=function(r){r.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(r)},s}()},"./src/demux/transmuxer-worker.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"default",function(){return L});var Y=P("./src/demux/transmuxer.ts"),W=P("./src/events.ts"),R=P("./src/utils/logger.ts"),B=P("./node_modules/eventemitter3/index.js"),M=P.n(B);function L(h){var s=new B.EventEmitter,l=function(r,n){h.postMessage({event:r,data:n})};s.on(W.Events.FRAG_DECRYPTED,l),s.on(W.Events.ERROR,l),h.addEventListener("message",function(i){var r=i.data;switch(r.cmd){case"init":{var n=JSON.parse(r.config);h.transmuxer=new Y.default(s,r.typeSupported,n,r.vendor,r.id),Object(R.enableLogs)(n.debug),l("init",null);break}case"configure":{h.transmuxer.configure(r.config);break}case"demux":{var d=h.transmuxer.push(r.data,r.decryptdata,r.chunkMeta,r.state);Object(Y.isPromise)(d)?d.then(function(x){I(h,x)}):I(h,d);break}case"flush":{var w=r.chunkMeta,T=h.transmuxer.flush(w);Object(Y.isPromise)(T)?T.then(function(x){m(h,x,w)}):m(h,T,w);break}default:break}})}function I(h,s){if(u(s.remuxResult))return;var l=[],i=s.remuxResult,r=i.audio,n=i.video;r&&p(l,r),n&&p(l,n),h.postMessage({event:"transmuxComplete",data:s},l)}function p(h,s){s.data1&&h.push(s.data1.buffer),s.data2&&h.push(s.data2.buffer)}function m(h,s,l){s.forEach(function(i){I(h,i)}),h.postMessage({event:"flush",data:l})}function u(h){return!h.audio&&!h.video&&!h.text&&!h.id3&&!h.initSegment}},"./src/demux/transmuxer.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"default",function(){return n}),P.d(V,"isPromise",function(){return T}),P.d(V,"TransmuxConfig",function(){return x}),P.d(V,"TransmuxState",function(){return O});var Y=P("./src/events.ts"),W=P("./src/errors.ts"),R=P("./src/crypt/decrypter.ts"),B=P("./src/demux/aacdemuxer.ts"),M=P("./src/demux/mp4demuxer.ts"),L=P("./src/demux/tsdemuxer.ts"),I=P("./src/demux/mp3demuxer.ts"),p=P("./src/remux/mp4-remuxer.ts"),m=P("./src/remux/passthrough-remuxer.ts"),u=P("./src/demux/chunk-cache.ts"),h=P("./src/utils/mp4-tools.ts"),s=P("./src/utils/logger.ts"),l;try{l=self.performance.now.bind(self.performance)}catch(E){s.logger.debug("Unable to use Performance API on this environment"),l=self.Date.now}var i=[{demux:L.default,remux:p.default},{demux:M.default,remux:m.default},{demux:B.default,remux:p.default},{demux:I.default,remux:p.default}],r=1024;i.forEach(function(E){var v=E.demux;r=Math.max(r,v.minProbeByteLength)});var n=function(){function E(_,f,c,S,y){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new u.default,this.observer=_,this.typeSupported=f,this.config=c,this.vendor=S,this.id=y}var v=E.prototype;return v.configure=function(f){this.transmuxConfig=f,this.decrypter&&this.decrypter.reset()},v.push=function(f,c,S,y){var b=this,N=S.transmuxing;N.executeStart=l();var F=new Uint8Array(f),X=this.cache,Z=this.config,H=this.currentTransmuxState,A=this.transmuxConfig;y&&(this.currentTransmuxState=y);var z=d(F,c);if(z&&z.method==="AES-128"){var ne=this.getDecrypter();if(Z.enableSoftwareAES){var ae=ne.softwareDecrypt(F,z.key.buffer,z.iv.buffer);if(!ae)return N.executeEnd=l(),w(S);F=new Uint8Array(ae)}else return this.decryptionPromise=ne.webCryptoDecrypt(F,z.key.buffer,z.iv.buffer).then(function(ht){var xt=b.push(ht,null,S);return b.decryptionPromise=null,xt}),this.decryptionPromise}var me=y||H,xe=me.contiguous,Te=me.discontinuity,Oe=me.trackSwitch,Ue=me.accurateTimeOffset,De=me.timeOffset,be=A.audioCodec,ge=A.videoCodec,He=A.defaultInitPts,ct=A.duration,vt=A.initSegmentData;if((Te||Oe)&&this.resetInitSegment(vt,be,ge,ct),Te&&this.resetInitialTimestamp(He),xe||this.resetContiguity(),this.needsProbing(F,Te,Oe)){if(X.dataLength){var _t=X.flush();F=Object(h.appendUint8Array)(_t,F)}this.configureTransmuxer(F,A)}var yt=this.transmux(F,z,De,Ue,S),et=this.currentTransmuxState;return et.contiguous=!0,et.discontinuity=!1,et.trackSwitch=!1,N.executeEnd=l(),yt},v.flush=function(f){var c=this,S=f.transmuxing;S.executeStart=l();var y=this.decrypter,b=this.cache,N=this.currentTransmuxState,F=this.decryptionPromise;if(F)return F.then(function(){return c.flush(f)});var X=[],Z=N.timeOffset;if(y){var H=y.flush();H&&X.push(this.push(H,null,f))}var A=b.dataLength;b.reset();var z=this.demuxer,ne=this.remuxer;if(!z||!ne)return A>=r&&this.observer.emit(Y.Events.ERROR,Y.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),S.executeEnd=l(),[w(f)];var ae=z.flush(Z);return T(ae)?ae.then(function(me){return c.flushRemux(X,me,f),X}):(this.flushRemux(X,ae,f),X)},v.flushRemux=function(f,c,S){var y=c.audioTrack,b=c.avcTrack,N=c.id3Track,F=c.textTrack,X=this.currentTransmuxState,Z=X.accurateTimeOffset,H=X.timeOffset;s.logger.log("[transmuxer.ts]: Flushed fragment "+S.sn+(S.part>-1?" p: "+S.part:"")+" of level "+S.level);var A=this.remuxer.remux(y,b,N,F,H,Z,!0,this.id);f.push({remuxResult:A,chunkMeta:S}),S.transmuxing.executeEnd=l()},v.resetInitialTimestamp=function(f){var c=this.demuxer,S=this.remuxer;if(!c||!S)return;c.resetTimeStamp(f),S.resetTimeStamp(f)},v.resetContiguity=function(){var f=this.demuxer,c=this.remuxer;if(!f||!c)return;f.resetContiguity(),c.resetNextTimestamp()},v.resetInitSegment=function(f,c,S,y){var b=this.demuxer,N=this.remuxer;if(!b||!N)return;b.resetInitSegment(c,S,y),N.resetInitSegment(f,c,S)},v.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},v.transmux=function(f,c,S,y,b){var N;return c&&c.method==="SAMPLE-AES"?N=this.transmuxSampleAes(f,c,S,y,b):N=this.transmuxUnencrypted(f,S,y,b),N},v.transmuxUnencrypted=function(f,c,S,y){var b=this.demuxer.demux(f,c,!1,!this.config.progressive),N=b.audioTrack,F=b.avcTrack,X=b.id3Track,Z=b.textTrack,H=this.remuxer.remux(N,F,X,Z,c,S,!1,this.id);return{remuxResult:H,chunkMeta:y}},v.transmuxSampleAes=function(f,c,S,y,b){var N=this;return this.demuxer.demuxSampleAes(f,c,S).then(function(F){var X=N.remuxer.remux(F.audioTrack,F.avcTrack,F.id3Track,F.textTrack,S,y,!1,N.id);return{remuxResult:X,chunkMeta:b}})},v.configureTransmuxer=function(f,c){for(var S=this.config,y=this.observer,b=this.typeSupported,N=this.vendor,F=c.audioCodec,X=c.defaultInitPts,Z=c.duration,H=c.initSegmentData,A=c.videoCodec,z,ne=0,ae=i.length;ne0&&v!=null&&v.key!=null&&v.iv!==null&&v.method!=null&&(_=v),_}var w=function(v){return{remuxResult:{},chunkMeta:v}};function T(E){return"then"in E&&E.then instanceof Function}var x=function(v,_,f,c,S){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=v,this.videoCodec=_,this.initSegmentData=f,this.duration=c,this.defaultInitPts=S},O=function(v,_,f,c,S){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=v,this.contiguous=_,this.accurateTimeOffset=f,this.trackSwitch=c,this.timeOffset=S}},"./src/demux/tsdemuxer.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"discardEPB",function(){return w});var Y=P("./src/demux/adts.ts"),W=P("./src/demux/mpegaudio.ts"),R=P("./src/demux/exp-golomb.ts"),B=P("./src/demux/id3.ts"),M=P("./src/demux/sample-aes.ts"),L=P("./src/events.ts"),I=P("./src/utils/mp4-tools.ts"),p=P("./src/utils/logger.ts"),m=P("./src/errors.ts"),u={video:1,audio:2,id3:3,text:4},h=function(){function T(O,E,v){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=O,this.config=E,this.typeSupported=v}T.probe=function(E){var v=T.syncOffset(E);return v<0?!1:(v&&p.logger.warn("MPEG2-TS detected but first sync word found @ offset "+v+", junk ahead ?"),!0)},T.syncOffset=function(E){for(var v=Math.min(1e3,E.length-3*188),_=0;_>4,be=void 0;if(De>1){if(be=Te+5+E[Te+4],be===Te+188)continue}else be=Te+4;switch(Ue){case N:Oe&&(F&&(c=r(F))&&this.parseAVCPES(c,!1),F={data:[],size:0}),F&&(F.data.push(E.subarray(be,Te+188)),F.size+=Te+188-be);break;case X:Oe&&(H&&(c=r(H))&&(y.isAAC?this.parseAACPES(c):this.parseMPEGPES(c)),H={data:[],size:0}),H&&(H.data.push(E.subarray(be,Te+188)),H.size+=Te+188-be);break;case Z:Oe&&(A&&(c=r(A))&&this.parseID3PES(c),A={data:[],size:0}),A&&(A.data.push(E.subarray(be,Te+188)),A.size+=Te+188-be);break;case 0:Oe&&(be+=E[be]+1),ae=this._pmtId=l(E,be);break;case ae:{Oe&&(be+=E[be]+1);var ge=i(E,be,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,_);N=ge.avc,N>0&&(S.pid=N),X=ge.audio,X>0&&(y.pid=X,y.isAAC=ge.isAAC),Z=ge.id3,Z>0&&(b.pid=Z),z&&!ne&&(p.logger.log("reparse from beginning"),z=!1,Te=xe-188),ne=this.pmtParsed=!0;break}case 17:case 8191:break;default:z=!0;break}}else this.observer.emit(L.Events.ERROR,L.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});S.pesData=F,y.pesData=H,b.pesData=A;var He={audioTrack:y,avcTrack:S,id3Track:b,textTrack:this._txtTrack};return f&&this.extractRemainingSamples(He),He},x.flush=function(){var E=this.remainderData;this.remainderData=null;var v;return E?v=this.demux(E,-1,!1,!0):v={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(v),this.sampleAes?this.decrypt(v,this.sampleAes):v},x.extractRemainingSamples=function(E){var v=E.audioTrack,_=E.avcTrack,f=E.id3Track,c=_.pesData,S=v.pesData,y=f.pesData,b;c&&(b=r(c))?(this.parseAVCPES(b,!0),_.pesData=null):_.pesData=c,S&&(b=r(S))?(v.isAAC?this.parseAACPES(b):this.parseMPEGPES(b),v.pesData=null):(S!=null&&S.size&&p.logger.log("last AAC PES packet truncated,might overlap between fragments"),v.pesData=S),y&&(b=r(y))?(this.parseID3PES(b),f.pesData=null):f.pesData=y},x.demuxSampleAes=function(E,v,_){var f=this.demux(E,_,!0,!this.config.progressive),c=this.sampleAes=new M.default(this.observer,this.config,v);return this.decrypt(f,c)},x.decrypt=function(E,v){return new Promise(function(_){var f=E.audioTrack,c=E.avcTrack;f.samples&&f.isAAC?v.decryptAacSamples(f.samples,0,function(){c.samples?v.decryptAvcSamples(c.samples,0,0,function(){_(E)}):_(E)}):c.samples&&v.decryptAvcSamples(c.samples,0,0,function(){_(E)})})},x.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},x.parseAVCPES=function(E,v){var _=this,f=this._avcTrack,c=this.parseAVCNALu(E.data),S=!1,y=this.avcSample,b,N=!1;E.data=null,y&&c.length&&!f.audFound&&(n(y,f),y=this.avcSample=s(!1,E.pts,E.dts,"")),c.forEach(function(F){switch(F.type){case 1:{b=!0,y||(y=_.avcSample=s(!0,E.pts,E.dts,"")),S&&(y.debug+="NDR "),y.frame=!0;var X=F.data;if(N&&X.length>4){var Z=new R.default(X).readSliceType();(Z===2||Z===4||Z===7||Z===9)&&(y.key=!0)}break}case 5:b=!0,y||(y=_.avcSample=s(!0,E.pts,E.dts,"")),S&&(y.debug+="IDR "),y.key=!0,y.frame=!0;break;case 6:{b=!0,S&&y&&(y.debug+="SEI ");var H=new R.default(w(F.data));H.readUByte();for(var A=0,z=0,ne=!1,ae=0;!ne&&H.bytesAvailable>1;){A=0;do ae=H.readUByte(),A+=ae;while(ae===255);z=0;do ae=H.readUByte(),z+=ae;while(ae===255);if(A===4&&H.bytesAvailable!==0){ne=!0;var me=H.readUByte();if(me===181){var xe=H.readUShort();if(xe===49){var Te=H.readUInt();if(Te===1195456820){var Oe=H.readUByte();if(Oe===3){for(var Ue=H.readUByte(),De=H.readUByte(),be=31&Ue,ge=[Ue,De],He=0;He16){for(var ct=[],vt=0;vt<16;vt++)ct.push(H.readUByte().toString(16)),(vt===3||vt===5||vt===7||vt===9)&&ct.push("-");for(var _t=z-16,yt=new Uint8Array(_t),et=0;et<_t;et++)yt[et]=H.readUByte();d(_._txtTrack.samples,{pts:E.pts,payloadType:A,uuid:ct.join(""),userData:Object(B.utf8ArrayToStr)(yt),userDataBytes:yt})}}else if(z=0){var H={data:E.subarray(X,y-f-1),type:Z};S.push(H)}else{var A=this.getLastNalUnit();if(A&&(c&&y<=4-c&&(A.state&&(A.data=A.data.subarray(0,A.data.byteLength-c))),N=y-f-1,N>0)){var z=new Uint8Array(A.data.byteLength+N);z.set(A.data,0),z.set(E.subarray(0,N),A.data.byteLength),A.data=z,A.state=0}}y=0&&f>=0){var ne={data:E.subarray(X,v),type:Z,state:f};S.push(ne)}if(S.length===0){var ae=this.getLastNalUnit();if(ae){var me=new Uint8Array(ae.data.byteLength+E.byteLength);me.set(ae.data,0),me.set(E,ae.data.byteLength),ae.data=me}}return _.naluState=f,S},x.parseAACPES=function(E){var v=0,_=this._audioTrack,f=this.aacOverFlow,c=E.data;if(f){this.aacOverFlow=null;var S=f.sample.unit.byteLength,y=Math.min(f.missing,S),b=S-y;f.sample.unit.set(c.subarray(0,y),b),_.samples.push(f.sample),v=f.missing}var N,F;for(N=v,F=c.length;N1;){var S=new Uint8Array(c[0].length+c[1].length);S.set(c[0]),S.set(c[1],c[0].length),c[0]=S,c.splice(1,1)}O=c[0];var y=(O[0]<<16)+(O[1]<<8)+O[2];if(y===1){if(E=(O[4]<<8)+O[5],E&&E>T.size-6)return null;var b=O[7];b&192&&(_=(O[9]&14)*536870912+(O[10]&255)*4194304+(O[11]&254)*16384+(O[12]&255)*128+(O[13]&254)/2,b&64?(f=(O[14]&14)*536870912+(O[15]&255)*4194304+(O[16]&254)*16384+(O[17]&255)*128+(O[18]&254)/2,_-f>60*9e4&&(p.logger.warn(Math.round((_-f)/9e4)+"s delta between PTS and DTS, align them"),_=f)):f=_),v=O[8];var N=v+9;if(T.size<=N)return null;T.size-=N;for(var F=new Uint8Array(T.size),X=0,Z=c.length;XH){N-=H;continue}else O=O.subarray(N),H-=N,N=0;F.set(O,x),x+=H}return E&&(E-=v+3),{data:F,pts:_,dts:f,len:E}}return null}function n(T,x){if(T.units.length&&T.frame){if(T.pts===void 0){var O=x.samples,E=O.length;if(E){var v=O[E-1];T.pts=v.pts,T.dts=v.dts}else{x.dropped++;return}}x.samples.push(T)}T.debug.length&&p.logger.log(T.pts+"/"+T.dts+":"+T.debug)}function d(T,x){var O=T.length;if(O>0){if(x.pts>=T[O-1].pts)T.push(x);else for(var E=O-1;E>=0;E--)if(x.pts_)return c;return 0}},{key:"maxAutoLevel",get:function(){var v=this.levels,_=this.autoLevelCapping,f;return _===-1&&v&&v.length?f=v.length-1:f=_,f}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(v){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,v)}},{key:"audioTracks",get:function(){var v=this.audioTrackController;return v?v.audioTracks:[]}},{key:"audioTrack",get:function(){var v=this.audioTrackController;return v?v.audioTrack:-1},set:function(v){var _=this.audioTrackController;_&&(_.audioTrack=v)}},{key:"subtitleTracks",get:function(){var v=this.subtitleTrackController;return v?v.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var v=this.subtitleTrackController;return v?v.subtitleTrack:-1},set:function(v){var _=this.subtitleTrackController;_&&(_.subtitleTrack=v)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var v=this.subtitleTrackController;return v?v.subtitleDisplay:!1},set:function(v){var _=this.subtitleTrackController;_&&(_.subtitleDisplay=v)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(v){this.config.lowLatencyMode=v}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return r.Events}},{key:"ErrorTypes",get:function(){return n.ErrorTypes}},{key:"ErrorDetails",get:function(){return n.ErrorDetails}},{key:"DefaultConfig",get:function(){return x.defaultConfig?x.defaultConfig:s.hlsDefaultConfig},set:function(v){x.defaultConfig=v}}]),x}();T.defaultConfig=void 0},"./src/is-supported.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"isSupported",function(){return R}),P.d(V,"changeTypeSupported",function(){return B});var Y=P("./src/utils/mediasource-helper.ts");function W(){return self.SourceBuffer||self.WebKitSourceBuffer}function R(){var M=Object(Y.getMediaSource)();if(!M)return!1;var L=W(),I=M&&typeof M.isTypeSupported=="function"&&M.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),p=!L||L.prototype&&typeof L.prototype.appendBuffer=="function"&&typeof L.prototype.remove=="function";return!!I&&!!p}function B(){var M,L=W();return typeof(L==null||((M=L.prototype)===null||M===void 0)?void 0:M.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"default",function(){return h}),P.d(V,"LoadError",function(){return l});var Y=P("./src/polyfills/number.ts"),W=P("./src/errors.ts");function R(i,r){i.prototype=Object.create(r.prototype),i.prototype.constructor=i,p(i,r)}function B(i){var r=typeof Map=="function"?new Map:void 0;return B=function(d){if(d===null||!I(d))return d;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r!="undefined"){if(r.has(d))return r.get(d);r.set(d,w)}function w(){return M(d,arguments,m(this).constructor)}return w.prototype=Object.create(d.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),p(w,d)},B(i)}function M(i,r,n){return L()?M=Reflect.construct:M=function(w,T,x){var O=[null];O.push.apply(O,T);var E=Function.bind.apply(w,O),v=new E;return x&&p(v,x.prototype),v},M.apply(null,arguments)}function L(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(i){return!1}}function I(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function p(i,r){return p=Object.setPrototypeOf||function(d,w){return d.__proto__=w,d},p(i,r)}function m(i){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},m(i)}var u=Math.pow(2,17),h=function(){function i(n){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=n}var r=i.prototype;return r.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},r.abort=function(){this.loader&&this.loader.abort()},r.load=function(d,w){var T=this,x=d.url;if(!x)return Promise.reject(new l({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,networkDetails:null},"Fragment does not have a "+(x?"part list":"url")));this.abort();var O=this.config,E=O.fLoader,v=O.loader;return new Promise(function(_,f){T.loader&&T.loader.destroy();var c=T.loader=d.loader=E?new E(O):new v(O),S=s(d),y={timeout:O.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:O.fragLoadingMaxRetryTimeout,highWaterMark:u};d.stats=c.stats,c.load(S,y,{onSuccess:function(N,F,X,Z){T.resetLoader(d,c),_({frag:d,part:null,payload:N.data,networkDetails:Z})},onError:function(N,F,X){T.resetLoader(d,c),f(new l({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,response:N,networkDetails:X}))},onAbort:function(N,F,X){T.resetLoader(d,c),f(new l({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,networkDetails:X}))},onTimeout:function(N,F,X){T.resetLoader(d,c),f(new l({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,networkDetails:X}))},onProgress:function(N,F,X,Z){w&&w({frag:d,part:null,payload:X,networkDetails:Z})}})})},r.loadPart=function(d,w,T){var x=this;this.abort();var O=this.config,E=O.fLoader,v=O.loader;return new Promise(function(_,f){x.loader&&x.loader.destroy();var c=x.loader=d.loader=E?new E(O):new v(O),S=s(d,w),y={timeout:O.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:O.fragLoadingMaxRetryTimeout,highWaterMark:u};w.stats=c.stats,c.load(S,y,{onSuccess:function(N,F,X,Z){x.resetLoader(d,c),x.updateStatsFromPart(d,w);var H={frag:d,part:w,payload:N.data,networkDetails:Z};T(H),_(H)},onError:function(N,F,X){x.resetLoader(d,c),f(new l({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,part:w,response:N,networkDetails:X}))},onAbort:function(N,F,X){d.stats.aborted=w.stats.aborted,x.resetLoader(d,c),f(new l({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,part:w,networkDetails:X}))},onTimeout:function(N,F,X){x.resetLoader(d,c),f(new l({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,part:w,networkDetails:X}))}})})},r.updateStatsFromPart=function(d,w){var T=d.stats,x=w.stats,O=x.total;if(T.loaded+=x.loaded,O){var E=Math.round(d.duration/w.duration),v=Math.min(Math.round(T.loaded/O),E),_=E-v,f=_*Math.round(T.loaded/v);T.total=T.loaded+f}else T.total=Math.max(T.loaded,T.total);var c=T.loading,S=x.loading;c.start?c.first+=S.first-S.start:(c.start=S.start,c.first=S.first),c.end=S.end},r.resetLoader=function(d,w){d.loader=null,this.loader===w&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),w.destroy()},i}();function s(i,r){r===void 0&&(r=null);var n=r||i,d={frag:i,part:r,responseType:"arraybuffer",url:n.url,headers:{},rangeStart:0,rangeEnd:0},w=n.byteRangeStartOffset,T=n.byteRangeEndOffset;return Object(Y.isFiniteNumber)(w)&&Object(Y.isFiniteNumber)(T)&&(d.rangeStart=w,d.rangeEnd=T),d}var l=function(i){R(r,i);function r(n){for(var d,w=arguments.length,T=new Array(w>1?w-1:0),x=1;x>8*(15-O)&255;return x},d.setDecryptDataFromLevelKey=function(T,x){var O=T;return(T==null?void 0:T.method)==="AES-128"&&T.uri&&!T.iv&&(O=M.LevelKey.fromURI(T.uri),O.method=T.method,O.iv=this.createInitializationVector(x),O.keyFormat="identity"),O},d.setElementaryStreamInfo=function(T,x,O,E,v,_){_===void 0&&(_=!1);var f=this.elementaryStreams,c=f[T];if(!c){f[T]={startPTS:x,endPTS:O,startDTS:E,endDTS:v,partial:_};return}c.startPTS=Math.min(c.startPTS,x),c.endPTS=Math.max(c.endPTS,O),c.startDTS=Math.min(c.startDTS,E),c.endDTS=Math.max(c.endDTS,v)},d.clearElementaryStreamInfo=function(){var T=this.elementaryStreams;T[h.AUDIO]=null,T[h.VIDEO]=null,T[h.AUDIOVIDEO]=null},u(n,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var T=this.sn;typeof T!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&B.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),T=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,T)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(Y.isFiniteNumber)(this.programDateTime))return null;var T=Object(Y.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+T*1e3}},{key:"encrypted",get:function(){var T;return!!((T=this.decryptdata)!==null&&T!==void 0&&T.keyFormat&&this.decryptdata.uri)}}]),n}(s),i=function(r){I(n,r);function n(d,w,T,x,O){var E;E=r.call(this,T)||this,E.fragOffset=0,E.duration=0,E.gap=!1,E.independent=!1,E.relurl=void 0,E.fragment=void 0,E.index=void 0,E.stats=new L.LoadStats,E.duration=d.decimalFloatingPoint("DURATION"),E.gap=d.bool("GAP"),E.independent=d.bool("INDEPENDENT"),E.relurl=d.enumeratedString("URI"),E.fragment=w,E.index=x;var v=d.enumeratedString("BYTERANGE");return v&&E.setByteRange(v,O),O&&(E.fragOffset=O.fragOffset+O.duration),E}return u(n,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var w=this.elementaryStreams;return!!(w.audio||w.video||w.audiovideo)}}]),n}(s)},"./src/loader/key-loader.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"default",function(){return B});var Y=P("./src/events.ts"),W=P("./src/errors.ts"),R=P("./src/utils/logger.ts"),B=function(){function M(I){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=I,this._registerListeners()}var L=M.prototype;return L._registerListeners=function(){this.hls.on(Y.Events.KEY_LOADING,this.onKeyLoading,this)},L._unregisterListeners=function(){this.hls.off(Y.Events.KEY_LOADING,this.onKeyLoading)},L.destroy=function(){this._unregisterListeners();for(var p in this.loaders){var m=this.loaders[p];m&&m.destroy()}this.loaders={}},L.onKeyLoading=function(p,m){var u=m.frag,h=u.type,s=this.loaders[h];if(!u.decryptdata){R.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var l=u.decryptdata.uri;if(l!==this.decrypturl||this.decryptkey===null){var i=this.hls.config;if(s&&(R.logger.warn("abort previous key loader for type:"+h),s.abort()),!l){R.logger.warn("key uri is falsy");return}var r=i.loader,n=u.loader=this.loaders[h]=new r(i);this.decrypturl=l,this.decryptkey=null;var d={url:l,frag:u,responseType:"arraybuffer"},w={timeout:i.fragLoadingTimeOut,maxRetry:0,retryDelay:i.fragLoadingRetryDelay,maxRetryDelay:i.fragLoadingMaxRetryTimeout,highWaterMark:0},T={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};n.load(d,w,T)}else this.decryptkey&&(u.decryptdata.key=this.decryptkey,this.hls.trigger(Y.Events.KEY_LOADED,{frag:u}))},L.loadsuccess=function(p,m,u){var h=u.frag;if(!h.decryptdata){R.logger.error("after key load, decryptdata unset");return}this.decryptkey=h.decryptdata.key=new Uint8Array(p.data),h.loader=null,delete this.loaders[h.type],this.hls.trigger(Y.Events.KEY_LOADED,{frag:h})},L.loaderror=function(p,m){var u=m.frag,h=u.loader;h&&h.abort(),delete this.loaders[u.type],this.hls.trigger(Y.Events.ERROR,{type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:u,response:p})},L.loadtimeout=function(p,m){var u=m.frag,h=u.loader;h&&h.abort(),delete this.loaders[u.type],this.hls.trigger(Y.Events.ERROR,{type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:u})},M}()},"./src/loader/level-details.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"LevelDetails",function(){return M});var Y=P("./src/polyfills/number.ts");function W(L,I){for(var p=0;pm.endSN||u>0||u===0&&h>0,this.updated||this.advanced?this.misses=Math.floor(m.misses*.6):this.misses=m.misses+1,this.availabilityDelay=m.availabilityDelay},R(L,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(Y.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||B}},{key:"drift",get:function(){var m=this.driftEndTime-this.driftStartTime;if(m>0){var u=this.driftEnd-this.driftStart;return u*1e3/m}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var m;return(m=this.fragments)!==null&&m!==void 0&&m.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),L}()},"./src/loader/level-key.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"LevelKey",function(){return M});var Y=P("./node_modules/url-toolkit/src/url-toolkit.js"),W=P.n(Y);function R(L,I){for(var p=0;p2){var f=_.shift()+".";return f+=parseInt(_.shift()).toString(16),f+=("000"+parseInt(_.shift()).toString(16)).substr(-4),f}return v},O.resolve=function(v,_){return W.buildAbsoluteURL(_,v,{alwaysNormalize:!0})},O.parseMasterPlaylist=function(v,_){var f=[],c={},S=!1;u.lastIndex=0;for(var y;(y=u.exec(v))!=null;)if(y[1]){var b=new I.AttrList(y[1]),N={attrs:b,bitrate:b.decimalInteger("AVERAGE-BANDWIDTH")||b.decimalInteger("BANDWIDTH"),name:b.NAME,url:O.resolve(y[2],_)},F=b.decimalResolution("RESOLUTION");F&&(N.width=F.width,N.height=F.height),d((b.CODECS||"").split(/[ ,]+/).filter(function(Z){return Z}),N),N.videoCodec&&N.videoCodec.indexOf("avc1")!==-1&&(N.videoCodec=O.convertAVC1ToAVCOTI(N.videoCodec)),f.push(N)}else if(y[3]){var X=new I.AttrList(y[3]);X["DATA-ID"]&&(S=!0,c[X["DATA-ID"]]=X)}return{levels:f,sessionData:S?c:null}},O.parseMasterPlaylistMedia=function(v,_,f,c){c===void 0&&(c=[]);var S,y=[],b=0;for(h.lastIndex=0;(S=h.exec(v))!==null;){var N=new I.AttrList(S[1]);if(N.TYPE===f){var F={attrs:N,bitrate:0,id:b++,groupId:N["GROUP-ID"],instreamId:N["INSTREAM-ID"],name:N.NAME||N.LANGUAGE||"",type:f,default:N.bool("DEFAULT"),autoselect:N.bool("AUTOSELECT"),forced:N.bool("FORCED"),lang:N.LANGUAGE,url:N.URI?O.resolve(N.URI,_):""};if(c.length){var X=O.findGroup(c,F.groupId)||c[0];w(F,X,"audioCodec"),w(F,X,"textCodec")}y.push(F)}}return y},O.parseLevelPlaylist=function(v,_,f,c,S){var y=new M.LevelDetails(_),b=y.fragments,N=null,F=0,X=0,Z=0,H=0,A=null,z=new B.Fragment(c,_),ne,ae,me,xe=-1,Te=!1;for(s.lastIndex=0,y.m3u8=v;(ne=s.exec(v))!==null;){Te&&(Te=!1,z=new B.Fragment(c,_),z.start=Z,z.sn=F,z.cc=H,z.level=f,N&&(z.initSegment=N,z.rawProgramDateTime=N.rawProgramDateTime));var Oe=ne[1];if(Oe){z.duration=parseFloat(Oe);var Ue=(" "+ne[2]).slice(1);z.title=Ue||null,z.tagList.push(Ue?["INF",Oe,Ue]:["INF",Oe])}else if(ne[3])Object(Y.isFiniteNumber)(z.duration)&&(z.start=Z,me&&(z.levelkey=me),z.sn=F,z.level=f,z.cc=H,z.urlId=S,b.push(z),z.relurl=(" "+ne[3]).slice(1),x(z,A),A=z,Z+=z.duration,F++,X=0,Te=!0);else if(ne[4]){var De=(" "+ne[4]).slice(1);A?z.setByteRange(De,A):z.setByteRange(De)}else if(ne[5])z.rawProgramDateTime=(" "+ne[5]).slice(1),z.tagList.push(["PROGRAM-DATE-TIME",z.rawProgramDateTime]),xe===-1&&(xe=b.length);else{if(ne=ne[0].match(l),!ne){p.logger.warn("No matches on slow regex match for level playlist!");continue}for(ae=1;ae-1){p.logger.warn("Keyformat "+$e+" is not supported from the manifest");continue}else if($e!=="identity")continue;xt&&(me=L.LevelKey.fromURL(_,Tt),Tt&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(xt)>=0&&(me.method=xt,me.keyFormat=$e,je&&(me.keyID=je),Ie&&(me.keyFormatVersions=Ie),me.iv=mt));break}case"START":{var lt=new I.AttrList(ge),bt=lt.decimalFloatingPoint("TIME-OFFSET");Object(Y.isFiniteNumber)(bt)&&(y.startTimeOffset=bt);break}case"MAP":{var Mt=new I.AttrList(ge);z.relurl=Mt.URI,Mt.BYTERANGE&&z.setByteRange(Mt.BYTERANGE),z.level=f,z.sn="initSegment",me&&(z.levelkey=me),z.initSegment=null,N=z,Te=!0;break}case"SERVER-CONTROL":{var jt=new I.AttrList(ge);y.canBlockReload=jt.bool("CAN-BLOCK-RELOAD"),y.canSkipUntil=jt.optionalFloat("CAN-SKIP-UNTIL",0),y.canSkipDateRanges=y.canSkipUntil>0&&jt.bool("CAN-SKIP-DATERANGES"),y.partHoldBack=jt.optionalFloat("PART-HOLD-BACK",0),y.holdBack=jt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Me=new I.AttrList(ge);y.partTarget=Me.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Pe=y.partList;Pe||(Pe=y.partList=[]);var tt=X>0?Pe[Pe.length-1]:void 0,rt=X++,Fe=new B.Part(new I.AttrList(ge),z,_,rt,tt);Pe.push(Fe),z.duration+=Fe.duration;break}case"PRELOAD-HINT":{var Je=new I.AttrList(ge);y.preloadHint=Je;break}case"RENDITION-REPORT":{var Ee=new I.AttrList(ge);y.renditionReports=y.renditionReports||[],y.renditionReports.push(Ee);break}default:p.logger.warn("line parsed but not handled: "+ne);break}}}A&&!A.relurl?(b.pop(),Z-=A.duration,y.partList&&(y.fragmentHint=A)):y.partList&&(x(z,A),z.cc=H,y.fragmentHint=z);var ye=b.length,_e=b[0],le=b[ye-1];if(Z+=y.skippedSegments*y.targetduration,Z>0&&ye&&le){y.averagetargetduration=Z/ye;var de=le.sn;y.endSN=de!=="initSegment"?de:0,_e&&(y.startCC=_e.cc,_e.initSegment||y.fragments.every(function(ve){return ve.relurl&&r(ve.relurl)})&&(p.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),z=new B.Fragment(c,_),z.relurl=le.relurl,z.level=f,z.sn="initSegment",_e.initSegment=z,y.needSidxRanges=!0))}else y.endSN=0,y.startCC=0;return y.fragmentHint&&(Z+=y.fragmentHint.duration),y.totalduration=Z,y.endCC=H,xe>0&&T(b,xe),y},O}();function d(O,E){["video","audio","text"].forEach(function(v){var _=O.filter(function(c){return Object(m.isCodecType)(c,v)});if(_.length){var f=_.filter(function(c){return c.lastIndexOf("avc1",0)===0||c.lastIndexOf("mp4a",0)===0});E[v+"Codec"]=f.length>0?f[0]:_[0],O=O.filter(function(c){return _.indexOf(c)===-1})}}),E.unknownCodecs=O}function w(O,E,v){var _=E[v];_&&(O[v]=_)}function T(O,E){for(var v=O[E],_=E;_--;){var f=O[_];if(!f)return;f.programDateTime=v.programDateTime-f.duration*1e3,v=f}}function x(O,E){O.rawProgramDateTime?O.programDateTime=Date.parse(O.rawProgramDateTime):E!=null&&E.programDateTime&&(O.programDateTime=E.endProgramDateTime),Object(Y.isFiniteNumber)(O.programDateTime)||(O.programDateTime=null,O.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ee,V,P){"use strict";P.r(V);var Y=P("./src/polyfills/number.ts"),W=P("./src/events.ts"),R=P("./src/errors.ts"),B=P("./src/utils/logger.ts"),M=P("./src/utils/mp4-tools.ts"),L=P("./src/loader/m3u8-parser.ts"),I=P("./src/types/loader.ts"),p=P("./src/utils/attr-list.ts");function m(s){var l=s.type;switch(l){case I.PlaylistContextType.AUDIO_TRACK:return I.PlaylistLevelType.AUDIO;case I.PlaylistContextType.SUBTITLE_TRACK:return I.PlaylistLevelType.SUBTITLE;default:return I.PlaylistLevelType.MAIN}}function u(s,l){var i=s.url;return(i===void 0||i.indexOf("data:")===0)&&(i=l.url),i}var h=function(){function s(i){this.hls=void 0,this.loaders=Object.create(null),this.hls=i,this.registerListeners()}var l=s.prototype;return l.registerListeners=function(){var r=this.hls;r.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(W.Events.LEVEL_LOADING,this.onLevelLoading,this),r.on(W.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),r.on(W.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},l.unregisterListeners=function(){var r=this.hls;r.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(W.Events.LEVEL_LOADING,this.onLevelLoading,this),r.off(W.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),r.off(W.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},l.createInternalLoader=function(r){var n=this.hls.config,d=n.pLoader,w=n.loader,T=d||w,x=new T(n);return r.loader=x,this.loaders[r.type]=x,x},l.getInternalLoader=function(r){return this.loaders[r.type]},l.resetInternalLoader=function(r){this.loaders[r]&&delete this.loaders[r]},l.destroyInternalLoaders=function(){for(var r in this.loaders){var n=this.loaders[r];n&&n.destroy(),this.resetInternalLoader(r)}},l.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},l.onManifestLoading=function(r,n){var d=n.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:I.PlaylistContextType.MANIFEST,url:d,deliveryDirectives:null})},l.onLevelLoading=function(r,n){var d=n.id,w=n.level,T=n.url,x=n.deliveryDirectives;this.load({id:d,groupId:null,level:w,responseType:"text",type:I.PlaylistContextType.LEVEL,url:T,deliveryDirectives:x})},l.onAudioTrackLoading=function(r,n){var d=n.id,w=n.groupId,T=n.url,x=n.deliveryDirectives;this.load({id:d,groupId:w,level:null,responseType:"text",type:I.PlaylistContextType.AUDIO_TRACK,url:T,deliveryDirectives:x})},l.onSubtitleTrackLoading=function(r,n){var d=n.id,w=n.groupId,T=n.url,x=n.deliveryDirectives;this.load({id:d,groupId:w,level:null,responseType:"text",type:I.PlaylistContextType.SUBTITLE_TRACK,url:T,deliveryDirectives:x})},l.load=function(r){var n,d=this.hls.config,w=this.getInternalLoader(r);if(w){var T=w.context;if(T&&T.url===r.url){B.logger.trace("[playlist-loader]: playlist request ongoing");return}B.logger.log("[playlist-loader]: aborting previous loader for type: "+r.type),w.abort()}var x,O,E,v;switch(r.type){case I.PlaylistContextType.MANIFEST:x=d.manifestLoadingMaxRetry,O=d.manifestLoadingTimeOut,E=d.manifestLoadingRetryDelay,v=d.manifestLoadingMaxRetryTimeout;break;case I.PlaylistContextType.LEVEL:case I.PlaylistContextType.AUDIO_TRACK:case I.PlaylistContextType.SUBTITLE_TRACK:x=0,O=d.levelLoadingTimeOut;break;default:x=d.levelLoadingMaxRetry,O=d.levelLoadingTimeOut,E=d.levelLoadingRetryDelay,v=d.levelLoadingMaxRetryTimeout;break}if(w=this.createInternalLoader(r),(n=r.deliveryDirectives)!==null&&n!==void 0&&n.part){var _;if(r.type===I.PlaylistContextType.LEVEL&&r.level!==null?_=this.hls.levels[r.level].details:r.type===I.PlaylistContextType.AUDIO_TRACK&&r.id!==null?_=this.hls.audioTracks[r.id].details:r.type===I.PlaylistContextType.SUBTITLE_TRACK&&r.id!==null&&(_=this.hls.subtitleTracks[r.id].details),_){var f=_.partTarget,c=_.targetduration;f&&c&&(O=Math.min(Math.max(f*3,c*.8)*1e3,O))}}var S={timeout:O,maxRetry:x,retryDelay:E,maxRetryDelay:v,highWaterMark:0},y={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};w.load(r,S,y)},l.loadsuccess=function(r,n,d,w){if(w===void 0&&(w=null),d.isSidxRequest){this.handleSidxRequest(r,d),this.handlePlaylistLoaded(r,n,d,w);return}this.resetInternalLoader(d.type);var T=r.data;if(T.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(r,d,"no EXTM3U delimiter",w);return}n.parsing.start=performance.now(),T.indexOf("#EXTINF:")>0||T.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(r,n,d,w):this.handleMasterPlaylist(r,n,d,w)},l.loaderror=function(r,n,d){d===void 0&&(d=null),this.handleNetworkError(n,d,!1,r)},l.loadtimeout=function(r,n,d){d===void 0&&(d=null),this.handleNetworkError(n,d,!0)},l.handleMasterPlaylist=function(r,n,d,w){var T=this.hls,x=r.data,O=u(r,d),E=L.default.parseMasterPlaylist(x,O),v=E.levels,_=E.sessionData;if(!v.length){this.handleManifestParsingError(r,d,"no level found in manifest",w);return}var f=v.map(function(F){return{id:F.attrs.AUDIO,audioCodec:F.audioCodec}}),c=v.map(function(F){return{id:F.attrs.SUBTITLES,textCodec:F.textCodec}}),S=L.default.parseMasterPlaylistMedia(x,O,"AUDIO",f),y=L.default.parseMasterPlaylistMedia(x,O,"SUBTITLES",c),b=L.default.parseMasterPlaylistMedia(x,O,"CLOSED-CAPTIONS");if(S.length){var N=S.some(function(F){return!F.url});!N&&v[0].audioCodec&&!v[0].attrs.AUDIO&&(B.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),S.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new p.AttrList({}),bitrate:0,url:""}))}T.trigger(W.Events.MANIFEST_LOADED,{levels:v,audioTracks:S,subtitles:y,captions:b,url:O,stats:n,networkDetails:w,sessionData:_})},l.handleTrackOrLevelPlaylist=function(r,n,d,w){var T=this.hls,x=d.id,O=d.level,E=d.type,v=u(r,d),_=Object(Y.isFiniteNumber)(x)?x:0,f=Object(Y.isFiniteNumber)(O)?O:_,c=m(d),S=L.default.parseLevelPlaylist(r.data,v,f,c,_);if(!S.fragments.length){T.trigger(W.Events.ERROR,{type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:v,reason:"no fragments found in level",level:typeof d.level=="number"?d.level:void 0});return}if(E===I.PlaylistContextType.MANIFEST){var y={attrs:new p.AttrList({}),bitrate:0,details:S,name:"",url:v};T.trigger(W.Events.MANIFEST_LOADED,{levels:[y],audioTracks:[],url:v,stats:n,networkDetails:w,sessionData:null})}if(n.parsing.end=performance.now(),S.needSidxRanges){var b,N=(b=S.fragments[0].initSegment)===null||b===void 0?void 0:b.url;this.load({url:N,isSidxRequest:!0,type:E,level:O,levelDetails:S,id:x,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}d.levelDetails=S,this.handlePlaylistLoaded(r,n,d,w)},l.handleSidxRequest=function(r,n){var d=Object(M.parseSegmentIndex)(new Uint8Array(r.data));if(!d)return;var w=d.references,T=n.levelDetails;w.forEach(function(x,O){var E=x.info,v=T.fragments[O];v.byteRange.length===0&&v.setByteRange(String(1+E.end-E.start)+"@"+String(E.start)),v.initSegment&&v.initSegment.setByteRange(String(d.moovEndOffset)+"@0")})},l.handleManifestParsingError=function(r,n,d,w){this.hls.trigger(W.Events.ERROR,{type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:n.type===I.PlaylistContextType.MANIFEST,url:r.url,reason:d,response:r,context:n,networkDetails:w})},l.handleNetworkError=function(r,n,d,w){d===void 0&&(d=!1),B.logger.warn("[playlist-loader]: A network "+(d?"timeout":"error")+" occurred while loading "+r.type+" level: "+r.level+" id: "+r.id+' group-id: "'+r.groupId+'"');var T=R.ErrorDetails.UNKNOWN,x=!1,O=this.getInternalLoader(r);switch(r.type){case I.PlaylistContextType.MANIFEST:T=d?R.ErrorDetails.MANIFEST_LOAD_TIMEOUT:R.ErrorDetails.MANIFEST_LOAD_ERROR,x=!0;break;case I.PlaylistContextType.LEVEL:T=d?R.ErrorDetails.LEVEL_LOAD_TIMEOUT:R.ErrorDetails.LEVEL_LOAD_ERROR,x=!1;break;case I.PlaylistContextType.AUDIO_TRACK:T=d?R.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:R.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,x=!1;break;case I.PlaylistContextType.SUBTITLE_TRACK:T=d?R.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:R.ErrorDetails.SUBTITLE_LOAD_ERROR,x=!1;break}O&&this.resetInternalLoader(r.type);var E={type:R.ErrorTypes.NETWORK_ERROR,details:T,fatal:x,url:r.url,loader:O,context:r,networkDetails:n};w&&(E.response=w),this.hls.trigger(W.Events.ERROR,E)},l.handlePlaylistLoaded=function(r,n,d,w){var T=d.type,x=d.level,O=d.id,E=d.groupId,v=d.loader,_=d.levelDetails,f=d.deliveryDirectives;if(!(_!=null&&_.targetduration)){this.handleManifestParsingError(r,d,"invalid target duration",w);return}if(!v)return;_.live&&(v.getCacheAge&&(_.ageHeader=v.getCacheAge()||0),(!v.getCacheAge||isNaN(_.ageHeader))&&(_.ageHeader=0));switch(T){case I.PlaylistContextType.MANIFEST:case I.PlaylistContextType.LEVEL:this.hls.trigger(W.Events.LEVEL_LOADED,{details:_,level:x||0,id:O||0,stats:n,networkDetails:w,deliveryDirectives:f});break;case I.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(W.Events.AUDIO_TRACK_LOADED,{details:_,id:O||0,groupId:E||"",stats:n,networkDetails:w,deliveryDirectives:f});break;case I.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(W.Events.SUBTITLE_TRACK_LOADED,{details:_,id:O||0,groupId:E||"",stats:n,networkDetails:w,deliveryDirectives:f});break}},s}();V.default=h},"./src/polyfills/number.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"isFiniteNumber",function(){return Y}),P.d(V,"MAX_SAFE_INTEGER",function(){return W});var Y=Number.isFinite||function(R){return typeof R=="number"&&isFinite(R)},W=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ee,V,P){"use strict";P.r(V);var Y=function(){function W(){}return W.getSilentFrame=function(B,M){switch(B){case"mp4a.40.2":if(M===1)return new Uint8Array([0,200,0,128,35,128]);if(M===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(M===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(M===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(M===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(M===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]);break;default:if(M===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(M===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(M===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]);break}return},W}();V.default=Y},"./src/remux/mp4-generator.ts":function(ee,V,P){"use strict";P.r(V);var Y=Math.pow(2,32)-1,W=function(){function R(){}return R.init=function(){R.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var M;for(M in R.types)R.types.hasOwnProperty(M)&&(R.types[M]=[M.charCodeAt(0),M.charCodeAt(1),M.charCodeAt(2),M.charCodeAt(3)]);var L=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),I=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);R.HDLR_TYPES={video:L,audio:I};var p=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),m=new Uint8Array([0,0,0,0,0,0,0,0]);R.STTS=R.STSC=R.STCO=m,R.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),R.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),R.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),R.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var u=new Uint8Array([105,115,111,109]),h=new Uint8Array([97,118,99,49]),s=new Uint8Array([0,0,0,1]);R.FTYP=R.box(R.types.ftyp,u,s,u,h),R.DINF=R.box(R.types.dinf,R.box(R.types.dref,p))},R.box=function(M){for(var L=8,I=arguments.length,p=new Array(I>1?I-1:0),m=1;m>24&255,s[1]=L>>16&255,s[2]=L>>8&255,s[3]=L&255,s.set(M,4),u=0,L=8;u>24&255,M>>16&255,M>>8&255,M&255,I>>24,I>>16&255,I>>8&255,I&255,p>>24,p>>16&255,p>>8&255,p&255,85,196,0,0]))},R.mdia=function(M){return R.box(R.types.mdia,R.mdhd(M.timescale,M.duration),R.hdlr(M.type),R.minf(M))},R.mfhd=function(M){return R.box(R.types.mfhd,new Uint8Array([0,0,0,0,M>>24,M>>16&255,M>>8&255,M&255]))},R.minf=function(M){return M.type==="audio"?R.box(R.types.minf,R.box(R.types.smhd,R.SMHD),R.DINF,R.stbl(M)):R.box(R.types.minf,R.box(R.types.vmhd,R.VMHD),R.DINF,R.stbl(M))},R.moof=function(M,L,I){return R.box(R.types.moof,R.mfhd(M),R.traf(I,L))},R.moov=function(M){for(var L=M.length,I=[];L--;)I[L]=R.trak(M[L]);return R.box.apply(null,[R.types.moov,R.mvhd(M[0].timescale,M[0].duration)].concat(I).concat(R.mvex(M)))},R.mvex=function(M){for(var L=M.length,I=[];L--;)I[L]=R.trex(M[L]);return R.box.apply(null,[R.types.mvex].concat(I))},R.mvhd=function(M,L){L*=M;var I=Math.floor(L/(Y+1)),p=Math.floor(L%(Y+1)),m=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,M>>24&255,M>>16&255,M>>8&255,M&255,I>>24,I>>16&255,I>>8&255,I&255,p>>24,p>>16&255,p>>8&255,p&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]);return R.box(R.types.mvhd,m)},R.sdtp=function(M){var L=M.samples||[],I=new Uint8Array(4+L.length),p,m;for(p=0;p>>8&255),L.push(u&255),L=L.concat(Array.prototype.slice.call(m));for(p=0;p>>8&255),I.push(u&255),I=I.concat(Array.prototype.slice.call(m));var h=R.box(R.types.avcC,new Uint8Array([1,L[3],L[4],L[5],252|3,224|M.sps.length].concat(L).concat([M.pps.length]).concat(I))),s=M.width,l=M.height,i=M.pixelRatio[0],r=M.pixelRatio[1];return R.box(R.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,s>>8&255,s&255,l>>8&255,l&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),h,R.box(R.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),R.box(R.types.pasp,new Uint8Array([i>>24,i>>16&255,i>>8&255,i&255,r>>24,r>>16&255,r>>8&255,r&255])))},R.esds=function(M){var L=M.config.length;return new Uint8Array([0,0,0,0,3,23+L,0,1,0,4,15+L,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([L]).concat(M.config).concat([6,1,2]))},R.mp4a=function(M){var L=M.samplerate;return R.box(R.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,M.channelCount,0,16,0,0,0,0,L>>8&255,L&255,0,0]),R.box(R.types.esds,R.esds(M)))},R.mp3=function(M){var L=M.samplerate;return R.box(R.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,M.channelCount,0,16,0,0,0,0,L>>8&255,L&255,0,0]))},R.stsd=function(M){return M.type==="audio"?!M.isAAC&&M.codec==="mp3"?R.box(R.types.stsd,R.STSD,R.mp3(M)):R.box(R.types.stsd,R.STSD,R.mp4a(M)):R.box(R.types.stsd,R.STSD,R.avc1(M))},R.tkhd=function(M){var L=M.id,I=M.duration*M.timescale,p=M.width,m=M.height,u=Math.floor(I/(Y+1)),h=Math.floor(I%(Y+1));return R.box(R.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,L>>24&255,L>>16&255,L>>8&255,L&255,0,0,0,0,u>>24,u>>16&255,u>>8&255,u&255,h>>24,h>>16&255,h>>8&255,h&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,p>>8&255,p&255,0,0,m>>8&255,m&255,0,0]))},R.traf=function(M,L){var I=R.sdtp(M),p=M.id,m=Math.floor(L/(Y+1)),u=Math.floor(L%(Y+1));return R.box(R.types.traf,R.box(R.types.tfhd,new Uint8Array([0,0,0,0,p>>24,p>>16&255,p>>8&255,p&255])),R.box(R.types.tfdt,new Uint8Array([1,0,0,0,m>>24,m>>16&255,m>>8&255,m&255,u>>24,u>>16&255,u>>8&255,u&255])),R.trun(M,I.length+16+20+8+16+8+8),I)},R.trak=function(M){return M.duration=M.duration||4294967295,R.box(R.types.trak,R.tkhd(M),R.mdia(M))},R.trex=function(M){var L=M.id;return R.box(R.types.trex,new Uint8Array([0,0,0,0,L>>24,L>>16&255,L>>8&255,L&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},R.trun=function(M,L){var I=M.samples||[],p=I.length,m=12+16*p,u=new Uint8Array(m),h,s,l,i,r,n;for(L+=8+m,u.set([0,0,15,1,p>>>24&255,p>>>16&255,p>>>8&255,p&255,L>>>24&255,L>>>16&255,L>>>8&255,L&255],0),h=0;h>>24&255,l>>>16&255,l>>>8&255,l&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255,r.isLeading<<2|r.dependsOn,r.isDependedOn<<6|r.hasRedundancy<<4|r.paddingValue<<1|r.isNonSync,r.degradPrio&240<<8,r.degradPrio&15,n>>>24&255,n>>>16&255,n>>>8&255,n&255],12+16*h);return R.box(R.types.trun,u)},R.initSegment=function(M){R.types||R.init();var L=R.moov(M),I=new Uint8Array(R.FTYP.byteLength+L.byteLength);return I.set(R.FTYP),I.set(L,R.FTYP.byteLength),I},R}();W.types=void 0,W.HDLR_TYPES=void 0,W.STTS=void 0,W.STSC=void 0,W.STCO=void 0,W.STSZ=void 0,W.VMHD=void 0,W.SMHD=void 0,W.STSD=void 0,W.FTYP=void 0,W.DINF=void 0,V.default=W},"./src/remux/mp4-remuxer.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"default",function(){return n}),P.d(V,"normalizePts",function(){return d});var Y=P("./src/polyfills/number.ts"),W=P("./src/remux/aac-helper.ts"),R=P("./src/remux/mp4-generator.ts"),B=P("./src/events.ts"),M=P("./src/errors.ts"),L=P("./src/utils/logger.ts"),I=P("./src/types/loader.ts"),p=P("./src/utils/timescale-conversion.ts");function m(){return m=Object.assign||function(O){for(var E=1;E0?S:y.pts},_[0].pts);return f&&L.logger.debug("PTS rollover detected"),c},E.remux=function(_,f,c,S,y,b,N,F){var X,Z,H,A,z,ne,ae=y,me=y,xe=_.pid>-1,Te=f.pid>-1,Oe=f.samples.length,Ue=_.samples.length>0,De=Oe>1,be=(!xe||Ue)&&(!Te||De)||this.ISGenerated||N;if(be){this.ISGenerated||(H=this.generateIS(_,f,y));var ge=this.isVideoContiguous,He=-1;if(De&&(He=w(f.samples),!ge&&this.config.forceKeyFrameOnDiscontinuity))if(ne=!0,He>0){L.logger.warn("[mp4-remuxer]: Dropped "+He+" out of "+Oe+" video samples due to a missing keyframe");var ct=this.getVideoStartPts(f.samples);f.samples=f.samples.slice(He),f.dropped+=He,me+=(f.samples[0].pts-ct)/(f.timescale||9e4)}else He===-1&&(L.logger.warn("[mp4-remuxer]: No keyframe found out of "+Oe+" video samples"),ne=!1);if(this.ISGenerated){if(Ue&&De){var vt=this.getVideoStartPts(f.samples),_t=d(_.samples[0].pts,vt)-vt,yt=_t/f.inputTimeScale;ae+=Math.max(0,yt),me+=Math.max(0,-yt)}if(Ue){if(_.samplerate||(L.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),H=this.generateIS(_,f,y)),Z=this.remuxAudio(_,ae,this.isAudioContiguous,b,Te||De||F===I.PlaylistLevelType.AUDIO?me:void 0),De){var et=Z?Z.endPTS-Z.startPTS:0;f.inputTimeScale||(L.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),H=this.generateIS(_,f,y)),X=this.remuxVideo(f,me,ge,et)}}else De&&(X=this.remuxVideo(f,me,ge,0));X&&(X.firstKeyFrame=He,X.independent=He!==-1)}}return this.ISGenerated&&(c.samples.length&&(z=this.remuxID3(c,y)),S.samples.length&&(A=this.remuxText(S,y))),{audio:Z,video:X,initSegment:H,independent:ne,text:A,id3:z}},E.generateIS=function(_,f,c){var S=_.samples,y=f.samples,b=this.typeSupported,N={},F=!Object(Y.isFiniteNumber)(this._initPTS),X="audio/mp4",Z,H,A;if(F&&(Z=H=Infinity),_.config&&S.length&&(_.timescale=_.samplerate,_.isAAC||(b.mpeg?(X="audio/mpeg",_.codec=""):b.mp3&&(_.codec="mp3")),N.audio={id:"audio",container:X,codec:_.codec,initSegment:!_.isAAC&&b.mpeg?new Uint8Array(0):R.default.initSegment([_]),metadata:{channelCount:_.channelCount}},F&&(A=_.inputTimeScale,Z=H=S[0].pts-Math.round(A*c))),f.sps&&f.pps&&y.length&&(f.timescale=f.inputTimeScale,N.video={id:"main",container:"video/mp4",codec:f.codec,initSegment:R.default.initSegment([f]),metadata:{width:f.width,height:f.height}},F)){A=f.inputTimeScale;var z=this.getVideoStartPts(y),ne=Math.round(A*c);H=Math.min(H,d(y[0].dts,z)-ne),Z=Math.min(Z,z-ne)}if(Object.keys(N).length)return this.ISGenerated=!0,F&&(this._initPTS=Z,this._initDTS=H),{tracks:N,initPTS:Z,timescale:A}},E.remuxVideo=function(_,f,c,S){var y=_.inputTimeScale,b=_.samples,N=[],F=b.length,X=this._initPTS,Z=this.nextAvcDts,H=8,A,z,ne,ae=Number.POSITIVE_INFINITY,me=Number.NEGATIVE_INFINITY,xe=0,Te=!1;if(!c||Z===null){var Oe=f*y,Ue=b[0].pts-d(b[0].dts,b[0].pts);Z=Oe-Ue}for(var De=0;Debe.pts){var ge=9e4*.2;xe=Math.max(Math.min(xe,be.pts-be.dts),-1*ge)}be.dts0?De-1:De].dts&&(Te=!0)}Te&&b.sort(function(wt,Qe){var it=wt.dts-Qe.dts,We=wt.pts-Qe.pts;return it||We}),z=b[0].dts,ne=b[b.length-1].dts;var He=Math.round((ne-z)/(F-1));if(xe<0){if(xeHe,ht=yt<-1;if(et||ht){et?L.logger.warn("AVC: "+Object(p.toMsFromMpegTsClock)(yt,!0)+" ms ("+yt+"dts) hole between fragments detected, filling it"):L.logger.warn("AVC: "+Object(p.toMsFromMpegTsClock)(-yt,!0)+" ms ("+yt+"dts) overlapping between fragments detected"),z=Z;var xt=b[0].pts-yt;b[0].dts=z,b[0].pts=xt,L.logger.log("Video: First PTS/DTS adjusted: "+Object(p.toMsFromMpegTsClock)(xt,!0)+"/"+Object(p.toMsFromMpegTsClock)(z,!0)+", delta: "+Object(p.toMsFromMpegTsClock)(yt,!0)+" ms")}}r&&(z=Math.max(0,z));for(var Tt=0,mt=0,Ie=0;Ie0?Pe-1:Pe].dts;if(de.stretchShortVideoTrack&&this.nextAudioPts!==null){var pe=Math.floor(de.maxBufferHole*y),Ce=(S?ae+S*y:this.nextAudioPts)-tt.pts;Ce>pe?(A=Ce-ve,A<0&&(A=ve),L.logger.log("[mp4-remuxer]: It is approximately "+Ce/90+" ms to the next segment; using duration "+A/90+" ms for the last video frame.")):A=ve}else A=ve}var Ke=Math.round(tt.pts-tt.dts);N.push(new T(tt.key,A,Fe,Ke))}if(N.length&&l&&l<70){var st=N[0].flags;st.dependsOn=2,st.isNonSync=0}console.assert(A!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=Z=ne+A,this.isVideoContiguous=!0;var At=R.default.moof(_.sequenceNumber++,z,m({},_,{samples:N})),Ft="video",kt={data1:At,data2:jt,startPTS:ae/y,endPTS:(me+A)/y,startDTS:z/y,endDTS:Z/y,type:Ft,hasAudio:!1,hasVideo:!0,nb:N.length,dropped:_.dropped};return _.samples=[],_.dropped=0,console.assert(jt.length,"MDAT length must not be zero"),kt},E.remuxAudio=function(_,f,c,S,y){var b=_.inputTimeScale,N=_.samplerate?_.samplerate:b,F=b/N,X=_.isAAC?h:s,Z=X*F,H=this._initPTS,A=!_.isAAC&&this.typeSupported.mpeg,z=[],ne=_.samples,ae=A?0:8,me=this.nextAudioPts||-1,xe=f*b;if(this.isAudioContiguous=c=c||ne.length&&me>0&&(S&&Math.abs(xe-me)<9e3||Math.abs(d(ne[0].pts-H,xe)-me)<20*Z),ne.forEach(function(_e){_e.pts=d(_e.pts-H,xe)}),!c||me<0){if(ne=ne.filter(function(_e){return _e.pts>=0}),!ne.length)return;y===0?me=0:S?me=Math.max(0,xe):me=ne[0].pts}if(_.isAAC)for(var Te=y!==void 0,Oe=this.config.maxAudioFramesDrift,Ue=0,De=me;Ue=Oe*Z&&ct0){mt+=ae;try{Tt=new Uint8Array(mt)}catch(_e){this.observer.emit(B.Events.ERROR,B.Events.ERROR,{type:M.ErrorTypes.MUX_ERROR,details:M.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:mt,reason:"fail allocating audio mdat "+mt});return}if(!A){var jt=new DataView(Tt.buffer);jt.setUint32(0,mt),Tt.set(R.default.types.mdat,4)}}else return;Tt.set(lt,ae);var Me=lt.byteLength;ae+=Me,z.push(new T(!0,X,Me,0)),xt=bt}var Pe=z.length;if(!Pe)return;var tt=z[z.length-1];this.nextAudioPts=me=xt+F*tt.duration;var rt=A?new Uint8Array(0):R.default.moof(_.sequenceNumber++,ht/F,m({},_,{samples:z}));_.samples=[];var Fe=ht/b,Je=me/b,Ee="audio",ye={data1:rt,data2:Tt,startPTS:Fe,endPTS:Je,startDTS:Fe,endDTS:Je,type:Ee,hasAudio:!0,hasVideo:!1,nb:Pe};return this.isAudioContiguous=!0,console.assert(Tt.length,"MDAT length must not be zero"),ye},E.remuxEmptyAudio=function(_,f,c,S){var y=_.inputTimeScale,b=_.samplerate?_.samplerate:y,N=y/b,F=this.nextAudioPts,X=(F!==null?F:S.startDTS*y)+this._initDTS,Z=S.endDTS*y+this._initDTS,H=N*h,A=Math.ceil((Z-X)/H),z=W.default.getSilentFrame(_.manifestCodec||_.codec,_.channelCount);if(L.logger.warn("[mp4-remuxer]: remux empty Audio"),!z){L.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var ne=[],ae=0;ae4294967296;)O+=v;return O}function w(O){for(var E=0;E0?this.lastEndDTS=_:(B.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var f=!!O.audio,c=!!O.video,S="";f&&(S+="audio"),c&&(S+="video");var y={data1:T,startPTS:v,startDTS:v,endPTS:_,endDTS:_,type:S,hasAudio:f,hasVideo:c,nb:1,dropped:0};return w.audio=y.type==="audio"?y:void 0,w.video=y.type!=="audio"?y:void 0,w.text=i,w.id3=l,w.initSegment=x,w},p}(),L=function(m,u,h){return Object(W.getStartDTS)(m,u)-h};function I(p,m){var u=p==null?void 0:p.codec;return u&&u.length>4?u:u==="hvc1"?"hvc1.1.c.L120.90":u==="av01"?"av01.0.04M.08":u==="avc1"||m===R.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}V.default=M},"./src/task-loop.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"default",function(){return Y});var Y=function(){function W(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var R=W.prototype;return R.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},R.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},R.onHandlerDestroyed=function(){},R.hasInterval=function(){return!!this._tickInterval},R.hasNextTick=function(){return!!this._tickTimer},R.setInterval=function(M){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,M),!0)},R.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},R.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},R.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},R.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},R.doTick=function(){},W}()},"./src/types/cmcd.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"CMCDVersion",function(){return Y}),P.d(V,"CMCDObjectType",function(){return W}),P.d(V,"CMCDStreamingFormat",function(){return R}),P.d(V,"CMCDStreamType",function(){return B});var Y=1,W;(function(M){M.MANIFEST="m",M.AUDIO="a",M.VIDEO="v",M.MUXED="av",M.INIT="i",M.CAPTION="c",M.TIMED_TEXT="tt",M.KEY="k",M.OTHER="o"})(W||(W={}));var R;(function(M){M.DASH="d",M.HLS="h",M.SMOOTH="s",M.OTHER="o"})(R||(R={}));var B;(function(M){M.VOD="v",M.LIVE="l"})(B||(B={}))},"./src/types/level.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"HlsSkip",function(){return R}),P.d(V,"getSkipValue",function(){return B}),P.d(V,"HlsUrlParameters",function(){return M}),P.d(V,"Level",function(){return L});function Y(I,p){for(var m=0;mNumber.MAX_SAFE_INTEGER?Infinity:p},M.hexadecimalInteger=function(I){if(this[I]){var p=(this[I]||"0x").slice(2);p=(p.length&1?"0":"")+p;for(var m=new Uint8Array(p.length/2),u=0;uNumber.MAX_SAFE_INTEGER?Infinity:p},M.decimalFloatingPoint=function(I){return parseFloat(this[I])},M.optionalFloat=function(I,p){var m=this[I];return m?parseFloat(m):p},M.enumeratedString=function(I){return this[I]},M.bool=function(I){return this[I]==="YES"},M.decimalResolution=function(I){var p=Y.exec(this[I]);return p===null?void 0:{width:parseInt(p[1],10),height:parseInt(p[2],10)}},B.parseAttrList=function(I){var p,m={},u='"';for(W.lastIndex=0;(p=W.exec(I))!==null;){var h=p[2];h.indexOf(u)===0&&h.lastIndexOf(u)===h.length-1&&(h=h.slice(1,-1)),m[p[1]]=h}return m},B}()},"./src/utils/binary-search.ts":function(ee,V,P){"use strict";P.r(V);var Y={search:function(R,B){for(var M=0,L=R.length-1,I=null,p=null;M<=L;){I=(M+L)/2|0,p=R[I];var m=B(p);if(m>0)M=I+1;else if(m<0)L=I-1;else return p}return null}};V.default=Y},"./src/utils/buffer-helper.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"BufferHelper",function(){return R});var Y=P("./src/utils/logger.ts"),W={length:0,start:function(){return 0},end:function(){return 0}},R=function(){function B(){}return B.isBuffered=function(L,I){try{if(L){for(var p=B.getBuffered(L),m=0;m=p.start(m)&&I<=p.end(m))return!0}}catch(u){}return!1},B.bufferInfo=function(L,I,p){try{if(L){var m=B.getBuffered(L),u=[],h;for(h=0;hs&&(m[h-1].end=L[u].end):m.push(L[u])}else m.push(L[u])}else m=L;for(var l=0,i,r=I,n=I,d=0;d=w&&I=c&&Y.logger.log(this.time+" ["+c+"] "+S)},v}(),l=function(_){for(var f=[],c=0;c<_.length;c++)f.push(_[c].toString(16));return f},i=function(){function v(f,c,S,y,b){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=f||"white",this.underline=c||!1,this.italics=S||!1,this.background=y||"black",this.flash=b||!1}var _=v.prototype;return _.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},_.setStyles=function(c){for(var S=["foreground","underline","italics","background","flash"],y=0;yM&&(this.logger.log(h.DEBUG,"Too large cursor position "+this.pos),this.pos=M)},_.moveCursor=function(c){var S=this.pos+c;if(c>1)for(var y=this.pos+1;y=144&&this.backSpace();var S=R(c);if(this.pos>=M){this.logger.log(h.ERROR,"Cannot insert "+c.toString(16)+" ("+S+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(S,this.currPenState),this.moveCursor(1)},_.clearFromPos=function(c){var S;for(S=c;S0&&(c?y="["+S.join(" | ")+"]":y=S.join(` `)),y},_.getTextAndFormat=function(){return this.rows},v}(),w=function(){function v(f,c,S){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=f,this.outputFilter=c,this.mode=null,this.verbose=0,this.displayedMemory=new d(S),this.nonDisplayedMemory=new d(S),this.lastOutputScreen=new d(S),this.currRollUpRow=this.displayedMemory.rows[B-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=S}var _=v.prototype;return _.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[B-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},_.getHandler=function(){return this.outputFilter},_.setHandler=function(c){this.outputFilter=c},_.setPAC=function(c){this.writeScreen.setPAC(c)},_.setBkgData=function(c){this.writeScreen.setBkgData(c)},_.setMode=function(c){if(c===this.mode)return;this.mode=c,this.logger.log(h.INFO,"MODE="+c),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=c},_.insertChars=function(c){for(var S=0;S=46,S.italics)S.foreground="white";else{var y=Math.floor(c/2)-16,b=["white","green","blue","cyan","red","yellow","magenta"];S.foreground=b[y]}this.logger.log(h.INFO,"MIDROW: "+JSON.stringify(S)),this.writeScreen.setPen(S)},_.outputDataUpdate=function(c){c===void 0&&(c=!1);var S=this.logger.time;if(S===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=S:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,S,this.lastOutputScreen),c&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:S),this.lastOutputScreen.copy(this.displayedMemory))},_.cueSplitAtTime=function(c){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,c,this.displayedMemory),this.cueStartTime=c))},v}(),T=function(){function v(f,c,S){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var y=new s;this.channels=[null,new w(f,c,y),new w(f+1,S,y)],this.cmdHistory=E(),this.logger=y}var _=v.prototype;return _.getHandler=function(c){return this.channels[c].getHandler()},_.setHandler=function(c,S){this.channels[c].setHandler(S)},_.addData=function(c,S){var y,b,N,F=!1;this.logger.time=c;for(var X=0;X ("+l([b,N])+")"),y=this.parseCmd(b,N),y||(y=this.parseMidrow(b,N)),y||(y=this.parsePAC(b,N)),y||(y=this.parseBackgroundAttributes(b,N)),!y&&(F=this.parseChars(b,N),F)){var Z=this.currentChannel;if(Z&&Z>0){var H=this.channels[Z];H.insertChars(F)}else this.logger.log(h.WARNING,"No channel found yet. TEXT-MODE?")}!y&&!F&&this.logger.log(h.WARNING,"Couldn't parse cleaned data "+l([b,N])+" orig: "+l([S[X],S[X+1]]))}},_.parseCmd=function(c,S){var y=this.cmdHistory,b=(c===20||c===28||c===21||c===29)&&S>=32&&S<=47,N=(c===23||c===31)&&S>=33&&S<=35;if(!(b||N))return!1;if(O(c,S,y))return x(null,null,y),this.logger.log(h.DEBUG,"Repeated command ("+l([c,S])+") is dropped"),!0;var F=c===20||c===21||c===23?1:2,X=this.channels[F];return c===20||c===21||c===28||c===29?S===32?X.ccRCL():S===33?X.ccBS():S===34?X.ccAOF():S===35?X.ccAON():S===36?X.ccDER():S===37?X.ccRU(2):S===38?X.ccRU(3):S===39?X.ccRU(4):S===40?X.ccFON():S===41?X.ccRDC():S===42?X.ccTR():S===43?X.ccRTD():S===44?X.ccEDM():S===45?X.ccCR():S===46?X.ccENM():S===47&&X.ccEOC():X.ccTO(S-32),x(c,S,y),this.currentChannel=F,!0},_.parseMidrow=function(c,S){var y=0;if((c===17||c===25)&&S>=32&&S<=47){if(c===17?y=1:y=2,y!==this.currentChannel)return this.logger.log(h.ERROR,"Mismatch channel in midrow parsing"),!1;var b=this.channels[y];return b?(b.ccMIDROW(S),this.logger.log(h.DEBUG,"MIDROW ("+l([c,S])+")"),!0):!1}return!1},_.parsePAC=function(c,S){var y,b=this.cmdHistory,N=(c>=17&&c<=23||c>=25&&c<=31)&&S>=64&&S<=127,F=(c===16||c===24)&&S>=64&&S<=95;if(!(N||F))return!1;if(O(c,S,b))return x(null,null,b),!0;var X=c<=23?1:2;S>=64&&S<=95?y=X===1?L[c]:p[c]:y=X===1?I[c]:m[c];var Z=this.channels[X];return Z?(Z.setPAC(this.interpretPAC(y,S)),x(c,S,b),this.currentChannel=X,!0):!1},_.interpretPAC=function(c,S){var y,b={color:null,italics:!1,indent:null,underline:!1,row:c};return S>95?y=S-96:y=S-64,b.underline=(y&1)===1,y<=13?b.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(y/2)]:y<=15?(b.italics=!0,b.color="white"):b.indent=Math.floor((y-16)/2)*4,b},_.parseChars=function(c,S){var y,b=null,N=null;if(c>=25?(y=2,N=c-8):(y=1,N=c),N>=17&&N<=19){var F;N===17?F=S+80:N===18?F=S+112:F=S+144,this.logger.log(h.INFO,"Special char '"+R(F)+"' in channel "+y),b=[F]}else c>=32&&c<=127&&(b=S===0?[c]:[c,S]);if(b){var X=l(b);this.logger.log(h.DEBUG,"Char codes = "+X.join(",")),x(c,S,this.cmdHistory)}return b},_.parseBackgroundAttributes=function(c,S){var y=(c===16||c===24)&&S>=32&&S<=47,b=(c===23||c===31)&&S>=45&&S<=47;if(!(y||b))return!1;var N,F={};c===16||c===24?(N=Math.floor((S-32)/2),F.background=u[N],S%2===1&&(F.background=F.background+"_semi")):S===45?F.background="transparent":(F.foreground="black",S===47&&(F.underline=!0));var X=c<=23?1:2,Z=this.channels[X];return Z.setBkgData(F),x(c,S,this.cmdHistory),!0},_.reset=function(){for(var c=0;c=16?r--:r++;var x=Object(Y.fixLineBreaks)(n.trim()),O=Object(W.generateCueId)(p,m,x);(!I||!I.cues||!I.cues.getCueById(O))&&(l=new d(p,m,x),l.id=O,l.line=w+1,l.align="left",l.position=10+Math.min(80,Math.floor(r*8/32)*10),h.push(l))}return I&&h.length&&(h.sort(function(E,v){return E.line==="auto"||v.line==="auto"?0:E.line>8&&v.line>8?v.line-E.line:E.line-v.line}),h.forEach(function(E){return Object(R.addCueToTrack)(I,E)})),h}};V.default=M},"./src/utils/discontinuities.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"findFirstFragWithCC",function(){return B}),P.d(V,"shouldAlignOnDiscontinuities",function(){return M}),P.d(V,"findDiscontinuousReferenceFrag",function(){return L}),P.d(V,"adjustSlidingStart",function(){return p}),P.d(V,"alignStream",function(){return m}),P.d(V,"alignPDT",function(){return h}),P.d(V,"alignFragmentByPDTDelta",function(){return s}),P.d(V,"alignMediaPlaylistByPDT",function(){return l});var Y=P("./src/polyfills/number.ts"),W=P("./src/utils/logger.ts"),R=P("./src/controller/level-helper.ts");function B(i,r){for(var n=null,d=0,w=i.length;dn.startCC||i&&i.cc=this.minWeight_},B.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},B.destroy=function(){},R}();V.default=W},"./src/utils/ewma.ts":function(ee,V,P){"use strict";P.r(V);var Y=function(){function W(B,M,L){M===void 0&&(M=0),L===void 0&&(L=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=B,this.alpha_=B?Math.exp(Math.log(.5)/B):0,this.estimate_=M,this.totalWeight_=L}var R=W.prototype;return R.sample=function(M,L){var I=Math.pow(this.alpha_,M);this.estimate_=L*(1-I)+I*this.estimate_,this.totalWeight_+=M},R.getTotalWeight=function(){return this.totalWeight_},R.getEstimate=function(){if(this.alpha_){var M=1-Math.pow(this.alpha_,this.totalWeight_);if(M)return this.estimate_/M}return this.estimate_},W}();V.default=Y},"./src/utils/fetch-loader.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"fetchSupported",function(){return s});var Y=P("./src/polyfills/number.ts"),W=P("./src/loader/load-stats.ts"),R=P("./src/demux/chunk-cache.ts");function B(d,w){d.prototype=Object.create(w.prototype),d.prototype.constructor=d,m(d,w)}function M(d){var w=typeof Map=="function"?new Map:void 0;return M=function(x){if(x===null||!p(x))return x;if(typeof x!="function")throw new TypeError("Super expression must either be null or a function");if(typeof w!="undefined"){if(w.has(x))return w.get(x);w.set(x,O)}function O(){return L(x,arguments,u(this).constructor)}return O.prototype=Object.create(x.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),m(O,x)},M(d)}function L(d,w,T){return I()?L=Reflect.construct:L=function(O,E,v){var _=[null];_.push.apply(_,E);var f=Function.bind.apply(O,_),c=new f;return v&&m(c,v.prototype),c},L.apply(null,arguments)}function I(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(d){return!1}}function p(d){return Function.toString.call(d).indexOf("[native code]")!==-1}function m(d,w){return m=Object.setPrototypeOf||function(x,O){return x.__proto__=O,x},m(d,w)}function u(d){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(T){return T.__proto__||Object.getPrototypeOf(T)},u(d)}function h(){return h=Object.assign||function(d){for(var w=1;w=v&&_(O,E,f.flush(),x)):_(O,E,N,x),y()}).catch(function(){return Promise.reject()})};return S()},d}();function i(d,w){var T={method:"GET",mode:"cors",credentials:"same-origin",signal:w,headers:new self.Headers(h({},d.headers))};return d.rangeEnd&&T.headers.set("Range","bytes="+d.rangeStart+"-"+String(d.rangeEnd-1)),T}function r(d,w){return new self.Request(d.url,w)}var n=function(d){B(w,d);function w(T,x,O){var E;return E=d.call(this,T)||this,E.code=void 0,E.details=void 0,E.code=x,E.details=O,E}return w}(M(Error));V.default=l},"./src/utils/imsc1-ttml-parser.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"IMSC1_CODEC",function(){return p}),P.d(V,"parseIMSC1",function(){return s});var Y=P("./src/utils/mp4-tools.ts"),W=P("./src/utils/vttparser.ts"),R=P("./src/utils/vttcue.ts"),B=P("./src/demux/id3.ts"),M=P("./src/utils/timescale-conversion.ts"),L=P("./src/utils/webvtt-parser.ts");function I(){return I=Object.assign||function(v){for(var _=1;_"):Y}function M(p){for(var m=arguments.length,u=new Array(m>1?m-1:0),h=1;h>24,w[T+1]=x>>16&255,w[T+2]=x>>8&255,w[T+3]=x&255}function m(w,T){var x=[];if(!T.length)return x;var O,E,v;"data"in w?(O=w.data,E=w.start,v=w.end):(O=w,E=0,v=O.byteLength);for(var _=E;_1?_+f:v;if(c===T[0])if(T.length===1)x.push({data:O,start:_+8,end:S});else{var y=m({data:O,start:_+8,end:S},T.slice(1));y.length&&B.apply(x,y)}_=S}return x}function u(w){var T=m(w,["moov"]),x=T[0],O=x?x.end:null,E=m(w,["sidx"]);if(!E||!E[0])return null;var v=[],_=E[0],f=_.data[0],c=f===0?8:16,S=I(_,c);c+=4;var y=0,b=0;f===0?c+=8:c+=16,c+=2;var N=_.end+b,F=L(_,c);c+=2;for(var X=0;X>>31;if(z===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var ne=I(_,Z);Z+=4,v.push({referenceSize:A,subsegmentDuration:ne,info:{duration:ne/S,start:N,end:N+A-1}}),N+=A,Z+=4,c=Z}return{earliestPresentationTime:y,timescale:S,version:f,referencesCount:F,references:v,moovEndOffset:O}}function h(w){for(var T=[],x=m(w,["moov","trak"]),O=0;OM)&&(this.startTime=M),this.endTime=L,this.screen=I,this.timelineController.createCaptionsTrack(this.trackName)},R.reset=function(){this.cueRanges=[]},W}()},"./src/utils/texttrack-utils.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"sendAddTrackEvent",function(){return W}),P.d(V,"addCueToTrack",function(){return R}),P.d(V,"clearCurrentCues",function(){return B}),P.d(V,"removeCuesInRange",function(){return M}),P.d(V,"getCuesInRange",function(){return I});var Y=P("./src/utils/logger.ts");function W(p,m){var u;try{u=new Event("addtrack")}catch(h){u=document.createEvent("Event"),u.initEvent("addtrack",!1,!1)}u.track=p,m.dispatchEvent(u)}function R(p,m){var u=p.mode;if(u==="disabled"&&(p.mode="hidden"),p.cues&&!p.cues.getCueById(m.id))try{if(p.addCue(m),!p.cues.getCueById(m.id))throw new Error("addCue is failed for: "+m)}catch(s){Y.logger.debug("[texttrack-utils]: "+s);var h=new self.TextTrackCue(m.startTime,m.endTime,m.text);h.id=m.id,p.addCue(h)}u==="disabled"&&(p.mode=u)}function B(p){var m=p.mode;if(m==="disabled"&&(p.mode="hidden"),p.cues)for(var u=p.cues.length;u--;)p.removeCue(p.cues[u]);m==="disabled"&&(p.mode=m)}function M(p,m,u){var h=p.mode;if(h==="disabled"&&(p.mode="hidden"),p.cues&&p.cues.length>0)for(var s=I(p.cues,m,u),l=0;lp[u].endTime)return-1;for(var h=0,s=u;h<=s;){var l=Math.floor((s+h)/2);if(mp[l].startTime&&h-1)for(var l=s,i=p.length;l=m&&r.endTime<=u)h.push(r);else if(r.startTime>u)return h}return h}},"./src/utils/time-ranges.ts":function(ee,V,P){"use strict";P.r(V);var Y={toString:function(R){for(var B="",M=R.length,L=0;L1?m-1:0),h=1;h100)throw new Error("Position must be between 0 and 100.");v=y,this.hasBeenReset=!0}})),Object.defineProperty(h,"positionAlign",L({},s,{get:function(){return _},set:function(y){var b=M(y);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");_=b,this.hasBeenReset=!0}})),Object.defineProperty(h,"size",L({},s,{get:function(){return f},set:function(y){if(y<0||y>100)throw new Error("Size must be between 0 and 100.");f=y,this.hasBeenReset=!0}})),Object.defineProperty(h,"align",L({},s,{get:function(){return c},set:function(y){var b=M(y);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");c=b,this.hasBeenReset=!0}})),h.displayState=void 0}return I.prototype.getCueAsHTML=function(){var p=self.WebVTT;return p.convertCueToDOMTree(self,this.text)},I}()},"./src/utils/vttparser.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"parseTimeStamp",function(){return R}),P.d(V,"fixLineBreaks",function(){return m}),P.d(V,"VTTParser",function(){return u});var Y=P("./src/utils/vttcue.ts"),W=function(){function h(){}var s=h.prototype;return s.decode=function(i,r){if(!i)return"";if(typeof i!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(i))},h}();function R(h){function s(i,r,n,d){return(i|0)*3600+(r|0)*60+(n|0)+parseFloat(d||0)}var l=h.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return l?parseFloat(l[2])>59?s(l[2],l[3],0,l[4]):s(l[1],l[2],l[3],l[4]):null}var B=function(){function h(){this.values=Object.create(null)}var s=h.prototype;return s.set=function(i,r){!this.get(i)&&r!==""&&(this.values[i]=r)},s.get=function(i,r,n){return n?this.has(i)?this.values[i]:r[n]:this.has(i)?this.values[i]:r},s.has=function(i){return i in this.values},s.alt=function(i,r,n){for(var d=0;d=0&&n<=100)return this.set(i,n),!0}return!1},h}();function M(h,s,l,i){var r=i?h.split(i):[h];for(var n in r){if(typeof r[n]!="string")continue;var d=r[n].split(l);if(d.length!==2)continue;var w=d[0],T=d[1];s(w,T)}}var L=new Y.default(0,0,""),I=L.align==="middle"?"middle":"center";function p(h,s,l){var i=h;function r(){var w=R(h);if(w===null)throw new Error("Malformed timestamp: "+i);return h=h.replace(/^[^\sa-zA-Z-]+/,""),w}function n(w,T){var x=new B;M(w,function(v,_){var f;switch(v){case"region":for(var c=l.length-1;c>=0;c--)if(l[c].id===_){x.set(v,l[c].region);break}break;case"vertical":x.alt(v,_,["rl","lr"]);break;case"line":f=_.split(","),x.integer(v,f[0]),x.percent(v,f[0])&&x.set("snapToLines",!1),x.alt(v,f[0],["auto"]),f.length===2&&x.alt("lineAlign",f[1],["start",I,"end"]);break;case"position":f=_.split(","),x.percent(v,f[0]),f.length===2&&x.alt("positionAlign",f[1],["start",I,"end","line-left","line-right","auto"]);break;case"size":x.percent(v,_);break;case"align":x.alt(v,_,["start",I,"end","left","right"]);break}},/:/,/\s/),T.region=x.get("region",null),T.vertical=x.get("vertical","");var O=x.get("line","auto");O==="auto"&&L.line===-1&&(O=-1),T.line=O,T.lineAlign=x.get("lineAlign","start"),T.snapToLines=x.get("snapToLines",!0),T.size=x.get("size",100),T.align=x.get("align",I);var E=x.get("position","auto");E==="auto"&&L.position===50&&(E=T.align==="start"||T.align==="left"?0:T.align==="end"||T.align==="right"?100:50),T.position=E}function d(){h=h.replace(/^\s+/,"")}if(d(),s.startTime=r(),d(),h.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+i);h=h.substr(3),d(),s.endTime=r(),d(),n(h,s)}function m(h){return h.replace(//gi,` `)}var u=function(){function h(){this.state="INITIAL",this.buffer="",this.decoder=new W,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var s=h.prototype;return s.parse=function(i){var r=this;i&&(r.buffer+=r.decoder.decode(i,{stream:!0}));function n(){var E=r.buffer,v=0;for(E=m(E);v")===-1){r.cue.id=w;continue}case"CUE":if(!r.cue){r.state="BADCUE";continue}try{p(w,r.cue,r.regionList)}catch(E){r.cue=null,r.state="BADCUE";continue}r.state="CUETEXT";continue;case"CUETEXT":{var O=w.indexOf("-->")!==-1;if(!w||O&&(x=!0)){r.oncue&&r.cue&&r.oncue(r.cue),r.cue=null,r.state="ID";continue}if(r.cue===null)continue;r.cue.text&&(r.cue.text+=` `),r.cue.text+=w}continue;case"BADCUE":w||(r.state="ID")}}}catch(E){r.state==="CUETEXT"&&r.cue&&r.oncue&&r.oncue(r.cue),r.cue=null,r.state=r.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},s.flush=function(){var i=this;try{if((i.cue||i.state==="HEADER")&&(i.buffer+=` `,i.parse()),i.state==="INITIAL"||i.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(r){i.onparsingerror&&i.onparsingerror(r)}return i.onflush&&i.onflush(),this},h}()},"./src/utils/webvtt-parser.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"generateCueId",function(){return u}),P.d(V,"parseWebVTT",function(){return s});var Y=P("./src/polyfills/number.ts"),W=P("./src/utils/vttparser.ts"),R=P("./src/demux/id3.ts"),B=P("./src/utils/timescale-conversion.ts"),M=P("./src/remux/mp4-remuxer.ts"),L=/\r\n|\n\r|\n|\r/g,I=function(i,r,n){return n===void 0&&(n=0),i.substr(n,r.length)===r},p=function(i){var r=parseInt(i.substr(-3)),n=parseInt(i.substr(-6,2)),d=parseInt(i.substr(-9,2)),w=i.length>9?parseInt(i.substr(0,i.indexOf(":"))):0;if(!Object(Y.isFiniteNumber)(r)||!Object(Y.isFiniteNumber)(n)||!Object(Y.isFiniteNumber)(d)||!Object(Y.isFiniteNumber)(w))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+i);return r+=1e3*n,r+=60*1e3*d,r+=60*60*1e3*w,r},m=function(i){for(var r=5381,n=i.length;n;)r=r*33^i.charCodeAt(--n);return(r>>>0).toString()};function u(l,i,r){return m(l.toString())+m(i.toString())+m(r)}var h=function(i,r,n){var d=i[r],w=i[d.prevCC];if(!w||!w.new&&d.new){i.ccOffset=i.presentationOffset=d.start,d.new=!1;return}for(;(T=w)!==null&&T!==void 0&&T.new;){var T;i.ccOffset+=d.start-w.start,d.new=!1,d=w,w=i[d.prevCC]}i.presentationOffset=n};function s(l,i,r,n,d,w,T,x){var O=new W.VTTParser,E=Object(R.utf8ArrayToStr)(new Uint8Array(l)).trim().replace(L,` `).split(` `),v=[],_=Object(B.toMpegTsClockFromTimescale)(i,r),f="00:00.000",c=0,S=0,y,b=!0,N=!1;O.oncue=function(F){var X=n[d],Z=n.ccOffset,H=(c-_)/9e4;if(X!=null&&X.new&&(S!==void 0?Z=n.ccOffset=X.start:h(n,d,H)),H&&(Z=H-n.presentationOffset),N){var A=F.endTime-F.startTime,z=Object(M.normalizePts)((F.startTime+Z-S)*9e4,w*9e4)/9e4;F.startTime=z,F.endTime=z+A}var ne=F.text.trim();F.text=decodeURIComponent(encodeURIComponent(ne)),F.id||(F.id=u(F.startTime,F.endTime,ne)),F.endTime>0&&v.push(F)},O.onparsingerror=function(F){y=F},O.onflush=function(){if(y){x(y);return}T(v)},E.forEach(function(F){if(b)if(I(F,"X-TIMESTAMP-MAP=")){b=!1,N=!0,F.substr(16).split(",").forEach(function(X){I(X,"LOCAL:")?f=X.substr(6):I(X,"MPEGTS:")&&(c=parseInt(X.substr(7)))});try{S=p(f)/1e3}catch(X){N=!1,y=X}return}else F===""&&(b=!1);O.parse(F+` `)}),O.flush()}},"./src/utils/xhr-loader.ts":function(ee,V,P){"use strict";P.r(V);var Y=P("./src/utils/logger.ts"),W=P("./src/loader/load-stats.ts"),R=/^age:\s*[\d.]+\s*$/m,B=function(){function M(I){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=I?I.xhrSetup:null,this.stats=new W.LoadStats,this.retryDelay=0}var L=M.prototype;return L.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},L.abortInternal=function(){var p=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),p&&(p.onreadystatechange=null,p.onprogress=null,p.readyState!==4&&(this.stats.aborted=!0,p.abort()))},L.abort=function(){var p;this.abortInternal(),(p=this.callbacks)!==null&&p!==void 0&&p.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},L.load=function(p,m,u){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=p,this.config=m,this.callbacks=u,this.retryDelay=m.retryDelay,this.loadInternal()},L.loadInternal=function(){var p=this.config,m=this.context;if(!p)return;var u=this.loader=new self.XMLHttpRequest,h=this.stats;h.loading.first=0,h.loaded=0;var s=this.xhrSetup;try{if(s)try{s(u,m.url)}catch(r){u.open("GET",m.url,!0),s(u,m.url)}u.readyState||u.open("GET",m.url,!0);var l=this.context.headers;if(l)for(var i in l)u.setRequestHeader(i,l[i])}catch(r){this.callbacks.onError({code:u.status,text:r.message},m,u);return}m.rangeEnd&&u.setRequestHeader("Range","bytes="+m.rangeStart+"-"+(m.rangeEnd-1)),u.onreadystatechange=this.readystatechange.bind(this),u.onprogress=this.loadprogress.bind(this),u.responseType=m.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),p.timeout),u.send()},L.readystatechange=function(){var p=this.context,m=this.loader,u=this.stats;if(!p||!m)return;var h=m.readyState,s=this.config;if(u.aborted)return;if(h>=2)if(self.clearTimeout(this.requestTimeout),u.loading.first===0&&(u.loading.first=Math.max(self.performance.now(),u.loading.start)),h===4){m.onreadystatechange=null,m.onprogress=null;var l=m.status;if(l>=200&&l<300){u.loading.end=Math.max(self.performance.now(),u.loading.first);var i,r;if(p.responseType==="arraybuffer"?(i=m.response,r=i.byteLength):(i=m.responseText,r=i.length),u.loaded=u.total=r,!this.callbacks)return;var n=this.callbacks.onProgress;if(n&&n(u,p,i,m),!this.callbacks)return;var d={url:m.responseURL,data:i};this.callbacks.onSuccess(d,u,p,m)}else u.retry>=s.maxRetry||l>=400&&l<499?(Y.logger.error(l+" while loading "+p.url),this.callbacks.onError({code:l,text:m.statusText},p,m)):(Y.logger.warn(l+" while loading "+p.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,s.maxRetryDelay),u.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.timeout)},L.loadtimeout=function(){Y.logger.warn("timeout while loading "+this.context.url);var p=this.callbacks;p&&(this.abortInternal(),p.onTimeout(this.stats,this.context,this.loader))},L.loadprogress=function(p){var m=this.stats;m.loaded=p.loaded,p.lengthComputable&&(m.total=p.total)},L.getCacheAge=function(){var p=null;if(this.loader&&R.test(this.loader.getAllResponseHeaders())){var m=this.loader.getResponseHeader("age");p=m?parseFloat(m):null}return p},M}();V.default=B}}).default})},vHTk:function(Be,we,k){Be.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},vef1:function(Be,we,k){Be.exports={upload:"upload___3GNI5"}},wCXF:function(Be,we,k){"use strict";k.d(we,"a",function(){return lt});var ee=k("rePB"),V=k("VTBJ"),P=k("KQm4"),Y=k("U8pU"),W=k("ODXe"),R=k("q1tI"),B=k("TSYQ"),M=k.n(B),L=k("Gytx"),I=k.n(L),p=k("Kwbf"),m=k("t23M"),u=k("qx4F"),h=k("6eGT"),s=k("IBYe"),l=k("Ff2n"),i=k("c+Xe"),r=k("fyJ8"),n=k("biw7");function d(Me,Pe,tt,rt,Fe){var Je=tt[Me]||{},Ee=tt[Pe]||{},ye,_e;Je.fixed==="left"?ye=rt.left[Me]:Ee.fixed==="right"&&(_e=rt.right[Pe]);var le=!1,de=!1,ve=!1,pe=!1,Ce=tt[Pe+1],Ke=tt[Me-1];if(Fe==="rtl"){if(ye!==void 0){var st=Ke&&Ke.fixed==="left";pe=!st}else if(_e!==void 0){var At=Ce&&Ce.fixed==="right";ve=!At}}else if(ye!==void 0){var Ft=Ce&&Ce.fixed==="left";le=!Ft}else if(_e!==void 0){var kt=Ke&&Ke.fixed==="right";de=!kt}return{fixLeft:ye,fixRight:_e,lastFixLeft:le,firstFixRight:de,lastFixRight:ve,firstFixLeft:pe,isSticky:rt.isSticky}}var w=k("sR1s");function T(Me){var Pe=Me.cells,tt=Me.stickyOffsets,rt=Me.flattenColumns,Fe=Me.rowComponent,Je=Me.cellComponent,Ee=Me.onHeaderRow,ye=Me.index,_e=R.useContext(n.a),le=_e.prefixCls,de=_e.direction,ve;Ee&&(ve=Ee(Pe.map(function(Ce){return Ce.column}),ye));var pe=Object(w.a)(Pe.map(function(Ce){return Ce.column}));return R.createElement(Fe,Object.assign({},ve),Pe.map(function(Ce,Ke){var st=Ce.column,At=d(Ce.colStart,Ce.colEnd,rt,tt,de),Ft;return st&&st.onHeaderCell&&(Ft=Ce.column.onHeaderCell(st)),R.createElement(r.a,Object.assign({},Ce,{ellipsis:st.ellipsis,align:st.align,component:Je,prefixCls:le,key:pe[Ke]},At,{additionalProps:Ft,rowType:"header"}))}))}T.displayName="HeaderRow";var x=T;function O(Me){var Pe=[];function tt(Ee,ye){var _e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Pe[_e]=Pe[_e]||[];var le=ye,de=Ee.filter(Boolean).map(function(ve){var pe={key:ve.key,className:ve.className||"",children:ve.title,column:ve,colStart:le},Ce=1,Ke=ve.children;return Ke&&Ke.length>0&&(Ce=tt(Ke,le,_e+1).reduce(function(st,At){return st+At},0),pe.hasSubColumns=!0),"colSpan"in ve&&(Ce=ve.colSpan),"rowSpan"in ve&&(pe.rowSpan=ve.rowSpan),pe.colSpan=Ce,pe.colEnd=pe.colStart+Ce-1,Pe[_e].push(pe),le+=Ce,Ce});return de}tt(Me,0);for(var rt=Pe.length,Fe=function(ye){Pe[ye].forEach(function(_e){!("rowSpan"in _e)&&!_e.hasSubColumns&&(_e.rowSpan=rt-ye)})},Je=0;Je=0;ye-=1){var _e=Pe[ye],le=tt&&tt[ye],de=le&&le[_.a];(_e||de||Ee)&&(Fe.unshift(R.createElement("col",Object.assign({key:ye,style:{width:_e,minWidth:_e}},de))),Ee=!0)}return R.createElement("colgroup",null,Fe)}var c=f;function S(Me,Pe){return Object(R.useMemo)(function(){for(var tt=[],rt=0;rt1?K-1:0),J=1;J=ve&&($t=ve-pe),Ee({scrollLeft:$t/ve*(de+2)}),kt.current.x=ke.pageX},ze=function(){var ke=Object(Tt.b)(Je.current).top,qe=ke+Je.current.offsetHeight,Rt=document.documentElement.scrollTop+window.innerHeight;qe-Object(u.a)()<=Rt||ke>=Rt-ye?Ft(function(Pt){return Object(V.a)(Object(V.a)({},Pt),{},{isHiddenScrollBar:!0})}):Ft(function(Pt){return Object(V.a)(Object(V.a)({},Pt),{},{isHiddenScrollBar:!1})})},Lt=function(ke){Ft(function(qe){return Object(V.a)(Object(V.a)({},qe),{},{scrollLeft:ke/de*ve||0})})};return R.useImperativeHandle(tt,function(){return{setScrollLeft:Lt}}),R.useEffect(function(){var Dt=Object(xt.a)(document.body,"mouseup",ce,!1),ke=Object(xt.a)(document.body,"mousemove",ot,!1);return ze(),function(){Dt.remove(),ke.remove()}},[pe,it]),R.useEffect(function(){var Dt=Object(xt.a)(window,"scroll",ze,!1),ke=Object(xt.a)(window,"resize",ze,!1);return function(){Dt.remove(),ke.remove()}},[]),R.useEffect(function(){At.isHiddenScrollBar||Ft(function(Dt){var ke,qe;return Object(V.a)(Object(V.a)({},Dt),{},{scrollLeft:Je.current.scrollLeft/((ke=Je.current)===null||ke===void 0?void 0:ke.scrollWidth)*((qe=Je.current)===null||qe===void 0?void 0:qe.clientWidth)})})},[At.isHiddenScrollBar]),de<=ve||!pe||At.isHiddenScrollBar?null:R.createElement("div",{style:{height:Object(u.a)(),width:ve,bottom:ye},className:"".concat(le,"-sticky-scroll")},R.createElement("div",{onMouseDown:Se,ref:Ce,className:M()("".concat(le,"-sticky-scroll-bar"),Object(ee.a)({},"".concat(le,"-sticky-scroll-bar-active"),it)),style:{width:"".concat(pe,"px"),transform:"translate3d(".concat(At.scrollLeft,"px, 0, 0)")}}))},Ie=R.forwardRef(mt);function je(Me,Pe){return R.useMemo(function(){var tt=!!Me;return{isSticky:tt,stickyClassName:tt?"".concat(Pe,"-sticky-header"):"",offsetHeader:Object(Y.a)(Me)==="object"&&Me.offsetHeader||0,offsetScroll:Object(Y.a)(Me)==="object"&&Me.offsetScroll||0}},[Me,Pe])}var $e=[],at={},lt="rc-table-internal-hook",bt=R.memo(function(Me){var Pe=Me.children;return Pe},function(Me,Pe){return I()(Me.props,Pe.props)?Me.pingLeft!==Pe.pingLeft||Me.pingRight!==Pe.pingRight:!1});function Mt(Me){var Pe,tt=Me.prefixCls,rt=Me.className,Fe=Me.rowClassName,Je=Me.style,Ee=Me.data,ye=Me.rowKey,_e=Me.scroll,le=Me.tableLayout,de=Me.direction,ve=Me.title,pe=Me.footer,Ce=Me.summary,Ke=Me.id,st=Me.showHeader,At=Me.components,Ft=Me.emptyText,kt=Me.onRow,wt=Me.onHeaderRow,Qe=Me.internalHooks,it=Me.transformColumns,We=Me.internalRefs,ce=Me.sticky,Se=Ee||$e,ot=!!Se.length,ze=R.useState(0),Lt=Object(W.a)(ze,2),Dt=Lt[0],ke=Lt[1];R.useEffect(function(){ke(Object(u.a)())});var qe=R.useMemo(function(){return Object(w.c)(At,{})},[At]),Rt=R.useCallback(function(tn,Xt){return Object(w.b)(qe,tn)||Xt},[qe]),Pt=R.useMemo(function(){return typeof ye=="function"?ye:function(tn){var Xt=tn&&tn[ye];return Xt}},[ye]),$t=Object(_.c)(Me),fe=$t.expandIcon,se=$t.expandedRowKeys,U=$t.defaultExpandedRowKeys,G=$t.defaultExpandAllRows,Q=$t.expandedRowRender,te=$t.onExpand,he=$t.onExpandedRowsChange,Le=$t.expandRowByClick,Ge=$t.rowExpandable,Ot=$t.expandIconColumnIndex,Nt=$t.expandedRowClassName,Xe=$t.childrenColumnName,It=$t.indentSize,an=fe||et,Ct=Xe||"children",pn=R.useMemo(function(){return Q?"row":Me.expandable&&Qe===lt&&Me.expandable.__PARENT_RENDER_ICON__||Se.some(function(tn){return tn&&Object(Y.a)(tn)==="object"&&tn[Ct]})?"nest":!1},[!!Q,Se]),nn=R.useState(function(){return U||(G?ht(Se,Pt,Ct):[])}),$=Object(W.a)(nn,2),C=$[0],D=$[1],K=R.useMemo(function(){return new Set(se||C||[])},[se,C]),re=R.useCallback(function(tn){var Xt=Pt(tn,Se.indexOf(tn)),nt,gt=K.has(Xt);gt?(K.delete(Xt),nt=Object(P.a)(K)):nt=[].concat(Object(P.a)(K),[Xt]),D(nt),te&&te(!gt,tn),he&&he(nt)},[Pt,K,Se,te,he]),J=R.useState(0),Re=Object(W.a)(J,2),ut=Re[0],St=Re[1],Yt=Object(Oe.b)(Object(V.a)(Object(V.a)(Object(V.a)({},Me),$t),{},{expandable:!!Q,expandedKeys:K,getRowKey:Pt,onTriggerExpand:re,expandIcon:an,expandIconColumnIndex:Ot,direction:de}),Qe===lt?it:null),dt=Object(W.a)(Yt,2),Gt=dt[0],sn=dt[1],Wn=R.useMemo(function(){return{columns:Gt,flattenColumns:sn}},[Gt,sn]),Si=R.useRef(),hi=R.useRef(),Fn=R.useRef(),di=R.useState(!1),Zi=Object(W.a)(di,2),_i=Zi[0],ri=Zi[1],wi=R.useState(!1),Di=Object(W.a)(wi,2),Oi=Di[0],Ri=Di[1],Vi=be(new Map),cr=Object(W.a)(Vi,2),rr=cr[0],ji=cr[1],Wi=Object(w.a)(sn),hr=Wi.map(function(tn){return rr.get(tn)}),Tr=R.useMemo(function(){return hr},[hr.join("_")]),ar=ct(Tr,sn.length,de),Hn=_e&&Object(w.d)(_e.y),Cn=_e&&Object(w.d)(_e.x),yi=Cn&&sn.some(function(tn){var Xt=tn.fixed;return Xt}),Nn=R.useRef(),Ti=je(ce,tt),ii=Ti.isSticky,Cr=Ti.offsetHeader,Ni=Ti.offsetScroll,Xi=Ti.stickyClassName,lr,gr,Hr;Hn&&(gr={overflowY:"scroll",maxHeight:_e.y}),Cn&&(lr={overflowX:"auto"},Hn||(gr={overflowY:"hidden"}),Hr={width:_e.x===!0?"auto":_e.x,minWidth:"100%"});var kr=R.useCallback(function(tn,Xt){ji(function(nt){var gt=new Map(nt);return gt.set(tn,Xt),gt})},[]),wr=ge(null),Xr=Object(W.a)(wr,2),vr=Xr[0],Yr=Xr[1];function $r(tn,Xt){if(!Xt)return;typeof Xt=="function"?Xt(tn):Xt.scrollLeft!==tn&&(Xt.scrollLeft=tn)}var fr=function(Xt){var nt=Xt.currentTarget,gt=Xt.scrollLeft,cn=typeof gt=="number"?gt:nt.scrollLeft,ft=nt||at;if(!Yr()||Yr()===ft){var hn;vr(ft),$r(cn,hi.current),$r(cn,Fn.current),$r(cn,(hn=Nn.current)===null||hn===void 0?void 0:hn.setScrollLeft)}if(nt){var Bt=nt.scrollWidth,vn=nt.clientWidth;ri(cn>0),Ri(cn0?[].concat(Object(V.a)(l),Object(V.a)(p(d).map(function(w){return Object(P.a)({fixed:n},w)}))):[].concat(Object(V.a)(l),[Object(P.a)(Object(P.a)({},i),{},{fixed:n})])},[])}function m(s){for(var l=!0,i=0;i=0;d-=1){var w=s[d];if(n&&w.fixed!=="right")n=!1;else if(!n&&w.fixed==="right"){Object(B.a)(!1,"Index ".concat(d+1," of `columns` missing `fixed='right'` prop."));break}}}function u(s){return s.map(function(l){var i=l.fixed,r=Object(Y.a)(l,["fixed"]),n=i;return i==="left"?n="right":i==="right"&&(n="left"),Object(P.a)({fixed:n},r)})}function h(s,l){var i=s.prefixCls,r=s.columns,n=s.children,d=s.expandable,w=s.expandedKeys,T=s.getRowKey,x=s.onTriggerExpand,O=s.expandIcon,E=s.rowExpandable,v=s.expandIconColumnIndex,_=s.direction,f=s.expandRowByClick,c=W.useMemo(function(){return r||I(n)},[r,n]),S=W.useMemo(function(){if(d){var N,F=v||0,X=c[F],Z=(N={},Object(ee.a)(N,L.a,{className:"".concat(i,"-expand-icon-col")}),Object(ee.a)(N,"title",""),Object(ee.a)(N,"fixed",X?X.fixed:null),Object(ee.a)(N,"className","".concat(i,"-row-expand-icon-cell")),Object(ee.a)(N,"render",function(z,ne,ae){var me=T(ne,ae),xe=w.has(me),Te=E?E(ne):!0,Oe=O({prefixCls:i,expanded:xe,expandable:Te,record:ne,onExpand:x});return f?W.createElement("span",{onClick:function(De){return De.stopPropagation()}},Oe):Oe}),N),H=c.slice();return F>=0&&H.splice(F,0,Z),H}return c},[d,c,T,w,O,_]),y=W.useMemo(function(){var N=S;return l&&(N=l(N)),N.length||(N=[{render:function(){return null}}]),N},[l,S,_]),b=W.useMemo(function(){return _==="rtl"?u(p(y)):p(y)},[y,_]);return[y,b]}we.b=h},wW8i:function(Be,we,k){Be.exports={flex_box_center:"flex_box_center___3xqQI",flex_space_between:"flex_space_between___1fvHN",flex_box_vertical_center:"flex_box_vertical_center___1Gb4J",flex_box_center_end:"flex_box_center_end___8RbQi",flex_box_column:"flex_box_column___3xL78",discuss:"discuss___ybobd",reply:"reply___3EgHc",pagination:"pagination___2EiMG"}},"y0+3":function(Be,we,k){"use strict";k.d(we,"a",function(){return p}),k.d(we,"b",function(){return u});var ee=/margin|padding|width|height|max|min|offset/,V={left:!0,top:!0},P={cssFloat:1,styleFloat:1,float:1};function Y(h){return h.nodeType===1?h.ownerDocument.defaultView.getComputedStyle(h,null):{}}function W(h,s,l){if(s=s.toLowerCase(),l==="auto"){if(s==="height")return h.offsetHeight;if(s==="width")return h.offsetWidth}return s in V||(V[s]=ee.test(s)),V[s]?parseFloat(l)||0:l}function R(h,s){var l=arguments.length,i=Y(h);return s=P[s]?"cssFloat"in h.style?"cssFloat":"styleFloat":s,l===1?i:W(h,s,i[s]||h.style[s])}function B(h,s,l){var i=arguments.length;if(s=P[s]?"cssFloat"in h.style?"cssFloat":"styleFloat":s,i===3)return typeof l=="number"&&ee.test(s)&&(l="".concat(l,"px")),h.style[s]=l,l;for(var r in s)s.hasOwnProperty(r)&&B(h,r,s[r]);return Y(h)}function M(h){return h===document.body?document.documentElement.clientWidth:h.offsetWidth}function L(h){return h===document.body?window.innerHeight||document.documentElement.clientHeight:h.offsetHeight}function I(){var h=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),s=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:h,height:s}}function p(){var h=document.documentElement.clientWidth,s=window.innerHeight||document.documentElement.clientHeight;return{width:h,height:s}}function m(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function u(h){var s=h.getBoundingClientRect(),l=document.documentElement;return{left:s.left+(window.pageXOffset||l.scrollLeft)-(l.clientLeft||document.body.clientLeft||0),top:s.top+(window.pageYOffset||l.scrollTop)-(l.clientTop||document.body.clientTop||0)}}},ynwM:function(Be,we,k){var ee=k("MFOe"),V=ee.Global;Be.exports={name:"oldFF-globalStorage",read:Y,write:W,each:R,remove:B,clearAll:M};var P=V.globalStorage;function Y(L){return P[L]}function W(L,I){P[L]=I}function R(L){for(var I=P.length-1;I>=0;I--){var p=P.key(I);L(P[p],p)}}function B(L){return P.removeItem(L)}function M(){R(function(L,I){delete P[L]})}}}]);