(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',C}(Je),Ke=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.strokeColor=re.defaultColor,J.strokeWidth=re.defaultStrokeWidth,J.strokeDasharray=re.defaultStrokeDasharray,J.fillColor=re.defaultFillColor,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.setOpacity=J.setOpacity.bind(J),J.createVisual=J.createVisual.bind(J),J.strokePanel=new mt("Line color",be(re.defaultColorSet,["transparent"]),re.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.fillPanel=new mt("Fill color",be(re.defaultColorSet,["transparent"]),J.fillColor,pe),J.fillPanel.onColorChanged=J.setFillColor,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.opacityPanel=new de("Opacity",re.defaultOpacitySteps,J.opacity),J.opacityPanel.onOpacityChanged=J.setOpacity,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.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},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,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).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.fillColorChanged(D),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.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.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var D=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},$.prototype.getState.call(this));return D.typeName=C.typeName,D},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.typeName="EllipseMarker",C.title="Ellipse marker",C.icon='',C}(lt),st=function($){function C(D,K,re){return $.call(this,D,K,re)||this}return Oe(C,$),Object.defineProperty(C.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),C.prototype.ownsTarget=function(D){return!(!$.prototype.ownsTarget.call(this,D)&&D!==this.tip1&&D!==this.tip2)},C.prototype.createTips=function(){this.tip1=ge.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(ge.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ge.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(ge.createTransform()),this.visual.appendChild(this.tip2)},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.tip1&&this.tip2&&(ge.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),ge.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var 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?`
`:"")+""+n+">",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?"/":"",h=L.getOption("autoCloseTags"),s=typeof h=="object"&&h.dontIndentOnSlash,l=0;l"&&(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]*?(?:\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable: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","?(?:tag)(?: +|\\n|/?>)|<(?: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","?(?:tag)(?: +|\\n|/?>)|<(?: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","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",be._tag).getRegex(),be.pedantic=De({},be.normal,{html:Ue(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\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:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +(["(][^\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:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del: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+"
`},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+""+pe+`>
`},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+""),`
`},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+""+ve+`>
`},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='"+ve+"",pe},ye.image=function(le,de,ve){if(le=Tt(this.options.sanitize,this.options.baseUrl,le),le===null)return ve;var pe='
":">",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(".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(".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(".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(un,' "').concat(Bn,'" )')):K.replaceSelection("")),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"+s+'>'),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",/^