(window.webpackJsonp=window.webpackJsonp||[]).push([[191,3,5,7,8,19],{"+NIl":function(Fe,Se,W){(function(q){q(W("VrN/"))})(function(q){"use strict";q.defineMode("stex",function(V,M){"use strict";function z(d,s){d.cmdState.push(s)}function U(d){return d.cmdState.length>0?d.cmdState[d.cmdState.length-1]:null}function L(d){var s=d.cmdState.pop();s&&s.closeBracket()}function H(d){for(var s=d.cmdState,l=s.length-1;l>=0;l--){var r=s[l];if(r.name=="DEFAULT")continue;return r}return{styleIdentifier:function(){return null}}}function F(d,s,l){return function(){this.name=d,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 D={};D.importmodule=F("importmodule","tag",["string","builtin"]),D.documentclass=F("documentclass","tag",["","atom"]),D.usepackage=F("usepackage","tag",["atom"]),D.begin=F("begin","tag",["atom"]),D.end=F("end","tag",["atom"]),D.label=F("label","tag",["atom"]),D.ref=F("ref","tag",["atom"]),D.eqref=F("eqref","tag",["atom"]),D.cite=F("cite","tag",["atom"]),D.bibitem=F("bibitem","tag",["atom"]),D.Bibitem=F("Bibitem","tag",["atom"]),D.RBibitem=F("RBibitem","tag",["atom"]),D.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function I(d,s){d.f=s}function g(d,s){var l;if(d.match(/^\\[a-zA-Z@]+/)){var r=d.current().slice(1);return l=D.hasOwnProperty(r)?D[r]:D.DEFAULT,l=new l,z(s,l),I(s,u),l.style}if(d.match(/^\\[$&%#{}_]/))return"tag";if(d.match(/^\\[,;!\/\\]/))return"tag";if(d.match("\\["))return I(s,function(n,h){return f(n,h,"\\]")}),"keyword";if(d.match("\\("))return I(s,function(n,h){return f(n,h,"\\)")}),"keyword";if(d.match("$$"))return I(s,function(n,h){return f(n,h,"$$")}),"keyword";if(d.match("$"))return I(s,function(n,h){return f(n,h,"$")}),"keyword";var a=d.next();if(a=="%")return d.skipToEnd(),"comment";if(a=="}"||a=="]"){if(l=U(s),l)l.closeBracket(a),I(s,u);else return"error";return"bracket"}else return a=="{"||a=="["?(l=D.DEFAULT,l=new l,z(s,l),"bracket"):/\d/.test(a)?(d.eatWhile(/[\w.%]/),"atom"):(d.eatWhile(/[\w\-_]/),l=H(s),l.name=="begin"&&(l.argument=d.current()),l.styleIdentifier())}function f(d,s,l){if(d.eatSpace())return null;if(l&&d.match(l))return I(s,g),"keyword";if(d.match(/^\\[a-zA-Z@]+/))return"tag";if(d.match(/^[a-zA-Z]+/))return"variable-2";if(d.match(/^\\[$&%#{}_]/))return"tag";if(d.match(/^\\[,;!\/]/))return"tag";if(d.match(/^[\^_&]/))return"tag";if(d.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(d.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var r=d.next();return r=="{"||r=="}"||r=="["||r=="]"||r=="("||r==")"?"bracket":r=="%"?(d.skipToEnd(),"comment"):"error"}function u(d,s){var l=d.peek(),r;return l=="{"||l=="["?(r=U(s),r.openBracket(l),d.eat(l),I(s,g),"bracket"):/[ \t\r]/.test(l)?(d.eat(l),null):(I(s,g),L(s),g(d,s))}return{startState:function(){var d=M.inMathMode?function(s,l){return f(s,l)}:g;return{cmdState:[],f:d}},copyState:function(d){return{cmdState:d.cmdState.slice(),f:d.f}},token:function(d,s){return s.f(d,s)},blankLine:function(d){d.f=g,d.cmdState.length=0},lineComment:"%"}}),q.defineMIME("text/x-stex","stex"),q.defineMIME("text/x-latex","stex")})},"+aKw":function(Fe,Se,W){"use strict";var q=W("tJVT"),V=W("q1tI"),M=W.n(V),z=function(H){return String(H).length===1?"0".concat(H):H},U=function(H){var F=H.className,D=F===void 0?"":F,I=H.onChange,g=H.defaultValue,f=g===void 0?0:g,u=Object(V.useState)(f),d=Object(q.a)(u,2),s=d[0],l=d[1];Object(V.useEffect)(function(){var h=setTimeout(function(){l(s+1e3)},1e3);return I(s+1e3),function(){clearInterval(h)}},[s]);var r=parseInt(s/(60*6e4))||"00",a=parseInt(s%(60*6e4)/6e4)||"00",n=parseInt(s%6e4/1e3)||"00";return M.a.createElement("div",{className:D},z(r),":",z(a),":",z(n))};Se.a=U},"+k/U":function(Fe,Se,W){Fe.exports={pagination:"pagination___2XcQw",info:"info___12Y4R"}},"+ua5":function(Fe,Se,W){},"07cG":function(Fe,Se,W){Fe.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},"19Vz":function(Fe,Se,W){(function(q){q(W("VrN/"))})(function(q){q.defineOption("placeholder","",function(F,D,I){var g=I&&I!=q.Init;if(D&&!g)F.on("blur",U),F.on("change",L),F.on("swapDoc",L),q.on(F.getInputField(),"compositionupdate",F.state.placeholderCompose=function(){z(F)}),L(F);else if(!D&&g){F.off("blur",U),F.off("change",L),F.off("swapDoc",L),q.off(F.getInputField(),"compositionupdate",F.state.placeholderCompose),V(F);var f=F.getWrapperElement();f.className=f.className.replace(" CodeMirror-empty","")}D&&!F.hasFocus()&&U(F)});function V(F){F.state.placeholder&&(F.state.placeholder.parentNode.removeChild(F.state.placeholder),F.state.placeholder=null)}function M(F){V(F);var D=F.state.placeholder=document.createElement("pre");D.style.cssText="height: 0; overflow: visible",D.style.direction=F.getOption("direction"),D.className="CodeMirror-placeholder CodeMirror-line-like";var I=F.getOption("placeholder");typeof I=="string"&&(I=document.createTextNode(I)),D.appendChild(I),F.display.lineSpace.insertBefore(D,F.display.lineSpace.firstChild)}function z(F){setTimeout(function(){var D=!1,I=F.getInputField();I.nodeName=="TEXTAREA"?D=!I.value:F.lineCount()==1&&(D=!/[^\u200b]/.test(I.querySelector(".CodeMirror-line").textContent)),D?M(F):V(F)},20)}function U(F){H(F)&&M(F)}function L(F){var D=F.getWrapperElement(),I=H(F);D.className=D.className.replace(" CodeMirror-empty","")+(I?" CodeMirror-empty":""),I?M(F):V(F)}function H(F){return F.lineCount()===1&&F.getLine(0)===""}})},"1eCo":function(Fe,Se,W){(function(q){q(W("VrN/"))})(function(q){"use strict";var V={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},M={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};q.defineMode("xml",function(z,U){var L=z.indentUnit,H={},F=U.htmlMode?V:M;for(var D in F)H[D]=F[D];for(var D in U)H[D]=U[D];var I,g;function f(c,E){function y(N){return E.tokenize=N,N(c,E)}var _=c.next();if(_=="<")return c.eat("!")?c.eat("[")?c.match("CDATA[")?y(s("atom","]]>")):null:c.match("--")?y(s("comment","-->")):c.match("DOCTYPE",!0,!0)?(c.eatWhile(/[\w\._\-]/),y(l(1))):null:c.eat("?")?(c.eatWhile(/[\w\._\-]/),E.tokenize=s("meta","?>"),"meta"):(I=c.eat("/")?"closeTag":"openTag",E.tokenize=u,"tag bracket");if(_=="&"){var P;return c.eat("#")?c.eat("x")?P=c.eatWhile(/[a-fA-F\d]/)&&c.eat(";"):P=c.eatWhile(/[\d]/)&&c.eat(";"):P=c.eatWhile(/[\w\.\-:]/)&&c.eat(";"),P?"atom":"error"}else return c.eatWhile(/[^&<]/),null}f.isInText=!0;function u(c,E){var y=c.next();if(y==">"||y=="/"&&c.eat(">"))return E.tokenize=f,I=y==">"?"endTag":"selfcloseTag","tag bracket";if(y=="=")return I="equals",null;if(y=="<"){E.tokenize=f,E.state=h,E.tagName=E.tagStart=null;var _=E.tokenize(c,E);return _?_+" tag error":"tag error"}else return/[\'\"]/.test(y)?(E.tokenize=d(y),E.stringStartCol=c.column(),E.tokenize(c,E)):(c.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function d(c){var E=function(y,_){for(;!y.eol();)if(y.next()==c){_.tokenize=u;break}return"string"};return E.isInAttribute=!0,E}function s(c,E){return function(y,_){for(;!y.eol();){if(y.match(E)){_.tokenize=f;break}y.next()}return c}}function l(c){return function(E,y){for(var _;(_=E.next())!=null;){if(_=="<")return y.tokenize=l(c+1),y.tokenize(E,y);if(_==">")if(c==1){y.tokenize=f;break}else return y.tokenize=l(c-1),y.tokenize(E,y)}return"meta"}}function r(c,E,y){this.prev=c.context,this.tagName=E,this.indent=c.indented,this.startOfLine=y,(H.doNotIndent.hasOwnProperty(E)||c.context&&c.context.noIndent)&&(this.noIndent=!0)}function a(c){c.context&&(c.context=c.context.prev)}function n(c,E){for(var y;;){if(!c.context)return;if(y=c.context.tagName,!H.contextGrabbers.hasOwnProperty(y)||!H.contextGrabbers[y].hasOwnProperty(E))return;a(c)}}function h(c,E,y){return c=="openTag"?(y.tagStart=E.column(),O):c=="closeTag"?S:h}function O(c,E,y){return c=="word"?(y.tagName=E.current(),g="tag",C):H.allowMissingTagName&&c=="endTag"?(g="tag bracket",C(c,E,y)):(g="error",O)}function S(c,E,y){if(c=="word"){var _=E.current();return y.context&&y.context.tagName!=_&&H.implicitlyClosed.hasOwnProperty(y.context.tagName)&&a(y),y.context&&y.context.tagName==_||H.matchClosing===!1?(g="tag",x):(g="tag error",A)}else return H.allowMissingTagName&&c=="endTag"?(g="tag bracket",x(c,E,y)):(g="error",A)}function x(c,E,y){return c!="endTag"?(g="error",x):(a(y),h)}function A(c,E,y){return g="error",x(c,E,y)}function C(c,E,y){if(c=="word")return g="attribute",b;if(c=="endTag"||c=="selfcloseTag"){var _=y.tagName,P=y.tagStart;return y.tagName=y.tagStart=null,c=="selfcloseTag"||H.autoSelfClosers.hasOwnProperty(_)?n(y,_):(n(y,_),y.context=new r(y,_,P==y.indented)),h}return g="error",C}function b(c,E,y){return c=="equals"?v:(H.allowMissing||(g="error"),C(c,E,y))}function v(c,E,y){return c=="string"?p:c=="word"&&H.allowUnquoted?(g="string",C):(g="error",C(c,E,y))}function p(c,E,y){return c=="string"?p:C(c,E,y)}return{startState:function(c){var E={tokenize:f,state:h,indented:c||0,tagName:null,tagStart:null,context:null};return c!=null&&(E.baseIndent=c),E},token:function(c,E){if(!E.tagName&&c.sol()&&(E.indented=c.indentation()),c.eatSpace())return null;I=null;var y=E.tokenize(c,E);return(y||I)&&y!="comment"&&(g=null,E.state=E.state(I||y,c,E),g&&(y=g=="error"?y+" error":g)),y},indent:function(c,E,y){var _=c.context;if(c.tokenize.isInAttribute)return c.tagStart==c.indented?c.stringStartCol+1:c.indented+L;if(_&&_.noIndent)return q.Pass;if(c.tokenize!=u&&c.tokenize!=f)return y?y.match(/^(\s*)/)[0].length:0;if(c.tagName)return H.multilineTagIndentPastTag!==!1?c.tagStart+c.tagName.length+2:c.tagStart+L*(H.multilineTagIndentFactor||1);if(H.alignCDATA&&/$/,blockCommentStart:"",configuration:H.htmlMode?"html":"xml",helperType:H.htmlMode?"html":"xml",skipAttribute:function(c){c.state==v&&(c.state=C)},xmlCurrentTag:function(c){return c.tagName?{name:c.tagName,close:c.type=="closeTag"}:null},xmlCurrentContext:function(c){for(var E=[],y=c.context;y;y=y.prev)y.tagName&&E.push(y.tagName);return E.reverse()}}}),q.defineMIME("text/xml","xml"),q.defineMIME("application/xml","xml"),q.mimeModes.hasOwnProperty("text/html")||q.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1j5w":function(Fe,Se,W){"use strict";W.d(Se,"d",function(){return vt}),W.d(Se,"b",function(){return be}),W.d(Se,"c",function(){return Xe}),W.d(Se,"a",function(){return bt});var q=W("VTBJ"),V=W("1OyB"),M=W("vuIU"),z=W("JX7q"),U=W("Ji7U"),L=W("LK+K"),H=W("q1tI"),F=W("I8Z2"),D=W("BGR+"),I=W("wx14"),g=W("rePB"),f=W("4IlW"),u=W("2GS6"),d=W("Gytx"),s=W.n(d),l=W("TSYQ"),r=W.n(l),a=W("U8pU"),n=W("ODXe"),h=/iPhone/i,O=/iPod/i,S=/iPad/i,x=/\bAndroid(?:.+)Mobile\b/i,A=/Android/i,C=/\bAndroid(?:.+)SD4930UR\b/i,b=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,v=/Windows Phone/i,p=/\bWindows(?:.+)ARM\b/i,c=/BlackBerry/i,E=/BB10/i,y=/Opera Mini/i,_=/\b(CriOS|Chrome)(?:.+)Mobile/i,P=/Mobile(?:.+)Firefox\b/i;function N(at,Be){return at.test(Be)}function K(at){var Be=at||(typeof navigator!="undefined"?navigator.userAgent:""),We=Be.split("[FBAN");if(typeof We[1]!="undefined"){var Me=We,se=Object(n.a)(Me,1);Be=se[0]}if(We=Be.split("Twitter"),typeof We[1]!="undefined"){var ve=We,Ke=Object(n.a)(ve,1);Be=Ke[0]}var Pe={apple:{phone:N(h,Be)&&!N(v,Be),ipod:N(O,Be),tablet:!N(h,Be)&&N(S,Be)&&!N(v,Be),device:(N(h,Be)||N(O,Be)||N(S,Be))&&!N(v,Be)},amazon:{phone:N(C,Be),tablet:!N(C,Be)&&N(b,Be),device:N(C,Be)||N(b,Be)},android:{phone:!N(v,Be)&&N(C,Be)||!N(v,Be)&&N(x,Be),tablet:!N(v,Be)&&!N(C,Be)&&!N(x,Be)&&(N(b,Be)||N(A,Be)),device:!N(v,Be)&&(N(C,Be)||N(b,Be)||N(x,Be)||N(A,Be))||N(/\bokhttp\b/i,Be)},windows:{phone:N(v,Be),tablet:N(p,Be),device:N(v,Be)||N(p,Be)},other:{blackberry:N(c,Be),blackberry10:N(E,Be),opera:N(y,Be),firefox:N(P,Be),chrome:N(_,Be),device:N(c,Be)||N(E,Be)||N(y,Be)||N(P,Be)||N(_,Be)},any:null,phone:null,tablet:null};return Pe.any=Pe.apple.device||Pe.android.device||Pe.windows.device||Pe.other.device,Pe.phone=Pe.apple.phone||Pe.android.phone||Pe.windows.phone,Pe.tablet=Pe.apple.tablet||Pe.android.tablet||Pe.windows.tablet,Pe}var $=Object(q.a)(Object(q.a)({},K()),{},{isMobile:K}),B=$;function R(){}function G(at,Be,We){var Me=Be||"";return at.key||"".concat(Me,"item_").concat(We)}function Q(at){return"".concat(at,"-menu-")}function ne(at,Be){var We=-1;H.Children.forEach(at,function(Me){We+=1,Me&&Me.type&&Me.type.isMenuItemGroup?H.Children.forEach(Me.props.children,function(se){We+=1,Be(se,We)}):Be(Me,We)})}function le(at,Be,We){if(!at||We.find)return;H.Children.forEach(at,function(Me){if(Me){var se=Me.type;if(!se||!(se.isSubMenu||se.isMenuItem||se.isMenuItemGroup))return;Be.indexOf(Me.key)!==-1?We.find=!0:Me.props.children&&le(Me.props.children,Be,We)}})}var _e=["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"],pe=function(Be){var We=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Me=Be&&typeof Be.getBoundingClientRect=="function"&&Be.getBoundingClientRect().width;if(Me){if(We){var se=getComputedStyle(Be),ve=se.marginLeft,Ke=se.marginRight;Me+=+ve.replace("px","")+ +Ke.replace("px","")}Me=+Me.toFixed(6)}return Me||0},Ee=function(Be,We,Me){Be&&Object(a.a)(Be.style)==="object"&&(Be.style[We]=Me)},Oe=function(){return B.any},we=W("KQm4"),he=W("Ff2n"),oe=W("i8i4"),Le=W("bdgK"),Ye=W("uciX"),nt=W("8XRh"),qe={adjustX:1,adjustY:1},it={topLeft:{points:["bl","tl"],overflow:qe,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:qe,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:qe,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:qe,offset:[4,0]}},He={topLeft:{points:["bl","tl"],overflow:qe,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:qe,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:qe,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:qe,offset:[4,0]}},$e=it,Qe=0,gt={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},et=function(Be,We,Me){var se=Q(We),ve=Be.getState();Be.setState({defaultActiveFirst:Object(q.a)(Object(q.a)({},ve.defaultActiveFirst),{},Object(g.a)({},se,Me))})},tt=function(at){Object(U.a)(We,at);var Be=Object(L.a)(We);function We(Me){var se;Object(V.a)(this,We),se=Be.call(this,Me),se.onDestroy=function(Te){se.props.onDestroy(Te)},se.onKeyDown=function(Te){var ke=Te.keyCode,rt=se.menuInstance,Ct=se.props,At=Ct.isOpen,cn=Ct.store;if(ke===f.a.ENTER)return se.onTitleClick(Te),et(cn,se.props.eventKey,!0),!0;if(ke===f.a.RIGHT)return At?rt.onKeyDown(Te):(se.triggerOpenChange(!0),et(cn,se.props.eventKey,!0)),!0;if(ke===f.a.LEFT){var yn;if(At)yn=rt.onKeyDown(Te);else return;return yn||(se.triggerOpenChange(!1),yn=!0),yn}return At&&(ke===f.a.UP||ke===f.a.DOWN)?rt.onKeyDown(Te):void 0},se.onOpenChange=function(Te){se.props.onOpenChange(Te)},se.onPopupVisibleChange=function(Te){se.triggerOpenChange(Te,Te?"mouseenter":"mouseleave")},se.onMouseEnter=function(Te){var ke=se.props,rt=ke.eventKey,Ct=ke.onMouseEnter,At=ke.store;et(At,se.props.eventKey,!1),Ct({key:rt,domEvent:Te})},se.onMouseLeave=function(Te){var ke=se.props,rt=ke.parentMenu,Ct=ke.eventKey,At=ke.onMouseLeave;rt.subMenuInstance=Object(z.a)(se),At({key:Ct,domEvent:Te})},se.onTitleMouseEnter=function(Te){var ke=se.props,rt=ke.eventKey,Ct=ke.onItemHover,At=ke.onTitleMouseEnter;Ct({key:rt,hover:!0}),At({key:rt,domEvent:Te})},se.onTitleMouseLeave=function(Te){var ke=se.props,rt=ke.parentMenu,Ct=ke.eventKey,At=ke.onItemHover,cn=ke.onTitleMouseLeave;rt.subMenuInstance=Object(z.a)(se),At({key:Ct,hover:!1}),cn({key:Ct,domEvent:Te})},se.onTitleClick=function(Te){var ke=Object(z.a)(se),rt=ke.props;if(rt.onTitleClick({key:rt.eventKey,domEvent:Te}),rt.triggerSubMenuAction==="hover")return;se.triggerOpenChange(!rt.isOpen,"click"),et(rt.store,se.props.eventKey,!1)},se.onSubMenuClick=function(Te){typeof se.props.onClick=="function"&&se.props.onClick(se.addKeyPath(Te))},se.onSelect=function(Te){se.props.onSelect(Te)},se.onDeselect=function(Te){se.props.onDeselect(Te)},se.getPrefixCls=function(){return"".concat(se.props.rootPrefixCls,"-submenu")},se.getActiveClassName=function(){return"".concat(se.getPrefixCls(),"-active")},se.getDisabledClassName=function(){return"".concat(se.getPrefixCls(),"-disabled")},se.getSelectedClassName=function(){return"".concat(se.getPrefixCls(),"-selected")},se.getOpenClassName=function(){return"".concat(se.props.rootPrefixCls,"-submenu-open")},se.saveMenuInstance=function(Te){se.menuInstance=Te},se.addKeyPath=function(Te){return Object(q.a)(Object(q.a)({},Te),{},{keyPath:(Te.keyPath||[]).concat(se.props.eventKey)})},se.triggerOpenChange=function(Te,ke){var rt=se.props.eventKey,Ct=function(){se.onOpenChange({key:rt,item:Object(z.a)(se),trigger:ke,open:Te})};ke==="mouseenter"?se.mouseenterTimeout=setTimeout(function(){Ct()},0):Ct()},se.isChildrenSelected=function(){var Te={find:!1};return le(se.props.children,se.props.selectedKeys,Te),Te.find},se.isOpen=function(){return se.props.openKeys.indexOf(se.props.eventKey)!==-1},se.adjustWidth=function(){if(!se.subMenuTitle||!se.menuInstance)return;var Te=oe.findDOMNode(se.menuInstance);if(Te.offsetWidth>=se.subMenuTitle.offsetWidth)return;Te.style.minWidth="".concat(se.subMenuTitle.offsetWidth,"px")},se.saveSubMenuTitle=function(Te){se.subMenuTitle=Te},se.getBaseProps=function(){var Te=Object(z.a)(se),ke=Te.props;return{mode:ke.mode==="horizontal"?"vertical":ke.mode,visible:se.props.isOpen,level:ke.level+1,inlineIndent:ke.inlineIndent,focusable:!1,onClick:se.onSubMenuClick,onSelect:se.onSelect,onDeselect:se.onDeselect,onDestroy:se.onDestroy,selectedKeys:ke.selectedKeys,eventKey:"".concat(ke.eventKey,"-menu-"),openKeys:ke.openKeys,motion:ke.motion,onOpenChange:se.onOpenChange,subMenuOpenDelay:ke.subMenuOpenDelay,parentMenu:Object(z.a)(se),subMenuCloseDelay:ke.subMenuCloseDelay,forceSubMenuRender:ke.forceSubMenuRender,triggerSubMenuAction:ke.triggerSubMenuAction,builtinPlacements:ke.builtinPlacements,defaultActiveFirst:ke.store.getState().defaultActiveFirst[Q(ke.eventKey)],multiple:ke.multiple,prefixCls:ke.rootPrefixCls,id:se.internalMenuId,manualRef:se.saveMenuInstance,itemIcon:ke.itemIcon,expandIcon:ke.expandIcon,direction:ke.direction}},se.getMotion=function(Te,ke){var rt=Object(z.a)(se),Ct=rt.haveRendered,At=se.props,cn=At.motion,yn=At.rootPrefixCls,en=Object(q.a)(Object(q.a)({},cn),{},{leavedClassName:"".concat(yn,"-hidden"),removeOnLeave:!1,motionAppear:Ct||!ke||Te!=="inline"});return en};var ve=Me.store,Ke=Me.eventKey,Pe=ve.getState(),st=Pe.defaultActiveFirst;se.isRootMenu=!1;var dt=!1;return st&&(dt=st[Ke]),et(ve,Ke,dt),se}return Object(M.a)(We,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var se=this,ve=this.props,Ke=ve.mode,Pe=ve.parentMenu,st=ve.manualRef;if(st&&st(this),Ke!=="horizontal"||!Pe.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return se.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var se=this.props,ve=se.onDestroy,Ke=se.eventKey;ve&&ve(Ke),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(se){var ve=this,Ke=this.getBaseProps(),Pe=this.getMotion(Ke.mode,Ke.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||Ke.visible||Ke.forceSubMenuRender,!this.haveOpened)return H.createElement("div",null);var st=Ke.direction;return H.createElement(nt.default,Object.assign({visible:Ke.visible},Pe),function(dt){var Te=dt.className,ke=dt.style,rt=r()("".concat(Ke.prefixCls,"-sub"),Te,Object(g.a)({},"".concat(Ke.prefixCls,"-rtl"),st==="rtl"));return H.createElement(ge,Object.assign({},Ke,{id:ve.internalMenuId,className:rt,style:ke}),se)})}},{key:"render",value:function(){var se,ve=Object(q.a)({},this.props),Ke=ve.isOpen,Pe=this.getPrefixCls(),st=ve.mode==="inline",dt=r()(Pe,"".concat(Pe,"-").concat(ve.mode),(se={},Object(g.a)(se,ve.className,!!ve.className),Object(g.a)(se,this.getOpenClassName(),Ke),Object(g.a)(se,this.getActiveClassName(),ve.active||Ke&&!st),Object(g.a)(se,this.getDisabledClassName(),ve.disabled),Object(g.a)(se,this.getSelectedClassName(),this.isChildrenSelected()),se));this.internalMenuId||(ve.eventKey?this.internalMenuId="".concat(ve.eventKey,"$Menu"):(Qe+=1,this.internalMenuId="$__$".concat(Qe,"$Menu")));var Te={},ke={},rt={};ve.disabled||(Te={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},ke={onClick:this.onTitleClick},rt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Ct={},At=ve.direction;st&&(At==="rtl"?Ct.paddingRight=ve.inlineIndent*ve.level:Ct.paddingLeft=ve.inlineIndent*ve.level);var cn={};this.props.isOpen&&(cn={"aria-owns":this.internalMenuId});var yn=null;ve.mode!=="horizontal"&&(yn=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(yn=H.createElement(this.props.expandIcon,Object(q.a)({},this.props))));var en=H.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:Ct,className:"".concat(Pe,"-title"),role:"button"},rt,ke,{"aria-expanded":Ke},cn,{"aria-haspopup":"true",title:typeof ve.title=="string"?ve.title:void 0}),ve.title,yn||H.createElement("i",{className:"".concat(Pe,"-arrow")})),Dt=this.renderChildren(ve.children),Rn=ve.parentMenu.isRootMenu?ve.parentMenu.props.getPopupContainer:function(ui){return ui.parentNode},Fn=gt[ve.mode],Cn=ve.popupOffset?{offset:ve.popupOffset}:{},Qt=ve.mode==="inline"?"":ve.popupClassName;Qt+=At==="rtl"?" ".concat(Pe,"-rtl"):"";var Sn=ve.disabled,Bn=ve.triggerSubMenuAction,li=ve.subMenuOpenDelay,ct=ve.forceSubMenuRender,St=ve.subMenuCloseDelay,zn=ve.builtinPlacements;_e.forEach(function(ui){return delete ve[ui]}),delete ve.onClick;var pi=At==="rtl"?Object.assign({},He,zn):Object.assign({},it,zn);return delete ve.direction,H.createElement("li",Object.assign({},ve,Te,{className:dt,role:"menuitem"}),st&&en,st&&Dt,!st&&H.createElement(Ye.a,{prefixCls:Pe,popupClassName:r()("".concat(Pe,"-popup"),Qt),getPopupContainer:Rn,builtinPlacements:pi,popupPlacement:Fn,popupVisible:Ke,popupAlign:Cn,popup:Dt,action:Sn?[]:[Bn],mouseEnterDelay:li,mouseLeaveDelay:St,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:ct},en))}}]),We}(H.Component);tt.defaultProps={onMouseEnter:R,onMouseLeave:R,onTitleMouseEnter:R,onTitleMouseLeave:R,onTitleClick:R,manualRef:R,mode:"vertical",title:""};var Je=Object(F.b)(function(at,Be){var We=at.openKeys,Me=at.activeKey,se=at.selectedKeys,ve=Be.eventKey,Ke=Be.subMenuKey;return{isOpen:We.indexOf(ve)>-1,active:Me[Ke]===ve,selectedKeys:se}})(tt);Je.isSubMenu=!0;var vt=Je,wt="menuitem-overflowed",Et=.5,xt=function(at){Object(U.a)(We,at);var Be=Object(L.a)(We);function We(){var Me;return Object(V.a)(this,We),Me=Be.apply(this,arguments),Me.resizeObserver=null,Me.mutationObserver=null,Me.originalTotalWidth=0,Me.overflowedItems=[],Me.menuItemSizes=[],Me.cancelFrameId=null,Me.state={lastVisibleIndex:void 0},Me.getMenuItemNodes=function(){var se=Me.props.prefixCls,ve=oe.findDOMNode(Object(z.a)(Me));return ve?[].slice.call(ve.children).filter(function(Ke){return Ke.className.split(" ").indexOf("".concat(se,"-overflowed-submenu"))<0}):[]},Me.getOverflowedSubMenuItem=function(se,ve,Ke){var Pe=Me.props,st=Pe.overflowedIndicator,dt=Pe.level,Te=Pe.mode,ke=Pe.prefixCls,rt=Pe.theme;if(dt!==1||Te!=="horizontal")return null;var Ct=Me.props.children[0],At=Ct.props,cn=At.children,yn=At.title,en=At.style,Dt=Object(he.a)(At,["children","title","style"]),Rn=Object(q.a)({},en),Fn="".concat(se,"-overflowed-indicator"),Cn="".concat(se,"-overflowed-indicator");ve.length===0&&Ke!==!0?Rn=Object(q.a)(Object(q.a)({},Rn),{},{display:"none"}):Ke&&(Rn=Object(q.a)(Object(q.a)({},Rn),{},{visibility:"hidden",position:"absolute"}),Fn="".concat(Fn,"-placeholder"),Cn="".concat(Cn,"-placeholder"));var Qt=rt?"".concat(ke,"-").concat(rt):"",Sn={};return _e.forEach(function(Bn){Dt[Bn]!==void 0&&(Sn[Bn]=Dt[Bn])}),H.createElement(vt,Object.assign({title:st,className:"".concat(ke,"-overflowed-submenu"),popupClassName:Qt},Sn,{key:Fn,eventKey:Cn,disabled:!1,style:Rn}),ve)},Me.setChildrenWidthAndResize=function(){if(Me.props.mode!=="horizontal")return;var se=oe.findDOMNode(Object(z.a)(Me));if(!se)return;var ve=se.children;if(!ve||ve.length===0)return;var Ke=se.children[ve.length-1];Ee(Ke,"display","inline-block");var Pe=Me.getMenuItemNodes(),st=Pe.filter(function(dt){return dt.className.split(" ").indexOf(wt)>=0});st.forEach(function(dt){Ee(dt,"display","inline-block")}),Me.menuItemSizes=Pe.map(function(dt){return pe(dt,!0)}),st.forEach(function(dt){Ee(dt,"display","none")}),Me.overflowedIndicatorWidth=pe(se.children[se.children.length-1],!0),Me.originalTotalWidth=Me.menuItemSizes.reduce(function(dt,Te){return dt+Te},0),Me.handleResize(),Ee(Ke,"display","none")},Me.handleResize=function(){if(Me.props.mode!=="horizontal")return;var se=oe.findDOMNode(Object(z.a)(Me));if(!se)return;var ve=pe(se);Me.overflowedItems=[];var Ke=0,Pe;Me.originalTotalWidth>ve+Et&&(Pe=-1,Me.menuItemSizes.forEach(function(st){Ke+=st,Ke+Me.overflowedIndicatorWidth<=ve&&(Pe+=1)})),Me.setState({lastVisibleIndex:Pe})},Me}return Object(M.a)(We,[{key:"componentDidMount",value:function(){var se=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var ve=oe.findDOMNode(this);if(!ve)return;this.resizeObserver=new Le.default(function(Ke){Ke.forEach(function(){var Pe=se.cancelFrameId;cancelAnimationFrame(Pe),se.cancelFrameId=requestAnimationFrame(se.setChildrenWidthAndResize)})}),[].slice.call(ve.children).concat(ve).forEach(function(Ke){se.resizeObserver.observe(Ke)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){se.resizeObserver.disconnect(),[].slice.call(ve.children).concat(ve).forEach(function(Ke){se.resizeObserver.observe(Ke)}),se.setChildrenWidthAndResize()}),this.mutationObserver.observe(ve,{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(se){var ve=this,Ke=this.state.lastVisibleIndex;return(se||[]).reduce(function(Pe,st,dt){var Te=st;if(ve.props.mode==="horizontal"){var ke=ve.getOverflowedSubMenuItem(st.props.eventKey,[]);Ke!==void 0&&ve.props.className.indexOf("".concat(ve.props.prefixCls,"-root"))!==-1&&(dt>Ke&&(Te=H.cloneElement(st,{style:{display:"none"},eventKey:"".concat(st.props.eventKey,"-hidden"),className:"".concat(wt)})),dt===Ke+1&&(ve.overflowedItems=se.slice(Ke+1).map(function(Ct){return H.cloneElement(Ct,{key:Ct.props.eventKey,mode:"vertical-left"})}),ke=ve.getOverflowedSubMenuItem(st.props.eventKey,ve.overflowedItems)));var rt=[].concat(Object(we.a)(Pe),[ke,Te]);return dt===se.length-1&&rt.push(ve.getOverflowedSubMenuItem(st.props.eventKey,[],!0)),rt}return[].concat(Object(we.a)(Pe),[Te])},[])}},{key:"render",value:function(){var se=this.props,ve=se.visible,Ke=se.prefixCls,Pe=se.overflowedIndicator,st=se.mode,dt=se.level,Te=se.tag,ke=se.children,rt=se.theme,Ct=Object(he.a)(se,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),At=Te;return H.createElement(At,Object.assign({},Ct),this.renderChildren(ke))}}]),We}(H.Component);xt.defaultProps={tag:"div",className:""};var kt=xt;function Ot(at){return at.length?at.every(function(Be){return!!Be.props.disabled}):!0}function Ae(at,Be,We){var Me=at.getState();at.setState({activeKey:Object(q.a)(Object(q.a)({},Me.activeKey),{},Object(g.a)({},Be,We))})}function Ce(at){return at.eventKey||"0-menu-"}function Ge(at,Be){var We=Be,Me=at.children,se=at.eventKey;if(We){var ve;if(ne(Me,function(Ke,Pe){Ke&&Ke.props&&!Ke.props.disabled&&We===G(Ke,se,Pe)&&(ve=!0)}),ve)return We}return We=null,at.defaultActiveFirst&&ne(Me,function(Ke,Pe){!We&&Ke&&!Ke.props.disabled&&(We=G(Ke,se,Pe))}),We}function ze(at){if(at){var Be=this.instanceArray.indexOf(at);Be!==-1?this.instanceArray[Be]=at:this.instanceArray.push(at)}}var Re=function(at){Object(U.a)(We,at);var Be=Object(L.a)(We);function We(Me){var se;return Object(V.a)(this,We),se=Be.call(this,Me),se.onKeyDown=function(ve,Ke){var Pe=ve.keyCode,st;if(se.getFlatInstanceArray().forEach(function(Te){Te&&Te.props.active&&Te.onKeyDown&&(st=Te.onKeyDown(ve))}),st)return 1;var dt=null;return(Pe===f.a.UP||Pe===f.a.DOWN)&&(dt=se.step(Pe===f.a.UP?-1:1)),dt?(ve.preventDefault(),Ae(se.props.store,Ce(se.props),dt.props.eventKey),typeof Ke=="function"&&Ke(dt),1):void 0},se.onItemHover=function(ve){var Ke=ve.key,Pe=ve.hover;Ae(se.props.store,Ce(se.props),Pe?Ke:null)},se.onDeselect=function(ve){se.props.onDeselect(ve)},se.onSelect=function(ve){se.props.onSelect(ve)},se.onClick=function(ve){se.props.onClick(ve)},se.onOpenChange=function(ve){se.props.onOpenChange(ve)},se.onDestroy=function(ve){se.props.onDestroy(ve)},se.getFlatInstanceArray=function(){return se.instanceArray},se.step=function(ve){var Ke=se.getFlatInstanceArray(),Pe=se.props.store.getState().activeKey[Ce(se.props)],st=Ke.length;if(!st)return null;ve<0&&(Ke=Ke.concat().reverse());var dt=-1;if(Ke.every(function(Ct,At){return Ct&&Ct.props.eventKey===Pe?(dt=At,!1):!0}),!se.props.defaultActiveFirst&&dt!==-1&&Ot(Ke.slice(dt,st-1)))return;var Te=(dt+1)%st,ke=Te;do{var rt=Ke[ke];if(!rt||rt.props.disabled)ke=(ke+1)%st;else return rt}while(ke!==Te);return null},se.renderCommonMenuItem=function(ve,Ke,Pe){var st=se.props.store.getState(),dt=Object(z.a)(se),Te=dt.props,ke=G(ve,Te.eventKey,Ke),rt=ve.props;if(!rt||typeof ve.type=="string")return ve;var Ct=ke===st.activeKey,At=Object(q.a)(Object(q.a)({mode:rt.mode||Te.mode,level:Te.level,inlineIndent:Te.inlineIndent,renderMenuItem:se.renderMenuItem,rootPrefixCls:Te.prefixCls,index:Ke,parentMenu:Te.parentMenu,manualRef:rt.disabled?void 0:Object(u.a)(ve.ref,ze.bind(Object(z.a)(se))),eventKey:ke,active:!rt.disabled&&Ct,multiple:Te.multiple,onClick:function(yn){(rt.onClick||R)(yn),se.onClick(yn)},onItemHover:se.onItemHover,motion:Te.motion,subMenuOpenDelay:Te.subMenuOpenDelay,subMenuCloseDelay:Te.subMenuCloseDelay,forceSubMenuRender:Te.forceSubMenuRender,onOpenChange:se.onOpenChange,onDeselect:se.onDeselect,onSelect:se.onSelect,builtinPlacements:Te.builtinPlacements,itemIcon:rt.itemIcon||se.props.itemIcon,expandIcon:rt.expandIcon||se.props.expandIcon},Pe),{},{direction:Te.direction});return(Te.mode==="inline"||Oe())&&(At.triggerSubMenuAction="click"),H.cloneElement(ve,At)},se.renderMenuItem=function(ve,Ke,Pe){if(!ve)return null;var st=se.props.store.getState(),dt={openKeys:st.openKeys,selectedKeys:st.selectedKeys,triggerSubMenuAction:se.props.triggerSubMenuAction,subMenuKey:Pe};return se.renderCommonMenuItem(ve,Ke,dt)},Me.store.setState({activeKey:Object(q.a)(Object(q.a)({},Me.store.getState().activeKey),{},Object(g.a)({},Me.eventKey,Ge(Me,Me.activeKey)))}),se.instanceArray=[],se}return Object(M.a)(We,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(se){return this.props.visible||se.visible||this.props.className!==se.className||!s()(this.props.style,se.style)}},{key:"componentDidUpdate",value:function(se){var ve=this.props,Ke="activeKey"in ve?ve.activeKey:ve.store.getState().activeKey[Ce(ve)],Pe=Ge(ve,Ke);if(Pe!==Ke)Ae(ve.store,Ce(ve),Pe);else if("activeKey"in se){var st=Ge(se,se.activeKey);Pe!==st&&Ae(ve.store,Ce(ve),Pe)}}},{key:"render",value:function(){var se=this,ve=Object(I.a)({},this.props);this.instanceArray=[];var Ke=r()(ve.prefixCls,ve.className,"".concat(ve.prefixCls,"-").concat(ve.mode)),Pe={className:Ke,role:ve.role||"menu"};ve.id&&(Pe.id=ve.id),ve.focusable&&(Pe.tabIndex=0,Pe.onKeyDown=this.onKeyDown);var st=ve.prefixCls,dt=ve.eventKey,Te=ve.visible,ke=ve.level,rt=ve.mode,Ct=ve.overflowedIndicator,At=ve.theme;return _e.forEach(function(cn){return delete ve[cn]}),delete ve.onClick,H.createElement(kt,Object.assign({},ve,{prefixCls:st,mode:rt,tag:"ul",level:ke,theme:At,visible:Te,overflowedIndicator:Ct},Pe),H.Children.map(ve.children,function(cn,yn){return se.renderMenuItem(cn,yn,dt||"0-menu-")}))}}]),We}(H.Component);Re.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:R};var je=Object(F.b)()(Re),ge=je,de=W("Kwbf");function ce(at,Be,We){var Me=at.prefixCls,se=at.motion,ve=at.defaultMotions,Ke=ve===void 0?{}:ve,Pe=at.openAnimation,st=at.openTransitionName,dt=Be.switchingModeFromInline;if(se)return se;if(Object(a.a)(Pe)==="object"&&Pe)Object(de.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof Pe=="string")return{motionName:"".concat(Me,"-open-").concat(Pe)};if(st)return{motionName:st};var Te=Ke[We];return Te||(dt?null:Ke.other)}var re=function(at){Object(U.a)(We,at);var Be=Object(L.a)(We);function We(Me){var se;Object(V.a)(this,We),se=Be.call(this,Me),se.inlineOpenKeys=[],se.onSelect=function(Pe){var st=Object(z.a)(se),dt=st.props;if(dt.selectable){var Te=se.store.getState(),ke=Te.selectedKeys,rt=Pe.key;dt.multiple?ke=ke.concat([rt]):ke=[rt],"selectedKeys"in dt||se.store.setState({selectedKeys:ke}),dt.onSelect(Object(q.a)(Object(q.a)({},Pe),{},{selectedKeys:ke}))}},se.onClick=function(Pe){var st=se.getRealMenuMode(),dt=Object(z.a)(se),Te=dt.store,ke=dt.props.onOpenChange;st!=="inline"&&!("openKeys"in se.props)&&(Te.setState({openKeys:[]}),ke([])),se.props.onClick(Pe)},se.onKeyDown=function(Pe,st){se.innerMenu.getWrappedInstance().onKeyDown(Pe,st)},se.onOpenChange=function(Pe){var st=Object(z.a)(se),dt=st.props,Te=se.store.getState().openKeys.concat(),ke=!1,rt=function(At){var cn=!1;if(At.open)cn=Te.indexOf(At.key)===-1,cn&&Te.push(At.key);else{var yn=Te.indexOf(At.key);cn=yn!==-1,cn&&Te.splice(yn,1)}ke=ke||cn};Array.isArray(Pe)?Pe.forEach(rt):rt(Pe),ke&&("openKeys"in se.props||se.store.setState({openKeys:Te}),dt.onOpenChange(Te))},se.onDeselect=function(Pe){var st=Object(z.a)(se),dt=st.props;if(dt.selectable){var Te=se.store.getState().selectedKeys.concat(),ke=Pe.key,rt=Te.indexOf(ke);rt!==-1&&Te.splice(rt,1),"selectedKeys"in dt||se.store.setState({selectedKeys:Te}),dt.onDeselect(Object(q.a)(Object(q.a)({},Pe),{},{selectedKeys:Te}))}},se.onMouseEnter=function(Pe){se.restoreModeVerticalFromInline();var st=se.props.onMouseEnter;st&&st(Pe)},se.onTransitionEnd=function(Pe){var st=Pe.propertyName==="width"&&Pe.target===Pe.currentTarget,dt=Pe.target.className,Te=Object.prototype.toString.call(dt)==="[object SVGAnimatedString]"?dt.animVal:dt,ke=Pe.propertyName==="font-size"&&Te.indexOf("anticon")>=0;(st||ke)&&se.restoreModeVerticalFromInline()},se.setInnerMenu=function(Pe){se.innerMenu=Pe},se.isRootMenu=!0;var ve=Me.defaultSelectedKeys,Ke=Me.defaultOpenKeys;return"selectedKeys"in Me&&(ve=Me.selectedKeys||[]),"openKeys"in Me&&(Ke=Me.openKeys||[]),se.store=Object(F.c)({selectedKeys:ve,openKeys:Ke,activeKey:{"0-menu-":Ge(Me,Me.activeKey)}}),se.state={switchingModeFromInline:!1},se}return Object(M.a)(We,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(se){this.updateOpentKeysWhenSwitchMode(se),this.updateMiniStore();var ve=this.props,Ke=ve.siderCollapsed,Pe=ve.inlineCollapsed,st=ve.onOpenChange;(!se.inlineCollapsed&&Pe||!se.siderCollapsed&&Ke)&&st([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(se){var ve=this.props,Ke=this.store,Pe=this.inlineOpenKeys,st=Ke.getState(),dt={};se.mode==="inline"&&ve.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in ve||((ve.inlineCollapsed&&!se.inlineCollapsed||ve.siderCollapsed&&!se.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=st.openKeys.concat(),dt.openKeys=[]),(!ve.inlineCollapsed&&se.inlineCollapsed||!ve.siderCollapsed&&se.siderCollapsed)&&(dt.openKeys=Pe,this.inlineOpenKeys=[])),Object.keys(dt).length&&Ke.setState(dt)}},{key:"updateMenuDisplay",value:function(){var se=this.props.collapsedWidth,ve=this.store,Ke=this.prevOpenKeys,Pe=this.getInlineCollapsed()&&(se===0||se==="0"||se==="0px");Pe?(this.prevOpenKeys=ve.getState().openKeys.concat(),this.store.setState({openKeys:[]})):Ke&&(this.store.setState({openKeys:Ke}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var se=this.props.mode,ve=this.state.switchingModeFromInline,Ke=this.getInlineCollapsed();return ve&&Ke?"inline":Ke?"vertical":se}},{key:"getInlineCollapsed",value:function(){var se=this.props,ve=se.inlineCollapsed,Ke=se.siderCollapsed;return Ke!==void 0?Ke:ve}},{key:"restoreModeVerticalFromInline",value:function(){var se=this.state.switchingModeFromInline;se&&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 se=Object(q.a)({},Object(D.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),ve=this.getRealMenuMode();return se.className+=" ".concat(se.prefixCls,"-root"),se.direction==="rtl"&&(se.className+=" ".concat(se.prefixCls,"-rtl")),se=Object(q.a)(Object(q.a)({},se),{},{mode:ve,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:ce(this.props,this.state,ve)}),delete se.openAnimation,delete se.openTransitionName,H.createElement(F.a,{store:this.store},H.createElement(ge,Object.assign({},se,{ref:this.setInnerMenu}),this.props.children))}}]),We}(H.Component);re.defaultProps={selectable:!0,onClick:R,onSelect:R,onOpenChange:R,onDeselect:R,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:H.createElement("span",null,"\xB7\xB7\xB7")};var ae=re,ue=function(at){Object(U.a)(We,at);var Be=Object(L.a)(We);function We(){var Me;return Object(V.a)(this,We),Me=Be.apply(this,arguments),Me.onKeyDown=function(se){var ve=se.keyCode;return ve===f.a.ENTER?(Me.onClick(se),!0):void 0},Me.onMouseLeave=function(se){var ve=Me.props,Ke=ve.eventKey,Pe=ve.onItemHover,st=ve.onMouseLeave;Pe({key:Ke,hover:!1}),st({key:Ke,domEvent:se})},Me.onMouseEnter=function(se){var ve=Me.props,Ke=ve.eventKey,Pe=ve.onItemHover,st=ve.onMouseEnter;Pe({key:Ke,hover:!0}),st({key:Ke,domEvent:se})},Me.onClick=function(se){var ve=Me.props,Ke=ve.eventKey,Pe=ve.multiple,st=ve.onClick,dt=ve.onSelect,Te=ve.onDeselect,ke=ve.isSelected,rt={key:Ke,keyPath:[Ke],item:Object(z.a)(Me),domEvent:se};st(rt),Pe?ke?Te(rt):dt(rt):ke||dt(rt)},Me.saveNode=function(se){Me.node=se},Me}return Object(M.a)(We,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var se=this.props;se.onDestroy&&se.onDestroy(se.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 se,ve=Object(q.a)({},this.props),Ke=r()(this.getPrefixCls(),ve.className,(se={},Object(g.a)(se,this.getActiveClassName(),!ve.disabled&&ve.active),Object(g.a)(se,this.getSelectedClassName(),ve.isSelected),Object(g.a)(se,this.getDisabledClassName(),ve.disabled),se)),Pe=Object(q.a)(Object(q.a)({},ve.attribute),{},{title:typeof ve.title=="string"?ve.title:void 0,className:Ke,role:ve.role||"menuitem","aria-disabled":ve.disabled});ve.role==="option"?Pe=Object(q.a)(Object(q.a)({},Pe),{},{role:"option","aria-selected":ve.isSelected}):(ve.role===null||ve.role==="none")&&(Pe.role="none");var st={onClick:ve.disabled?null:this.onClick,onMouseLeave:ve.disabled?null:this.onMouseLeave,onMouseEnter:ve.disabled?null:this.onMouseEnter},dt=Object(q.a)({},ve.style);ve.mode==="inline"&&(ve.direction==="rtl"?dt.paddingRight=ve.inlineIndent*ve.level:dt.paddingLeft=ve.inlineIndent*ve.level),_e.forEach(function(ke){return delete ve[ke]}),delete ve.direction;var Te=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Te=H.createElement(this.props.itemIcon,this.props)),H.createElement("li",Object.assign({},Object(D.default)(ve,["onClick","onMouseEnter","onMouseLeave","onSelect"]),Pe,st,{style:dt,ref:this.saveNode}),ve.children,Te)}}]),We}(H.Component);ue.isMenuItem=!0,ue.defaultProps={onSelect:R,onMouseEnter:R,onMouseLeave:R,manualRef:R};var fe=Object(F.b)(function(at,Be){var We=at.activeKey,Me=at.selectedKeys,se=Be.eventKey,ve=Be.subMenuKey;return{active:We[ve]===se,isSelected:Me.indexOf(se)!==-1}})(ue),be=fe,Ie=function(at){Object(U.a)(We,at);var Be=Object(L.a)(We);function We(){var Me;return Object(V.a)(this,We),Me=Be.apply(this,arguments),Me.renderInnerMenuItem=function(se){var ve=Me.props,Ke=ve.renderMenuItem,Pe=ve.index;return Ke(se,Pe,Me.props.subMenuKey)},Me}return Object(M.a)(We,[{key:"render",value:function(){var se=Object(I.a)({},this.props),ve=se.className,Ke=ve===void 0?"":ve,Pe=se.rootPrefixCls,st="".concat(Pe,"-item-group-title"),dt="".concat(Pe,"-item-group-list"),Te=se.title,ke=se.children;return _e.forEach(function(rt){return delete se[rt]}),delete se.onClick,delete se.direction,H.createElement("li",Object.assign({},se,{className:"".concat(Ke," ").concat(Pe,"-item-group")}),H.createElement("div",{className:st,title:typeof Te=="string"?Te:void 0},Te),H.createElement("ul",{className:dt},H.Children.map(ke,this.renderInnerMenuItem)))}}]),We}(H.Component);Ie.isMenuItemGroup=!0,Ie.defaultProps={disabled:!0};var Xe=Ie,ut=function(Be){var We=Be.className,Me=Be.rootPrefixCls,se=Be.style;return H.createElement("li",{className:"".concat(We," ").concat(Me,"-item-divider"),style:se})};ut.defaultProps={disabled:!0,className:"",style:{}};var bt=ut,ft=Se.e=ae},"55Ip":function(Fe,Se,W){"use strict";W.d(Se,"a",function(){return n});var q=W("Ty5D"),V=W("dI71"),M=W("q1tI"),z=W.n(M),U=W("YS25"),L=W("17x9"),H=W.n(L),F=W("wx14"),D=W("zLVn"),I=W("9R94"),g=function(v){Object(V.a)(p,v);function p(){for(var E,y=arguments.length,_=new Array(y),P=0;P=0||y.relatedTarget.className.indexOf("".concat(K,"-next"))>=0))return;v.setState({goInputText:""}),N(v.getValidValue())},v.go=function(y){var _=v.state.goInputText;if(_==="")return;(y.keyCode===d.ENTER||y.type==="click")&&(v.setState({goInputText:""}),v.props.quickGo(v.getValidValue()))},v}return Object(U.a)(b,[{key:"getValidValue",value:function(){var p=this.state,c=p.goInputText,E=p.current;return!c||isNaN(c)?E:Number(c)}},{key:"getPageSizeOptions",value:function(){var p=this.props,c=p.pageSize,E=p.pageSizeOptions;return E.some(function(y){return y.toString()===c.toString()})?E:E.concat([c.toString()]).sort(function(y,_){var P=isNaN(Number(y))?0:Number(y),N=isNaN(Number(_))?0:Number(_);return P-N})}},{key:"render",value:function(){var p=this,c=this.props,E=c.pageSize,y=c.locale,_=c.rootPrefixCls,P=c.changeSize,N=c.quickGo,K=c.goButton,$=c.selectComponentClass,B=c.buildOptionText,R=c.selectPrefixCls,G=c.disabled,Q=this.state.goInputText,ne="".concat(_,"-options"),le=$,_e=null,pe=null,Ee=null;if(!P&&!N)return null;var Oe=this.getPageSizeOptions();if(P&&le){var we=Oe.map(function(he,oe){return D.a.createElement(le.Option,{key:oe,value:he.toString()},(B||p.buildOptionText)(he))});_e=D.a.createElement(le,{disabled:G,prefixCls:R,showSearch:!1,className:"".concat(ne,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(E||Oe[0]).toString(),onChange:this.changeSize,getPopupContainer:function(oe){return oe.parentNode}},we)}return N&&(K&&(Ee=typeof K=="boolean"?D.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:G,className:"".concat(ne,"-quick-jumper-button")},y.jump_to_confirm):D.a.createElement("span",{onClick:this.go,onKeyUp:this.go},K)),pe=D.a.createElement("div",{className:"".concat(ne,"-quick-jumper")},y.jump_to,D.a.createElement("input",{disabled:G,type:"text",value:Q,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),y.page,Ee)),D.a.createElement("li",{className:"".concat(ne)},_e,pe)}}]),b}(D.a.Component);s.defaultProps={pageSizeOptions:["10","20","50","100"]};var l=s,r=W("N2Kk");function a(){}function n(A){return typeof A=="number"&&isFinite(A)&&Math.floor(A)===A}function h(A,C,b){return b}function O(A,C,b){var v=typeof A=="undefined"?C.pageSize:A;return Math.floor((b.total-1)/v)+1}var S=function(A){Object(L.a)(b,A);var C=Object(H.a)(b);function b(v){var p;Object(z.a)(this,b),p=C.call(this,v),p.getJumpPrevPage=function(){return Math.max(1,p.state.current-(p.props.showLessItems?3:5))},p.getJumpNextPage=function(){return Math.min(O(void 0,p.state,p.props),p.state.current+(p.props.showLessItems?3:5))},p.getItemIcon=function(P,N){var K=p.props.prefixCls,$=P||D.a.createElement("button",{type:"button","aria-label":N,className:"".concat(K,"-item-link")});return typeof P=="function"&&($=D.a.createElement(P,Object(M.a)({},p.props))),$},p.savePaginationNode=function(P){p.paginationNode=P},p.isValid=function(P){return n(P)&&P!==p.state.current},p.shouldDisplayQuickJumper=function(){var P=p.props,N=P.showQuickJumper,K=P.pageSize,$=P.total;return $<=K?!1:N},p.handleKeyDown=function(P){(P.keyCode===d.ARROW_UP||P.keyCode===d.ARROW_DOWN)&&P.preventDefault()},p.handleKeyUp=function(P){var N=p.getValidValue(P),K=p.state.currentInputValue;N!==K&&p.setState({currentInputValue:N}),P.keyCode===d.ENTER?p.handleChange(N):P.keyCode===d.ARROW_UP?p.handleChange(N-1):P.keyCode===d.ARROW_DOWN&&p.handleChange(N+1)},p.changePageSize=function(P){var N=p.state.current,K=O(P,p.state,p.props);N=N>K?K:N,K===0&&(N=p.state.current),typeof P=="number"&&("pageSize"in p.props||p.setState({pageSize:P}),"current"in p.props||p.setState({current:N,currentInputValue:N})),p.props.onShowSizeChange(N,P),"onChange"in p.props&&p.props.onChange&&p.props.onChange(N,P)},p.handleChange=function(P){var N=p.props.disabled,K=P;if(p.isValid(K)&&!N){var $=O(void 0,p.state,p.props);K>$?K=$:K<1&&(K=1),"current"in p.props||p.setState({current:K,currentInputValue:K});var B=p.state.pageSize;return p.props.onChange(K,B),K}return p.state.current},p.prev=function(){p.hasPrev()&&p.handleChange(p.state.current-1)},p.next=function(){p.hasNext()&&p.handleChange(p.state.current+1)},p.jumpPrev=function(){p.handleChange(p.getJumpPrevPage())},p.jumpNext=function(){p.handleChange(p.getJumpNextPage())},p.hasPrev=function(){return p.state.current>1},p.hasNext=function(){return p.state.current2?K-2:0),B=2;B=E?_=E:_=Number(c),_}},{key:"getShowSizeChanger",value:function(){var p=this.props,c=p.showSizeChanger,E=p.total,y=p.totalBoundaryShowSizeChanger;return typeof c!="undefined"?c:E>y}},{key:"renderPrev",value:function(p){var c=this.props,E=c.prevIcon,y=c.itemRender,_=y(p,"prev",this.getItemIcon(E,"prev page")),P=!this.hasPrev();return Object(F.isValidElement)(_)?Object(F.cloneElement)(_,{disabled:P}):_}},{key:"renderNext",value:function(p){var c=this.props,E=c.nextIcon,y=c.itemRender,_=y(p,"next",this.getItemIcon(E,"next page")),P=!this.hasNext();return Object(F.isValidElement)(_)?Object(F.cloneElement)(_,{disabled:P}):_}},{key:"render",value:function(){var p=this,c=this.props,E=c.prefixCls,y=c.className,_=c.style,P=c.disabled,N=c.hideOnSinglePage,K=c.total,$=c.locale,B=c.showQuickJumper,R=c.showLessItems,G=c.showTitle,Q=c.showTotal,ne=c.simple,le=c.itemRender,_e=c.showPrevNextJumpers,pe=c.jumpPrevIcon,Ee=c.jumpNextIcon,Oe=c.selectComponentClass,we=c.selectPrefixCls,he=c.pageSizeOptions,oe=this.state,Le=oe.current,Ye=oe.pageSize,nt=oe.currentInputValue;if(N===!0&&K<=Ye)return null;var qe=O(void 0,this.state,this.props),it=[],He=null,$e=null,Qe=null,gt=null,et=null,tt=B&&B.goButton,Je=R?1:2,vt=Le-1>0?Le-1:0,wt=Le+1=Je*2&&Le!==1+2&&(it[0]=Object(F.cloneElement)(it[0],{className:"".concat(E,"-item-after-jump-prev")}),it.unshift(He)),qe-Le>=Je*2&&Le!==qe-2&&(it[it.length-1]=Object(F.cloneElement)(it[it.length-1],{className:"".concat(E,"-item-before-jump-next")}),it.push($e)),Ge!==1&&it.unshift(Qe),ze!==qe&&it.push(gt)}var ge=null;Q&&(ge=D.a.createElement("li",{className:"".concat(E,"-total-text")},Q(K,[K===0?0:(Le-1)*Ye+1,Le*Ye>K?K:Le*Ye])));var de=!this.hasPrev()||!qe,ce=!this.hasNext()||!qe;return D.a.createElement("ul",Object(q.a)({className:g()(E,y,Object(V.a)({},"".concat(E,"-disabled"),P)),style:_,unselectable:"unselectable",ref:this.savePaginationNode},Et),ge,D.a.createElement("li",{title:G?$.prev_page:null,onClick:this.prev,tabIndex:de?null:0,onKeyPress:this.runIfEnterPrev,className:g()("".concat(E,"-prev"),Object(V.a)({},"".concat(E,"-disabled"),de)),"aria-disabled":de},this.renderPrev(vt)),it,D.a.createElement("li",{title:G?$.next_page:null,onClick:this.next,tabIndex:ce?null:0,onKeyPress:this.runIfEnterNext,className:g()("".concat(E,"-next"),Object(V.a)({},"".concat(E,"-disabled"),ce)),"aria-disabled":ce},this.renderNext(wt)),D.a.createElement(l,{disabled:P,locale:$,rootPrefixCls:E,selectComponentClass:Oe,selectPrefixCls:we,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Le,pageSize:Ye,pageSizeOptions:he,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:tt}))}}],[{key:"getDerivedStateFromProps",value:function(p,c){var E={};if("current"in p&&(E.current=p.current,p.current!==c.current&&(E.currentInputValue=E.current)),"pageSize"in p&&p.pageSize!==c.pageSize){var y=c.current,_=O(p.pageSize,c,p);y=y>_?_:y,"current"in p||(E.current=y,E.currentInputValue=y),E.pageSize=p.pageSize}return E}}]),b}(D.a.Component);S.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:a,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:a,locale:r.a,style:{},itemRender:h,totalBoundaryShowSizeChanger:50};var x=S},"6RRn":function(Fe,Se,W){"use strict";var q=W("wCXF"),V=W("n6Qo");W.d(Se,"b",function(){return V.a});var M=W("IBYe"),z=W("6eGT"),U=W("hW8S");W.d(Se,"a",function(){return U.a}),Se.c=q.b},"6UM0":function(Fe,Se,W){var q,V;(function(){var M;(function(){"use strict";var U=[function(D,I,g){var f=g(1).Beautifier,u=g(5).Options;function d(s,l){var r=new f(s,l);return r.beautify()}D.exports=d,D.exports.defaultOptions=function(){return new u}},function(D,I,g){var f=g(2).Output,u=g(3).Token,d=g(4),s=g(5).Options,l=g(7).Tokenizer,r=g(7).line_starters,a=g(7).positionable_operators,n=g(7).TOKEN;function h(R,G){return G.indexOf(R)!==-1}function O(R){return R.replace(/^\s+/g,"")}function S(R){for(var G={},Q=0;QQ&&(Q=R.line_indent_level));var ne={mode:G,parent:R,last_token:R?R.last_token:new u(n.START_BLOCK,""),last_word:R?R.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:Q,alignment:0,line_indent_level:R?R.line_indent_level:Q,start_line_index:this._output.get_line_number(),ternary_depth:0};return ne},$.prototype._reset=function(R){var G=R.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new f(this._options,G),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(c.BlockStatement);var Q=new l(R,this._options);return this._tokens=Q.tokenize(),R},$.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var R,G=this._reset(this._source_text),Q=this._options.eol;this._options.eol==="auto"&&(Q=` `,G&&d.lineBreak.test(G||"")&&(Q=G.match(d.lineBreak)[0]));for(var ne=this._tokens.next();ne;)this.handle_token(ne),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ne,ne=this._tokens.next();return R=this._output.get_code(Q),R},$.prototype.handle_token=function(R,G){R.type===n.START_EXPR?this.handle_start_expr(R):R.type===n.END_EXPR?this.handle_end_expr(R):R.type===n.START_BLOCK?this.handle_start_block(R):R.type===n.END_BLOCK?this.handle_end_block(R):R.type===n.WORD?this.handle_word(R):R.type===n.RESERVED?this.handle_word(R):R.type===n.SEMICOLON?this.handle_semicolon(R):R.type===n.STRING?this.handle_string(R):R.type===n.EQUALS?this.handle_equals(R):R.type===n.OPERATOR?this.handle_operator(R):R.type===n.COMMA?this.handle_comma(R):R.type===n.BLOCK_COMMENT?this.handle_block_comment(R,G):R.type===n.COMMENT?this.handle_comment(R,G):R.type===n.DOT?this.handle_dot(R):R.type===n.EOF?this.handle_eof(R):R.type===n.UNKNOWN?this.handle_unknown(R,G):this.handle_unknown(R,G)},$.prototype.handle_whitespace_and_comments=function(R,G){var Q=R.newlines,ne=this._options.keep_array_indentation&&_(this._flags.mode);if(R.comments_before)for(var le=R.comments_before.next();le;)this.handle_whitespace_and_comments(le,G),this.handle_token(le,G),le=R.comments_before.next();if(ne)for(var _e=0;_e0,G);else if(this._options.max_preserve_newlines&&Q>this._options.max_preserve_newlines&&(Q=this._options.max_preserve_newlines),this._options.preserve_newlines&&Q>1){this.print_newline(!1,G);for(var pe=1;pe0&&(!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))},$.prototype.set_mode=function(R){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,R),this._flags=this.create_flags(this._previous_flags,R),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},$.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&&E(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},$.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||A(this._flags.last_token,["get","set"]))},$.prototype.start_of_statement=function(R){var G=!1;return G=G||A(this._flags.last_token,["var","let","const"])&&R.type===n.WORD,G=G||x(this._flags.last_token,"do"),G=G||!(this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement)&&A(this._flags.last_token,B)&&!R.newlines,G=G||x(this._flags.last_token,"else")&&!(x(R,"if")&&!R.comments_before),G=G||this._flags.last_token.type===n.END_EXPR&&(this._previous_flags.mode===c.ForInitializer||this._previous_flags.mode===c.Conditional),G=G||this._flags.last_token.type===n.WORD&&this._flags.mode===c.BlockStatement&&!this._flags.in_case&&!(R.text==="--"||R.text==="++")&&this._last_last_text!=="function"&&R.type!==n.WORD&&R.type!==n.RESERVED,G=G||this._flags.mode===c.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||A(this._flags.last_token,["get","set"])),G?(this.set_mode(c.Statement),this.indent(),this.handle_whitespace_and_comments(R,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(R,A(R,["do","for","if","while"])),!0):!1},$.prototype.handle_start_expr=function(R){this.start_of_statement(R)||this.handle_whitespace_and_comments(R);var G=c.Expression;if(R.text==="["){if(this._flags.last_token.type===n.WORD||this._flags.last_token.text===")"){A(this._flags.last_token,r)&&(this._output.space_before_token=!0),this.print_token(R),this.set_mode(G),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}G=c.ArrayLiteral,_(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())),h(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,G=c.ForInitializer):h(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,G=c.Conditional):h(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&R.whitespace_before===""?this._output.space_before_token=!1:(h(this._flags.last_token.text,r)||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(R);else if(this._flags.last_token.type===n.WORD){this._output.space_before_token=!1;var Q=this._tokens.peek(-3);if(this._options.space_after_named_function&&Q){var ne=this._tokens.peek(-4);A(Q,["async","function"])||Q.text==="*"&&A(ne,["async","function"])?this._output.space_before_token=!0:this._flags.mode===c.ObjectLiteral?(Q.text==="{"||Q.text===","||Q.text==="*"&&(ne.text==="{"||ne.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(R);(this._flags.last_token.type===n.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(h(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&h(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(R,R.newlines),this.print_token(R),this.set_mode(G),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},$.prototype.handle_end_expr=function(R){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(R),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(R,R.text==="]"&&_(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(R),this.restore_mode(),E(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)},$.prototype.handle_start_block=function(R){this.handle_whitespace_and_comments(R);var G=this._tokens.peek(),Q=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):Q&&(h(Q.text,[":",","])&&h(G.type,[n.STRING,n.WORD,n.RESERVED])||h(G.text,["get","set","..."])&&h(Q.type,[n.WORD,n.RESERVED]))?h(this._last_last_text,["class","interface"])&&!h(Q.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):h(this._flags.last_token.type,[n.EQUALS,n.START_EXPR,n.COMMA,n.OPERATOR])||A(this._flags.last_token,["return","throw","import","default"])?this.set_mode(c.ObjectLiteral):this.set_mode(c.BlockStatement),this._flags.last_token&&(A(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ne=!G.comments_before&&G.text==="}",le=ne&&this._flags.last_word==="function"&&this._flags.last_token.type===n.END_EXPR;if(this._options.brace_preserve_inline){var _e=0,pe=null;this._flags.inline_frame=!0;do if(_e+=1,pe=this._tokens.peek(_e-1),pe.newlines){this._flags.inline_frame=!1;break}while(pe.type!==n.EOF&&!(pe.type===n.END_BLOCK&&pe.opened===R))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&R.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==n.OPERATOR&&(le||this._flags.last_token.type===n.EQUALS||A(this._flags.last_token,C)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(_(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(R),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(R),this.indent(),!ne&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},$.prototype.handle_end_block=function(R){for(this.handle_whitespace_and_comments(R);this._flags.mode===c.Statement;)this.restore_mode();var G=this._flags.last_token.type===n.START_BLOCK;this._flags.inline_frame&&!G?this._output.space_before_token=!0:this._options.brace_style==="expand"?G||this.print_newline():G||(_(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(R)},$.prototype.handle_word=function(R){if(R.type===n.RESERVED){if(h(R.text,["set","get"])&&this._flags.mode!==c.ObjectLiteral)R.type=n.WORD;else if(R.text==="import"&&h(this._tokens.peek().text,["(","."]))R.type=n.WORD;else if(h(R.text,["as","from"])&&!this._flags.import_block)R.type=n.WORD;else if(this._flags.mode===c.ObjectLiteral){var G=this._tokens.peek();G.text===":"&&(R.type=n.WORD)}}if(this.start_of_statement(R)?A(this._flags.last_token,["var","let","const"])&&R.type===n.WORD&&(this._flags.declaration_statement=!0):R.newlines&&!P(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||!A(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(R),this.print_newline()):this.handle_whitespace_and_comments(R),this._flags.do_block&&!this._flags.do_while)if(x(R,"while")){this._output.space_before_token=!0,this.print_token(R),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(R,"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&&A(R,["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(R),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(R)),x(R,"function")){(h(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(h(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===n.OPERATOR))&&(!this._output.just_added_blankline()&&!R.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===n.RESERVED||this._flags.last_token.type===n.WORD?A(this._flags.last_token,["get","set","new","export"])||A(this._flags.last_token,B)?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&&(P(this._flags.mode)||_(this._flags.mode))||this.print_newline(),this.print_token(R),this._flags.last_word=R.text;return}var Q="NONE";if(this._flags.last_token.type===n.END_BLOCK?this._previous_flags.inline_frame?Q="SPACE":A(R,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&R.newlines?Q="NEWLINE":(Q="SPACE",this._output.space_before_token=!0):Q="NEWLINE":this._flags.last_token.type===n.SEMICOLON&&this._flags.mode===c.BlockStatement?Q="NEWLINE":this._flags.last_token.type===n.SEMICOLON&&P(this._flags.mode)?Q="SPACE":this._flags.last_token.type===n.STRING?Q="NEWLINE":this._flags.last_token.type===n.RESERVED||this._flags.last_token.type===n.WORD||this._flags.last_token.text==="*"&&(h(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&h(this._last_last_text,["{",","]))?Q="SPACE":this._flags.last_token.type===n.START_BLOCK?this._flags.inline_frame?Q="SPACE":Q="NEWLINE":this._flags.last_token.type===n.END_EXPR&&(this._output.space_before_token=!0,Q="NEWLINE"),A(R,r)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?Q="SPACE":Q="NEWLINE"),A(R,["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"&&R.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ne=this._output.current_line;ne.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else Q==="NEWLINE"?A(this._flags.last_token,C)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&A(R,["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||!A(R,["var","let","const"]))&&this._flags.last_token.text!==":"&&(x(R,"if")&&x(R.previous,"else")?this._output.space_before_token=!0:this.print_newline()):A(R,r)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&_(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():Q==="SPACE"&&(this._output.space_before_token=!0);R.previous&&(R.previous.type===n.WORD||R.previous.type===n.RESERVED)&&(this._output.space_before_token=!0),this.print_token(R),this._flags.last_word=R.text,R.type===n.RESERVED&&(R.text==="do"?this._flags.do_block=!0:R.text==="if"?this._flags.if_block=!0:R.text==="import"?this._flags.import_block=!0:this._flags.import_block&&x(R,"from")&&(this._flags.import_block=!1))},$.prototype.handle_semicolon=function(R){this.start_of_statement(R)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(R);for(var G=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&x(G,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(R)},$.prototype.handle_string=function(R){R.text.startsWith("`")&&R.newlines===0&&R.whitespace_before===""&&(R.previous.text===")"||this._flags.last_token.type===n.WORD)||(this.start_of_statement(R)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(R),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(R):R.text.startsWith("`")&&this._flags.last_token.type===n.END_EXPR&&(R.previous.text==="]"||R.previous.text===")")&&R.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(R)},$.prototype.handle_equals=function(R){this.start_of_statement(R)||this.handle_whitespace_and_comments(R),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(R),this._output.space_before_token=!0},$.prototype.handle_comma=function(R){this.handle_whitespace_and_comments(R,!0),this.print_token(R),this._output.space_before_token=!0,this._flags.declaration_statement?(P(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(R)):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(R)},$.prototype.handle_operator=function(R){var G=R.text==="*"&&(A(this._flags.last_token,["function","yield"])||h(this._flags.last_token.type,[n.START_BLOCK,n.COMMA,n.END_BLOCK,n.SEMICOLON])),Q=h(R.text,["-","+"])&&(h(this._flags.last_token.type,[n.START_BLOCK,n.START_EXPR,n.EQUALS,n.OPERATOR])||h(this._flags.last_token.text,r)||this._flags.last_token.text===",");if(!this.start_of_statement(R)){var ne=!G;this.handle_whitespace_and_comments(R,ne)}if(R.text==="*"&&this._flags.last_token.type===n.DOT){this.print_token(R);return}if(R.text==="::"){this.print_token(R);return}if(this._flags.last_token.type===n.OPERATOR&&h(this._options.operator_position,p)&&this.allow_wrap_or_preserved_newline(R),R.text===":"&&this._flags.in_case){this.print_token(R),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 le=!0,_e=!0,pe=!1;if(R.text===":"?this._flags.ternary_depth===0?le=!1:(this._flags.ternary_depth-=1,pe=!0):R.text==="?"&&(this._flags.ternary_depth+=1),!Q&&!G&&this._options.preserve_newlines&&h(R.text,a)){var Ee=R.text===":",Oe=Ee&&pe,we=Ee&&!pe;switch(this._options.operator_position){case v.before_newline:this._output.space_before_token=!we,this.print_token(R),(!Ee||Oe)&&this.allow_wrap_or_preserved_newline(R),this._output.space_before_token=!0;return;case v.after_newline:this._output.space_before_token=!0,!Ee||Oe?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(R):this._output.space_before_token=!1,this.print_token(R),this._output.space_before_token=!0;return;case v.preserve_newline:we||this.allow_wrap_or_preserved_newline(R),le=!(this._output.just_added_newline()||we),this._output.space_before_token=le,this.print_token(R),this._output.space_before_token=!0;return}}if(G){this.allow_wrap_or_preserved_newline(R),le=!1;var he=this._tokens.peek();_e=he&&h(he.type,[n.WORD,n.RESERVED])}else if(R.text==="...")this.allow_wrap_or_preserved_newline(R),le=this._flags.last_token.type===n.START_BLOCK,_e=!1;else if(h(R.text,["--","++","!","~"])||Q){if((this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR)&&this.allow_wrap_or_preserved_newline(R),le=!1,_e=!1,R.newlines&&(R.text==="--"||R.text==="++"||R.text==="~")){var oe=A(this._flags.last_token,C)&&R.newlines;oe&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(oe,!0)}this._flags.last_token.text===";"&&P(this._flags.mode)&&(le=!0),this._flags.last_token.type===n.RESERVED?le=!0:this._flags.last_token.type===n.END_EXPR?le=!(this._flags.last_token.text==="]"&&(R.text==="--"||R.text==="++")):this._flags.last_token.type===n.OPERATOR&&(le=h(R.text,["--","-","++","+"])&&h(this._flags.last_token.text,["--","-","++","+"]),h(R.text,["+","-"])&&h(this._flags.last_token.text,["--","++"])&&(_e=!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||le,this.print_token(R),this._output.space_before_token=_e},$.prototype.handle_block_comment=function(R,G){if(this._output.raw){this._output.add_raw_token(R),R.directives&&R.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(R.directives){this.print_newline(!1,G),this.print_token(R),R.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!d.newline.test(R.text)&&!R.newlines){this._output.space_before_token=!0,this.print_token(R),this._output.space_before_token=!0;return}else this.print_block_commment(R,G)},$.prototype.print_block_commment=function(R,G){var Q=y(R.text),ne,le=!1,_e=!1,pe=R.whitespace_before,Ee=pe.length;if(this.print_newline(!1,G),this.print_token_line_indentation(R),this._output.add_token(Q[0]),this.print_newline(!1,G),Q.length>1){for(Q=Q.slice(1),le=N(Q,"*"),_e=K(Q,pe),le&&(this._flags.alignment=1),ne=0;ne=0;d--)if(this.__items[d].match(u))return!0;return!1},I.prototype.set_indent=function(u,d){this.is_empty()&&(this.__indent_count=u||0,this.__alignment_count=d||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 d=u.lastIndexOf(` `);d!==-1?this.__character_count=u.length-d: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 g(u,d){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)),d=d||"",u.indent_level>0&&(d=new Array(u.indent_level+1).join(this.__indent_string)),this.__base_string=d,this.__base_string_length=d.length}g.prototype.get_indent_size=function(u,d){var s=this.__base_string_length;return d=d||0,u<0&&(s=0),s+=u*this.__indent_size,s+=d,s},g.prototype.get_indent_string=function(u,d){var s=this.__base_string;return d=d||0,u<0&&(u=0,s=""),d+=u*this.__indent_size,this.__ensure_cache(d),s+=this.__cache[d],s},g.prototype.__ensure_cache=function(u){for(;u>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var u=this.__cache.length,d=0,s="";this.__indent_size&&u>=this.__indent_size&&(d=Math.floor(u/this.__indent_size),u-=d*this.__indent_size,s=new Array(d+1).join(this.__indent_string)),u&&(s+=new Array(u+1).join(" ")),this.__cache.push(s)};function f(u,d){this.__indent_cache=new g(u,d),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()}f.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},f.prototype.get_line_number=function(){return this.__lines.length},f.prototype.get_indent_string=function(u,d){return this.__indent_cache.get_indent_string(u,d)},f.prototype.get_indent_size=function(u,d){return this.__indent_cache.get_indent_size(u,d)},f.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},f.prototype.add_new_line=function(u){return this.is_empty()||!u&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},f.prototype.get_code=function(u){this.trim(!0);var d=this.current_line.pop();d&&(d[d.length-1]===` `&&(d=d.replace(/\n+$/g,"")),this.current_line.push(d)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(` `);return u!==` `&&(s=s.replace(/[\n]/g,u)),s},f.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},f.prototype.set_indent=function(u,d){return u=u||0,d=d||0,this.next_line.set_indent(u,d),this.__lines.length>1?(this.current_line.set_indent(u,d),!0):(this.current_line.set_indent(),!1)},f.prototype.add_raw_token=function(u){for(var d=0;d1&&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},f.prototype.just_added_newline=function(){return this.current_line.is_empty()},f.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},f.prototype.ensure_empty_line_above=function(u,d){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)!==d){this.__lines.splice(s+1,0,new I(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},D.exports.Output=f},function(D){function I(g,f,u,d){this.type=g,this.text=f,this.comments_before=null,this.newlines=u||0,this.whitespace_before=d||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}D.exports.Token=I},function(D,I){var g="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",f="\\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",d="\\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}|["+g+u+"])",l="(?:\\\\u[0-9a-fA-F]{4}|["+f+u+d+"])*";I.identifier=new RegExp(s+l,"g"),I.identifierStart=new RegExp(s),I.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+f+u+d+"])+");var r=/[\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(D,I,g){var f=g(6).Options,u=["before-newline","after-newline","preserve-newline"];function d(s){f.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 r=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var a=0;a>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),b=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";b=b.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),b="\\?\\.(?!\\d) "+b,b=b.replace(/ /g,"|");var v=new RegExp(b),p="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),c=p.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),E=new RegExp("^(?:"+c.join("|")+")$"),y,_=function(N,K){u.call(this,N,K),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var $=new r(this._input),B=new a(this._input).read_options(this._options);this.__patterns={template:B,identifier:B.starting_with(l.identifier).matching(l.identifierMatch),number:$.matching(S),punct:$.matching(v),comment:$.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:$.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:$.matching(//),include:$.starting_with(/#include/).until_after(l.lineBreak),shebang:$.starting_with(/#!/).until_after(l.lineBreak),xml:$.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:B.until(/['\\\n\r\u2028\u2029]/),double_quote:B.until(/["\\\n\r\u2028\u2029]/),template_text:B.until(/[`\\$]/),template_expression:B.until(/[`}\\]/)}};_.prototype=new u,_.prototype._is_comment=function(N){return N.type===h.COMMENT||N.type===h.BLOCK_COMMENT||N.type===h.UNKNOWN},_.prototype._is_opening=function(N){return N.type===h.START_BLOCK||N.type===h.START_EXPR},_.prototype._is_closing=function(N,K){return(N.type===h.END_BLOCK||N.type===h.END_EXPR)&&K&&(N.text==="]"&&K.text==="["||N.text===")"&&K.text==="("||N.text==="}"&&K.text==="{")},_.prototype._reset=function(){y=!1},_.prototype._get_next_token=function(N,K){var $=null;this._readWhitespace();var B=this._input.peek();return B===null?this._create_token(h.EOF,""):($=$||this._read_non_javascript(B),$=$||this._read_string(B),$=$||this._read_word(N),$=$||this._read_singles(B),$=$||this._read_comment(B),$=$||this._read_regexp(B,N),$=$||this._read_xml(B,N),$=$||this._read_punctuation(),$=$||this._create_token(h.UNKNOWN,this._input.next()),$)},_.prototype._read_word=function(N){var K;if(K=this.__patterns.identifier.read(),K!=="")return K=K.replace(l.allLineBreaks,` `),!(N.type===h.DOT||N.type===h.RESERVED&&(N.text==="set"||N.text==="get"))&&E.test(K)?(K==="in"||K==="of")&&(N.type===h.WORD||N.type===h.STRING)?this._create_token(h.OPERATOR,K):this._create_token(h.RESERVED,K):this._create_token(h.WORD,K);if(K=this.__patterns.number.read(),K!=="")return this._create_token(h.WORD,K)},_.prototype._read_singles=function(N){var K=null;return N==="("||N==="["?K=this._create_token(h.START_EXPR,N):N===")"||N==="]"?K=this._create_token(h.END_EXPR,N):N==="{"?K=this._create_token(h.START_BLOCK,N):N==="}"?K=this._create_token(h.END_BLOCK,N):N===";"?K=this._create_token(h.SEMICOLON,N):N==="."&&A.test(this._input.peek(1))?K=this._create_token(h.DOT,N):N===","&&(K=this._create_token(h.COMMA,N)),K&&this._input.next(),K},_.prototype._read_punctuation=function(){var N=this.__patterns.punct.read();if(N!=="")return N==="="?this._create_token(h.EQUALS,N):N==="?."?this._create_token(h.DOT,N):this._create_token(h.OPERATOR,N)},_.prototype._read_non_javascript=function(N){var K="";if(N==="#"){if(this._is_first_token()&&(K=this.__patterns.shebang.read(),K))return this._create_token(h.UNKNOWN,K.trim()+` `);if(K=this.__patterns.include.read(),K)return this._create_token(h.UNKNOWN,K.trim()+` `);N=this._input.next();var $="#";if(this._input.hasNext()&&this._input.testChar(x)){do N=this._input.next(),$+=N;while(this._input.hasNext()&&N!=="#"&&N!=="=");return N==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?($+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&($+="{}",this._input.next(),this._input.next())),this._create_token(h.WORD,$)}this._input.back()}else if(N==="<"&&this._is_first_token()){if(K=this.__patterns.html_comment_start.read(),K){for(;this._input.hasNext()&&!this._input.testChar(l.newline);)K+=this._input.next();return y=!0,this._create_token(h.COMMENT,K)}}else if(y&&N==="-"&&(K=this.__patterns.html_comment_end.read(),K))return y=!1,this._create_token(h.COMMENT,K);return null},_.prototype._read_comment=function(N){var K=null;if(N==="/"){var $="";if(this._input.peek(1)==="*"){$=this.__patterns.block_comment.read();var B=O.get_directives($);B&&B.ignore==="start"&&($+=O.readIgnored(this._input)),$=$.replace(l.allLineBreaks,` `),K=this._create_token(h.BLOCK_COMMENT,$),K.directives=B}else this._input.peek(1)==="/"&&($=this.__patterns.comment.read(),K=this._create_token(h.COMMENT,$))}return K},_.prototype._read_string=function(N){if(N==="`"||N==="'"||N==='"'){var K=this._input.next();return this.has_char_escapes=!1,N==="`"?K+=this._read_string_recursive("`",!0,"${"):K+=this._read_string_recursive(N),this.has_char_escapes&&this._options.unescape_strings&&(K=P(K)),this._input.peek()===N&&(K+=this._input.next()),K=K.replace(l.allLineBreaks,` `),this._create_token(h.STRING,K)}return null},_.prototype._allow_regexp_or_xml=function(N){return N.type===h.RESERVED&&n(N.text,["return","case","throw","else","do","typeof","yield"])||N.type===h.END_EXPR&&N.text===")"&&N.opened.previous.type===h.RESERVED&&n(N.opened.previous.text,["if","while","for"])||n(N.type,[h.COMMENT,h.START_EXPR,h.START_BLOCK,h.START,h.END_BLOCK,h.OPERATOR,h.EQUALS,h.EOF,h.SEMICOLON,h.COMMA])},_.prototype._read_regexp=function(N,K){if(N==="/"&&this._allow_regexp_or_xml(K)){for(var $=this._input.next(),B=!1,R=!1;this._input.hasNext()&&(B||R||this._input.peek()!==N)&&!this._input.testChar(l.newline);)$+=this._input.peek(),B?B=!1:(B=this._input.peek()==="\\",this._input.peek()==="["?R=!0:this._input.peek()==="]"&&(R=!1)),this._input.next();return this._input.peek()===N&&($+=this._input.next(),$+=this._input.read(l.identifier)),this._create_token(h.STRING,$)}return null},_.prototype._read_xml=function(N,K){if(this._options.e4x&&N==="<"&&this._allow_regexp_or_xml(K)){var $="",B=this.__patterns.xml.read_match();if(B){for(var R=B[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),G=R.indexOf("{")===0,Q=0;B;){var ne=!!B[1],le=B[2],_e=!!B[B.length-1]||le.slice(0,8)==="![CDATA[";if(!_e&&(le===R||G&&le.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ne?--Q:++Q),$+=B[0],Q<=0)break;B=this.__patterns.xml.read_match()}return B||($+=this._input.match(/[\s\S]*/g)[0]),$=$.replace(l.allLineBreaks,` `),this._create_token(h.STRING,$)}}return null};function P(N){for(var K="",$=0,B=new f(N),R=null;B.hasNext();)if(R=B.match(/([\s]|[^\\]|\\\\)+/g),R&&(K+=R[0]),B.peek()==="\\"){if(B.next(),B.peek()==="x")R=B.match(/x([0-9A-Fa-f]{2})/g);else if(B.peek()==="u")R=B.match(/u([0-9A-Fa-f]{4})/g);else{K+="\\",B.hasNext()&&(K+=B.next());continue}if(!R)return N;if($=parseInt(R[1],16),$>126&&$<=255&&R[0].indexOf("x")===0)return N;if($>=0&&$<32){K+="\\"+R[0];continue}else $===34||$===39||$===92?K+="\\"+String.fromCharCode($):K+=String.fromCharCode($)}return K}_.prototype._read_string_recursive=function(N,K,$){var B,R;N==="'"?R=this.__patterns.single_quote:N==='"'?R=this.__patterns.double_quote:N==="`"?R=this.__patterns.template_text:N==="}"&&(R=this.__patterns.template_expression);for(var G=R.read(),Q="";this._input.hasNext();){if(Q=this._input.next(),Q===N||!K&&l.newline.test(Q)){this._input.back();break}else Q==="\\"&&this._input.hasNext()?(B=this._input.peek(),B==="x"||B==="u"?this.has_char_escapes=!0:B==="\r"&&this._input.peek(1)===` `&&this._input.next(),Q+=this._input.next()):$&&($==="${"&&Q==="$"&&this._input.peek()==="{"&&(Q+=this._input.next()),$===Q&&(N==="`"?Q+=this._read_string_recursive("}",K,"`"):Q+=this._read_string_recursive("`",K,"${"),this._input.hasNext()&&(Q+=this._input.next())));Q+=R.read(),G+=Q}return G},D.exports.Tokenizer=_,D.exports.TOKEN=h,D.exports.positionable_operators=C.slice(),D.exports.line_starters=p.slice()},function(D){var I=RegExp.prototype.hasOwnProperty("sticky");function g(f){this.__input=f||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position=0&&f=0&&u=f.length&&this.__input.substring(u-f.length,u).toLowerCase()===f},D.exports.InputScanner=g},function(D,I,g){var f=g(8).InputScanner,u=g(3).Token,d=g(10).TokenStream,s=g(11).WhitespacePattern,l={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},r=function(a,n){this._input=new f(a),this._options=n||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};r.prototype.tokenize=function(){this._input.restart(),this.__tokens=new d,this._reset();for(var a,n=new u(l.START,""),h=null,O=[],S=new d;n.type!==l.EOF;){for(a=this._get_next_token(n,h);this._is_comment(a);)S.add(a),a=this._get_next_token(n,h);S.isEmpty()||(a.comments_before=S,S=new d),a.parent=h,this._is_opening(a)?(O.push(h),h=a):h&&this._is_closing(a,h)&&(a.opened=h,h.closed=a,h=O.pop(),a.parent=h),a.previous=n,n.next=a,this.__tokens.add(a),n=a}return this.__tokens},r.prototype._is_first_token=function(){return this.__tokens.isEmpty()},r.prototype._reset=function(){},r.prototype._get_next_token=function(a,n){this._readWhitespace();var h=this._input.read(/.+/g);return h?this._create_token(l.RAW,h):this._create_token(l.EOF,"")},r.prototype._is_comment=function(a){return!1},r.prototype._is_opening=function(a){return!1},r.prototype._is_closing=function(a,n){return!1},r.prototype._create_token=function(a,n){var h=new u(a,n,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return h},r.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},D.exports.Tokenizer=r,D.exports.TOKEN=l},function(D){function I(g){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=g}I.prototype.restart=function(){this.__position=0},I.prototype.isEmpty=function(){return this.__tokens_length===0},I.prototype.hasNext=function(){return this.__position=0&&g/),erb:r.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:r.starting_with(/{%/).until_after(/%}/),django_value:r.starting_with(/{{/).until_after(/}}/),django_comment:r.starting_with(/{#/).until_after(/#}/),smarty:r.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:r.starting_with(/{\*/).until_after(/\*}/),smarty_literal:r.starting_with(/{literal}/).until_after(/{\/literal}/)}}d.prototype=new f,d.prototype._create=function(){return new d(this._input,this)},d.prototype._update=function(){this.__set_templated_pattern()},d.prototype.disable=function(s){var l=this._create();return l._disabled[s]=!0,l._update(),l},d.prototype.read_options=function(s){var l=this._create();for(var r in u)l._disabled[r]=s.templating.indexOf(r)===-1;return l._update(),l},d.prototype.exclude=function(s){var l=this._create();return l._excluded[s]=!0,l._update(),l},d.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},d.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("|")+")")},d.prototype._read_template=function(){var s="",l=this._input.peek();if(l==="<"){var r=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&r==="?"&&(s=s||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&r==="%"&&(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},D.exports.TemplatablePattern=d}],L={};function H(D){var I=L[D];if(I!==void 0)return I.exports;var g=L[D]={exports:{}};return U[D](g,g.exports,H),g.exports}var F=H(0);M=F})();var z=M;!(q=[],V=function(){return{js_beautify:z}}.apply(Se,q),V!==void 0&&(Fe.exports=V))})()},"6eGT":function(Fe,Se,W){"use strict";function q(V){return null}Se.a=q},"7Cbv":function(Fe,Se,W){"use strict";var q=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 M(){if(!q)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return q(V)}var z=/^(?:[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 U(u){return typeof u=="string"&&z.test(u)}for(var L=U,H=[],F=0;F<256;++F)H.push((F+256).toString(16).substr(1));function D(u){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=(H[u[d+0]]+H[u[d+1]]+H[u[d+2]]+H[u[d+3]]+"-"+H[u[d+4]]+H[u[d+5]]+"-"+H[u[d+6]]+H[u[d+7]]+"-"+H[u[d+8]]+H[u[d+9]]+"-"+H[u[d+10]]+H[u[d+11]]+H[u[d+12]]+H[u[d+13]]+H[u[d+14]]+H[u[d+15]]).toLowerCase();if(!L(s))throw TypeError("Stringified UUID is invalid");return s}var I=D;function g(u,d,s){u=u||{};var l=u.random||(u.rng||M)();if(l[6]=l[6]&15|64,l[8]=l[8]&63|128,d){s=s||0;for(var r=0;r<16;++r)d[s+r]=l[r];return d}return I(l)}var f=Se.a=g},"7ahc":function(Fe,Se,W){"use strict";W.d(Se,"a",function(){return O});var q=W("k1fw"),V=W("0Owb"),M=W("+L6B"),z=W("2/Rp"),U=W("y8nQ"),L=W("Vl3Y"),H=W("tJVT"),F=W("OaEy"),D=W("2fM7"),I=W("q1tI"),g=W.n(I),f=W("VrN/"),u=W.n(f),d=W("p77/"),s=W.n(d),l=W("c5Ni"),r=W.n(l),a=D.a.Option,n={labelCol:{span:4},wrapperCol:{span:20}},h={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"]};Se.b=function(S){var x=S.callback,A=S.onCancel,C=Object(I.useState)("python"),b=Object(H.a)(C,2),v=b[0],p=b[1];function c(y){p(h[y][1])}function E(y){x(y)}return g.a.createElement(L.a,Object(V.a)({},n,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:E}),g.a.createElement(L.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},g.a.createElement(D.a,{onChange:c},Object.keys(h).map(function(y){return g.a.createElement(a,{key:y,value:y},h[y][0])}))),g.a.createElement(L.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},g.a.createElement(O,{mode:v})),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(z.a,{type:"ghost",onClick:A},"\u53D6\u6D88")))};function O(S){var x=S.value,A=S.onChange,C=S.mode,b=S.options,v=b===void 0?{}:b,p=Object(I.useRef)(),c=Object(I.useState)(),E=Object(H.a)(c,2),y=E[0],_=E[1];return Object(I.useEffect)(function(){if(y){function P(N){var K=N.getValue();A&&A(K)}return y.on("change",P),function(){y.off("change",P)}}},[y,A]),Object(I.useEffect)(function(){y&&y.setOption("mode",C)},[y,C]),Object(I.useEffect)(function(){y&&((x!==y.getValue()||x==="")&&setTimeout(function(){y.setValue(x||" ")},300))},[y,x]),Object(I.useEffect)(function(){if(p.current&&!y){var P=u.a.fromTextArea(p.current,Object(q.a)({mode:C,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},v));_(P)}},[p.current,y]),g.a.createElement("div",{className:"my-codemirror-container"},g.a.createElement("textarea",{ref:p}))}},"7ixt":function(Fe,Se,W){"use strict";W.d(Se,"a",function(){return M});var q={adjustX:1,adjustY:1},V=[0,0],M={left:{points:["cr","cl"],overflow:q,offset:[-4,0],targetOffset:V},right:{points:["cl","cr"],overflow:q,offset:[4,0],targetOffset:V},top:{points:["bc","tc"],overflow:q,offset:[0,-4],targetOffset:V},bottom:{points:["tc","bc"],overflow:q,offset:[0,4],targetOffset:V},topLeft:{points:["bl","tl"],overflow:q,offset:[0,-4],targetOffset:V},leftTop:{points:["tr","tl"],overflow:q,offset:[-4,0],targetOffset:V},topRight:{points:["br","tr"],overflow:q,offset:[0,-4],targetOffset:V},rightTop:{points:["tl","tr"],overflow:q,offset:[4,0],targetOffset:V},bottomRight:{points:["tr","br"],overflow:q,offset:[0,4],targetOffset:V},rightBottom:{points:["bl","br"],overflow:q,offset:[4,0],targetOffset:V},bottomLeft:{points:["tl","bl"],overflow:q,offset:[0,4],targetOffset:V},leftBottom:{points:["br","bl"],overflow:q,offset:[-4,0],targetOffset:V}},z=M},"815F":function(Fe,Se,W){"use strict";W.d(Se,"e",function(){return H}),W.d(Se,"c",function(){return D}),W.d(Se,"d",function(){return I}),W.d(Se,"a",function(){return f}),W.d(Se,"f",function(){return u}),W.d(Se,"b",function(){return d});var q=W("KQm4"),V=W("VTBJ"),M=W("Ff2n"),z=W("Zm9Q"),U=W("Kwbf"),L=W("OZM5");function H(s,l){return s!=null?s:l}function F(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],l=new Map;function r(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(a||[]).forEach(function(h){var O=h.key,S=h.children;Object(U.a)(O!=null,"Tree node must have a certain key: [".concat(n).concat(O,"]"));var x=String(O);Object(U.a)(!l.has(x)||O===null||O===void 0,"Same 'key' exist in the Tree: ".concat(x)),l.set(x,!0),r(S,"".concat(n).concat(x," > "))})}r(s)}function D(s){function l(r){var a=Object(z.a)(r);return a.map(function(n){if(!Object(L.i)(n))return Object(U.a)(!n,"Tree/TreeNode can only accept TreeNode as children."),null;var h=n.key,O=n.props,S=O.children,x=Object(M.a)(O,["children"]),A=Object(V.a)({key:h},x),C=l(S);return C.length&&(A.children=C),A}).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]:[],r=new Set(l===!0?[]:l),a=[];function n(h){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return h.map(function(S,x){var A=Object(L.h)(O?O.pos:"0",x),C=H(S.key,A),b=Object(V.a)(Object(V.a)({},S),{},{parent:O,pos:A,children:null,data:S,isStart:[].concat(Object(q.a)(O?O.isStart:[]),[x===0]),isEnd:[].concat(Object(q.a)(O?O.isEnd:[]),[x===h.length-1])});return a.push(b),l===!0||r.has(C)?b.children=n(S.children||[],b):b.children=[],b})}return n(s),a}function g(s,l,r){var a;r?typeof r=="string"?a=function(O){return O[r]}:typeof r=="function"&&(a=function(O){return r(O)}):a=function(O,S){return H(O.key,S)};function n(h,O,S){var x=h?h.children:s,A=h?Object(L.h)(S.pos,O):"0";if(h){var C=a(h,A),b={node:h,index:O,pos:A,key:C,parentPos:S.node?S.pos:null,level:S.level+1};l(b)}x&&x.forEach(function(v,p){n(v,p,{node:h,pos:A,level:S?S.level+1:-1})})}n(null)}function f(s){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=l.initWrapper,a=l.processEntity,n=l.onProcessFinished,h=arguments.length>2?arguments[2]:void 0,O={},S={},x={posEntities:O,keyEntities:S};return r&&(x=r(x)||x),g(s,function(A){var C=A.node,b=A.index,v=A.pos,p=A.key,c=A.parentPos,E=A.level,y={node:C,index:b,key:p,pos:v,level:E},_=H(p,v);O[v]=y,S[_]=y,y.parent=O[c],y.parent&&(y.parent.children=y.parent.children||[],y.parent.children.push(y)),a&&a(y,x)},h),n&&n(x),x}function u(s,l){var r=l.expandedKeys,a=l.selectedKeys,n=l.loadedKeys,h=l.loadingKeys,O=l.checkedKeys,S=l.halfCheckedKeys,x=l.dragOverNodeKey,A=l.dropPosition,C=l.keyEntities,b=C[s],v={eventKey:s,expanded:r.indexOf(s)!==-1,selected:a.indexOf(s)!==-1,loaded:n.indexOf(s)!==-1,loading:h.indexOf(s)!==-1,checked:O.indexOf(s)!==-1,halfChecked:S.indexOf(s)!==-1,pos:String(b?b.pos:""),dragOver:x===s&&A===0,dragOverGapTop:x===s&&A===-1,dragOverGapBottom:x===s&&A===1};return v}function d(s){var l=s.data,r=s.expanded,a=s.selected,n=s.checked,h=s.loaded,O=s.loading,S=s.halfChecked,x=s.dragOver,A=s.dragOverGapTop,C=s.dragOverGapBottom,b=s.pos,v=s.active,p=Object(V.a)(Object(V.a)({},l),{},{expanded:r,selected:a,checked:n,loaded:h,loading:O,halfChecked:S,dragOver:x,dragOverGapTop:A,dragOverGapBottom:C,pos:b,active:v});return"props"in p||Object.defineProperty(p,"props",{get:function(){return Object(U.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),s}}),p}},"8EBN":function(Fe,Se,W){(function(q){q(W("VrN/"))})(function(q){"use strict";q.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&&z.substring(H+1,z.length);if(F)return q.findModeByExtension(F)},q.findModeByName=function(z){z=z.toLowerCase();for(var U=0;U=j.length?ee.slice(j.length):ee}).join(` `)}var r=[],a=["
    "],n=new d.a.Renderer,h=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function O(){r.length=0,a=["
      "]}var S={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function x(J,w,T,j){if(w>=J.length||J[w].level<=T)return w;var ee=J[w];j.push("
    • "+ee.text+""),w++;var X=[];return w=x(J,w,ee.level,X),X.length>0&&(j.push("
        "),X.forEach(function(ye){j.push(ye)}),j.push("
      ")),j.push("
    • "),w=x(J,w,T,j),w}function A(){return x(r,0,0,a),a.push("
    "),a.join("")}var C={heading:function(w){var T=h.exec(w);if(T)return{type:"heading",raw:T[0],depth:T[1].length,text:T[2]}},fences:function(w){var T=this.rules.block.fences.exec(w);if(T){var j=T[0],ee=l(j,T[3]||""),X=T[2]?T[2].trim():T[2];if(["latex","katex","math"].indexOf(X)>=0){var ye=p(),Ve=ee;ee=ye,c[ye]={type:"block",expression:Ve}}return{type:"code",raw:j,lang:X,text:ee}}}},b=/(?:\${2})([^\n`]+?)(?:\${2})/gi,v=0,p=function(){return"__special_katext_id_".concat(v++,"__")},c={};function E(){return c}function y(){v=0,c={}}function _(J){return J=J.replace(b,function(w,T){var j=p();return c[j]={type:"inline",expression:T},j}),J}var P=n.listitem;n.listitem=function(J){return P(_(J))};var N=n.paragraph;n.paragraph=function(J){return N(_(J))};var K=n.tablecell;n.tablecell=function(J,w){return K(_(J),w)},n.code=function(J,w,T){var j=(w||"").match(/\S*/)[0];return j?["latex","katex","math"].indexOf(j)>=0?"

    ".concat(J,"

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

    [TOC]

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

    "+re+`

    `},de.table=function(re,ae){return ae&&(ae=""+ae+""),` `+re+` `+ae+`
    `},de.tablerow=function(re){return` `+re+` `},de.tablecell=function(re,ae){var ue=ae.header?"th":"td",fe=ae.align?"<"+ue+' align="'+ae.align+'">':"<"+ue+">";return fe+re+" `},de.strong=function(re){return""+re+""},de.em=function(re){return""+re+""},de.codespan=function(re){return""+re+""},de.br=function(){return this.options.xhtml?"
    ":"
    "},de.del=function(re){return""+re+""},de.link=function(re,ae,ue){if(re=gt(this.options.sanitize,this.options.baseUrl,re),re===null)return ue;var fe='",fe},de.image=function(re,ae,ue){if(re=gt(this.options.sanitize,this.options.baseUrl,re),re===null)return ue;var fe=''+ue+'":">",fe},de.text=function(re){return re},ge}(),Je=function(){function ge(){}var de=ge.prototype;return de.strong=function(re){return re},de.em=function(re){return re},de.codespan=function(re){return re},de.del=function(re){return re},de.html=function(re){return re},de.text=function(re){return re},de.link=function(re,ae,ue){return""+ue},de.image=function(re,ae,ue){return""+ue},de.br=function(){return""},ge}(),vt=function(){function ge(){this.seen={}}var de=ge.prototype;return de.slug=function(re){var ae=re.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ae)){var ue=ae;do this.seen[ue]++,ae=ue+"-"+this.seen[ue];while(this.seen.hasOwnProperty(ae))}return this.seen[ae]=0,ae},ge}(),wt=H.defaults,Et=$.unescape,xt=function(){function ge(ce){this.options=ce||wt,this.options.renderer=this.options.renderer||new tt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Je,this.slugger=new vt}ge.parse=function(re,ae){var ue=new ge(ae);return ue.parse(re)};var de=ge.prototype;return de.parse=function(re,ae){ae===void 0&&(ae=!0);var ue="",fe,be,Ie,Xe,ut,bt,ft,at,Be,We,Me,se,ve,Ke,Pe,st,dt,Te,ke=re.length;for(fe=0;fe0&&Pe.tokens[0].type==="text"?(Pe.tokens[0].text=Te+" "+Pe.tokens[0].text,Pe.tokens[0].tokens&&Pe.tokens[0].tokens.length>0&&Pe.tokens[0].tokens[0].type==="text"&&(Pe.tokens[0].tokens[0].text=Te+" "+Pe.tokens[0].tokens[0].text)):Pe.tokens.unshift({type:"text",text:Te}):Ke+=Te),Ke+=this.parse(Pe.tokens,ve),Be+=this.renderer.listitem(Ke,dt,st);ue+=this.renderer.list(Be,Me,se);continue}case"html":{ue+=this.renderer.html(We.text);continue}case"paragraph":{ue+=this.renderer.paragraph(this.parseInline(We.tokens));continue}case"text":{for(Be=We.tokens?this.parseInline(We.tokens):We.text;fe+1An error occurred:

    "+Ae(Ie.message+"",!0)+"
    ";throw Ie}}Re.options=Re.setOptions=function(ge){return kt(Re.defaults,ge),Ge(Re.defaults),Re},Re.getDefaults=Ce,Re.defaults=ze,Re.use=function(ge){var de=kt({},ge);if(ge.renderer&&function(){var re=Re.defaults.renderer||new tt,ae=function(be){var Ie=re[be];re[be]=function(){for(var Xe=arguments.length,ut=new Array(Xe),bt=0;bt=0;u--){if(!M(f[u]))continue;var d=f[u].split("="),s=unescape(d[0]),l=unescape(d[1]);g(l,s)}}function H(g,f){if(!g)return;z.cookie=escape(g)+"="+escape(f)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function F(g){if(!g||!I(g))return;z.cookie=escape(g)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function D(){L(function(g,f){F(f)})}function I(g){return new RegExp("(?:^|;\\s*)"+escape(g).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(z.cookie)}},EHPI:function(Fe,Se,W){"use strict";var q=W("bbsP"),V=W("/wGt"),M=W("tJVT"),z=W("k1fw"),U=W("q1tI"),L=W.n(U),H=W("ZW9T"),F=W("ZD9Y"),D=W("M8RZ"),I=W("bCnd"),g=W("fcyK"),f=W.n(g),u={theme:Object(I.a)("cmCodeMode","vs-dark"),fontSize:Object(I.a)("cmFontSize",14),showEditorSetting:!1,tabToSpace:Object(I.a)("cmTabToSpace",!0)},d;(function(r){r[r.set_font_size=0]="set_font_size",r[r.set_theme=1]="set_theme",r[r.on_tab_to_space=2]="on_tab_to_space",r[r.set_show_editor_setting=3]="set_show_editor_setting"})(d||(d={}));function s(r,a){switch(a.type){case d.set_show_editor_setting:return Object(z.a)(Object(z.a)({},r),{},{showEditorSetting:a.payload});case d.set_theme:return Object(z.a)(Object(z.a)({},r),{},{theme:a.payload});case d.set_font_size:return Object(z.a)(Object(z.a)({},r),{},{fontSize:a.payload});case d.on_tab_to_space:return Object(z.a)(Object(z.a)({},r),{},{tabToSpace:a.payload});default:throw new Error}}Se.a=function(r){var a=r.isLoading,n=r.value,h=r.onChange,O=r.language,S=r.ActionBarRender,x=S===void 0?function($){return L.a.createElement(l,{onShowCodeSetting:$})}:S,A=Object(U.useReducer)(s,u),C=Object(M.a)(A,2),b=C[0],v=C[1],p=b.theme,c=b.fontSize,E=b.showEditorSetting,y=b.tabToSpace,_={onFontSizeChange:function(B){v({type:d.set_font_size,payload:B}),Object(I.b)("cmFontSize",B)},tabToSpace:y,cmFontSize:c,className:"oj",cmCodeMode:p,onTabToSpace:function(B){v({type:d.on_tab_to_space,payload:B}),Object(I.b)("cmTabToSpace",B)},onCodeModeChange:function(B){v({type:d.set_theme,payload:B}),Object(I.b)("cmCodeMode",B)}};function P(){v({type:d.set_show_editor_setting,payload:!1})}function N(){v({type:d.set_show_editor_setting,payload:!0})}var K={value:n,language:O,onChange:h,theme:p,height:"calc(100% - 56px)",options:{fontSize:c,insertSpaces:y}};return L.a.createElement(U.Fragment,null,L.a.createElement("div",{className:"code-panel-container"},x(N),!a&&L.a.createElement(H.b,K)),L.a.createElement(D.a,null,L.a.createElement(V.a,{className:"oj",title:null,placement:"right",closable:!1,visible:E,onClose:P},L.a.createElement(F.a,_))))};function l(r){var a=r.onShowCodeSetting;return L.a.createElement("div",{className:"action-bar"},L.a.createElement("span",null,"\u5B66\u5458\u521D\u59CB\u4EE3\u7801\u6587\u4EF6"),L.a.createElement("a",{onClick:a},L.a.createElement("i",{className:"iconfont icon-shezhi"})))}},ELLl:function(Fe,Se,W){(function(q){q(W("VrN/"))})(function(q){var V={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},M=q.Pos;q.defineOption("autoCloseBrackets",!1,function(s,l,r){r&&r!=q.Init&&(s.removeKeyMap(U),s.state.closeBrackets=null),l&&(L(z(l,"pairs")),s.state.closeBrackets=l,s.addKeyMap(U))});function z(s,l){return l=="pairs"&&typeof s=="string"?s:typeof s=="object"&&s[l]!=null?s[l]:V[l]}var U={Backspace:D,Enter:I};function L(s){for(var l=0;l=0;n--){var O=a[n].head;s.replaceRange("",M(O.line,O.ch-1),M(O.line,O.ch+1),"+delete")}}function I(s){var l=F(s),r=l&&z(l,"explode");if(!r||s.getOption("disableInput"))return q.Pass;for(var a=s.listSelections(),n=0;n0;return{anchor:new M(s.anchor.line,s.anchor.ch+(l?-1:1)),head:new M(s.head.line,s.head.ch+(l?1:-1))}}function f(s,l){var r=F(s);if(!r||s.getOption("disableInput"))return q.Pass;var a=z(r,"pairs"),n=a.indexOf(l);if(n==-1)return q.Pass;for(var h=z(r,"closeBefore"),O=z(r,"triples"),S=a.charAt(n+1)==l,x=s.listSelections(),A=n%2==0,C,b=0;b=0&&s.getRange(p,M(p.line,p.ch+3))==l+l+l?c="skipThree":c="skip";else if(S&&p.ch>1&&O.indexOf(l)>=0&&s.getRange(M(p.line,p.ch-2),p)==l+l){if(p.ch>2&&/\bstring/.test(s.getTokenTypeAt(M(p.line,p.ch-2))))return q.Pass;c="addFour"}else if(S){var y=p.ch==0?" ":s.getRange(M(p.line,p.ch-1),p);if(!q.isWordChar(E)&&y!=l&&!q.isWordChar(y))c="both";else return q.Pass}else if(A&&(E.length===0||/\s/.test(E)||h.indexOf(E)>-1))c="both";else return q.Pass;if(!C)C=c;else if(C!=c)return q.Pass}var _=n%2?a.charAt(n-1):l,P=n%2?l:a.charAt(n+1);s.operation(function(){if(C=="skip")s.execCommand("goCharRight");else if(C=="skipThree")for(var N=0;N<3;N++)s.execCommand("goCharRight");else if(C=="surround"){for(var K=s.getSelections(),N=0;N>>6)+D(128|P&63):D(224|P>>>12&15)+D(128|P>>>6&63)+D(128|P&63)}else{var P=65536+(_.charCodeAt(0)-55296)*1024+(_.charCodeAt(1)-56320);return D(240|P>>>18&7)+D(128|P>>>12&63)+D(128|P>>>6&63)+D(128|P&63)}},g=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,f=function(_){return _.replace(g,I)},u=function(_){var P=[0,2,1][_.length%3],N=_.charCodeAt(0)<<16|(_.length>1?_.charCodeAt(1):0)<<8|(_.length>2?_.charCodeAt(2):0),K=[H.charAt(N>>>18),H.charAt(N>>>12&63),P>=2?"=":H.charAt(N>>>6&63),P>=1?"=":H.charAt(N&63)];return K.join("")},d=z.btoa&&typeof z.btoa=="function"?function(_){return z.btoa(_)}:function(_){if(_.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return _.replace(/[\s\S]{1,3}/g,u)},s=function(_){return d(f(String(_)))},l=function(_){return _.replace(/[+\/]/g,function(P){return P=="+"?"-":"_"}).replace(/=/g,"")},r=function(_,P){return P?l(s(_)):s(_)},a=function(_){return r(_,!0)},n;z.Uint8Array&&(n=function(_,P){for(var N="",K=0,$=_.length;K<$;K+=3){var B=_[K],R=_[K+1],G=_[K+2],Q=B<<16|R<<8|G;N+=H.charAt(Q>>>18)+H.charAt(Q>>>12&63)+(typeof R!="undefined"?H.charAt(Q>>>6&63):"=")+(typeof G!="undefined"?H.charAt(Q&63):"=")}return P?l(N):N});var h=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,O=function(_){switch(_.length){case 4:var P=(7&_.charCodeAt(0))<<18|(63&_.charCodeAt(1))<<12|(63&_.charCodeAt(2))<<6|63&_.charCodeAt(3),N=P-65536;return D((N>>>10)+55296)+D((N&1023)+56320);case 3:return D((15&_.charCodeAt(0))<<12|(63&_.charCodeAt(1))<<6|63&_.charCodeAt(2));default:return D((31&_.charCodeAt(0))<<6|63&_.charCodeAt(1))}},S=function(_){return _.replace(h,O)},x=function(_){var P=_.length,N=P%4,K=(P>0?F[_.charAt(0)]<<18:0)|(P>1?F[_.charAt(1)]<<12:0)|(P>2?F[_.charAt(2)]<<6:0)|(P>3?F[_.charAt(3)]:0),$=[D(K>>>16),D(K>>>8&255),D(K&255)];return $.length-=[0,0,2,1][N],$.join("")},A=z.atob&&typeof z.atob=="function"?function(_){return z.atob(_)}:function(_){return _.replace(/\S{1,4}/g,x)},C=function(_){return A(String(_).replace(/[^A-Za-z0-9\+\/]/g,""))},b=function(_){return S(A(_))},v=function(_){return String(_).replace(/[-_]/g,function(P){return P=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},p=function(_){return b(v(_))},c;z.Uint8Array&&(c=function(_){return Uint8Array.from(C(v(_)),function(P){return P.charCodeAt(0)})});var E=function(){var _=z.Base64;return z.Base64=U,_};if(z.Base64={VERSION:L,atob:C,btoa:d,fromBase64:p,toBase64:r,utob:f,encode:r,encodeURI:a,btou:S,decode:p,noConflict:E,fromUint8Array:n,toUint8Array:c},typeof Object.defineProperty=="function"){var y=function(_){return{value:_,enumerable:!1,writable:!0,configurable:!0}};z.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",y(function(){return p(this)})),Object.defineProperty(String.prototype,"toBase64",y(function(_){return r(this,_)})),Object.defineProperty(String.prototype,"toBase64URI",y(function(){return r(this,!0)}))}}return z.Meteor&&(Base64=z.Base64),Fe.exports?Fe.exports.Base64=z.Base64:!(V=[],M=function(){return z.Base64}.apply(Se,V),M!==void 0&&(Fe.exports=M)),{Base64:z.Base64}})}).call(this,W("IyRk"))},JB8y:function(Fe,Se,W){"use strict";W.d(Se,"a",function(){return q});var q;(function(V){V[V.NOMATCH=-1]="NOMATCH",V[V.OK=0]="OK",V[V.TIMEOUT=2]="TIMEOUT",V[V.PODFAILURE=3]="PODFAILURE",V[V.COMPILEFAILURE=4]="COMPILEFAILURE",V[V.EXECUTEFAILURE=5]="EXECUTEFAILURE"})(q||(q={}))},JPnl:function(Fe,Se,W){"use strict";W.d(Se,"a",function(){return v}),W.d(Se,"c",function(){return E});var q=W("+L6B"),V=W("2/Rp"),M=W("tJVT"),z=W("9og8"),U=W("k1fw"),L=W("jrin"),H=W("5NDa"),F=W("5rEg"),D=W("WmNS"),I=W.n(D),g=W("q1tI"),f=W.n(g),u=W("8Skl"),d=W("y3Kf"),s=W("JB8y"),l=W("J66h"),r=W.n(l),a=W("a4uL"),n=W.n(a),h=W("IxHN"),O=W("9Bee"),S=W("1vsH"),x=W("ErOA"),A,C=F.a.TextArea,b={visible:!1,tabIndex:"0"},v=(A={},Object(L.a)(A,s.a.NOMATCH,"\u6D4B\u8BD5\u7528\u4F8B\u7ED3\u679C\u4E0D\u5339\u914D"),Object(L.a)(A,s.a.OK,"\u8C03\u8BD5\u901A\u8FC7"),Object(L.a)(A,2,"\u8C03\u8BD5\u8D85\u65F6"),Object(L.a)(A,3,"\u8C03\u8BD5pod\u5931\u8D25"),Object(L.a)(A,4,"\u7F16\u8BD1\u5931\u8D25"),Object(L.a)(A,5,"\u6267\u884C\u5931\u8D25"),A),p;(function(_){_[_.SET_VISIBLE=0]="SET_VISIBLE",_[_.SET_TABINDEX=1]="SET_TABINDEX"})(p||(p={}));function c(_,P){switch(P.type){case p.SET_VISIBLE:return Object(U.a)(Object(U.a)({},_),{},{visible:P.payload});case p.SET_TABINDEX:return Object(U.a)(Object(U.a)({},_),{},{tabIndex:P.payload});default:throw new Error}}function E(_){var P=_.status,N=_.error_msg,K=_.output,$=_.input,B=_.expected_output,R=_.is_file,G=_.input_file_url,Q=_.output_file_url,ne=_.expected_output_file_url,le=_.setMonacoValue,_e=_.setData,pe=null,Ee={minHeight:150,marginBottom:10,paddingLeft:24,background:"#070f19",color:"#fff"};switch(P){case s.a.NOMATCH:pe=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),!R&&f.a.createElement(O.a,{value:$,style:Ee}),R&&f.a.createElement("div",{style:Ee},f.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(z.a)(I.a.mark(function Oe(){var we;return I.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return oe.next=2,fetch(G,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 2:return we=oe.sent,oe.t0=le,oe.next=6,we.text();case 6:oe.t1=oe.sent,(0,oe.t0)(oe.t1),setTimeout(function(){_e(G)},200);case 9:case"end":return oe.stop()}},Oe)}))},$)),f.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),!R&&f.a.createElement(O.a,{value:K&&l.Base64.decode(K)||"",style:Ee}),R&&f.a.createElement("div",{style:Ee},f.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(z.a)(I.a.mark(function Oe(){var we;return I.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return oe.next=2,Object(x.a)(Q,{method:"Get",headers:{"Content-Type":"application/xml",Accept:"*/*"}});case 2:we=oe.sent,le(we),setTimeout(function(){_e(Q)},200);case 5:case"end":return oe.stop()}},Oe)}))},K)),f.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),!R&&f.a.createElement(O.a,{value:B&&l.Base64.decode(B)||"",style:Ee}),R&&f.a.createElement("div",{style:Ee},f.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(z.a)(I.a.mark(function Oe(){var we;return I.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return oe.next=2,fetch(ne,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 2:return we=oe.sent,oe.t0=le,oe.next=6,we.text();case 6:oe.t1=oe.sent,(0,oe.t0)(oe.t1),setTimeout(function(){_e(ne)},200);case 9:case"end":return oe.stop()}},Oe)}))},B)));break;case s.a.EXECUTEFAILURE:pe=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!R&&f.a.createElement(O.a,{value:$,style:Ee}),R&&f.a.createElement("div",{style:Ee},f.a.createElement("a",{onClick:function(){return Object(S.y)(G,$)}},$)),f.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),f.a.createElement("pre",{className:"error"},l.Base64.decode(N)));break;case s.a.COMPILEFAILURE:pe=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!R&&f.a.createElement(O.a,{value:$,style:Ee}),R&&f.a.createElement("div",{style:Ee},f.a.createElement("a",{onClick:function(){return Object(S.y)(G,$)}},$)),f.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),f.a.createElement("pre",{className:"error"},l.Base64.decode(N)));break;case s.a.PODFAILURE:pe=f.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case s.a.TIMEOUT:pe=f.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return f.a.createElement(f.a.Fragment,null," ",pe," ")}function y(_){var P=_.status,N=_.error_msg,K=_.execute_time,$=_.output,B=_.input,R=_.expected_output,G=_.is_file,Q=_.input_file_url,ne=_.output_file_url,le=_.expected_output_file_url,_e=null;switch(P){case s.a.OK:_e=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6267\u884C\u7528\u65F6\uFF1A",K),f.a.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A"),f.a.createElement("pre",null,l.Base64.decode($)));break;case s.a.NOMATCH:_e=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u8F93\u5165\uFF1A",f.a.createElement("pre",null,B)),f.a.createElement("p",null,"\u8F93\u51FA\uFF1A",$&&l.Base64.decode($)),f.a.createElement("p",null,"\u9884\u671F\u8F93\u51FA\uFF1A",R&&l.Base64.decode(R)));break;case s.a.EXECUTEFAILURE:_e=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",f.a.createElement("pre",null,B)),f.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),f.a.createElement("pre",{className:"error"},l.Base64.decode(N)));break;case s.a.COMPILEFAILURE:_e=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",f.a.createElement("pre",null,B)),f.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),f.a.createElement("pre",{className:"error"},l.Base64.decode(N)));break;case s.a.PODFAILURE:_e=f.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case s.a.TIMEOUT:_e=f.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return f.a.createElement(f.a.Fragment,null," ",_e," ")}Se.b=function(_){var P=_.input,N=_.debuging,K=_.submitting,$=_.executingMessage,B=_.debugResult,R=_.onChangeInput,G=_.onDebugCode,Q=_.onSubmitCode,ne=_.hack,le=_.user,_e=Object(g.useReducer)(c,b),pe=Object(M.a)(_e,2),Ee=pe[0],Oe=pe[1],we=Ee.visible,he=Ee.tabIndex;function oe(it){var He=it.target.id;Oe({type:p.SET_TABINDEX,payload:He})}function Le(){Oe({type:p.SET_VISIBLE,payload:!we})}var Ye=Object(g.useMemo)(function(){if(B){var it=B.status;return f.a.createElement(f.a.Fragment,null,y(B))}return null},[B]);function nt(){Oe({type:p.SET_VISIBLE,payload:!0}),Oe({type:p.SET_TABINDEX,payload:"1"}),G()}var qe=function(){var it=Object(z.a)(I.a.mark(function He($e){var Qe;return I.a.wrap(function(et){for(;;)switch(et.prev=et.next){case 0:return et.next=2,Object(x.a)("/api/problems/".concat($e,"/start.json"),{method:"get",params:{hack_user_id:le==null?void 0:le.user_id}});case 2:Qe=et.sent,Qe&&(window.location.href="/myproblems/".concat(Qe==null?void 0:Qe.identifier,"?type=1"));case 4:case"end":return et.stop()}},He)}));return function($e){return it.apply(this,arguments)}}();return f.a.createElement("div",{className:"test-case-panel"},f.a.createElement("div",{className:"test-case-panel-body ".concat(we?"active":"")},f.a.createElement("ul",{className:"s-navs"},f.a.createElement("li",null,f.a.createElement("a",{className:he==="0"?"active":"",id:"0",onClick:oe},"\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B")),f.a.createElement("li",null,f.a.createElement("a",{className:he==="1"?"active":"",id:"1",onClick:oe},"\u4EE3\u7801\u6267\u884C\u7ED3\u679C"))),f.a.createElement("div",{className:"tab-panel-body ".concat(he==="0"?"":"hide")},f.a.createElement(C,{placeholder:"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D",value:P,onChange:R})),f.a.createElement("div",{className:"tab-panel-body ".concat(he==="1"?"":"hide")},N?f.a.createElement(h.a,{message:$}):B?f.a.createElement("section",{style:{height:200}}," ",Ye," "):f.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"))),f.a.createElement("a",{className:"btn-collapse ".concat(we?"up":""),onClick:Le},we?f.a.createElement(u.a,null):f.a.createElement(d.a,null)),f.a.createElement("footer",{className:"footer"},f.a.createElement("span",null,"\u63A7\u5236\u53F0"),f.a.createElement("div",{className:"flex-container"},(ne==null?void 0:ne.is_program)&&(ne==null?void 0:ne.above_question)&&f.a.createElement(V.a,{onClick:function(){return qe(ne==null?void 0:ne.above_question)},id:"oj-prev",className:"btn-blue",type:"ghost"},"\u4E0A\u4E00\u9898"),(ne==null?void 0:ne.is_program)&&(ne==null?void 0:ne.under_question)&&f.a.createElement(V.a,{onClick:function(){return qe(ne==null?void 0:ne.under_question)},id:"oj-next",className:"btn-blue",type:"ghost"},"\u4E0B\u4E00\u9898"),f.a.createElement(V.a,{className:"btn-green",type:"ghost",loading:N,onClick:nt},"\u8C03\u8BD5\u4EE3\u7801"),f.a.createElement(V.a,{type:"primary",loading:K,disabled:K,onClick:function(){Oe({type:p.SET_VISIBLE,payload:!1}),Q()}},"\u8BC4\u6D4B\u5E76\u63D0\u4EA4"))))}},LdHM:function(Fe,Se,W){"use strict";W.d(Se,"b",function(){return h}),W.d(Se,"a",function(){return S});var q=W("1OyB"),V=W("vuIU"),M=W("Ji7U"),z=W("LK+K"),U=W("q1tI"),L=W("rePB"),H=W("Ff2n"),F=W("ODXe"),D=W("4IlW"),I=W("bX4T"),g=W("YrtM"),f=W("TSYQ"),u=W.n(f),d=W("+nKL"),s=W("8OUc"),l=function(G,Q){var ne=G.prefixCls,le=G.id,_e=G.flattenOptions,pe=G.childrenAsData,Ee=G.values,Oe=G.searchValue,we=G.multiple,he=G.defaultActiveFirstOption,oe=G.height,Le=G.itemHeight,Ye=G.notFoundContent,nt=G.open,qe=G.menuItemSelectedIcon,it=G.virtual,He=G.onSelect,$e=G.onToggleOpen,Qe=G.onActiveValue,gt=G.onScroll,et=G.onMouseEnter,tt="".concat(ne,"-item"),Je=Object(g.a)(function(){return _e},[nt,_e],function(je,ge){return ge[0]&&je[1]!==ge[1]}),vt=U.useRef(null),wt=function(ge){ge.preventDefault()},Et=function(ge){vt.current&&vt.current.scrollTo({index:ge})},xt=function(ge){for(var de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ce=Je.length,re=0;re1&&arguments[1]!==void 0?arguments[1]:!1;return Object(A.a)(R).map(function(Q,ne){if(!U.isValidElement(Q)||!Q.type)return null;var le=Q.type.isSelectOptGroup,_e=Q.key,pe=Q.props,Ee=pe.children,Oe=Object(H.a)(pe,["children"]);return G||!le?C(Q):Object(x.a)(Object(x.a)({key:"__RC_SELECT_GRP__".concat(_e===null?ne:_e,"__"),label:_e},Oe),{},{options:b(Ee)})}).filter(function(Q){return Q})}var v=W("2Qr1"),p=W("qNPg"),c=W("U8pU"),E=W("Kwbf"),y=W("WKfj");function _(R){var G=R.mode,Q=R.options,ne=R.children,le=R.backfill,_e=R.allowClear,pe=R.placeholder,Ee=R.getInputElement,Oe=R.showSearch,we=R.onSearch,he=R.defaultOpen,oe=R.autoFocus,Le=R.labelInValue,Ye=R.value,nt=R.inputValue,qe=R.optionLabelProp,it=G==="multiple"||G==="tags",He=Oe!==void 0?Oe:it||G==="combobox",$e=Q||b(ne);if(Object(E.a)(G!=="tags"||$e.every(function(tt){return!tt.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),G==="tags"||G==="combobox"){var Qe=$e.some(function(tt){return tt.options?tt.options.some(function(Je){return typeof("value"in Je?Je.value:Je.key)=="number"}):typeof("value"in tt?tt.value:tt.key)=="number"});Object(E.a)(!Qe,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(E.a)(G!=="combobox"||!qe,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(E.a)(G==="combobox"||!le,"`backfill` only works with `combobox` mode."),Object(E.a)(G==="combobox"||!Ee,"`getInputElement` only work with `combobox` mode."),Object(E.b)(G!=="combobox"||!Ee||!_e||!pe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),we&&!He&&G!=="combobox"&&G!=="tags"&&Object(E.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(E.b)(!he||oe,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Ye!=null){var gt=Object(y.d)(Ye);Object(E.a)(!Le||gt.every(function(tt){return Object(c.a)(tt)==="object"&&("key"in tt||"value"in tt)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(E.a)(!it||Array.isArray(Ye),"`value` should be array when `mode` is `multiple` or `tags`")}if(ne){var et=null;Object(A.a)(ne).some(function(tt){if(!U.isValidElement(tt)||!tt.type)return!1;var Je=tt.type;if(Je.isSelectOption)return!1;if(Je.isSelectOptGroup){var vt=Object(A.a)(tt.props.children).every(function(wt){return!U.isValidElement(wt)||!tt.type||wt.type.isSelectOption?!0:(et=wt.type,!1)});return!vt}return et=Je,!0}),et&&Object(E.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(et.displayName||et.name||et,"`.")),Object(E.a)(nt===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var P=_,N=Object(p.a)({prefixCls:"rc-select",components:{optionList:a},convertChildrenToData:b,flattenOptions:v.d,getLabeledValue:v.e,filterOptions:v.b,isValueDisabled:v.g,findValueOption:v.c,warningProps:P,fillOptionsWithMissingValue:v.a}),K=function(R){Object(M.a)(Q,R);var G=Object(z.a)(Q);function Q(){var ne;return Object(q.a)(this,Q),ne=G.apply(this,arguments),ne.selectRef=U.createRef(),ne.focus=function(){ne.selectRef.current.focus()},ne.blur=function(){ne.selectRef.current.blur()},ne}return Object(V.a)(Q,[{key:"render",value:function(){return U.createElement(N,Object.assign({ref:this.selectRef},this.props))}}]),Q}(U.Component);K.Option=h,K.OptGroup=S;var $=K,B=Se.c=$},M8RZ:function(Fe,Se,W){"use strict";W.d(Se,"a",function(){return D});var q=W("fWQN"),V=W("mtLc"),M=W("yKVA"),z=W("879j"),U=W("q1tI"),L=W.n(U),H=W("i8i4"),F=W.n(H),D=function(I){Object(M.a)(f,I);var g=Object(z.a)(f);function f(u){var d;Object(q.a)(this,f),d=g.call(this,u);var s=window.document;return d.node=s.createElement("div"),s.body.appendChild(d.node),d}return Object(V.a)(f,[{key:"render",value:function(){var d=this.props.children;return Object(H.createPortal)(d,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),f}(L.a.Component)},MFOe:function(Fe,Se,W){(function(q){var V=L(),M=H(),z=F(),U=typeof window!="undefined"?window:q;Fe.exports={assign:V,create:M,trim:z,bind:D,slice:I,each:g,map:f,pluck:u,isList:d,isFunction:s,isObject:l,Global:U};function L(){return Object.assign?Object.assign:function(a,n,h,O){for(var S=1;S=0;l-=1){var r=F.get(l)||new Set;r.forEach(function(a){var n=a.parent,h=a.node;if(I(h)||!a.parent||s.has(a.parent.key))return;if(I(a.parent.node)){s.add(n.key);return}var O=!0,S=!1;(n.children||[]).filter(function(x){return!I(x.node)}).forEach(function(x){var A=x.key,C=g.has(A);O&&!C&&(O=!1),!S&&(C||f.has(A))&&(S=!0)}),O&&g.add(n.key),S&&f.add(n.key),s.add(n.key)})}return{checkedKeys:Array.from(g),halfCheckedKeys:Array.from(V(f,g))}}function U(H,F,D,I,g){for(var f=new Set(H),u=new Set(F),d=0;d<=I;d+=1){var s=D.get(d)||new Set;s.forEach(function(n){var h=n.key,O=n.node,S=n.children,x=S===void 0?[]:S;!f.has(h)&&!u.has(h)&&!g(O)&&x.filter(function(A){return!g(A.node)}).forEach(function(A){f.delete(A.key)})})}u=new Set;for(var l=new Set,r=I;r>=0;r-=1){var a=D.get(r)||new Set;a.forEach(function(n){var h=n.parent,O=n.node;if(g(O)||!n.parent||l.has(n.parent.key))return;if(g(n.parent.node)){l.add(h.key);return}var S=!0,x=!1;(h.children||[]).filter(function(A){return!g(A.node)}).forEach(function(A){var C=A.key,b=f.has(C);S&&!b&&(S=!1),!x&&(b||u.has(C))&&(x=!0)}),S||f.delete(h.key),x&&u.add(h.key),l.add(h.key)})}return{checkedKeys:Array.from(f),halfCheckedKeys:Array.from(V(u,f))}}function L(H,F,D,I){var g=[],f;I?f=I:f=M;var u=new Set(H.filter(function(r){var a=!!D[r];return a||g.push(r),a})),d=new Map,s=0;Object.keys(D).forEach(function(r){var a=D[r],n=a.level,h=d.get(n);h||(h=new Set,d.set(n,h)),h.add(a),s=Math.max(s,n)}),Object(q.a)(!g.length,"Tree missing follow keys: ".concat(g.slice(0,100).map(function(r){return"'".concat(r,"'")}).join(", ")));var l;return F===!0?l=z(u,d,s,f):l=U(u,F.halfCheckedKeys,d,s,f),l}},OJz4:function(Fe,Se,W){"use strict";W.d(Se,"d",function(){return V}),W.d(Se,"h",function(){return M}),W.d(Se,"b",function(){return z}),W.d(Se,"f",function(){return U}),W.d(Se,"e",function(){return L}),W.d(Se,"c",function(){return H}),W.d(Se,"a",function(){return F}),W.d(Se,"g",function(){return D}),W.d(Se,"i",function(){return I}),W.d(Se,"k",function(){return g}),W.d(Se,"j",function(){return f});var q=W("ErOA");function V(u){return Object(q.c)("myproblems/".concat(u,".json"),{hidePopLogin:!0})}function M(u,d){return Object(q.f)("myproblems/".concat(u,"/code_submit.json"),d)}function z(u,d){return Object(q.c)("myproblems/".concat(u,"/code_debug.json"),d)}function U(u,d){return Object(q.c)("myproblems/".concat(u,"/submit_records.json"),d)}function L(u){return Object(q.c)("myproblems/record_detail.json",{id:u})}function H(u,d){return Object(q.c)("myproblems/".concat(u,"/result.json"),{mode:d})}function F(u,d){return Object(q.f)("myproblems/".concat(u,"/add_notes.json"),d)}function D(u){return Object(q.f)("myproblems/".concat(u,"/restore_initial_code.json"))}function I(u){return Object(q.f)("myproblems/".concat(u,"/sync_code.json"))}function g(u,d){return Object(q.f)("myproblems/".concat(u,"/update_code.json"),d)}function f(u,d){return Object(q.f)("discusses/".concat(u,"/plus.json"),d)}},OLES:function(Fe,Se,W){"use strict";var q=W("U8pU"),V=W("VTBJ"),M=W("Ff2n"),z=W("q1tI"),U=W("uciX"),L=W("7ixt"),H=function(u){var d=u.overlay,s=u.prefixCls,l=u.id,r=u.overlayInnerStyle;return z.createElement("div",{className:"".concat(s,"-inner"),id:l,role:"tooltip",style:r},typeof d=="function"?d():d)},F=H,D=function(u,d){var s=u.overlayClassName,l=u.trigger,r=l===void 0?["hover"]:l,a=u.mouseEnterDelay,n=a===void 0?0:a,h=u.mouseLeaveDelay,O=h===void 0?.1:h,S=u.overlayStyle,x=u.prefixCls,A=x===void 0?"rc-tooltip":x,C=u.children,b=u.onVisibleChange,v=u.afterVisibleChange,p=u.transitionName,c=u.animation,E=u.placement,y=E===void 0?"right":E,_=u.align,P=_===void 0?{}:_,N=u.destroyTooltipOnHide,K=N===void 0?!1:N,$=u.defaultVisible,B=u.getTooltipContainer,R=u.overlayInnerStyle,G=Object(M.a)(u,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),Q=Object(z.useRef)(null);Object(z.useImperativeHandle)(d,function(){return Q.current});var ne=Object(V.a)({},G);"visible"in u&&(ne.popupVisible=u.visible);var le=function(){var we=u.arrowContent,he=we===void 0?null:we,oe=u.overlay,Le=u.id;return[z.createElement("div",{className:"".concat(A,"-arrow"),key:"arrow"},he),z.createElement(F,{key:"content",prefixCls:A,id:Le,overlay:oe,overlayInnerStyle:R})]},_e=!1,pe=!1;if(typeof K=="boolean")_e=K;else if(K&&Object(q.a)(K)==="object"){var Ee=K.keepParent;_e=Ee===!0,pe=Ee===!1}return z.createElement(U.a,Object.assign({popupClassName:s,prefixCls:A,popup:le,action:r,builtinPlacements:L.a,popupPlacement:y,ref:Q,popupAlign:P,getPopupContainer:B,onPopupVisibleChange:b,afterPopupVisibleChange:v,popupTransitionName:p,popupAnimation:c,defaultPopupVisible:$,destroyPopupOnHide:_e,autoDestroy:pe,mouseLeaveDelay:O,popupStyle:S,mouseEnterDelay:n},ne),C)},I=Object(z.forwardRef)(D),g=Se.a=I},OZM5:function(Fe,Se,W){"use strict";W.d(Se,"b",function(){return I}),W.d(Se,"a",function(){return g}),W.d(Se,"k",function(){return f}),W.d(Se,"h",function(){return u}),W.d(Se,"i",function(){return d}),W.d(Se,"g",function(){return s}),W.d(Se,"c",function(){return l}),W.d(Se,"d",function(){return r}),W.d(Se,"j",function(){return h}),W.d(Se,"e",function(){return O}),W.d(Se,"f",function(){return S});var q=W("KQm4"),V=W("U8pU"),M=W("Ff2n"),z=W("q1tI"),U=W.n(z),L=W("Kwbf"),H=W("WaYH"),F=.25,D=2;function I(x,A){var C=x.slice(),b=C.indexOf(A);return b>=0&&C.splice(b,1),C}function g(x,A){var C=x.slice();return C.indexOf(A)===-1&&C.push(A),C}function f(x){return x.split("-")}function u(x,A){return"".concat(x,"-").concat(A)}function d(x){return x&&x.type&&x.type.isTreeNode}function s(x,A){var C=[x],b=A[x];function v(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];p.forEach(function(c){var E=c.key,y=c.children;C.push(E),v(y)})}return v(b.children),C}function l(x,A){var C=x.clientY,b=A.selectHandle.getBoundingClientRect(),v=b.top,p=b.bottom,c=b.height,E=Math.max(c*F,D);return C<=v+E?-1:C>=p-E?1:0}function r(x,A){if(!x)return;var C=A.multiple;return C?x.slice():x.length?[x[0]]:x}var a=function(A){return A};function n(x,A){if(!x)return[];var C=A||{},b=C.processProps,v=b===void 0?a:b,p=Array.isArray(x)?x:[x];return p.map(function(c){var E=c.children,y=Object(M.a)(c,["children"]),_=n(E,A);return U.a.createElement(H.a,Object.assign({},v(y)),_)})}function h(x){if(!x)return null;var A;if(Array.isArray(x))A={checkedKeys:x,halfCheckedKeys:void 0};else if(Object(V.a)(x)==="object")A={checkedKeys:x.checked||void 0,halfCheckedKeys:x.halfChecked||void 0};else return Object(L.a)(!1,"`checkedKeys` is not an array or an object"),null;return A}function O(x,A){var C=new Set;function b(v){if(C.has(v))return;var p=A[v];if(!p)return;C.add(v);var c=p.parent,E=p.node;if(E.disabled)return;c&&b(c.key)}return(x||[]).forEach(function(v){b(v)}),Object(q.a)(C)}function S(x){var A={};return Object.keys(x).forEach(function(C){(C.startsWith("data-")||C.startsWith("aria-"))&&(A[C]=x[C])}),A}},Ot1p:function(Fe,Se,W){"use strict";var q=W("2qtc"),V=W("kLXV"),M=W("rAM+"),z=W("miYZ"),U=W("tsqr"),L=W("9og8"),H=W("tJVT"),F=W("jrin"),D=W("WmNS"),I=W.n(D),g=W("q1tI"),f=W.n(g),u=W("VrN/"),d=W.n(u),s=W("bdgK"),l=W("p77/"),r=W("Bd2K"),a=W("ELLl"),n=W("19Vz"),h=W("lZu9"),O=W("+NIl"),S=W("kSUc"),x=W("9Bee"),A=function(be){var Ie=be.value,Xe=Ie===void 0?"":Ie,ut=be.className,bt=be.showTextOnly,ft=be.showLines,at=be.style,Be=at===void 0?{}:at,We=Object(g.useMemo)(function(){return""},[Xe]);return f.a.createElement(f.a.Fragment,null,f.a.createElement("div",{dangerouslySetInnerHTML:{__html:We}}))},C=W("0Owb"),b=W("dejd"),v=W("C+DQ"),p=W("1vsH"),c=W("m3rI"),E=[{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(be){var Ie=be.onActionCallback,Xe=be.title,ut=be.icon,bt=be.actionName,ft=be.className,at=ft===void 0?"":ft,Be=be.children;function We(){Ie(bt)}return f.a.createElement("a",{title:Xe,className:at,onClick:We},f.a.createElement("i",{className:"md-iconfont ".concat(ut)}),Be)}var _=function(be){var Ie=be.watch,Xe=be.showNullButton,ut=be.onActionCallback,bt=be.fullScreen,ft=be.insertTemp,at=be.hidetoolBar,Be=be.uuid,We=be.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(p.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(p.F)("_educoder_session"),"&key=").concat(Be,"&api=").concat(encodeURIComponent(c.a.PROXY_SERVER)));var Me=[].concat(E,[{title:"".concat(Ie?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ie?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return f.a.createElement("ul",{className:"markdown-toolbar-container"},!at&&Me.map(function(se,ve){return f.a.createElement("li",{key:ve},se.actionName?f.a.createElement(y,Object(C.a)({},se,{onActionCallback:ut})):f.a.createElement("span",{className:"v-line"}))}),Xe?f.a.createElement("li",null,f.a.createElement(y,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ut},f.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ft&&f.a.createElement("li",null,f.a.createElement(y,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(ft),onActionCallback:ut},f.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),f.a.createElement("li",{className:"btn-full-screen"},f.a.createElement(y,{icon:"".concat(bt?"icon-shrink":"icon-enlarge"),title:bt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ut})))},P=W("M8RZ"),N=W("+L6B"),K=W("2/Rp"),$=W("y8nQ"),B=W("Vl3Y"),R=W("5NDa"),G=W("5rEg"),Q={labelCol:{span:4},wrapperCol:{span:20}},ne=function(be){var Ie=be.callback,Xe=be.onCancel;function ut(bt){Ie(bt)}return f.a.createElement(B.a,Object(C.a)({},Q,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ut}),f.a.createElement(B.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},f.a.createElement(G.a,null)),f.a.createElement(B.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},f.a.createElement(G.a,null)),f.a.createElement("div",{className:"flex-container flex-end"},f.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(K.a,{type:"ghost",onClick:Xe},"\u53D6\u6D88")))},le=W("7ahc"),_e=W("HmJG"),pe=W("BjJ7"),Ee=B.a.useForm,Oe={width:280,marginRight:10},we={labelCol:{span:5},wrapperCol:{span:19}},he=function(be){var Ie=be.callback,Xe=be.onCancel,ut=Ee(),bt=Object(H.a)(ut,1),ft=bt[0];function at(Me){Ie(Me)}function Be(Me,se){if(Me.status===-1){U.b.error(Me.message);return}ft.setFieldsValue({src:"/api/attachments/".concat(Me.id),type:se.type})}function We(Me){var se=Me.target.files[0];Le(se,Be)}return f.a.createElement(B.a,Object(C.a)({form:ft},we,{className:"upload-image-panel",onFinish:at}),f.a.createElement(B.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},f.a.createElement("div",{className:"flex-container"},f.a.createElement(B.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},f.a.createElement(G.a,{style:Oe})),f.a.createElement(oe,{onFileChange:We}))),f.a.createElement(B.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},f.a.createElement(G.a,{style:{width:264}})),f.a.createElement(B.a.Item,{style:{textAlign:"right"}},f.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(K.a,{type:"ghost",onClick:Xe},"\u53D6\u6D88")))};function oe(be){var Ie=be.onFileChange;return f.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",f.a.createElement("input",{type:"file",onChange:Ie}))}function Le(be,Ie){if(!be)throw new String("\u6CA1\u6709\u6587\u4EF6");var Xe=new FormData;Xe.append("editormd-image-file",be),Xe.append("file_param_name","editormd-image-file"),Xe.append("byxhr","true");var ut=new window.XMLHttpRequest;ut.withCredentials=!0,ut.addEventListener("load",function(bt){Ie(JSON.parse(bt.target.responseText),be)},!1),ut.addEventListener("error",function(bt){console.error(bt)},!1),ut.open("POST","".concat(pe.a,"/api/attachments.json")),ut.send(Xe)}var Ye=W("giR+"),nt=W("fyUT"),qe=W("7Kak"),it=W("9yH6"),He=it.a.Group,$e={margin:"0 8px"},Qe=function(be){var Ie=be.callback,Xe=be.onCancel;function ut(bt){Ie(bt)}return f.a.createElement(B.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ut},f.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},f.a.createElement("span",{style:$e},"\u5355\u5143\u683C\u6570\uFF1A"),f.a.createElement("span",{style:$e},"\u884C\u6570"),f.a.createElement(B.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},f.a.createElement(nt.a,null)),f.a.createElement("span",{style:$e},"\u5217\u6570"),f.a.createElement(B.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},f.a.createElement(nt.a,null))),f.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},f.a.createElement("span",{style:$e},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),f.a.createElement(B.a.Item,{name:"align"},f.a.createElement(He,null,f.a.createElement(it.a,{value:"default"},f.a.createElement("i",{className:"fa fa-align-justify"})),f.a.createElement(it.a,{value:"left"},f.a.createElement("i",{className:"fa fa-align-left"})),f.a.createElement(it.a,{value:"center"},f.a.createElement("i",{className:"fa fa-align-center"})),f.a.createElement(it.a,{value:"right"},f.a.createElement("i",{className:"fa fa-align-right"}))))),f.a.createElement("div",{className:"flex-container flex-end"},f.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(K.a,{type:"ghost",onClick:Xe},"\u53D6\u6D88")))},gt=W("ErOA"),et=W("7Cbv"),tt="link",Je="upload-image",vt="code-block",wt="add-table",Et="------------",xt={default:Et,left:":".concat(Et),center:":".concat(Et,":"),right:"".concat(Et,":")},kt=W("9VGf"),Ot,Ae;function Ce(){}var Ge=0,ze=1e4,Re="\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 ge(be){return/^\d+$/.test(be)?"".concat(be,"px"):be}var de=navigator.platform.toUpperCase().indexOf("MAC")>=0,ce=de?"Cmd":"Ctrl",re=["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"],ae=(Ot={},Object(F.a)(Ot,ce+"-B","bold"),Object(F.a)(Ot,ce+"-I","italic"),Ot),ue=(Ae={},Object(F.a)(Ae,tt,"\u6DFB\u52A0\u94FE\u63A5"),Object(F.a)(Ae,vt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(F.a)(Ae,Je,"\u6DFB\u52A0\u6587\u4EF6"),Object(F.a)(Ae,wt,"\u6DFB\u52A0\u8868\u683C"),Ae),fe=Se.a=function(be){var Ie=be.defaultValue,Xe=Ie===void 0?"":Ie,ut=be.onChange,bt=be.width,ft=bt===void 0?"100%":bt,at=be.height,Be=at===void 0?400:at,We=be.miniToolbar,Me=We===void 0?!1:We,se=be.isFocus,ve=se===void 0?!1:se,Ke=be.watch,Pe=be.insertTemp,st=be.mode,dt=st===void 0?"markdown":st,Te=be.id,ke=Te===void 0?"markdown-editor-id":Te,rt=be.showResizeBar,Ct=rt===void 0?!1:rt,At=be.noStorage,cn=At===void 0?!1:At,yn=be.showNullButton,en=yn===void 0?!1:yn,Dt=be.hidetoolBar,Rn=Dt===void 0?!1:Dt,Fn=be.fullScreen,Cn=Fn===void 0?!1:Fn,Qt=be.onBlur,Sn=be.onCMBeforeChange,Bn=be.onFullScreen,li=be.className,ct=li===void 0?"":li,St=be.disablePaste,zn=St===void 0?!1:St,pi=be.placeholder,ui=pi===void 0?"":pi,ki=be.values,J=ki===void 0?"":ki,w=Object(g.useState)(null),T=Object(H.a)(w,2),j=T[0],ee=T[1],X=Object(g.useState)(Xe),ye=Object(H.a)(X,2),Ve=ye[0],ot=ye[1],ht=Object(g.useState)(Ke),Ue=Object(H.a)(ht,2),mt=Ue[0],Rt=Ue[1],Mt=Object(g.useState)(Cn),Jt=Object(H.a)(Mt,2),Tt=Jt[0],qt=Jt[1],Zt=Object(g.useState)(""),Mn=Object(H.a)(Zt,2),Gt=Mn[0],wn=Mn[1],On=Object(g.useState)(0),Ln=Object(H.a)(On,2),xn=Ln[0],In=Ln[1],Hn=Object(g.useState)(Be),ri=Object(H.a)(Hn,2),Vn=ri[0],_n=ri[1],jn=Object(g.useState)(!1),dn=Object(H.a)(jn,2),pn=dn[0],mn=dn[1],zt=Object(g.useRef)(Object(et.a)()),yt=Object(g.useRef)(!1),Wt=Object(g.useRef)(),pt=Object(g.useRef)(),$t=Object(g.useRef)(),Nt=Object(g.useRef)(),Xn=Object(g.useRef)(),sn=function(){var Ft=Object(L.a)(I.a.mark(function Xt(){var Kt,tn;return I.a.wrap(function(Tn){for(;;)switch(Tn.prev=Tn.next){case 0:return Tn.next=2,Object(gt.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:zt.current}});case 2:tn=Tn.sent,tn!=null&&(Kt=tn.attachments)!==null&&Kt!==void 0&&Kt.length&&(console.log("cm:",j,pt),tn.attachments.map(function(ln){ln.content_type.indexOf("image")>-1?j.replaceSelection("![,](/api/attachments/".concat(ln.id,"?type=").concat(ln.content_type,")")):ln.content_type.indexOf("video")>-1?j.replaceSelection('')):ln.content_type.indexOf("pdf")>-1?j.replaceSelection('
    ').concat(ln.name,"")):j.replaceSelection("[".concat(ln.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(ln.id,"?type=").concat(ln.content_type,")"))}));case 4:case"end":return Tn.stop()}},Xt)}));return function(){return Ft.apply(this,arguments)}}();Object(g.useEffect)(function(){ot(J),j==null||j.setValue(J)},[J]),Object(g.useEffect)(function(){Bn==null||Bn(Tt)},[Tt]),Object(g.useEffect)(function(){if(pt.current){var Ft=d.a.fromTextArea(pt.current,{mode:dt,lineNumbers:!Me,lineWrapping:!0,value:Xe,autoCloseTags:!0,autoCloseBrackets:!0});ve&&Ft.focus();function Xt(Kt,tn){if(zn){tn.preventDefault();return}var rn=tn.clipboardData;if(rn){var Tn=rn.types.toString(),ln=rn.items;if(Tn==="Files"||rn.types.indexOf("Files")>-1){if(tn.preventDefault(),dt=="stex")return;try{var Un,ai=ln[1];((Un=ln[0])===null||Un===void 0?void 0:Un.kind)==="file"&&(ai=ln[0]);var nn=ai.getAsFile(),bi=nn.name.split(".").pop();Le(nn,function(bn){if(bn.id){var Qn,qn,mi;(nn==null||((Qn=nn.type)===null||Qn===void 0)?void 0:Qn.indexOf("image"))>-1?Ft.replaceSelection("![,](/api/attachments/".concat(bn.id,"?type=").concat(bn.content_type,")")):(nn==null||((qn=nn.type)===null||qn===void 0)?void 0:qn.indexOf("video"))>-1?Ft.replaceSelection('')):(nn==null||((mi=nn.type)===null||mi===void 0)?void 0:mi.indexOf("pdf"))>-1?Ft.replaceSelection('').concat(nn.name,"")):re.includes(bi)?Ft.replaceSelection('').concat(nn.name,"")):Ft.replaceSelection("[".concat(nn.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(bn.id,"?type=").concat(bn.content_type,")"))}else(bn==null?void 0:bn.status)===401&&(document.location.href="/user/login")})}catch(bn){U.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Ft.on("paste",Xt),Ft.on("dragleave",function(Kt,tn){$t.current.classList.remove("mouse-hover-md")}),Ft.on("dragover",function(Kt,tn){$t.current.classList.add("mouse-hover-md")}),Ft.on("drop",function(Kt,tn){$t.current.classList.add("mouse-hover-md");var rn;if(rn=tn.dataTransfer.files,rn.length>0){tn.preventDefault(),tn.stopPropagation();for(var Tn=function(ai){var nn=rn[ai],bi=nn.name.split(".").pop();Le(nn,function(bn){if(bn.id){var Qn,qn,mi;(nn==null||((Qn=nn.type)===null||Qn===void 0)?void 0:Qn.indexOf("image"))>-1?Ft.replaceSelection("![,](/api/attachments/".concat(bn.id,"?type=").concat(bn.content_type,")")):(nn==null||((qn=nn.type)===null||qn===void 0)?void 0:qn.indexOf("video"))>-1?Ft.replaceSelection('')):(nn==null||((mi=nn.type)===null||mi===void 0)?void 0:mi.indexOf("pdf"))>-1?Ft.replaceSelection('').concat(nn.name,"")):re.includes(bi)?Ft.replaceSelection('').concat(nn.name,"")):Ft.replaceSelection("[".concat(nn.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(bn.id,"?type=").concat(bn.content_type,")"))}else(bn==null?void 0:bn.status)===401&&(document.location.href="/user/login")})},ln=0;ln0||ln.target.offsetWidth>0)&&(Zn(),j.setSize("100%","100%"),j.refresh())}}catch(Un){rn.e(Un)}finally{rn.f()}});return Kt.observe(pt.current.parentElement),Kt}if(j){var Xt=Ft();return function(){Xt.unobserve(pt.current.parentElement)}}},[j,Zn]),Object(g.useEffect)(function(){if(j){for(var Ft=[],Xt=function(){var ln=tn[Kt];rn=Object(H.a)(ln,2);var Un=rn[0],ai=rn[1],nn=Object(F.a)({},Un,function(){Ki(ai)});Ft.push(nn),j.addKeyMap(nn)},Kt=0,tn=Object.entries(ae);Kt0){var Ft=new Date().getTime(),Xt=window.sessionStorage.getItem(ke);Ft>=xn+ze&&(!Xt||Xt!==Ve)&&(window.sessionStorage.setItem(ke,Ve),mn(!0))}},ze),Object(g.useEffect)(function(){Rt(Ke)},[j,Ke]),Object(g.useEffect)(function(){j&&(ve&&j.focus())},[j,ve]),Object(g.useEffect)(function(){if(mt&&j){var Ft=j.getScrollerElement();function Xt(Kt){var tn=Kt.target;if(Xn.current){var rn=tn.scrollTop/tn.scrollHeight;Xn.current.scrollTop=Xn.current.scrollHeight*rn}}return Ft.addEventListener("scroll",Xt),function(){Ft.removeEventListener("scroll",Xt)}}},[j,mt]),Object(g.useEffect)(function(){if(j&&Sn){function Ft(Xt,Kt){Sn(Xt,Kt)}return j.on("beforeChange",Ft),function(){j.off("beforeChange",Ft)}}},[j,Sn]),Object(g.useEffect)(function(){if(j&&Qt){function Ft(){Qt(j.getValue())}return j.on("blur",Ft),function(){j.off("blur",Ft)}}},[j,Qt]),Object(g.useEffect)(function(){if(j){function Ft(Xt){var Kt=Xt.getValue();ot(Kt),In(new Date().getTime()),Xt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ut&&ut(Kt)}return j.on("change",Ft),function(){j.off("change",Ft)}}},[j,ut]),Object(g.useEffect)(function(){j&&(Xe==null?(j.setValue(""),ot("")):Xe!==j.getValue()&&(j.setValue(Xe),ot(Xe),j.setCursor(j.lineCount(),0)))},[j,Xe]);var Ki=Object(g.useCallback)(function(Ft){var Xt=j.getCursor(),Kt=j.getSelection(),tn=Kt.split(` `);switch(Ft){case"bold":return j.replaceSelection("**"+Kt+"**"),Kt===""&&j.setCursor(Xt.line,Xt.ch+2),j.focus();case"italic":return j.replaceSelection("*"+Kt+"*"),Kt===""&&j.setCursor(Xt.line,Xt.ch+1),j.focus();case"code":return j.replaceSelection("`"+Kt+"`"),Kt===""&&j.setCursor(Xt.line,Xt.ch+1),j.focus();case"inline-latex":return j.replaceSelection("`$$"+Kt+"$$`"),Kt===""&&j.setCursor(Xt.line,Xt.ch+3),j.focus();case"latex":return j.replaceSelection("```latex\n"+Kt+"\n```"),j.setCursor(Xt.line+1,Kt.length+1),j.focus();case"line-break":return j.replaceSelection(`
    `),j.focus();case"list-ul":return Kt===""?j.replaceSelection("- "+Kt):j.replaceSelection(tn.map(function(rn){return rn===""?"":"- ".concat(rn)}).join(` `)),j.focus();case"list-ol":return Kt===""?j.replaceSelection("1. "+Kt):j.replaceSelection(tn.map(function(rn,Tn){return rn===""?"":"".concat(Tn+1,". ").concat(rn)}).join(` `)),j.focus();case"add-null-ch":return Kt===""&&j.setCursor(Xt.line,Xt.ch+1),j.replaceSelection(Re),j.focus();case"inster-template-1":return Kt===""&&j.setCursor(Xt.line,Xt.ch),j.replaceSelection(je),j.focus();case"eraser":return j.setValue(""),j.focus();case"trigger-watch":return Rt(!mt),j.focus();case"trigger-full-screen":return qt(!Tt),j.focus();case tt:wn(tt);return;case vt:wn(vt);return;case Je:wn(Je);return;case wt:wn(wt);return;default:throw new Error}},[j,mt,Tt]),Ci=Object(g.useCallback)(function(Ft){wn("");switch(Gt){case tt:var Xt=Ft.title,Kt=Ft.link;return j.replaceSelection("[".concat(Xt,"](").concat(Kt,")")),j.focus();case vt:var tn=Ft.language,rn=Ft.content;return j.replaceSelection(["```"+tn,rn,"```"].join(` `)),j.focus();case Je:var Tn=Ft.src,ln=Ft.alt;return ln?j.replaceSelection("![ ".concat(ln," ]( ").concat(Tn,' "').concat(ln,'" )')):j.replaceSelection("![,](".concat(Tn,")")),j.focus();case wt:for(var Un=Ft.row,ai=Ft.col,nn=Ft.align,bi=` `,bn=0;bn300&&(Un=300);var ai=Be+Un+"px";_n(ai)}}return Ft.addEventListener("mousedown",tn),document.addEventListener("mousemove",Tn),document.addEventListener("mouseup",rn),function(){Ft.removeEventListener("mousedown",tn),document.removeEventListener("mousemove",Tn),document.removeEventListener("mouseup",rn)}}},[j,Nt]),Object(g.useEffect)(function(){_n(Be)},[Be]);var Ri=ge(ft),Gi=ge(Vn),Kn={width:Ri,height:Gi},Ht=Object(g.useMemo)(function(){if(xn){var Ft=new Date(xn),Xt=Ft.getHours(),Kt=Ft.getMinutes(),tn=Ft.getSeconds();return Xt=Xt<10?"0"+Xt:Xt,Kt=Kt<10?"0"+Kt:Kt,tn=tn<10?"0"+tn:tn,"".concat(Xt,":").concat(Kt,":").concat(tn)}return 0},[xn]);function Xi(){window.sessionStorage.removeItem(ke),mn(!1),In(0)}function _i(){mn(!1),In(0),j.setValue(window.sessionStorage.getItem(ke))}function nr(Ft,Xt){var Kt=j.getValue();Kt=Kt.replace(Ft,Xt),ot(Kt),j==null||j.setValue(Kt)}return f.a.createElement(g.Fragment,null,f.a.createElement("div",{className:"markdown-editor-wrapper",ref:$t},f.a.createElement("div",{className:"markdown-editor-container ".concat(ct," ").concat(mt?"on-preview":""," ").concat(Me?"mini":""," ").concat(Tt?"full-screen":""),style:Kn},f.a.createElement(_,{insertTemp:Pe,watch:mt,fullScreen:Tt,showNullButton:en,onActionCallback:Ki,hidetoolBar:Rn,uuid:zt.current,setOpenPhones:function(){yt.current=!0}}),f.a.createElement("div",{className:"markdown-editor-body"},f.a.createElement("div",{className:"codemirror-container"},f.a.createElement("textarea",{ref:pt,placeholder:ui})),mt?f.a.createElement("div",{ref:Xn,className:"preview-container"},dt==="stex"&&f.a.createElement(A,{value:Ve}),dt!=="stex"&&f.a.createElement(x.a,{edit:!0,value:Ve,replaces:nr})):null))),Ct?f.a.createElement("a",{ref:Nt,className:"editor-resize"}):null,f.a.createElement(P.a,null,ue[Gt]?f.a.createElement(V.a,{centered:!0,title:ue[Gt],visible:!0,onCancel:Ni,footer:null,className:"markdown-popup-form"},Vi):null))}},PD8m:function(Fe,Se){Fe.exports={name:"memoryStorage",read:q,write:V,each:M,remove:z,clearAll:U};var W={};function q(L){return W[L]}function V(L,H){W[L]=H}function M(L){for(var H in W)W.hasOwnProperty(H)&&L(W[H],H)}function z(L){delete W[L]}function U(L){W={}}},QUZ3:function(Fe,Se,W){"use strict";W.r(Se);var q=W("0Owb"),V=W("PpiC"),M=W("OaEy"),z=W("2fM7"),U=W("T2oS"),L=W("W9HT"),H=W("+L6B"),F=W("2/Rp"),D=W("9og8"),I=W("2qtc"),g=W("kLXV"),f=W("tJVT"),u=W("k1fw"),d=W("aHsQ"),s=W("sGsY"),l=W("WmNS"),r=W.n(l),a=W("q1tI"),n=W.n(a),h=W("Icgb"),O=W("Fvcw"),S=W("GIiI"),x=W("Ty5D"),A=W("55Ip"),C=W("OJz4"),b=W("V0Rq"),v=W("bntm"),p=W("cDPC"),c=W("m3rI"),E=W("RCxd"),y=W("EHPI"),_=W("S+dL"),P=W.n(_),N=W("J66h"),K=W("uMZB"),$=W.n(K),B=W("p/48"),R=W("JPnl"),G=W("y8nQ"),Q=W("Vl3Y"),ne=W("5NDa"),le=W("5rEg"),_e=le.a.TextArea,pe=5e3,Ee=function(T){var j=T.callback,ee=T.onCancel,X=T.notes;function ye(Ve){j(Ve)}return n.a.createElement(Q.a,{className:"note-form-panel",onFinish:ye,initialValues:{notes:X}},n.a.createElement(Q.a.Item,{name:"notes",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9"},{max:pe,message:"\u7B14\u8BB0\u6700\u5927\u5B57\u6570\u4E3A".concat(pe)}]},n.a.createElement(_e,{placeholder:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9",rows:5})),n.a.createElement(Q.a.Item,{style:{textAlign:"right"}},n.a.createElement(F.a,{type:"ghost",onClick:ee,style:{marginRight:10}}," \u53D6\u6D88 "),n.a.createElement(F.a,{type:"primary",htmlType:"submit"}," \u63D0\u4EA4 ")))},Oe=W("bbsP"),we=W("/wGt"),he=W("DjyN"),oe=W("NUBc"),Le=W("H2Ag"),Ye=W.n(Le),nt=W("miYZ"),qe=W("tsqr"),it=W("g9YV"),He=W("wCAj"),$e=W("+k/U"),Qe=W.n($e),gt=W("ye1Q"),et=W("lfch"),tt=W("JB8y"),Je=W("p5ED"),vt=W("ErOA"),wt=W("wd/R"),Et=W.n(wt),xt=He.a.Column,kt=function(T){var j,ee=T.submitResult,X=T.submitting,ye=T.submitRecords,Ve=T.page,ot=T.onPageChange,ht=T.topicId,Ue=ee||{},mt=Ue.status,Rt=Ue.id,Mt=Ue.input,Jt=Ue.output,Tt=Ue.expected_output,qt=Ue.is_file,Zt=Ue.input_file_url,Mn=Ue.output_file_url,Gt=Ue.expected_output_file_url,wn=Ue.error_msg,On=ye||{},Ln=On.records,xn=On.records_count,In=Object(a.useState)(""),Hn=Object(f.a)(In,2),ri=Hn[0],Vn=Hn[1],_n=Object(a.useState)(""),jn=Object(f.a)(_n,2),dn=jn[0],pn=jn[1],mn=Object(x.h)(),zt=(mn==null||((j=mn.query)===null||j===void 0)?void 0:j.type)==="1";function yt(){qt?navigator.clipboard.writeText(N.Base64.decode(wn)).then(function(){qe.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")}):navigator.clipboard.writeText(N.Base64.decode(Jt)).then(function(){qe.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")})}return n.a.createElement(L.a,{spinning:X,tip:"\u8BC4\u6D4B\u4E2D...",indicator:n.a.createElement(gt.a,{style:{fontSize:24},spin:!0})},Rt?n.a.createElement(n.a.Fragment,null,n.a.createElement("ul",{className:Qe.a.info},n.a.createElement("li",null,"\u6267\u884C\u7ED3\u679C\uFF1A",n.a.createElement("span",{className:mt===tt.a.OK?"c-green":"c-red"},R.a[mt])),n.a.createElement("li",{className:Qe.a.error},n.a.createElement("a",{onClick:yt},"\u590D\u5236\u9519\u8BEF\u4FE1\u606F ",n.a.createElement(et.a,null)," ")),n.a.createElement("li",null,n.a.createElement(A.a,{to:"/myproblems/".concat(ht,"/record-detail/").concat(Rt)},"\u663E\u793A\u8BE6\u60C5 >"," "))),mt!==tt.a.OK?n.a.createElement(n.a.Fragment,null,n.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),n.a.createElement("pre",null,!qt&&Mt,qt&&n.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(D.a)(r.a.mark(function Wt(){var pt;return r.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:return Nt.next=2,fetch(Zt,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 2:return pt=Nt.sent,Nt.t0=pn,Nt.next=6,pt.text();case 6:Nt.t1=Nt.sent,(0,Nt.t0)(Nt.t1),setTimeout(function(){Vn(Zt)},200);case 9:case"end":return Nt.stop()}},Wt)}))},Mt)),n.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),n.a.createElement("pre",null,(mt===4||mt===5)&&N.Base64.decode(wn),mt!=4&&mt!=5&&(qt?n.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(D.a)(r.a.mark(function Wt(){var pt;return r.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:return Nt.next=2,Object(vt.a)(Mn,{method:"Get",headers:{"Content-Type":"application/xml",Accept:"*/*"}});case 2:pt=Nt.sent;try{pn(pt)}catch(Xn){pn("")}setTimeout(function(){Vn(Mn)},200);case 5:case"end":return Nt.stop()}},Wt)}))},Jt):N.Base64.decode(Jt))),n.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),n.a.createElement("pre",null,!qt&&N.Base64.decode(Tt),qt&&n.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(D.a)(r.a.mark(function Wt(){var pt;return r.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:return Nt.next=2,fetch(Gt,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 2:return pt=Nt.sent,Nt.t0=pn,Nt.next=6,pt.text();case 6:Nt.t1=Nt.sent,(0,Nt.t0)(Nt.t1),setTimeout(function(){Vn(Gt)},200);case 9:case"end":return Nt.stop()}},Wt)}))},Tt))):null):null,(Ln==null?void 0:Ln.length)>0?n.a.createElement(He.a,{dataSource:Ln,rowKey:"id",pagination:!1},n.a.createElement(xt,{title:"\u63D0\u4EA4\u65F6\u95F4",dataIndex:"created_at",key:"created_at",render:function(pt,$t){return n.a.createElement("span",null," ",Et()(pt).format("YYYY-MM-DD HH:mm:ss"))}}),n.a.createElement(xt,{title:"\u63D0\u4EA4\u7ED3\u679C",dataIndex:"status",key:"status",render:function(pt,$t){var Nt;return n.a.createElement(A.a,{className:pt===0?"c-green":"c-red",to:"/myproblems/".concat(ht,"/record-detail/").concat($t.id)},(Nt=R.a[pt])===null||Nt===void 0?void 0:Nt.replace("\u8C03\u8BD5","\u8BC4\u6D4B"))}}),n.a.createElement(xt,{title:"\u6267\u884C\u7528\u65F6 (".concat(zt?"MS":"S",")"),dataIndex:"execute_time",key:"execute_time",render:function(pt){return pt?zt?pt:pt/1e3:""}}),n.a.createElement(xt,{title:"\u5185\u5B58\u6D88\u8017\uFF08".concat(zt?"KB":"MB","\uFF09"),dataIndex:"execute_memory",key:"execute_memory",render:function(pt){return pt?zt?pt:parseFloat((pt/1024).toFixed(2)):""}}),n.a.createElement(xt,{title:"\u8BED\u8A00",dataIndex:"language",key:"language"}),n.a.createElement(xt,{title:"\u64CD\u4F5C",dataIndex:"status",key:"status",render:function(pt,$t){return n.a.createElement(A.a,{className:"c-light-primary",to:"/myproblems/".concat(ht,"/record-detail/").concat($t.id)},"\u67E5\u770B")}})):n.a.createElement("div",{style:{height:300,width:"100%"}}),xn>15?n.a.createElement(oe.a,{className:Qe.a.pagination,current:Ve,pageSize:15,total:xn,onChange:ot}):null,n.a.createElement(Je.a,{close:!0,data:ri,type:ri.length?"txt":"",onClose:function(){return Vn("")},monacoEditor:{value:dn,language:"txt",onChange:function(){},options:{fontSize:14,readOnly:!0,minimap:{enabled:!1}}}}))},Ot=W("BdwD"),Ae=W("DYRE"),Ce=W("zeV3"),Ge=W("+BJd"),ze=W("mr32"),Re=W("pPuO"),je=W.n(Re),ge=W("9Bee"),de={1:{name:"\u7B80\u5355",color:"#52c41a"},2:{name:"\u4E2D\u7B49",color:"#faad14"},3:{name:"\u56F0\u96BE",color:"#f5222d"}},ce=function(T){var j=T.hack,ee=T.onTriggerPraise,X=T.toDiscuss,ye=j.language,Ve=j.difficult,ot=j.time_limit,ht=j.username,Ue=j.user_path,mt=j.user_praise,Rt=j.comments_count,Mt=j.praises_count,Jt=j.description,Tt=j.pass_count,qt=j.submit_count,Zt=Object(x.h)(),Mn=de[Ve];return n.a.createElement(n.a.Fragment,null,n.a.createElement("ul",{className:je.a.info},n.a.createElement("li",null,"\u7F16\u7A0B\u8BED\uFF1A",n.a.createElement("b",null,ye)),n.a.createElement("li",null,"\u96BE\u5EA6\uFF1A",n.a.createElement(ze.a,{color:Mn.color},Mn.name)),n.a.createElement("li",null,"\u8BC4\u6D4B\u65F6\u957F\u9650\u5236\uFF1A",n.a.createElement("b",null,ot,"\u79D2"))),n.a.createElement(ge.a,{value:Jt,className:je.a.desc}),n.a.createElement("ul",{className:je.a["commit-info"]},n.a.createElement("li",null,n.a.createElement(Ce.a,{size:4},n.a.createElement("span",null,"\u901A\u8FC7\u6B21\u6570")," ",n.a.createElement("b",null,Tt))),n.a.createElement("li",null,n.a.createElement(Ce.a,{size:4},n.a.createElement("span",null,"\u63D0\u4EA4\u6B21\u6570")," ",n.a.createElement("b",null,qt))," "),n.a.createElement("li",{style:{flex:"1 0 0"}}),Zt.query.type!=="exercises"&&n.a.createElement("li",null,n.a.createElement(Ce.a,{size:4},n.a.createElement("i",{className:"iconfont icon-huifu1",onClick:X})," ",n.a.createElement("b",null,Rt))," ")))},re=W("dhSg"),ae=W("oBTY"),ue=W("M8RZ"),fe=W("qJ4+");function be(T,j){return Object(vt.c)("/problems/".concat(T,"/comments.json?page=").concat(j,"&limit=10"))}function Ie(T){return Object(vt.f)("/discusses/".concat(T,"/plus.json"),{container_type:"Discuss",type:1})}function Xe(T,j,ee){return Object(vt.f)("/problems/".concat(T,"/comments/reply.json"),{comments:{content:ee,parent_id:j}})}function ut(T,j){return Object(vt.f)("/problems/".concat(T,"/comments.json"),{comments:{content:j}})}function bt(T,j,ee){return Object(vt.f)("/problems/".concat(T,"/comments/").concat(j,"/hidden.json"),ee)}function ft(T,j){return Object(vt.b)("/problems/".concat(T,"/comments/").concat(j))}var at=W("U7T7"),Be=W("AMnG");function We(T){var j=T.author;return n.a.createElement("a",{href:"/users/".concat(j.login),target:"_blank"},n.a.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",height:"50",style:{borderRadius:"50%"},src:"".concat(c.a.IMG_SERVER,"/images/").concat(j.image_url),width:"50"}))}function Me(T){var j=T.data,ee=T.index,X=T.parentDiscussIndex,ye=T.user,Ve=T.onSetActionType,ot=j.author,ht=j.can_delete,Ue=j.content,mt=j.id,Rt=j.time;function Mt(){Ve({id:mt,index:ee,type:"delete-discuss",parentDiscussIndex:X,message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}var Jt=ye.admin||ht||ot.user_id===ye.user_id;return n.a.createElement("div",{className:"discuss-item-container second-discuss "},n.a.createElement(We,{author:ot}),n.a.createElement("section",null,n.a.createElement("div",{className:"discuss-info"},n.a.createElement("a",{href:"/users/".concat(ot.login),target:"_blank"},ot.name),n.a.createElement("span",{className:"grey"},Rt),n.a.createElement("div",{className:"btn-group",style:{marginBottom:0}},Jt?n.a.createElement("a",{onClick:Mt,title:"\u5220\u9664"},n.a.createElement("i",{className:"iconfont icon-shanchu"})):null)),n.a.createElement(ge.a,{className:"discuss-content",value:Ue})))}var se=function(T){var j=T.user,ee=T.data,X=T.index,ye=T.onPlusDiscuss,Ve=T.onSetActionType,ot=T.activeDiscussIndex,ht=T.onReplyDiscuss,Ue=T.onSetActiveDiscussIndex,mt=ee.content,Rt=ee.children,Mt=ee.hidden,Jt=ee.id,Tt=ee.praise_count,qt=ee.time,Zt=ee.user_praise,Mn=ee.can_delete,Gt=ee.author;function wn(){Ue(Jt)}function On(){ye(Jt,!Zt,X)}function Ln(){Ve({id:Jt,index:X,type:"delete-discuss",message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}function xn(){Ve({id:Jt,index:X,params:{hidden:Mt?"0":"1"},type:"hidden-discuss",message:Mt?"\u786E\u5B9A\u8981\u53D6\u6D88\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417":"\u786E\u5B9A\u8981\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417"})}var In=j.admin||j.user_id===Gt.user_id;return n.a.createElement("div",{className:"discuss-item-container",key:Jt},n.a.createElement(We,{author:Gt}),n.a.createElement("section",null,n.a.createElement("div",{className:"discuss-info"},n.a.createElement("a",{href:"/users/".concat(Gt.login),target:"_blank"}," ",Gt.name," "),n.a.createElement("span",{className:"grey"},qt)),n.a.createElement(ge.a,{className:"discuss-content",value:mt}),Rt&&Rt.length>0?n.a.createElement("div",{className:"reply-discuss-container"},Rt.map(function(Hn,ri){return n.a.createElement(Me,{key:Hn.id,data:Hn,index:ri,user:j,onSetActionType:Ve,parentDiscussIndex:X})})):null,n.a.createElement("div",{className:"btn-group"},In?n.a.createElement("a",{onClick:xn,title:Mt?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF\u8BC4\u8BBA"},n.a.createElement("i",{className:Mt?"iconfont icon-yincangbiyan":"fa fa-eye"})):null,Mn&&(!Rt||Rt.length==0)?n.a.createElement("a",{onClick:Ln,title:"\u5220\u9664"},n.a.createElement("i",{className:"iconfont icon-shanchu"})):null,n.a.createElement("a",{onClick:wn,title:"\u56DE\u590D"}," ",n.a.createElement("i",{className:"iconfont icon-huifu1"})," "),n.a.createElement("a",{onClick:On,className:Zt?"c-orange":""},n.a.createElement("i",{className:Zt?"iconfont icon-dianzan mr3":"iconfont icon-dianzan-xian mr3 "}),n.a.createElement("span",null,Tt||""))),n.a.createElement(Be.a,{id:Jt,activeDiscussIndex:ot,onReplyDiscuss:ht})))},ve=W("kaH+"),Ke=W("uD2n"),Pe=W.n(Ke),st=W("Ot1p"),dt=function(T){var j=T.user_praise,ee=T.praise_count,X=T.praisePlus,ye=T.onCreateDiscuss,Ve=T.discuss_count,ot=Object(a.useState)(!1),ht=Object(f.a)(ot,2),Ue=ht[0],mt=ht[1],Rt=Object(a.useState)(""),Mt=Object(f.a)(Rt,2),Jt=Mt[0],Tt=Mt[1];function qt(On){Tt(On)}function Zt(){mt(!0)}function Mn(){mt(!1)}function Gt(){return wn.apply(this,arguments)}function wn(){return wn=Object(D.a)(r.a.mark(function On(){return r.a.wrap(function(xn){for(;;)switch(xn.prev=xn.next){case 0:ye(Jt),Tt(""),mt(!1);case 3:case"end":return xn.stop()}},On)})),wn.apply(this,arguments)}return n.a.createElement("div",{className:"".concat(Pe.a["dis-input-editor-container"]," ").concat(Ue?Pe.a.active:""," ")},n.a.createElement("div",{className:Ue?"hide ".concat(Pe.a["text-area"]):Pe.a["text-area"]},n.a.createElement("input",{placeholder:"\u8BF4\u70B9\u4EC0\u4E48",onClick:Zt}),n.a.createElement("a",null," ",n.a.createElement("i",{className:"iconfont icon-huifu1"})," \xA0 \xA0",Ve," "),n.a.createElement("a",{className:"c-light-black",onClick:X,title:j?"\u53D6\u6D88\u70B9\u8D5E":"\u70B9\u8D5E"},n.a.createElement("i",{className:"mr3 ".concat(j?"iconfont icon-dianzan c-orange":"iconfont icon-dianzan-xian"," ")}),ee?n.a.createElement("span",null,ee):"")),Ue?n.a.createElement("div",{className:Pe.a["input-mask"],onClick:Mn}):null,n.a.createElement("div",{className:Ue?Pe.a["md-container"]:"".concat(Pe.a["md-container"]," hide")},n.a.createElement(st.a,{id:"discuss-input-editor",miniToolbar:!0,watch:!1,noStorage:!0,defaultValue:Jt,height:240,onChange:qt}),n.a.createElement("div",{className:Pe.a["tip-container"],onClick:Mn},n.a.createElement("a",{className:Pe.a["btn-send"],onClick:Gt}," \u53D1\u9001 "))))},Te={loading:!1,page:1,data:[],count:0,actionType:null,activeDiscussIndex:null},ke;(function(T){T[T.GET_DISCUSSES=0]="GET_DISCUSSES",T[T.TOP_OR_DOWN_DISCUSS=1]="TOP_OR_DOWN_DISCUSS",T[T.ACTIVE_DISCUSS_INDEX=2]="ACTIVE_DISCUSS_INDEX",T[T.PLUS_DISCUSS=3]="PLUS_DISCUSS",T[T.SET_ACTION_TYPE=4]="SET_ACTION_TYPE",T[T.SET_PAGE=5]="SET_PAGE",T[T.SHOW_DISCUSSES_LOADING=6]="SHOW_DISCUSSES_LOADING"})(ke||(ke={}));function rt(T,j){switch(j.type){case ke.SHOW_DISCUSSES_LOADING:return Object(u.a)(Object(u.a)({},T),{},{loading:!0});case ke.GET_DISCUSSES:return Object(u.a)(Object(u.a)({},T),j.payload);case ke.TOP_OR_DOWN_DISCUSS:return Object(u.a)(Object(u.a)({},T),j.payload);case ke.SET_ACTION_TYPE:return Object(u.a)(Object(u.a)({},T),j.payload);case ke.PLUS_DISCUSS:return Object(u.a)(Object(u.a)({},T),j.payload);case ke.SET_PAGE:return Object(u.a)(Object(u.a)({},T),{},{page:j.payload});case ke.ACTIVE_DISCUSS_INDEX:return Object(u.a)(Object(u.a)({},T),j.payload);default:throw new Error}}var Ct=function(T){var j=T.user,ee=T.identifier,X=T.hack,ye=T.onTriggerPraise,Ve=Object(a.useReducer)(rt,Te),ot=Object(f.a)(Ve,2),ht=ot[0],Ue=ot[1],mt=ht.loading,Rt=ht.page,Mt=ht.data,Jt=ht.count,Tt=ht.actionType,qt=ht.activeDiscussIndex,Zt=Object(a.useCallback)(Object(D.a)(r.a.mark(function dn(){var pn,mn,zt;return r.a.wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:return Ue({type:ke.SHOW_DISCUSSES_LOADING}),Wt.next=3,be(ee,Rt);case 3:pn=Wt.sent,mn=pn.comments,zt=pn.disscuss_count,Ue({type:ke.GET_DISCUSSES,payload:{data:mn,count:zt,loading:!1}});case 6:case"end":return Wt.stop()}},dn)})),[Rt,ee]);Object(a.useEffect)(function(){Zt()},[ee,Rt]);function Mn(dn){Ue({type:ke.SET_PAGE,page:dn})}function Gt(dn){Ue({type:ke.SET_ACTION_TYPE,payload:{actionType:dn}})}function wn(dn){qt===dn?Ue({type:ke.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:null}}):Ue({type:ke.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:dn}})}function On(dn,pn,mn){return Ln.apply(this,arguments)}function Ln(){return Ln=Object(D.a)(r.a.mark(function dn(pn,mn,zt){var yt;return r.a.wrap(function(pt){for(;;)switch(pt.prev=pt.next){case 0:return pt.prev=0,pt.next=3,Ie(pn);case 3:yt=pt.sent,Mt[zt].user_praise=mn,Mt[zt].praise_count=yt.praise_count,Ue({type:ke.PLUS_DISCUSS,payload:{data:Object(ae.a)(Mt)}}),pt.next=12;break;case 9:pt.prev=9,pt.t0=pt.catch(0),console.log(pt.t0);case 12:case"end":return pt.stop()}},dn,null,[[0,9]])})),Ln.apply(this,arguments)}function xn(){return In.apply(this,arguments)}function In(){return In=Object(D.a)(r.a.mark(function dn(){var pn,mn,zt,yt,Wt,pt,$t,Nt;return r.a.wrap(function(sn){for(;;)switch(sn.prev=sn.next){case 0:if(pn=Tt.id,mn=Tt.params,zt=Tt.type,yt=Tt.index,Wt=Tt.parentDiscussIndex,!(zt==="hidden-discuss")){sn.next=6;break}return sn.next=4,bt(ee,pn,mn);case 4:Wt?Mt[Wt].children[yt].hidden=mn.hidden==1:Mt[yt].hidden=mn.hidden==1,Ue({type:ke.SET_ACTION_TYPE,payload:{actionType:null,data:Object(ae.a)(Mt)}});case 6:if(!(zt==="delete-discuss")){sn.next=31;break}return sn.next=9,ft(ee,pn);case 9:if(!(Wt||Wt===0)){sn.next=22;break}pt=Mt[Wt].children,$t=pt.length-1;case 12:if(!($t>=0)){sn.next=19;break}if(!(pt[$t].id===pn)){sn.next=16;break}return pt.splice($t,1),sn.abrupt("break",19);case 16:$t--,sn.next=12;break;case 19:Mt[Wt].children=pt,sn.next=30;break;case 22:Nt=Mt.length-1;case 23:if(!(Nt>=0)){sn.next=30;break}if(!(Mt[Nt].id===pn)){sn.next=27;break}return Mt.splice(Nt,1),sn.abrupt("break",30);case 27:Nt--,sn.next=23;break;case 30:Ue({type:ke.SET_ACTION_TYPE,payload:{actionType:null,data:Object(ae.a)(Mt)}});case 31:case"end":return sn.stop()}},dn)})),In.apply(this,arguments)}function Hn(){Ue({type:ke.SET_ACTION_TYPE,payload:{actionType:null}})}function ri(dn,pn){return Vn.apply(this,arguments)}function Vn(){return Vn=Object(D.a)(r.a.mark(function dn(pn,mn){return r.a.wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:return yt.prev=0,yt.next=3,Xe(ee,pn,mn);case 3:Zt(),yt.next=9;break;case 6:yt.prev=6,yt.t0=yt.catch(0),console.log(yt.t0);case 9:case"end":return yt.stop()}},dn,null,[[0,6]])})),Vn.apply(this,arguments)}function _n(dn){return jn.apply(this,arguments)}function jn(){return jn=Object(D.a)(r.a.mark(function dn(pn){return r.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:return Ue({type:ke.SHOW_DISCUSSES_LOADING}),zt.next=3,ut(ee,pn);case 3:Zt();case 4:case"end":return zt.stop()}},dn)})),jn.apply(this,arguments)}return n.a.createElement(n.a.Fragment,null,n.a.createElement("div",{className:"discuss-panel"},Mt.length===0?n.a.createElement(Ot.a,null):Mt.map(function(dn,pn){return n.a.createElement(se,{onReplyDiscuss:ri,onPlusDiscuss:On,onSetActiveDiscussIndex:wn,onSetActionType:Gt,data:dn,index:pn,user:j,activeDiscussIndex:qt})}),Jt>10?n.a.createElement("div",{className:"pagination-container"},n.a.createElement(oe.a,{showQuickJumper:!0,onChange:Mn,current:Rt,total:Jt})):null),n.a.createElement(dt,{user_praise:X.user_praise,praise_count:X.praises_count,praisePlus:ye,discuss_count:X.comments_count,onCreateDiscuss:_n}),n.a.createElement(ue.a,null,n.a.createElement(g.a,{centered:!0,title:"\u63D0\u793A",visible:!!Tt,onOk:xn,onCancel:Hn},n.a.createElement("p",null,Tt?Tt.message:"")),n.a.createElement(ve.a,null)))},At=W("9kvl"),cn={1:"\u7B80\u5355",2:"\u9002\u4E2D",3:"\u56F0\u96BE"},yn={1:"#2fa34f",2:"#0152d9",3:"#fa6400"},en=function(T){var j,ee=T.hack,X=T.onTriggerPraise,ye=T.topicId,Ve=T.page,ot=T.onPageChange,ht=T.user,Ue=T.submitRecords,mt=T.submitting,Rt=T.submitResult,Mt=Object(a.useState)("0"),Jt=Object(f.a)(Mt,2),Tt=Jt[0],qt=Jt[1],Zt=Object(x.h)(),Mn=Object(a.useState)(!1),Gt=Object(f.a)(Mn,2),wn=Gt[0],On=Gt[1],Ln=Object(a.useState)([]),xn=Object(f.a)(Ln,2),In=xn[0],Hn=xn[1],ri=Object(a.useState)(Object(u.a)(Object(u.a)({},Object(x.i)()),{},{page:1,per_page:20,name:""})),Vn=Object(f.a)(ri,2),_n=Vn[0],jn=Vn[1];function dn(yt){var Wt=yt.target.id;qt(Wt)}Object(a.useEffect)(function(){var yt=re.a.subscribe("to-commit-info",function(){qt("1")});return yt},[]);function pn(){qt("2")}function mn(){return zt.apply(this,arguments)}function zt(){return zt=Object(D.a)(r.a.mark(function yt(){var Wt;return r.a.wrap(function($t){for(;;)switch($t.prev=$t.next){case 0:return $t.next=2,Object(vt.a)("/api/problems/my_hack_list.json",{method:"get",params:Object(u.a)({identifier:_n==null?void 0:_n.id},_n)});case 2:Wt=$t.sent,Hn(Wt);case 4:case"end":return $t.stop()}},yt)})),zt.apply(this,arguments)}return console.log(Ue,"submitRecords"),n.a.createElement("div",{className:Ye.a["left-panel"]},n.a.createElement("ul",{className:"".concat(Ye.a["s-navs"]," ").concat(Ye.a["bg-white"]," ").concat(Ye.a.b1)},n.a.createElement("li",null,n.a.createElement("a",{className:Tt==="0"?Ye.a.active:"",id:"0",onClick:dn},"\u4EFB\u52A1\u63CF\u8FF0")),n.a.createElement("li",null,n.a.createElement("a",{className:Tt==="1"?Ye.a.active:"",id:"1",onClick:dn},"\u63D0\u4EA4\u8BB0\u5F55")),Zt.query.type!=="exercises"&&n.a.createElement("li",null,n.a.createElement("a",{className:Tt==="2"?Ye.a.active:"",id:"2",onClick:dn},"\u8BC4\u8BBA"))),n.a.createElement("div",{className:"".concat(Ye.a["tab-panel-body"]," ").concat(Tt==="0"?"":"hide")},n.a.createElement(ce,{hack:ee,onTriggerPraise:X,toDiscuss:pn})),n.a.createElement("div",{style:{padding:"0 12px"},className:"".concat(Ye.a["tab-panel-body"]," ").concat(Tt==="1"?"":"hide")},!!(Ue!=null&&Ue.records_count)||mt?n.a.createElement(kt,{page:Ve,onPageChange:ot,topicId:ye,submitting:mt,submitRecords:Ue,submitResult:Rt}):n.a.createElement(Ot.a,null)),n.a.createElement("div",{className:"".concat(Ye.a["tab-panel-body"]," ").concat(Tt==="2"?"":"hide"),style:{padding:0}},n.a.createElement(Ct,{user:ht,identifier:ee.identifier,hack:ee,onTriggerPraise:X})),n.a.createElement(we.a,{className:Ye.a.drawer,headerStyle:{background:"#000",border:0},closable:!1,title:n.a.createElement("div",{style:{display:"flex",alignItems:"center"}},n.a.createElement("span",{style:{color:"#fff"}},"\u9898\u76EE\u5217\u8868"),n.a.createElement(le.a.Search,{onSearch:function(Wt){_n.name=Wt,_n.page=1,jn(Object(u.a)({},_n)),mn()},style:{width:180,margin:"0px 20px",marginLeft:"auto"},placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE\u540D\u79F0\u641C\u7D22"}),n.a.createElement(z.a,{style:{width:100},placeholder:"\u8BF7\u9009\u62E9\u96BE\u5EA6",onChange:function(Wt){_n.page=1,_n.difficult=Wt||null,jn(Object(u.a)({},_n)),mn()}},n.a.createElement(z.a.Option,{value:0},"\u5168\u90E8"),n.a.createElement(z.a.Option,{value:1},"\u7B80\u5355"),n.a.createElement(z.a.Option,{value:2},"\u9002\u4E2D"),n.a.createElement(z.a.Option,{value:3},"\u56F0\u96BE"))),bodyStyle:{background:"#0f1e31",padding:"20px 0px"},footerStyle:{background:"#0f1e31",border:0,textAlign:"center"},footer:n.a.createElement("div",null,n.a.createElement(oe.a,{current:_n.page,className:"mt10 mb10",hideOnSinglePage:!0,total:In==null?void 0:In.count,pageSize:_n.per_page,onChange:function(Wt,pt){_n.page=Wt,_n.per_page=pt,mn()}})),width:530,placement:"left",onClose:function(){return On(!1)},visible:wn},In==null||((j=In.data)===null||j===void 0)?void 0:j.map(function(yt,Wt){return n.a.createElement("div",{onClick:Object(D.a)(r.a.mark(function pt(){var $t;return r.a.wrap(function(Xn){for(;;)switch(Xn.prev=Xn.next){case 0:return Xn.next=2,Object(vt.a)("/api/problems/".concat(yt==null?void 0:yt.identifier,"/start.json"),{method:"get",params:{hack_user_id:ht==null?void 0:ht.user_id}});case 2:$t=Xn.sent,$t&&(At.d.replace("/myproblems/".concat($t==null?void 0:$t.identifier,"?type=1")),window.location.reload());case 4:case"end":return Xn.stop()}},pt)})),className:"".concat(Ye.a.list," ").concat(yt!=null&&yt.checked?Ye.a.active:"")},n.a.createElement("div",null,(yt==null?void 0:yt.opened)&&(yt==null?void 0:yt.passed)&&n.a.createElement("i",{className:"iconfont icon-wancheng1 c-green-29b"}),(yt==null?void 0:yt.opened)&&!(yt!=null&&yt.passed)&&n.a.createElement("i",{className:"iconfont icon-cuowu c-red"}),n.a.createElement("span",{style:{color:"rgb(186, 196, 205)",fontWeight:400,fontSize:14,marginLeft:10}},yt.name)),n.a.createElement("span",{style:{color:yn[yt.difficult]}},cn[yt.difficult]))})),(ee==null?void 0:ee.is_program)&&n.a.createElement("div",{onClick:function(){mn(),On(!0)},className:Ye.a.btns},n.a.createElement("i",{className:"iconfont icon-timuliebiao"}),n.a.createElement("span",null,"\u9898\u76EE\u5217\u8868")))},Dt=W("oFv4"),Rn=W.n(Dt),Fn=W("+aKw"),Cn=W("S/kP"),Qt=W.n(Cn),Sn=W("t/PP"),Bn=W.n(Sn),li=s.a.Countdown,ct={Java:"java",C:"c",Python:"py","C++":"c"},St;(function(T){T[T.SET_LOADING=0]="SET_LOADING",T[T.GET_DATA=1]="GET_DATA",T[T.GET_SUBMIT_RECORDS=2]="GET_SUBMIT_RECORDS",T[T.SET_DATA=3]="SET_DATA",T[T.SET_DEBUGING=4]="SET_DEBUGING",T[T.SET_SUBMITING=5]="SET_SUBMITING",T[T.SET_EXECUTE_MESSAGE=6]="SET_EXECUTE_MESSAGE",T[T.SET_EXECUTE_RESULT=7]="SET_EXECUTE_RESULT",T[T.SET_SUBMIT_RESULT=8]="SET_SUBMIT_RESULT",T[T.SET_SHOW_NOTE=9]="SET_SHOW_NOTE",T[T.SET_PAGE=10]="SET_PAGE"})(St||(St={}));function zn(){return new Date().getTime()}var pi={loading:!0,data:void 0,showNote:!1,debugResult:void 0,submitResult:void 0,debuging:!1,submitting:!1,submitRecords:void 0,submitRecordPage:1,executingMessage:""};function ui(T,j){switch(j.type){case St.GET_DATA:return Object(u.a)(Object(u.a)({},T),j.payload);case St.SET_DATA:return Object(u.a)(Object(u.a)({},T),{},{data:j.payload});case St.SET_LOADING:return Object(u.a)(Object(u.a)({},T),{},{loading:j.payload});case St.SET_SHOW_NOTE:return Object(u.a)(Object(u.a)({},T),{},{showNote:j.payload});case St.SET_DEBUGING:return Object(u.a)(Object(u.a)({},T),{},{debuging:j.payload});case St.SET_SUBMITING:return Object(u.a)(Object(u.a)({},T),{},{submitting:j.payload});case St.GET_SUBMIT_RECORDS:return Object(u.a)(Object(u.a)({},T),{},{submitRecords:j.payload});case St.SET_PAGE:return Object(u.a)(Object(u.a)({},T),{},{submitRecordPage:j.payload});case St.SET_EXECUTE_MESSAGE:return Object(u.a)(Object(u.a)({},T),{},{executingMessage:j.payload});case St.SET_EXECUTE_RESULT:return Object(u.a)(Object(u.a)({},T),j.payload);case St.SET_SUBMIT_RESULT:return Object(u.a)(Object(u.a)({},T),j.payload);default:throw new Error}}var ki=Se.default=function(T){var j,ee,X,ye,Ve=T.children,ot=Object(a.useReducer)(ui,pi),ht=Object(f.a)(ot,2),Ue=ht[0],mt=ht[1],Rt=Object(x.i)(),Mt=Rt.id,Jt=Object(x.g)(),Tt=Object(x.h)(),qt=Ue.loading,Zt=Ue.data,Mn=Ue.debugResult,Gt=Ue.submitResult,wn=Ue.submitRecords,On=Ue.submitRecordPage,Ln=Ue.showNote,xn=Ue.debuging,In=Ue.submitting,Hn=Ue.executingMessage,ri=Object(a.useState)("#FFF"),Vn=Object(f.a)(ri,2),_n=Vn[0],jn=Vn[1],dn=Object(a.useState)(null),pn=Object(f.a)(dn,2),mn=pn[0],zt=pn[1],yt=Object(a.useState)({}),Wt=Object(f.a)(yt,2),pt=Wt[0],$t=Wt[1],Nt=Object(a.useState)(!0),Xn=Object(f.a)(Nt,2),sn=Xn[0],Zn=Xn[1],Ki=Object(a.useState)(!1),Ci=Object(f.a)(Ki,2),Vi=Ci[0],Ni=Ci[1],Ri=Object(a.useRef)(null),Gi=Object(a.useRef)(0),Kn=Zt==null?void 0:Zt.user,Ht=Zt==null?void 0:Zt.hack,Xi=Object(a.useRef)(),_i=Object(a.useRef)();Object(a.useEffect)(function(){var on;if(clearTimeout(Xi.current),clearTimeout(_i.current),pt!=null&&(on=pt.exercise)!==null&&on!==void 0&&on.left_time){var Bt,an;if((pt==null||((Bt=pt.exercise)===null||Bt===void 0)?void 0:Bt.left_time)>1800){var Pt;_i.current=setTimeout(function(){g.a.info({content:"\u5F53\u524D\u8DDD\u79BB\u8003\u8BD5\u7ED3\u675F\u8FD8\u670930\u5206\u949F",icon:n.a.createElement(h.a,null),okText:"\u77E5\u9053\u4E86"})},((pt==null||((Pt=pt.exercise)===null||Pt===void 0)?void 0:Pt.left_time)-1800)*1e3)}if((pt==null||((an=pt.exercise)===null||an===void 0)?void 0:an.left_time)>900){var fn;Xi.current=setTimeout(function(){g.a.info({content:"\u5F53\u524D\u8DDD\u79BB\u8003\u8BD5\u7ED3\u675F\u8FD8\u670915\u5206\u949F",icon:n.a.createElement(h.a,null),okText:"\u77E5\u9053\u4E86"})},((pt==null||((fn=pt.exercise)===null||fn===void 0)?void 0:fn.left_time)-900)*1e3)}}},[pt]),Object(a.useEffect)(function(){function on(){return Bt.apply(this,arguments)}function Bt(){return Bt=Object(D.a)(r.a.mark(function an(){var Pt,fn,Pn,ei,Si,ti,vn,kn,Yi,Fi,$n,vi;return r.a.wrap(function(oi){for(;;)switch(oi.prev=oi.next){case 0:return Zn(!0),oi.next=3,Object(C.d)(Mt);case 3:if(Pt=oi.sent,setTimeout(function(){Zn(!1)},800),Pt.status===401)document.location.href="/user/login";else{try{Pt.hack.code=N.Base64.decode(Pt.hack.code)}catch(zi){console.log(zi)}Pt.hack=Object(u.a)(Object(u.a)({},Pt.hack),{},{is_program:(Tt==null||((fn=Tt.query)===null||fn===void 0)?void 0:fn.type)==="1"}),mt({type:St.GET_DATA,payload:{loading:!1,data:Pt}})}if(!(Tt.query.type==="exercises")){oi.next=18;break}if(!(Tt.query.coursesId=="coursesId")){oi.next=13;break}return oi.next=10,Object(b.Y)({categoryId:Tt.query.exercisesId,login:Tt.query.login});case 10:ti=oi.sent,oi.next=16;break;case 13:return oi.next=15,Object(b.z)({categoryId:Tt.query.exercisesId,login:Tt.query.login});case 15:ti=oi.sent;case 16:$t(Object(u.a)({},ti)),(Pn=ti)!==null&&Pn!==void 0&&Pn.left_banner_id&&(ei=ti)!==null&&ei!==void 0&&(Si=ei.exercise)!==null&&Si!==void 0&&Si.left_time&&(zt(Date.now()+((vn=ti)===null||vn===void 0||((kn=vn.exercise)===null||kn===void 0)?void 0:kn.left_time)*1e3),setTimeout(function(){jn("red")},(((Yi=ti)===null||Yi===void 0||((Fi=Yi.exercise)===null||Fi===void 0)?void 0:Fi.left_time)-300>0?(($n=ti)===null||$n===void 0||((vi=$n.exercise)===null||vi===void 0)?void 0:vi.left_time)-300:0)*1e3));case 18:case"end":return oi.stop()}},an)})),Bt.apply(this,arguments)}Mt&&on()},[Mt]),Object(a.useEffect)(function(){return Tt.query.type==="exercises"&&(window.addEventListener(Object(v.c)(),Ft),window.focus(),window.onblur=function(){Object(v.a)()&&Object(v.b)()}),function(){document.removeEventListener(Object(v.c)(),Ft)}},[Mt]),Object(a.useEffect)(function(){Mt&&Ht!==null&&Ht!==void 0&&Ht.language&&Xt()},[Mt,On,Ht==null?void 0:Ht.language]),Object(a.useEffect)(function(){return Ht!=null&&Ht.is_program&&(Gi.current=0,Ri.current=setInterval(function(){nr()},15e3)),function(){clearInterval(Ri.current)}},[Ht==null?void 0:Ht.is_program]);var nr=function(){var on=Object(D.a)(r.a.mark(function Bt(){var an;return r.a.wrap(function(fn){for(;;)switch(fn.prev=fn.next){case 0:return fn.next=2,Object(vt.a)("/api/myproblems/".concat(Mt,"/save_long_time.json"),{method:"get",params:{answer_long_time:Gi.current}});case 2:an=fn.sent;case 3:case"end":return fn.stop()}},Bt)}));return function(){return on.apply(this,arguments)}}(),Ft=function(){window.parent.postMessage("backExercise","*")};function Xt(){return Kt.apply(this,arguments)}function Kt(){return Kt=Object(D.a)(r.a.mark(function on(){var Bt;return r.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Pt.prev=0,Pt.next=3,Object(C.f)(Mt,{limit:15,page:On,language:Ht==null?void 0:Ht.language});case 3:Bt=Pt.sent,mt({type:St.GET_SUBMIT_RECORDS,payload:Bt}),Pt.next=10;break;case 7:Pt.prev=7,Pt.t0=Pt.catch(0),console.log(Pt.t0);case 10:case"end":return Pt.stop()}},on,null,[[0,7]])})),Kt.apply(this,arguments)}function tn(on){mt({type:St.SET_PAGE,payload:on})}function rn(){return Tn.apply(this,arguments)}function Tn(){return Tn=Object(D.a)(r.a.mark(function on(){var Bt;return r.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Pt.next=2,Object(C.k)(Mt,{code:N.Base64.encode(Ht.code),language:Ht==null?void 0:Ht.language});case 2:return Bt=Pt.sent,Pt.abrupt("return",Bt);case 4:case"end":return Pt.stop()}},on)})),Tn.apply(this,arguments)}function ln(){return Un.apply(this,arguments)}function Un(){return Un=Object(D.a)(r.a.mark(function on(){var Bt,an,Pt,fn,Pn,ei,Si,ti;return r.a.wrap(function(kn){for(;;)switch(kn.prev=kn.next){case 0:if(!In){kn.next=2;break}return kn.abrupt("return");case 2:return mt({type:St.SET_SUBMITING,payload:!0}),kn.prev=3,re.a.publish("to-commit-info"),kn.next=7,rn();case 7:if(Bt=kn.sent,console.log(Bt,1),!(Bt.status===0)){kn.next=23;break}return ti=function(){return ti=Object(D.a)(r.a.mark(function Fi(){var $n,vi,wi,oi,zi,Cr,Bi;return r.a.wrap(function(Ei){for(;;)switch(Ei.prev=Ei.next){case 0:return Ei.next=2,Object(C.c)(Mt,"submit");case 2:if($n=Ei.sent,vi=$n.status,wi=$n.data,oi=zn(),zi=oi-ei>(Pn+3)*1e3,vi!==0&&!zi&&setTimeout(Si,1e3),!zi){Ei.next=12;break}return g.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),mt({type:St.SET_SUBMITING,payload:!1}),Ei.abrupt("return");case 12:if(!(vi===0)){Ei.next=19;break}return wi.status===2&&g.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),(wi==null?void 0:wi.status)===0&&(Tt==null||((Cr=Tt.query)===null||Cr===void 0)?void 0:Cr.type)==="1"&&Ni(!0),Ei.next=17,Object(C.f)(Mt,{limit:15,page:On,language:Ht==null?void 0:Ht.language});case 17:Bi=Ei.sent,mt({type:St.SET_SUBMIT_RESULT,payload:Object(u.a)(Object(u.a)({},Ue),{},{submitResult:wi,submitting:!1,submitRecords:Bi})});case 19:case"end":return Ei.stop()}},Fi)})),ti.apply(this,arguments)},Si=function(){return ti.apply(this,arguments)},Pt={},Tt.query.type==="exercises"&&(Pt.extras={exercise_id:Tt.query.exercisesId,question_id:Tt.query.questionId}),kn.next=16,Object(C.h)(Mt,Pt);case 16:if(fn=kn.sent,!(fn.status===-1&&Tt!==null&&Tt!==void 0&&(an=Tt.query)!==null&&an!==void 0&&an.coursesId)){kn.next=20;break}return window.parent.location.href="/classrooms/".concat(Tt.query.coursesId,"/exercise/").concat(Tt.query.exercisesId,"/detail"),kn.abrupt("return");case 20:Pn=Ht.time_limit,ei=zn(),Si();case 23:kn.next=29;break;case 25:kn.prev=25,kn.t0=kn.catch(3),console.log(kn.t0),mt({type:St.SET_SUBMITING,payload:!1});case 29:case"end":return kn.stop()}},on,null,[[3,25]])})),Un.apply(this,arguments)}function ai(){return nn.apply(this,arguments)}function nn(){return nn=Object(D.a)(r.a.mark(function on(){var Bt,an,Pt,fn,Pn,ei,Si;return r.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:return Ue.debuging=!0,mt({type:St.SET_DEBUGING,payload:!0}),vn.prev=2,vn.next=5,rn();case 5:if(Bt=vn.sent,!(Bt.status===0)){vn.next=22;break}return Si=function(){return Si=Object(D.a)(r.a.mark(function Yi(){var Fi,$n,vi,wi,oi,zi;return r.a.wrap(function(Bi){for(;;)switch(Bi.prev=Bi.next){case 0:return Bi.next=2,Object(C.c)(Mt,"debug");case 2:if(Fi=Bi.sent,$n=Fi.status,vi=Fi.message,wi=Fi.data,oi=zn(),zi=oi-Pn>(an+3)*1e3,$n!==0&&!zi&&(mt({type:St.SET_EXECUTE_MESSAGE,payload:vi}),setTimeout(ei,1e3)),!zi){Bi.next=13;break}return g.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),mt({type:St.SET_DEBUGING,payload:!1}),Bi.abrupt("return");case 13:$n===0&&(mt({type:St.SET_DEBUGING,payload:!1}),wi.status===2&&g.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),wi.status===2&&g.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),mt({type:St.SET_EXECUTE_RESULT,payload:Object(u.a)(Object(u.a)({},Ue),{},{debugResult:wi,debuging:!1})}));case 14:case"end":return Bi.stop()}},Yi)})),Si.apply(this,arguments)},ei=function(){return Si.apply(this,arguments)},an=Ht.time_limit,Pt={input:encodeURIComponent(Zt.test_case.input)},Tt.query.type==="exercises"&&(Pt.exercise_id=Tt.query.exercisesId),vn.next=14,Object(C.b)(Mt,Pt);case 14:if(fn=vn.sent,!(fn.status===-1&&Tt.query.coursesId)){vn.next=18;break}return window.parent.location.href="/classrooms/".concat(Tt.query.coursesId,"/exercise/").concat(Tt.query.exercisesId,"/detail"),vn.abrupt("return");case 18:Pn=zn(),ei(),vn.next=23;break;case 22:mt({type:St.SET_DEBUGING,payload:!1});case 23:vn.next=28;break;case 25:vn.prev=25,vn.t0=vn.catch(2),console.log(vn.t0);case 28:return vn.prev=28,vn.finish(28);case 30:case"end":return vn.stop()}},on,null,[[2,25,28,30]])})),nn.apply(this,arguments)}function bi(on){mt({type:St.SET_DATA,payload:Object(u.a)(Object(u.a)({},Zt),{},{hack:Object(u.a)(Object(u.a)({},Ht),{},{code:on})})})}var bn=function(){var on=Object(D.a)(r.a.mark(function Bt(an){var Pt,fn;return r.a.wrap(function(ei){for(;;)switch(ei.prev=ei.next){case 0:return ei.next=2,Object(vt.a)("/api/problems/".concat(Ht==null?void 0:Ht.identifier,"/start.json"),{method:"get",params:{language:an==="C++"||an==="c++"?encodeURIComponent(an):an,hack_user_id:Kn==null?void 0:Kn.user_id}});case 2:Pt=ei.sent,Pt.status!==-1&&Jt.replace("/myproblems/".concat(Pt==null?void 0:Pt.identifier,"?type=").concat(Tt==null||((fn=Tt.query)===null||fn===void 0)?void 0:fn.type));case 4:case"end":return ei.stop()}},Bt)}));return function(an){return on.apply(this,arguments)}}();function Qn(on){var Bt=on.target.value;mt({type:St.SET_DATA,payload:Object(u.a)(Object(u.a)({},Zt),{},{test_case:{input:Bt}})})}function qn(){return mi.apply(this,arguments)}function mi(){return mi=Object(D.a)(r.a.mark(function on(){var Bt;return r.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Pt.prev=0,Pt.next=3,Object(C.g)(Mt);case 3:Bt=Pt.sent,Bt.status===401?Jt.replace("/login",{from:Tt.pathname}):bi(N.Base64.decode(Bt.code)),Pt.next=10;break;case 7:Pt.prev=7,Pt.t0=Pt.catch(0),console.log(Pt.t0);case 10:case"end":return Pt.stop()}},on,null,[[0,7]])})),mi.apply(this,arguments)}function Wr(){g.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:n.a.createElement("p",null,"\u521D\u59CB\u4EE3\u7801\u6709\u4FEE\u6539\uFF0C\u66F4\u65B0\u540E\u5C06\u8986\u76D6\u73B0\u6709\u4EE3\u7801\u54E6~ ",n.a.createElement("br",null),"\u8BF7\u5C06\u60A8\u7F16\u8F91\u7684\u4EE3\u7801\u4FDD\u5B58\u81F3\u672C\u5730\uFF0C\u4EE5\u9632\u4E22\u5931"),onOk:function(){return Object(D.a)(r.a.mark(function Bt(){var an;return r.a.wrap(function(fn){for(;;)switch(fn.prev=fn.next){case 0:return fn.next=2,Object(C.i)(Mt);case 2:an=fn.sent,an.status===401?Jt.replace("/login",{from:Tt.pathname}):bi(N.Base64.decode(an.code));case 4:case"end":return fn.stop()}},Bt)}))()}})}function En(){mt({type:St.SET_SHOW_NOTE,payload:!0})}function hn(){mt({type:St.SET_SHOW_NOTE,payload:!1})}function gn(on){return gi.apply(this,arguments)}function gi(){return gi=Object(D.a)(r.a.mark(function on(Bt){return r.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Pt.next=2,Object(C.a)(Mt,Bt);case 2:mt({type:St.GET_DATA,payload:{showNote:!1,data:Object(u.a)(Object(u.a)({},Zt),{},{hack:Object(u.a)(Object(u.a)({},Ht),{},{notes:Bt.notes})})}});case 3:case"end":return Pt.stop()}},on)})),gi.apply(this,arguments)}var Qi={hack:Ht,isLoading:sn,input:Zt==null||((j=Zt.test_case)===null||j===void 0)?void 0:j.input,language:Ht==null?void 0:Ht.language,code:Ht==null?void 0:Ht.code,title:"main."+ct[Ht==null?void 0:Ht.language],modify_code:Ht==null?void 0:Ht.modify_code,notes:Ht==null?void 0:Ht.notes,debugResult:Mn,debuging:xn,submitting:In,executingMessage:Hn,onCancelNote:hn,onAddNote:gn,showNote:Ln,user:Kn,onShowNote:En,onSubmitCode:ln,onChangeCode:bi,onChangeInput:Qn,onDebugCode:ai,onResetCode:qn,onSyncCode:Wr,onUpdateCode:rn,onChangeLanguage:bn};function qi(){return ir.apply(this,arguments)}function ir(){return ir=Object(D.a)(r.a.mark(function on(){var Bt,an,Pt;return r.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:return Pn.next=2,Object(C.j)(Ht.id,{container_type:"Hack",type:1});case 2:Bt=Pn.sent,an=Bt.praise_count,Pt=Object(u.a)(Object(u.a)({},Zt),{},{hack:Object(u.a)(Object(u.a)({},Ht),{},{praises_count:an,user_praise:!Ht.user_praise})}),mt({type:St.SET_DATA,payload:Pt});case 6:case"end":return Pn.stop()}},on)})),ir.apply(this,arguments)}var Tr={topicId:Mt,submitResult:Gt,submitRecords:wn,submitting:In,page:On,onPageChange:tn,hack:Ht,user:Zt==null?void 0:Zt.user,onTriggerPraise:qi};return n.a.createElement(n.a.Fragment,null,n.a.createElement(L.a,{spinning:qt,delay:500},Zt?n.a.createElement(n.a.Fragment,null,n.a.createElement("header",{className:$.a.header},Tt.query.type!=="exercises"&&n.a.createElement("div",null,n.a.createElement("img",{src:"".concat(c.a.IMG_SERVER,"/images/").concat(Kn.image_url),alt:"user",width:30}),n.a.createElement("span",null,Kn.name)),n.a.createElement("h2",{className:"flex-wrp flex_box_column flex_box_center"},n.a.createElement("div",null,Ht.name),(Ht==null?void 0:Ht.is_program)&&n.a.createElement(Fn.a,{defaultValue:Ht==null?void 0:Ht.answer_long_time,onChange:function(Bt){console.log(Bt),Gi.current=Bt},className:"font12 c-grey-999"})),Kn.hack_manager?n.a.createElement(A.a,{className:$.a.btn_back,to:(Tt==null||((ee=Tt.query)===null||ee===void 0)?void 0:ee.type)==="1"?"/problems/".concat(Ht.identifier,"/edit?type=1"):"/problems/".concat(Ht.identifier,"/edit"),style:{marginRight:10}}," ",n.a.createElement(O.a,null)," \u7F16\u8F91"):null,(pt==null||((X=pt.exercise)===null||X===void 0)?void 0:X.left_time)&&n.a.createElement(n.a.Fragment,null,n.a.createElement("span",{style:{color:_n},className:"iconfont icon-kaoshishichang mr5"}),n.a.createElement("span",{className:"c-white mr20"},n.a.createElement(li,{valueStyle:{color:_n,fontSize:16,fontWeight:"normal"},title:n.a.createElement("span",{style:{color:_n,fontSize:16}},"\u5269\u4F59\u65F6\u95F4\uFF1A"),value:mn,onFinish:Object(D.a)(r.a.mark(function on(){var Bt,an;return r.a.wrap(function(fn){for(;;)switch(fn.prev=fn.next){case 0:return fn.next=2,Object(b.Z)({categoryId:Tt.query.exercisesId,commit_method:2});case 2:Bt=fn.sent,(Bt==null?void 0:Bt.status)===0&&(rn(),g.a.info({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",content:n.a.createElement("div",{className:"tc font16"},"\u7B54\u9898\u7ED3\u675F\u4E86\uFF0C\u7CFB\u7EDF\u5DF2\u81EA\u52A8\u63D0\u4EA4\u8BD5\u5377",n.a.createElement("br",null),"\u4E0D\u80FD\u518D\u4FEE\u6539\u7B54\u9898"),onOk:function(){var Pn=Object(D.a)(r.a.mark(function Si(){return r.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:window.parent.location.href="/classrooms/".concat(Tt.query.coursesId,"/exercise/").concat(Tt.query.exercisesId,"/detail");case 1:case"end":return vn.stop()}},Si)}));function ei(){return Pn.apply(this,arguments)}return ei}()})),(Bt==null?void 0:Bt.status)===-3&&(an=parseInt(Bt==null?void 0:Bt.message),zt(Date.now()+an*1e3));case 5:case"end":return fn.stop()}},on)}))}))),(Tt==null||((ye=Tt.query)===null||ye===void 0)?void 0:ye.type)==="exercises"?n.a.createElement(F.a,{type:"primary",onClick:function(){rn(),g.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:n.a.createElement("div",{className:"tc"},"\u8BF7\u786E\u8BA4\u4F60\u7684\u7B54\u9898\u5185\u5BB9\u5DF2\u7ECF\u63D0\u4EA4\uFF1F"),onOk:function(){Ft()}})}},n.a.createElement("span",{className:"iconfont icon-yiguanbi mr5 font14"})," \u8FD4\u56DE\u8BD5\u5377"):n.a.createElement("span",{className:$.a.btn_back,onClick:function(){var Bt;if((Tt==null||((Bt=Tt.query)===null||Bt===void 0)?void 0:Bt.type)==="1"){var an,Pt=(an=localStorage.getItem("program_homework"))===null||an===void 0?void 0:an.split(",");Jt.push("/classrooms/".concat(Pt==null?void 0:Pt[0],"/program_homework/").concat(Pt==null?void 0:Pt[1],"/detail"))}else Jt.push("/problemset")}}," ",n.a.createElement(S.a,null),"\u9000\u51FA")),n.a.createElement(L.a,{size:"large",spinning:sn},n.a.createElement(p.a,{className:"my-problems",leftChild:n.a.createElement(en,Tr),rightChild:n.a.createElement(w,Qi)}))):null,n.a.createElement(g.a,{centered:!0,closable:!1,width:680,footer:null,visible:Vi,className:"oj-modal"},n.a.createElement("section",{className:"oj-modal-content"},n.a.createElement("div",{className:"oj-modal-head"},n.a.createElement("img",{src:Rn.a,alt:""}),n.a.createElement("i",{onClick:function(){return Ni(!1)},className:"iconfont icon-guanbi1"})),n.a.createElement("aside",null,n.a.createElement("img",{className:"mr30",src:Bn.a}),"\u8FD0\u884C\u65F6\u95F4:\xA0",n.a.createElement("span",{style:{color:"#75d6ba",marginRight:100}},Gt==null?void 0:Gt.execute_time,"ms"),"\u4F18\u4E8E",n.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(Gt==null?void 0:Gt.time_better_than)||100,"%"),"\u7684\u7528\u6237"),n.a.createElement("aside",{className:"mb50"},n.a.createElement("img",{src:Qt.a,className:"mr30"}),n.a.createElement("span",{className:"oj-modal-tt"},n.a.createElement("span",null,n.a.createElement("span",null,"\u5360\u7528\u5185\u5B58:\xA0"),n.a.createElement("span",{className:"c-light-primary"},Gt==null?void 0:Gt.execute_memory,"kb")),n.a.createElement("span",null,n.a.createElement("span",null))),"\u4F18\u4E8E",n.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(Gt==null?void 0:Gt.memory_better_than)||100,"%"),"\u7684\u7528\u6237"),n.a.createElement("div",{id:"oj-modal-next",onClick:Object(D.a)(r.a.mark(function on(){var Bt,an,Pt;return r.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:if(!(Gt!=null&&Gt.next_identifier)){Pn.next=7;break}return Pn.next=3,Object(vt.a)("/api/problems/".concat(Gt==null?void 0:Gt.next_identifier,"/start.json"),{method:"get",params:{hack_user_id:Kn==null?void 0:Kn.user_id}});case 3:Bt=Pn.sent,Bt&&(Jt.replace("/myproblems/".concat(Bt==null?void 0:Bt.identifier,"?type=1")),window.location.reload()),Pn.next=9;break;case 7:Pt=(an=localStorage.getItem("program_homework"))===null||an===void 0?void 0:an.split(","),Jt.push("/classrooms/".concat(Pt==null?void 0:Pt[0],"/program_homework/").concat(Pt==null?void 0:Pt[1],"/detail"));case 9:case"end":return Pn.stop()}},on)})),className:"oj-modal-btn"},Gt!=null&&Gt.next_identifier?"\u8FDB\u5165\u4E0B\u4E00\u9898":"\u56DE\u5230\u4F5C\u4E1A\u8BE6\u60C5\u9875")))))};function J(T){var j,ee=T.title,X=T.modify_code,ye=T.onSyncCode,Ve=T.onShowCodeSetting,ot=T.onResetCode,ht=T.hack,Ue=T.onChangeLanguage,mt=function(){g.a.confirm({title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",icon:n.a.createElement(E.a,null),content:"\u4F60\u5728\u672C\u6587\u4EF6\u4E2D\u4FEE\u6539\u7684\u5185\u5BB9\u5C06\u4E22\u5931\uFF0C\u662F\u5426\u786E\u5B9A\u91CD\u65B0\u52A0\u8F7D\u521D\u59CB\u4EE3\u7801\uFF1F",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:ot})};return console.log(ht,"hack"),n.a.createElement("div",{className:"action-bar",style:{paddingLeft:0}},(ht==null?void 0:ht.is_program)&&n.a.createElement(z.a,{className:"oj-select",value:ht==null?void 0:ht.language,style:{width:100},placeholder:"\u9009\u62E9\u8BED\u8A00",onChange:Ue},ht==null||((j=ht.all_language)===null||j===void 0)?void 0:j.map(function(Rt){return n.a.createElement(z.a.Option,{key:Rt,value:Rt},Rt)})),n.a.createElement("span",null),X?n.a.createElement("a",{title:"\u66F4\u65B0\u901A\u77E5",onClick:ye},n.a.createElement("img",{src:P.a,alt:"notice"})):null,n.a.createElement("a",{title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",onClick:mt},n.a.createElement("i",{className:"iconfont icon-zhongzhi font-20 "})),n.a.createElement("a",{onClick:Ve},n.a.createElement("i",{className:"iconfont icon-shezhi"})))}function w(T){var j=T.input,ee=T.showNote,X=T.onShowNote,ye=T.notes,Ve=T.onCancelNote,ot=T.onAddNote,ht=T.debugResult,Ue=T.language,mt=T.debuging,Rt=T.submitting,Mt=T.executingMessage,Jt=T.code,Tt=T.onSubmitCode,qt=T.onDebugCode,Zt=T.onChangeCode,Mn=T.onChangeInput,Gt=T.onUpdateCode,wn=T.user,On=T.isLoading,Ln=Object(V.a)(T,["input","showNote","onShowNote","notes","onCancelNote","onAddNote","debugResult","language","debuging","submitting","executingMessage","code","onSubmitCode","onDebugCode","onChangeCode","onChangeInput","onUpdateCode","user","isLoading"]);function xn(Hn){return n.a.createElement(J,Object(q.a)({},Ln,{onShowCodeSetting:Hn}))}var In=Object(u.a)({input:j,debugResult:ht,debuging:mt,submitting:Rt,executingMessage:Mt,onDebugCode:qt,onChangeCode:Zt,onSubmitCode:Tt,onChangeInput:Mn,user:wn},Ln);return n.a.createElement("div",{className:"right-panel"},n.a.createElement(y.a,{isLoading:On,language:Ue,value:Jt,onChange:Zt,ActionBarRender:xn}),n.a.createElement("div",{className:"note-form-area ".concat(ee?"active":"")},n.a.createElement(Ee,{onCancel:Ve,notes:ye,callback:ot})),n.a.createElement(R.b,In))}},RELg:function(Fe,Se,W){var q=W("MFOe"),V=q.Global;Fe.exports={name:"oldIE-userDataStorage",write:H,read:F,each:D,remove:I,clearAll:g};var M="storejs",z=V.document,U=d(),L=(V.navigator?V.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function H(s,l){if(L)return;var r=u(s);U(function(a){a.setAttribute(r,l),a.save(M)})}function F(s){if(L)return;var l=u(s),r=null;return U(function(a){r=a.getAttribute(l)}),r}function D(s){U(function(l){for(var r=l.XMLDocument.documentElement.attributes,a=r.length-1;a>=0;a--){var n=r[a];s(l.getAttribute(n.name),n.name)}})}function I(s){var l=u(s);U(function(r){r.removeAttribute(l),r.save(M)})}function g(){U(function(s){var l=s.XMLDocument.documentElement.attributes;s.load(M);for(var r=l.length-1;r>=0;r--)s.removeAttribute(l[r].name);s.save(M)})}var f=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function u(s){return s.replace(/^\d/,"___$&").replace(f,"___")}function d(){if(!z||!z.documentElement||!z.documentElement.addBehavior)return null;var s="script",l,r,a;try{r=new ActiveXObject("htmlfile"),r.open(),r.write("<"+s+">document.w=window'),r.close(),l=r.w.frames[0].document,a=l.createElement("div")}catch(n){a=z.createElement("div"),l=z.body}return function(n){var h=[].slice.call(arguments,0);h.unshift(a),l.appendChild(a),a.addBehavior("#default#userData"),a.load(M),n.apply(this,h),l.removeChild(a);return}}},"S+dL":function(Fe,Se){Fe.exports="data:image/gif;base64,R0lGODlhFAAQAOZVAD6Q33p6ezZto2VnaW5vcDuCxiYvNysvM1tdXzNij5eXlyg0QTA0OExOUWZnaS8zN19hYzFYf0Oi/Sg1QoeHh2JjZWZoaTdzrTRmljl5tzFZgDBWez6P3Tl4tjl8uzdxqWBiYys/VCUqL39/gHV2dy4yNScyPDJeiEpNTzk8P0CX6jc7PiYuNWlqaywwNDZtojAzNytDWScrLitAVUGb8Xl6eoWFhTp+wDNgjWRmZ4+QkFdZWzo9QIODgyo/Uzh3syg0QCczPmprbTRllW9wcSotMVJUVjZupDuEylBSVUGb8kxPUZGRkTd0rUGc82JkZUKe9j2M1zg7P4iIiEOj/yUpLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6N0U3Nzk1NkY5QkRGMTFFQUIzQzFDQjY5MEVFODZDMDciIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6N0U3Nzk1NzA5QkRGMTFFQUIzQzFDQjY5MEVFODZDMDciPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3RTc3OTU2RDlCREYxMUVBQjNDMUNCNjkwRUU4NkMwNyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3RTc3OTU2RTlCREYxMUVBQjNDMUNCNjkwRUU4NkMwNyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAUyAFUALAAAAAAUABAAAAd5gFWCg4RSLoSIiVUPFlNEhAwDCIoyST1TUwGCBwM6AweJPCSYmJpVCAMMgykgFRUtFKSlilVCsreZtAS4sqaJu7yzisDBvhAKyBDEvL6Iy7jNhA7BwoklKA0NRiO30bRFOzakpqiqtItPsTWbA0wWoOcrOUuEMA6TgQAh+QQFMgBVACwAAAAAFAAQAAAHeIBVgoOEISaEiIlVExlUSIQLAgmKIidOVFQAggYCNAIGiTFRmJiaVQkCC4MzHxcXHhKkpYpVN7K3mbQFuLKmibu8s4rAwb4YpBjEvL6IyrjMhB3BwolBGxEROCq30LQsQ1CkpqiqtItNsRybAkpHoOY+PxqEQC+TgQA7"},"S/kP":function(Fe,Se,W){Fe.exports=W.p+"static/time.a3dc82f3.svg"},"SA+Z":function(Fe,Se,W){var q=W("wTVA"),V=W("EbDI"),M=W("ZhPi"),z=W("wkBT");function U(L){return q(L)||V(L)||M(L)||z()}Fe.exports=U,Fe.exports.__esModule=!0,Fe.exports.default=Fe.exports},SJMd:function(Fe,Se){/** * @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 W,q,V,M=!1,z,U;window.PR_SHOULD_USE_CONTINUATION=!0;var L,H;(function(){var F=window,D=["break,continue,do,else,for,if,return,while"],I=[D,"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"],g=[I,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],f=[g,"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=[g,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],d=[g,"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=[g,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],r="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",a=[D,"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=[D,"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"],h=[D,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],O=[f,d,u,l,r,a,n,h],S=/^(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",A="kwd",C="com",b="typ",v="lit",p="pun",c="pln",E="tag",y="dec",_="src",P="atn",N="atv",K="nocode",$="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function B(He){for(var $e=0,Qe=!1,gt=!1,et=0,tt=He.length;et122||(re<65||ce>90||Ge.push([Math.max(65,ce)|32,Math.min(re,90)|32]),re<97||ce>122||Ge.push([Math.max(97,ce)&~32,Math.min(re,122)&~32]))}}Ge.sort(function(be,Ie){return be[0]-Ie[0]||Ie[1]-be[1]});for(var ae=[],ue=[],je=0;jefe[0]&&(fe[1]+1>fe[0]&&Re.push("-"),Re.push(Et(fe[1])))}return Re.push("]"),Re.join("")}function kt(Ae){for(var Ce=Ae.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")),Ge=Ce.length,ze=[],Re=0,je=0;Re=2&&ce==="["?Ce[Re]=xt(ge):ce!=="\\"&&(Ce[Re]=ge.replace(/[a-zA-Z]/g,function(ue){var fe=ue.charCodeAt(0);return"["+String.fromCharCode(fe&~32,fe|32)+"]"}))}return Ce.join("")}for(var Ot=[],et=0,tt=He.length;et=0;)Qe[Ot.charAt(Ae)]=kt;var Ce=kt[1],Ge=""+Ce;wt.hasOwnProperty(Ge)||(vt.push(Ce),wt[Ge]=null)}vt.push(/[\0-\uffff]/),gt=B(vt)})();var et=$e.length,tt=function(Je){for(var vt=Je.sourceCode,wt=Je.basePos,Et=Je.sourceNode,xt=[wt,c],kt=0,Ot=vt.match(gt)||[],Ae={},Ce=0,Ge=Ot.length;Ce=5&&Re.substring(0,5)==="lang-",ge&&!(je&&typeof je[1]=="string")&&(ge=!1,Re=_),ge||(Ae[ze]=Re)}var re=kt;if(kt+=ze.length,!ge)xt.push(wt+re,Re);else{var ae=je[1],ue=ze.indexOf(ae),fe=ue+ae.length;je[2]&&(fe=ze.length-je[2].length,ue=fe-ae.length);var be=Re.substring(5);G(Et,wt+re,ze.substring(0,ue),tt,xt),G(Et,wt+re+ue,ae,oe(be,ae),xt),G(Et,wt+re+fe,ze.substring(fe),tt,xt)}}Je.decorations=xt};return tt}function _e(He){var $e=[],Qe=[];He.tripleQuotedStrings?$e.push([x,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):He.multiLineStrings?$e.push([x,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):$e.push([x,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),He.verbatimStrings&&Qe.push([x,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var gt=He.hashComments;gt&&(He.cStyleComments?(gt>1?$e.push([C,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):$e.push([C,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Qe.push([x,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):$e.push([C,/^#[^\r\n]*/,null,"#"])),He.cStyleComments&&(Qe.push([C,/^\/\/[^\r\n]*/,null]),Qe.push([C,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var et=He.regexLiterals;if(et){var tt=et>1?"":` \r`,Je=tt?".":"[\\S\\s]",vt="/(?=[^/*"+tt+"])(?:[^/\\x5B\\x5C"+tt+"]|\\x5C"+Je+"|\\x5B(?:[^\\x5C\\x5D"+tt+"]|\\x5C"+Je+")*(?:\\x5D|$))+/";Qe.push(["lang-regex",RegExp("^"+$+"("+vt+")")])}var wt=He.types;wt&&Qe.push([b,wt]);var Et=(""+He.keywords).replace(/^ | $/g,"");Et.length&&Qe.push([A,new RegExp("^(?:"+Et.replace(/[\s,]+/g,"|")+")\\b"),null]),$e.push([c,/^\s+/,null,` \r \xA0`]);var xt="^.[^\\s\\w.$@'\"`/\\\\]*";return He.regexLiterals&&(xt+="(?!s*/)"),Qe.push([v,/^@[a-z_$][a-z_$@0-9]*/i,null],[b,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[c,/^[a-z_$][a-z_$@0-9]*/i,null],[v,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[c,/^\\[\s\S]?/,null],[p,new RegExp(xt),null]),le($e,Qe)}var pe=_e({keywords:O,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ee(He,$e,Qe){for(var gt=/(?:^|\s)nocode(?:\s|$)/,et=/\r\n?|\n/,tt=He.ownerDocument,Je=tt.createElement("li");He.firstChild;)Je.appendChild(He.firstChild);var vt=[Je];function wt(Ce){var Ge=Ce.nodeType;if(Ge==1&&!gt.test(Ce.className))if(Ce.nodeName==="br")Et(Ce),Ce.parentNode&&Ce.parentNode.removeChild(Ce);else for(var ze=Ce.firstChild;ze;ze=ze.nextSibling)wt(ze);else if((Ge==3||Ge==4)&&Qe){var Re=Ce.nodeValue,je=Re.match(et);if(je){var ge=Re.substring(0,je.index);Ce.nodeValue=ge;var de=Re.substring(je.index+je[0].length);if(de){var ce=Ce.parentNode;ce.insertBefore(tt.createTextNode(de),Ce.nextSibling)}Et(Ce),ge||Ce.parentNode.removeChild(Ce)}}}function Et(Ce){for(;!Ce.nextSibling;)if(Ce=Ce.parentNode,!Ce)return;function Ge(je,ge){var de=ge?je.cloneNode(!1):je,ce=je.parentNode;if(ce){var re=Ge(ce,1),ae=je.nextSibling;re.appendChild(de);for(var ue=ae;ue;ue=ae)ae=ue.nextSibling,re.appendChild(ue)}return de}for(var ze=Ge(Ce.nextSibling,0),Re;(Re=ze.parentNode)&&Re.nodeType===1;)ze=Re;vt.push(ze)}for(var xt=0;xt=ce&&(wt+=2),tt>=re&&(kt+=2)}}finally{Re&&(Re.style.display=je)}}var we={};function he(He,$e){for(var Qe=$e.length;--Qe>=0;){var gt=$e[Qe];we.hasOwnProperty(gt)?F.console&&console.warn("cannot override language handler %s",gt):we[gt]=He}}function oe(He,$e){return He&&we.hasOwnProperty(He)||(He=/^\s*]*(?:>|$)/],[C,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[p,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),he(le([[c,/^[\s]+/,null,` \r `],[N,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[E,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[p,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),he(le([],[[N,/^[\s\S]+/]]),["uq.val"]),he(_e({keywords:f,hashComments:!0,cStyleComments:!0,types:S}),["c","cc","cpp","cxx","cyc","m"]),he(_e({keywords:"null,true,false"}),["json"]),he(_e({keywords:d,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:S}),["cs"]),he(_e({keywords:u,cStyleComments:!0}),["java"]),he(_e({keywords:h,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),he(_e({keywords:a,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),he(_e({keywords:r,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),he(_e({keywords:n,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),he(_e({keywords:l,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),he(_e({keywords:s,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),he(le([],[[x,/^[\s\S]+/]]),["regex"]);function Le(He){var $e=He.langExtension;try{var Qe=R(He.sourceNode,He.pre),gt=Qe.sourceCode;He.sourceCode=gt,He.spans=Qe.spans,He.basePos=0,oe($e,gt)(He),Oe(He)}catch(et){F.console&&console.log(et&&et.stack||et)}}function Ye(He,$e,Qe){var gt=Qe||!1,et=$e||null,tt=document.createElement("div");tt.innerHTML="
    "+He+"
    ",tt=tt.firstChild,gt&&Ee(tt,gt,!0);var Je={langExtension:et,numberLines:gt,sourceNode:tt,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Le(Je),tt.innerHTML}function nt(He,$e){var Qe=$e||document.body,gt=Qe.ownerDocument||document;function et(de){return Qe.getElementsByTagName(de)}for(var tt=[et("pre"),et("code"),et("xmp")],Je=[],vt=0;vt=0;d--)if(this.__items[d].match(u))return!0;return!1},I.prototype.set_indent=function(u,d){this.is_empty()&&(this.__indent_count=u||0,this.__alignment_count=d||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 d=u.lastIndexOf(` `);d!==-1?this.__character_count=u.length-d: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 g(u,d){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)),d=d||"",u.indent_level>0&&(d=new Array(u.indent_level+1).join(this.__indent_string)),this.__base_string=d,this.__base_string_length=d.length}g.prototype.get_indent_size=function(u,d){var s=this.__base_string_length;return d=d||0,u<0&&(s=0),s+=u*this.__indent_size,s+=d,s},g.prototype.get_indent_string=function(u,d){var s=this.__base_string;return d=d||0,u<0&&(u=0,s=""),d+=u*this.__indent_size,this.__ensure_cache(d),s+=this.__cache[d],s},g.prototype.__ensure_cache=function(u){for(;u>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var u=this.__cache.length,d=0,s="";this.__indent_size&&u>=this.__indent_size&&(d=Math.floor(u/this.__indent_size),u-=d*this.__indent_size,s=new Array(d+1).join(this.__indent_string)),u&&(s+=new Array(u+1).join(" ")),this.__cache.push(s)};function f(u,d){this.__indent_cache=new g(u,d),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()}f.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},f.prototype.get_line_number=function(){return this.__lines.length},f.prototype.get_indent_string=function(u,d){return this.__indent_cache.get_indent_string(u,d)},f.prototype.get_indent_size=function(u,d){return this.__indent_cache.get_indent_size(u,d)},f.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},f.prototype.add_new_line=function(u){return this.is_empty()||!u&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},f.prototype.get_code=function(u){this.trim(!0);var d=this.current_line.pop();d&&(d[d.length-1]===` `&&(d=d.replace(/\n+$/g,"")),this.current_line.push(d)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(` `);return u!==` `&&(s=s.replace(/[\n]/g,u)),s},f.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},f.prototype.set_indent=function(u,d){return u=u||0,d=d||0,this.next_line.set_indent(u,d),this.__lines.length>1?(this.current_line.set_indent(u,d),!0):(this.current_line.set_indent(),!1)},f.prototype.add_raw_token=function(u){for(var d=0;d1&&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},f.prototype.just_added_newline=function(){return this.current_line.is_empty()},f.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},f.prototype.ensure_empty_line_above=function(u,d){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)!==d){this.__lines.splice(s+1,0,new I(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},D.exports.Output=f},,,,function(D){function I(u,d){this.raw_options=g(u,d),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}I.prototype._get_array=function(u,d){var s=this.raw_options[u],l=d||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(l=s.concat()):typeof s=="string"&&(l=s.split(/[^a-zA-Z0-9_\/\-]+/)),l},I.prototype._get_boolean=function(u,d){var s=this.raw_options[u],l=s===void 0?!!d:!!s;return l},I.prototype._get_characters=function(u,d){var s=this.raw_options[u],l=d||"";return typeof s=="string"&&(l=s.replace(/\\r/,"\r").replace(/\\n/,` `).replace(/\\t/," ")),l},I.prototype._get_number=function(u,d){var s=this.raw_options[u];d=parseInt(d,10),isNaN(d)&&(d=0);var l=parseInt(s,10);return isNaN(l)&&(l=d),l},I.prototype._get_selection=function(u,d,s){var l=this._get_selection_list(u,d,s);if(l.length!==1)throw new Error("Invalid Option Value: The option '"+u+`' can only be one of the following values: `+d+` You passed in: '`+this.raw_options[u]+"'");return l[0]},I.prototype._get_selection_list=function(u,d,s){if(!d||d.length===0)throw new Error("Selection list cannot be empty.");if(s=s||[d[0]],!this._is_valid_selection(s,d))throw new Error("Invalid Default Value!");var l=this._get_array(u,s);if(!this._is_valid_selection(l,d))throw new Error("Invalid Option Value: The option '"+u+`' can contain only the following values: `+d+` You passed in: '`+this.raw_options[u]+"'");return l},I.prototype._is_valid_selection=function(u,d){return u.length&&d.length&&!u.some(function(s){return d.indexOf(s)===-1})};function g(u,d){var s={};u=f(u);var l;for(l in u)l!==d&&(s[l]=u[l]);if(d&&u[d])for(l in u[d])s[l]=u[d][l];return s}function f(u){var d={},s;for(s in u){var l=s.replace(/-/g,"_");d[l]=u[s]}return d}D.exports.Options=I,D.exports.normalizeOpts=f,D.exports.mergeOpts=g},,function(D){var I=RegExp.prototype.hasOwnProperty("sticky");function g(f){this.__input=f||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position=0&&f=0&&u=f.length&&this.__input.substring(u-f.length,u).toLowerCase()===f},D.exports.InputScanner=g},,,,,function(D){function I(g,f){g=typeof g=="string"?g:g.source,f=typeof f=="string"?f:f.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+f,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+f,"g")}I.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var f={};this.__directive_pattern.lastIndex=0;for(var u=this.__directive_pattern.exec(g);u;)f[u[1]]=u[2],u=this.__directive_pattern.exec(g);return f},I.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},D.exports.Directives=I},,function(D,I,g){var f=g(16).Beautifier,u=g(17).Options;function d(s,l){var r=new f(s,l);return r.beautify()}D.exports=d,D.exports.defaultOptions=function(){return new u}},function(D,I,g){var f=g(17).Options,u=g(2).Output,d=g(8).InputScanner,s=g(13).Directives,l=new s(/\/\*/,/\*\//),r=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,n=/\s/,h=/(?:\s|\n)+/g,O=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,S=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function x(A,C){this._source_text=A||"",this._options=new f(C),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}x.prototype.eatString=function(A){var C="";for(this._ch=this._input.next();this._ch;){if(C+=this._ch,this._ch==="\\")C+=this._input.next();else if(A.indexOf(this._ch)!==-1||this._ch===` `)break;this._ch=this._input.next()}return C},x.prototype.eatWhitespace=function(A){for(var C=n.test(this._input.peek()),b=0;n.test(this._input.peek());)this._ch=this._input.next(),A&&this._ch===` `&&((b===0||b0&&this._indentLevel--},x.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var A=this._source_text,C=this._options.eol;C==="auto"&&(C=` `,A&&r.test(A||"")&&(C=A.match(r)[0])),A=A.replace(a,` `);var b=A.match(/^[\t ]*/)[0];this._output=new u(this._options,b),this._input=new d(A),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var v=0,p=!1,c=!1,E=!1,y=!1,_=!1,P=!1,N=this._ch,K=!1,$,B,R;$=this._input.read(h),B=$!=="",R=N,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),N=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var G=this._input.read(O),Q=l.get_directives(G);Q&&Q.ignore==="start"&&(G+=l.readIgnored(this._input)),this.print_string(G),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(S)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(B),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ne=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ne.match(/[ :]$/)&&(ne=this.eatString(": ").replace(/\s$/,""),this.print_string(ne),this._output.space_before_token=!0),ne=ne.replace(/\s$/,""),ne==="extend"?y=!0:ne==="import"&&(_=!0),ne in this.NESTED_AT_RULE?(this._nestedLevel+=1,ne in this.CONDITIONAL_GROUP_RULE&&(E=!0)):!p&&v===0&&ne.indexOf(":")!==-1&&(c=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(B),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")c&&(c=!1,this.outdent()),E?(E=!1,p=this._indentLevel>=this._nestedLevel):p=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&p&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(R==="("?this._output.space_before_token=!1:R!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),R==="{"&&this._output.trim(!0),_=!1,y=!1,c&&(this.outdent(),c=!1),this.print_string(this._ch),p=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&(this._input.peek()!=="}"&&this._output.add_new_line(!0)),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var le=0;le"||this._ch==="+"||this._ch==="~")&&!c&&v===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&n.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(B),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),n.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var Ee=R==='"'||R==="'";this.preserveSingleSpace(Ee||B),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===` `&&K&&this._output.add_new_line()}var Oe=this._output.get_code(C);return Oe},D.exports.Beautifier=x},function(D,I,g){var f=g(6).Options;function u(d){f.call(this,d,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var s=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||s;var l=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var r=0;r=15&&(f=!1,D=!0);var x=n&&(I||f&&(S==null||S<12.11)),A=M||H&&F>=9;function C(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var b=function(e,t){var o=e.className,i=C(t).exec(o);if(i){var m=o.slice(i.index+i[0].length);e.className=o.slice(0,i.index)+(m?i[1]+m:"")}};function v(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function p(e,t){return v(e).appendChild(t)}function c(e,t,o,i){var m=document.createElement(e);if(o&&(m.className=o),i&&(m.style.cssText=i),typeof t=="string")m.appendChild(document.createTextNode(t));else if(t)for(var k=0;k=t)return Y+(t-k);Y+=Z-k,Y+=o-Y%o,k=Z+1}}var Q=function(){this.id=null,this.f=null,this.time=0,this.handler=B(this.onTimeout,this)};Q.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Q.prototype.set=function(e,t){this.f=t;var o=+new Date+e;(!this.id||o=t)return i+Math.min(Y,t-m);if(m+=k-i,m+=o-m%o,i=k+1,m>=t)return i}}var he=[""];function oe(e){for(;he.length<=e;)he.push(Le(he)+" ");return he[e]}function Le(e){return e[e.length-1]}function Ye(e,t){for(var o=[],i=0;i"\x80"&&(e.toUpperCase()!=e.toLowerCase()||He.test(e))}function Qe(e,t){return t?t.source.indexOf("\\w")>-1&&$e(e)?!0:t.test(e):$e(e)}function gt(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var et=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function tt(e){return e.charCodeAt(0)>=768&&et.test(e)}function Je(e,t,o){for(;(o<0?t>0:to?-1:1;;){if(t==o)return t;var m=(t+o)/2,k=i<0?Math.ceil(m):Math.floor(m);if(k==t)return e(k)?t:o;e(k)?o=k:t=k+i}}function wt(e,t,o,i){if(!e)return i(t,o,"ltr",0);for(var m=!1,k=0;kt||t==o&&Y.to==t)&&(i(Math.max(Y.from,t),Math.min(Y.to,o),Y.level==1?"rtl":"ltr",k),m=!0)}m||i(t,o,"ltr")}var Et=null;function xt(e,t,o){var i;Et=null;for(var m=0;mt)return m;k.to==t&&(k.from!=k.to&&o=="before"?i=m:Et=m),k.from==t&&(k.from!=k.to&&o!="before"?i=m:Et=m)}return i!=null?i:Et}var kt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function o(ie){return ie<=247?e.charAt(ie):1424<=ie&&ie<=1524?"R":1536<=ie&&ie<=1785?t.charAt(ie-1536):1774<=ie&&ie<=2220?"r":8192<=ie&&ie<=8203?"w":ie==8204?"b":"L"}var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,m=/[stwN]/,k=/[LRr]/,Y=/[Lb1n]/,Z=/[1n]/;function te(ie,me,xe){this.level=ie,this.from=me,this.to=xe}return function(ie,me){var xe=me=="ltr"?"L":"R";if(ie.length==0||me=="ltr"&&!i.test(ie))return!1;for(var Ne=ie.length,De=[],Ze=0;Ze-1&&(i[t]=m.slice(0,k).concat(m.slice(k+1)))}}}function Re(e,t){var o=Ge(e,t);if(!o.length)return;for(var i=Array.prototype.slice.call(arguments,2),m=0;m0}function ce(e){e.prototype.on=function(t,o){Ce(this,t,o)},e.prototype.off=function(t,o){ze(this,t,o)}}function re(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ae(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ue(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function fe(e){re(e),ae(e)}function be(e){return e.target||e.srcElement}function Ie(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),n&&e.ctrlKey&&t==1&&(t=3),t}var Xe=function(){if(H&&F<9)return!1;var e=c("div");return"draggable"in e||"dragDrop"in e}(),ut;function bt(e){if(ut==null){var t=c("span","\u200B");p(e,c("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(ut=t.offsetWidth<=1&&t.offsetHeight>2&&!(H&&F<8))}var o=ut?c("span","\u200B"):c("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return o.setAttribute("cm-text",""),o}var ft;function at(e){if(ft!=null)return ft;var t=p(e,document.createTextNode("A\u062EA")),o=y(t,0,1).getBoundingClientRect(),i=y(t,1,2).getBoundingClientRect();return v(e),!o||o.left==o.right?!1:ft=i.right-o.right<3}var Be=` b`.split(/\n/).length!=3?function(e){for(var t=0,o=[],i=e.length;t<=i;){var m=e.indexOf(` `,t);m==-1&&(m=e.length);var k=e.slice(t,e.charAt(m-1)=="\r"?m-1:m),Y=k.indexOf("\r");Y!=-1?(o.push(k.slice(0,Y)),t+=Y+1):(o.push(k),t=m+1)}return o}:function(e){return e.split(/\r\n?|\n/)},We=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(o){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Me=function(){var e=c("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),se=null;function ve(e){if(se!=null)return se;var t=p(e,c("span","x")),o=t.getBoundingClientRect(),i=y(t,0,1).getBoundingClientRect();return se=Math.abs(o.left-i.left)>1}var Ke={},Pe={};function st(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ke[e]=t}function dt(e,t){Pe[e]=t}function Te(e){if(typeof e=="string"&&Pe.hasOwnProperty(e))e=Pe[e];else if(e&&typeof e.name=="string"&&Pe.hasOwnProperty(e.name)){var t=Pe[e.name];typeof t=="string"&&(t={name:t}),e=it(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Te("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Te("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function ke(e,t){t=Te(t);var o=Ke[t.name];if(!o)return ke(e,"text/plain");var i=o(e,t);if(rt.hasOwnProperty(t.name)){var m=rt[t.name];for(var k in m){if(!m.hasOwnProperty(k))continue;i.hasOwnProperty(k)&&(i["_"+k]=i[k]),i[k]=m[k]}}if(i.name=t.name,t.helperType&&(i.helperType=t.helperType),t.modeProps)for(var Y in t.modeProps)i[Y]=t.modeProps[Y];return i}var rt={};function Ct(e,t){var o=rt.hasOwnProperty(e)?rt[e]:rt[e]={};R(t,o)}function At(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var o={};for(var i in t){var m=t[i];m instanceof Array&&(m=m.concat([])),o[i]=m}return o}function cn(e,t){for(var o;e.innerMode&&!(o=e.innerMode(t),!o||o.mode==e);)t=o.state,e=o.mode;return o||{mode:e,state:t}}function yn(e,t,o){return e.startState?e.startState(t,o):!0}var en=function(e,t,o){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=o};en.prototype.eol=function(){return this.pos>=this.string.length},en.prototype.sol=function(){return this.pos==this.lineStart},en.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},en.prototype.next=function(){if(this.post},en.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},en.prototype.skipToEnd=function(){this.pos=this.string.length},en.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},en.prototype.backUp=function(e){this.pos-=e},en.prototype.column=function(){return this.lastColumnPos0?null:(k&&t!==!1&&(this.pos+=k[0].length),k)}},en.prototype.current=function(){return this.string.slice(this.start,this.pos)},en.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},en.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},en.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Dt(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var o=e;!o.lines;)for(var i=0;;++i){var m=o.children[i],k=m.chunkSize();if(t=e.first&&to?ct(o,Dt(e,o).text.length):T(t,Dt(e,t.line).text.length)}function T(e,t){var o=e.ch;return o==null||o>t?ct(e.line,t):o<0?ct(e.line,0):e}function j(e,t){for(var o=[],i=0;ithis.maxLookAhead&&(this.maxLookAhead=e),t},X.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},X.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},X.fromSaved=function(e,t,o){return t instanceof ee?new X(e,At(e.mode,t.state),o,t.lookAhead):new X(e,At(e.mode,t),o)},X.prototype.save=function(e){var t=e!==!1?At(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ee(t,this.maxLookAhead):t};function ye(e,t,o,i){var m=[e.state.modeGen],k={};Tt(e,t.text,e.doc.mode,o,function(ie,me){return m.push(ie,me)},k,i);for(var Y=o.state,Z=function(ie){o.baseTokens=m;var me=e.state.overlays[ie],xe=1,Ne=0;o.state=!0,Tt(e,t.text,me.mode,o,function(De,Ze){for(var lt=xe;NeDe&&m.splice(xe,1,De,m[xe+1],_t),xe+=2,Ne=Math.min(De,_t)}if(!Ze)return;if(me.opaque)m.splice(lt,xe-lt,De,"overlay "+Ze),xe=lt+2;else for(;lte.options.maxHighlightLength&&At(e.doc.mode,i.state),k=ye(e,t,i);m&&(i.state=m),t.stateAfter=i.save(!m),t.styles=k.styles,k.classes?t.styleClasses=k.classes:t.styleClasses&&(t.styleClasses=null),o===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function ot(e,t,o){var i=e.doc,m=e.display;if(!i.mode.startState)return new X(i,!0,t);var k=qt(e,t,o),Y=k>i.first&&Dt(i,k-1).stateAfter,Z=Y?X.fromSaved(i,Y,k):new X(i,yn(i.mode),k);return i.iter(k,t,function(te){ht(e,te.text,Z);var ie=Z.line;te.stateAfter=ie==t-1||ie%5==0||ie>=m.viewFrom&&iet.start)return k}throw new Error("Mode "+e.name+" failed to advance stream.")}var Rt=function(e,t,o){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=o};function Mt(e,t,o,i){var m=e.doc,k=m.mode,Y;t=w(m,t);var Z=Dt(m,t.line),te=ot(e,t.line,o),ie=new en(Z.text,e.options.tabSize,te),me;for(i&&(me=[]);(i||ie.pose.options.maxHighlightLength?(Z=!1,Y&&ht(e,t,i,me.pos),me.pos=t.length,xe=null):xe=Jt(mt(o,me,i.state,Ne),k),Ne){var De=Ne[0].name;De&&(xe="m-"+(xe?De+" "+xe:De))}if(!Z||ie!=xe){for(;teY;--Z){if(Z<=k.first)return k.first;var te=Dt(k,Z-1),ie=te.stateAfter;if(ie&&(!o||Z+(ie instanceof ee?ie.lookAhead:0)<=k.modeFrontier))return Z;var me=G(te.text,null,e.options.tabSize);(m==null||i>me)&&(m=Z-1,i=me)}return m}function Zt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontiero;i--){var m=Dt(e,i).stateAfter;if(m&&(!(m instanceof ee)||i+m.lookAhead=t:k.to>t);(i||(i=[])).push(new Ln(Y,k.from,te?null:k.to))}}return i}function Vn(e,t,o){var i;if(e)for(var m=0;m=t:k.to>t);if(Z||k.from==t&&Y.type=="bookmark"&&(!o||k.marker.insertLeft)){var te=k.from==null||(Y.inclusiveLeft?k.from<=t:k.from0&&Z)for(var jt=0;jt0)continue;var me=[te,1],xe=St(ie.from,Z.from),Ne=St(ie.to,Z.to);(xe<0||!Y.inclusiveLeft&&!xe)&&me.push({from:ie.from,to:Z.from}),(Ne>0||!Y.inclusiveRight&&!Ne)&&me.push({from:Z.to,to:ie.to}),m.splice.apply(m,me),te+=me.length-3}return m}function pn(e){var t=e.markedSpans;if(!t)return;for(var o=0;ot)&&(!i||Wt(i,k.marker)<0)&&(i=k.marker)}return i}function sn(e,t,o,i,m){var k=Dt(e,t),Y=Gt&&k.markedSpans;if(Y)for(var Z=0;Z=0&&xe<=0||me<=0&&xe>=0)continue;if(me<=0&&(te.marker.inclusiveRight&&m.inclusiveLeft?St(ie.to,o)>=0:St(ie.to,o)>0)||me>=0&&(te.marker.inclusiveRight&&m.inclusiveLeft?St(ie.from,i)<=0:St(ie.from,i)<0))return!0}}function Zn(e){for(var t;t=$t(e);)e=t.find(-1,!0).line;return e}function Ki(e){for(var t;t=Nt(e);)e=t.find(1,!0).line;return e}function Ci(e){for(var t,o;t=Nt(e);)e=t.find(1,!0).line,(o||(o=[])).push(e);return o}function Vi(e,t){var o=Dt(e,t),i=Zn(o);return o==i?t:Qt(i)}function Ni(e,t){if(t>e.lastLine())return t;var o=Dt(e,t),i;if(!Ri(e,o))return t;for(;i=Nt(o);)o=i.find(1,!0).line;return Qt(o)+1}function Ri(e,t){var o=Gt&&t.markedSpans;if(o)for(var i=void 0,m=0;mt.maxLineLength&&(t.maxLineLength=m,t.maxLine=i)})}var _i=function(e,t,o){this.text=e,mn(this,t),this.height=o?o(this):1};_i.prototype.lineNo=function(){return Qt(this)},ce(_i);function nr(e,t,o,i){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),pn(e),mn(e,o);var m=i?i(e):1;m!=e.height&&Cn(e,m)}function Ft(e){e.parent=null,pn(e)}var Xt={},Kt={};function tn(e,t){if(!e||/^\s*$/.test(e))return null;var o=t.addModeClass?Kt:Xt;return o[e]||(o[e]=e.replace(/\S+/g,"cm-$&"))}function rn(e,t){var o=E("span",null,null,D?"padding-right: .1px":null),i={pre:E("pre",[o],"CodeMirror-line"),content:o,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var m=0;m<=(t.rest?t.rest.length:0);m++){var k=m?t.rest[m-1]:t.line,Y=void 0;i.pos=0,i.addToken=ln,at(e.display.measure)&&(Y=Ot(k,e.doc.direction))&&(i.addToken=ai(i.addToken,Y)),i.map=[];var Z=t!=e.display.externalMeasured&&Qt(k);bi(k,i,Ve(e,k,Z)),k.styleClasses&&(k.styleClasses.bgClass&&(i.bgClass=K(k.styleClasses.bgClass,i.bgClass||"")),k.styleClasses.textClass&&(i.textClass=K(k.styleClasses.textClass,i.textClass||""))),i.map.length==0&&i.map.push(0,0,i.content.appendChild(bt(e.display.measure))),m==0?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(D){var te=i.content.lastChild;(/\bcm-tab\b/.test(te.className)||te.querySelector&&te.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return Re(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=K(i.pre.className,i.textClass||"")),i}function Tn(e){var t=c("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ln(e,t,o,i,m,k,Y){if(!t)return;var Z=e.splitSpaces?Un(t,e.trailingSpace):t,te=e.cm.state.specialChars,ie=!1,me;if(!te.test(t))e.col+=t.length,me=document.createTextNode(Z),e.map.push(e.pos,e.pos+t.length,me),H&&F<9&&(ie=!0),e.pos+=t.length;else{me=document.createDocumentFragment();for(var xe=0;;){te.lastIndex=xe;var Ne=te.exec(t),De=Ne?Ne.index-xe:t.length-xe;if(De){var Ze=document.createTextNode(Z.slice(xe,xe+De));H&&F<9?me.appendChild(c("span",[Ze])):me.appendChild(Ze),e.map.push(e.pos,e.pos+De,Ze),e.col+=De,e.pos+=De}if(!Ne)break;xe+=De+1;var lt=void 0;if(Ne[0]==" "){var _t=e.cm.options.tabSize,Lt=_t-e.col%_t;lt=me.appendChild(c("span",oe(Lt),"cm-tab")),lt.setAttribute("role","presentation"),lt.setAttribute("cm-text"," "),e.col+=Lt}else Ne[0]=="\r"||Ne[0]==` `?(lt=me.appendChild(c("span",Ne[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),lt.setAttribute("cm-text",Ne[0]),e.col+=1):(lt=e.cm.options.specialCharPlaceholder(Ne[0]),lt.setAttribute("cm-text",Ne[0]),H&&F<9?me.appendChild(c("span",[lt])):me.appendChild(lt),e.col+=1);e.map.push(e.pos,e.pos+1,lt),e.pos++}}if(e.trailingSpace=Z.charCodeAt(t.length-1)==32,o||i||m||ie||k||Y){var Ut=o||"";i&&(Ut+=i),m&&(Ut+=m);var It=c("span",[me],Ut,k);if(Y)for(var jt in Y)Y.hasOwnProperty(jt)&&jt!="style"&&jt!="class"&&It.setAttribute(jt,Y[jt]);return e.content.appendChild(It)}e.content.appendChild(me)}function Un(e,t){if(e.length>1&&!/ /.test(e))return e;for(var o=t,i="",m=0;mie&&xe.from<=ie);Ne++);if(xe.to>=me)return e(o,i,m,k,Y,Z,te);e(o,i.slice(0,xe.to-ie),m,k,null,Z,te),k=null,i=i.slice(xe.to-ie),ie=xe.to}}}function nn(e,t,o,i){var m=!i&&o.widgetNode;m&&e.map.push(e.pos,e.pos+t,m),!i&&e.cm.display.input.needsContentAttribute&&(m||(m=e.content.appendChild(document.createElement("span"))),m.setAttribute("cm-marker",o.id)),m&&(e.cm.display.input.setUneditable(m),e.content.appendChild(m)),e.pos+=t,e.trailingSpace=!1}function bi(e,t,o){var i=e.markedSpans,m=e.text,k=0;if(!i){for(var Y=1;Yte||un.collapsed&&Vt.to==te&&Vt.from==te)){if(Vt.to!=null&&Vt.to!=te&&De>Vt.to&&(De=Vt.to,lt=""),un.className&&(Ze+=" "+un.className),un.css&&(Ne=(Ne?Ne+";":"")+un.css),un.startStyle&&Vt.from==te&&(_t+=" "+un.startStyle),un.endStyle&&Vt.to==De&&(jt||(jt=[])).push(un.endStyle,Vt.to),un.title&&((Ut||(Ut={})).title=un.title),un.attributes)for(var Nn in un.attributes)(Ut||(Ut={}))[Nn]=un.attributes[Nn];un.collapsed&&(!Lt||Wt(Lt.marker,un)<0)&&(Lt=Vt)}else Vt.from>te&&De>Vt.from&&(De=Vt.from)}if(jt)for(var hi=0;hi=Z)break;for(var ji=Math.min(Z,De);;){if(me){var Di=te+me.length;if(!Lt){var ni=Di>ji?me.slice(0,ji-te):me;t.addToken(t,ni,xe?xe+Ze:Ze,_t,te+ni.length==De?lt:"",Ne,Ut)}if(Di>=ji){me=me.slice(ji-te),te=ji;break}te=Di,_t=""}me=m.slice(k,k=o[ie++]),xe=tn(o[ie++],t.cm.options)}}}function bn(e,t,o){this.line=t,this.rest=Ci(t),this.size=this.rest?Qt(Le(this.rest))-o+1:1,this.node=this.text=null,this.hidden=Ri(e,t)}function Qn(e,t,o){for(var i=[],m,k=t;k2&&k.push((te.bottom+ie.top)/2-o.top)}}k.push(o.bottom-o.top)}}function zi(e,t,o){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var i=0;io)return{map:e.measure.maps[m],cache:e.measure.caches[m],before:!0}}function Cr(e,t){t=Zn(t);var o=Qt(t),i=e.display.externalMeasured=new bn(e.doc,t,o);i.lineN=o;var m=i.built=rn(e,i);return i.text=m.pre,p(e.display.lineMeasure,m.pre),i}function Bi(e,t,o,i){return er(e,Ei(e,t),o,i)}function da(e,t){if(t>=e.display.viewFrom&&t=o.lineN&&tt)&&(k=te-Z,m=k-1,t>=te&&(Y="right")),m!=null){if(i=e[ie+2],Z==te&&o==(i.insertLeft?"left":"right")&&(Y=o),o=="left"&&m==0)for(;ie&&e[ie-2]==e[ie-3]&&e[ie-1].insertLeft;)i=e[(ie-=3)+2],Y="left";if(o=="right"&&m==te-Z)for(;ie=0&&!((o=e[m]).left!=o.right);m--);return o}function Ws(e,t,o,i){var m=po(t.map,o,i),k=m.node,Y=m.start,Z=m.end,te=m.collapse,ie;if(k.nodeType==3){for(var me=0;me<4;me++){for(;Y&&tt(t.line.text.charAt(m.coverStart+Y));)--Y;for(;m.coverStart+Z0&&(te=i="right");var xe;e.options.lineWrapping&&(xe=k.getClientRects()).length>1?ie=xe[i=="right"?xe.length-1:0]:ie=k.getBoundingClientRect()}if(H&&F<9&&!Y&&(!ie||!ie.left&&!ie.right)){var Ne=k.parentNode.getClientRects()[0];Ne?ie={left:Ne.left,right:Ne.left+wr(e.display),top:Ne.top,bottom:Ne.bottom}:ie=fo}for(var De=ie.top-t.rect.top,Ze=ie.bottom-t.rect.top,lt=(De+Ze)/2,_t=t.view.measure.heights,Lt=0;Lt<_t.length-1&&!(lt<_t[Lt]);Lt++);var Ut=Lt?_t[Lt-1]:0,It=_t[Lt],jt={left:(te=="right"?ie.right:ie.left)-t.rect.left,right:(te=="left"?ie.left:ie.right)-t.rect.left,top:Ut,bottom:It};return!ie.left&&!ie.right&&(jt.bogus=!0),e.options.singleCursorHeightPerLine||(jt.rtop=De,jt.rbottom=Ze),jt}function Hs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!ve(e))return t;var o=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*o,right:t.right*o,top:t.top*i,bottom:t.bottom*i}}function mo(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t=i.text.length?(te=i.text.length,ie="before"):te<=0&&(te=0,ie="after"),!Z)return Y(ie=="before"?te-1:te,ie=="before");function me(Ze,lt,_t){var Lt=Z[lt],Ut=Lt.level==1;return Y(_t?Ze-1:Ze,Ut!=_t)}var xe=xt(Z,te,ie),Ne=Et,De=me(te,xe,ie=="before");return Ne!=null&&(De.other=me(te,Ne,ie!="before")),De}function bo(e,t){var o=0;t=w(e.doc,t),e.options.lineWrapping||(o=wr(e.display)*t.ch);var i=Dt(e.doc,t.line),m=Kn(i)+kn(e.display);return{left:o,right:o,top:m,bottom:m+i.height}}function Pa(e,t,o,i,m){var k=ct(e,t,o);return k.xRel=m,i&&(k.outside=i),k}function ka(e,t,o){var i=e.doc;if(o+=e.display.viewOffset,o<0)return Pa(i.first,0,null,-1,-1);var m=Sn(i,o),k=i.first+i.size-1;if(m>k)return Pa(i.first+i.size-1,Dt(i,k).text.length,null,1,1);t<0&&(t=0);for(var Y=Dt(i,m);;){var Z=Ks(e,Y,m,t,o),te=Xn(Y,Z.ch+(Z.xRel>0||Z.outside>0?1:0));if(!te)return Z;var ie=te.find(1);if(ie.line==m)return ie;Y=Dt(i,m=ie.line)}}function Eo(e,t,o,i){i-=Da(t);var m=t.text.length,k=vt(function(Y){return er(e,o,Y-1).bottom<=i},m,0);return m=vt(function(Y){return er(e,o,Y).top>i},k,m),{begin:k,end:m}}function xo(e,t,o,i){o||(o=Ei(e,t));var m=ca(e,t,er(e,o,i),"line").top;return Eo(e,t,o,m)}function Na(e,t,o,i){return e.bottom<=o?!1:e.top>o?!0:(i?e.left:e.right)>t}function Ks(e,t,o,i,m){m-=Kn(t);var k=Ei(e,t),Y=Da(t),Z=0,te=t.text.length,ie=!0,me=Ot(t,e.doc.direction);if(me){var xe=(e.options.lineWrapping?zs:Gs)(e,t,o,k,me,i,m);ie=xe.level!=1,Z=ie?xe.from:xe.to-1,te=ie?xe.to:xe.from-1}var Ne=null,De=null,Ze=vt(function(Yt){var Vt=er(e,k,Yt);return Vt.top+=Y,Vt.bottom+=Y,Na(Vt,i,m,!1)?(Vt.top<=m&&Vt.left<=i&&(Ne=Yt,De=Vt),!0):!1},Z,te),lt,_t,Lt=!1;if(De){var Ut=i-De.left=jt.bottom?1:0}return Ze=Je(t.text,Ze,1),Pa(o,Ze,_t,Lt,i-lt)}function Gs(e,t,o,i,m,k,Y){var Z=vt(function(xe){var Ne=m[xe],De=Ne.level!=1;return Na($i(e,ct(o,De?Ne.to:Ne.from,De?"before":"after"),"line",t,i),k,Y,!0)},0,m.length-1),te=m[Z];if(Z>0){var ie=te.level!=1,me=$i(e,ct(o,ie?te.from:te.to,ie?"after":"before"),"line",t,i);Na(me,k,Y,!0)&&me.top>Y&&(te=m[Z-1])}return te}function zs(e,t,o,i,m,k,Y){var Z=Eo(e,t,i,Y),te=Z.begin,ie=Z.end;/\s/.test(t.text.charAt(ie-1))&&ie--;for(var me=null,xe=null,Ne=0;Ne=ie||De.to<=te)continue;var Ze=De.level!=1,lt=er(e,i,Ze?Math.min(ie,De.to)-1:Math.max(te,De.from)).right,_t=lt_t)&&(me=De,xe=_t)}return me||(me=m[m.length-1]),me.fromie&&(me={from:me.from,to:ie,level:me.level}),me}var pr;function Sr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(pr==null){pr=c("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)pr.appendChild(document.createTextNode("x")),pr.appendChild(c("br"));pr.appendChild(document.createTextNode("x"))}p(e.measure,pr);var o=pr.offsetHeight/50;return o>3&&(e.cachedTextHeight=o),v(e.measure),o||1}function wr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=c("span","xxxxxxxxxx"),o=c("pre",[t],"CodeMirror-line-like");p(e.measure,o);var i=t.getBoundingClientRect(),m=(i.right-i.left)/10;return m>2&&(e.cachedCharWidth=m),m||10}function Ua(e){for(var t=e.display,o={},i={},m=t.gutters.clientLeft,k=t.gutters.firstChild,Y=0;k;k=k.nextSibling,++Y){var Z=e.display.gutterSpecs[Y].className;o[Z]=k.offsetLeft+k.clientLeft+m,i[Z]=k.clientWidth}return{fixedPos:ja(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:o,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function ja(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function To(e){var t=Sr(e.display),o=e.options.lineWrapping,i=o&&Math.max(5,e.display.scroller.clientWidth/wr(e.display)-3);return function(m){if(Ri(e.doc,m))return 0;var k=0;if(m.widgets)for(var Y=0;Y0&&(ie=Dt(e.doc,te.line).text).length==te.ch){var me=G(ie,ie.length,e.options.tabSize)-ie.length;te=ct(te.line,Math.max(0,Math.round((k-Fi(e.display).left)/wr(e.display))-me))}return te}function gr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var o=e.display.view,i=0;it)&&(m.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=m.viewTo)Gt&&Vi(e.doc,t)m.viewFrom?sr(e):(m.viewFrom+=i,m.viewTo+=i);else if(t<=m.viewFrom&&o>=m.viewTo)sr(e);else if(t<=m.viewFrom){var k=ha(e,o,o+i,1);k?(m.view=m.view.slice(k.index),m.viewFrom=k.lineN,m.viewTo+=i):sr(e)}else if(o>=m.viewTo){var Y=ha(e,t,t,-1);Y?(m.view=m.view.slice(0,Y.index),m.viewTo=Y.lineN):sr(e)}else{var Z=ha(e,t,t,-1),te=ha(e,o,o+i,1);Z&&te?(m.view=m.view.slice(0,Z.index).concat(Qn(e,Z.lineN,te.lineN)).concat(m.view.slice(te.index)),m.viewTo+=i):sr(e)}var ie=m.externalMeasured;ie&&(o=m.lineN&&t=i.viewTo)return;var k=i.view[gr(e,t)];if(k.node==null)return;var Y=k.changes||(k.changes=[]);ne(Y,o)==-1&&Y.push(o)}function sr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function ha(e,t,o,i){var m=gr(e,t),k,Y=e.display.view;if(!Gt||o==e.doc.first+e.doc.size)return{index:m,lineN:o};for(var Z=e.display.viewFrom,te=0;te0){if(m==Y.length-1)return null;k=Z+Y[m].size-t,m++}else k=Z-t;t+=k,o+=k}for(;Vi(e.doc,o)!=o;){if(m==(i<0?0:Y.length-1))return null;o+=i*Y[m-(i<0?1:0)].size,m+=i}return{index:m,lineN:o}}function Vs(e,t,o){var i=e.display,m=i.view;m.length==0||t>=i.viewTo||o<=i.viewFrom?(i.view=Qn(e,t,o),i.viewFrom=t):(i.viewFrom>t?i.view=Qn(e,t,i.viewFrom).concat(i.view):i.viewFromo&&(i.view=i.view.slice(0,gr(e,o)))),i.viewTo=o}function Co(e){for(var t=e.display.view,o=0,i=0;i=e.display.viewTo||Z.to().line0?t.blinker=setInterval(function(){e.hasFocus()||Or(e),t.cursorDiv.style.visibility=(o=!o)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Oo(e){e.state.focused||(e.display.input.focus(),Wa(e))}function Ao(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Or(e))},100)}function Wa(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Re(e,"focus",e,t),e.state.focused=!0,N(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),D&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ba(e)}function Or(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Re(e,"blur",e,t),e.state.focused=!1,b(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function pa(e){for(var t=e.display,o=t.lineDiv.offsetTop,i=0;i.005||me<-.005)&&(Cn(m.line,Y),Ro(m.line),m.rest))for(var xe=0;xee.display.sizerWidth){var Ne=Math.ceil(Z/wr(e.display));Ne>e.display.maxLineLength&&(e.display.maxLineLength=Ne,e.display.maxLine=m.line,e.display.maxLineChanged=!0)}}}function Ro(e){if(e.widgets)for(var t=0;t=Y&&(k=Sn(t,Kn(Dt(t,te))-e.wrapper.clientHeight),Y=te)}return{from:k,to:Math.max(Y,k+1)}}function Ys(e,t){if(je(e,"scrollCursorIntoView"))return;var o=e.display,i=o.sizer.getBoundingClientRect(),m=null;if(t.top+i.top<0?m=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(m=!1),m!=null&&!s){var k=c("div","\u200B",null,`position: absolute; top: `+(t.top-o.viewOffset-kn(e.display))+`px; height: `+(t.bottom-t.top+$n(e)+o.barHeight)+`px; left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(k),k.scrollIntoView(m),e.display.lineSpace.removeChild(k)}}function $s(e,t,o,i){i==null&&(i=0);var m;!e.options.lineWrapping&&t==o&&(t=t.ch?ct(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,o=t.sticky=="before"?ct(t.line,t.ch+1,"before"):t);for(var k=0;k<5;k++){var Y=!1,Z=$i(e,t),te=!o||o==t?Z:$i(e,o);m={left:Math.min(Z.left,te.left),top:Math.min(Z.top,te.top)-i,right:Math.max(Z.left,te.left),bottom:Math.max(Z.bottom,te.bottom)+i};var ie=Ha(e,m),me=e.doc.scrollTop,xe=e.doc.scrollLeft;if(ie.scrollTop!=null&&(zr(e,ie.scrollTop),Math.abs(e.doc.scrollTop-me)>1&&(Y=!0)),ie.scrollLeft!=null&&(vr(e,ie.scrollLeft),Math.abs(e.doc.scrollLeft-xe)>1&&(Y=!0)),!Y)break}return m}function Js(e,t){var o=Ha(e,t);o.scrollTop!=null&&zr(e,o.scrollTop),o.scrollLeft!=null&&vr(e,o.scrollLeft)}function Ha(e,t){var o=e.display,i=Sr(e.display);t.top<0&&(t.top=0);var m=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:o.scroller.scrollTop,k=wi(e),Y={};t.bottom-t.top>k&&(t.bottom=t.top+k);var Z=e.doc.height+Yi(o),te=t.topZ-i;if(t.topm+k){var me=Math.min(t.top,(ie?Z:t.bottom)-k);me!=m&&(Y.scrollTop=me)}var xe=e.options.fixedGutter?0:o.gutters.offsetWidth,Ne=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:o.scroller.scrollLeft-xe,De=vi(e)-o.gutters.offsetWidth,Ze=t.right-t.left>De;return Ze&&(t.right=t.left+De),t.left<10?Y.scrollLeft=0:t.leftDe+Ne-3&&(Y.scrollLeft=t.right+(Ze?0:10)-De),Y}function Ka(e,t){if(t==null)return;ga(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Ar(e){ga(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Gr(e,t,o){(t!=null||o!=null)&&ga(e),t!=null&&(e.curOp.scrollLeft=t),o!=null&&(e.curOp.scrollTop=o)}function Zs(e,t){ga(e),e.curOp.scrollToPos=t}function ga(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var o=bo(e,t.from),i=bo(e,t.to);Lo(e,o,i,t.margin)}}function Lo(e,t,o,i){var m=Ha(e,{left:Math.min(t.left,o.left),top:Math.min(t.top,o.top)-i,right:Math.max(t.right,o.right),bottom:Math.max(t.bottom,o.bottom)+i});Gr(e,m.scrollLeft,m.scrollTop)}function zr(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;M||za(e,{top:t}),Io(e,t,!0),M&&za(e),Yr(e,100)}function Io(e,t,o){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!o)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function vr(e,t,o,i){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(o?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!i)return;e.doc.scrollLeft=t,No(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Vr(e){var t=e.display,o=t.gutters.offsetWidth,i=Math.round(e.doc.height+Yi(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?o:0,docHeight:i,scrollHeight:i+$n(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:o}}var yr=function(e,t,o){this.cm=o;var i=this.vert=c("div",[c("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),m=this.horiz=c("div",[c("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=m.tabIndex=-1,e(i),e(m),Ce(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),Ce(m,"scroll",function(){m.clientWidth&&t(m.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,H&&F<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};yr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,o=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;if(o){this.vert.style.display="block",this.vert.style.bottom=t?i+"px":"0";var m=e.viewHeight-(t?i:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+m)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=o?i+"px":"0",this.horiz.style.left=e.barLeft+"px";var k=e.viewWidth-e.barLeft-(o?i:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+k)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(i==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:o?i:0,bottom:t?i:0}},yr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},yr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},yr.prototype.zeroWidthHack=function(){var e=n&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Q,this.disableVert=new Q},yr.prototype.enableZeroWidthBar=function(e,t,o){e.style.pointerEvents="auto";function i(){var m=e.getBoundingClientRect(),k=o=="vert"?document.elementFromPoint(m.right-1,(m.top+m.bottom)/2):document.elementFromPoint((m.right+m.left)/2,m.bottom-1);k!=e?e.style.pointerEvents="none":t.set(1e3,i)}t.set(1e3,i)},yr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Xr=function(){};Xr.prototype.update=function(){return{bottom:0,right:0}},Xr.prototype.setScrollLeft=function(){},Xr.prototype.setScrollTop=function(){},Xr.prototype.clear=function(){};function Rr(e,t){t||(t=Vr(e));var o=e.display.barWidth,i=e.display.barHeight;Do(e,t);for(var m=0;m<4&&o!=e.display.barWidth||i!=e.display.barHeight;m++)o!=e.display.barWidth&&e.options.lineWrapping&&pa(e),Do(e,Vr(e)),o=e.display.barWidth,i=e.display.barHeight}function Do(e,t){var o=e.display,i=o.scrollbars.update(t);o.sizer.style.paddingRight=(o.barWidth=i.right)+"px",o.sizer.style.paddingBottom=(o.barHeight=i.bottom)+"px",o.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(o.scrollbarFiller.style.display="block",o.scrollbarFiller.style.height=i.bottom+"px",o.scrollbarFiller.style.width=i.right+"px"):o.scrollbarFiller.style.display="",i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(o.gutterFiller.style.display="block",o.gutterFiller.style.height=i.bottom+"px",o.gutterFiller.style.width=t.gutterWidth+"px"):o.gutterFiller.style.display=""}var Mo={native:yr,null:Xr};function Po(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&b(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Mo[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ce(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,o){o=="horizontal"?vr(e,t):zr(e,t)},e),e.display.scrollbars.addClass&&N(e.display.wrapper,e.display.scrollbars.addClass)}var Qs=0;function _r(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Qs},mi(e.curOp)}function br(e){var t=e.curOp;t&&En(t,function(o){for(var i=0;i=o.viewTo)||o.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new va(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Ga(e.cm,e.update)}function nl(e){var t=e.cm,o=t.display;e.updatedDisplay&&pa(t),e.barMeasure=Vr(t),o.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Bi(t,o.maxLine,o.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(o.scroller.clientWidth,o.sizer.offsetLeft+e.adjustWidthTo+$n(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,o.sizer.offsetLeft+e.adjustWidthTo-vi(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=o.input.prepareSelection())}function il(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)return;var o=+new Date+e.options.workTime,i=ot(e,t.highlightFrontier),m=[];t.iter(i.line,Math.min(t.first+t.size,e.display.viewTo+500),function(k){if(i.line>=e.display.viewFrom){var Y=k.styles,Z=k.text.length>e.options.maxHighlightLength?At(t.mode,i.state):null,te=ye(e,k,i,!0);Z&&(i.state=Z),k.styles=te.styles;var ie=k.styleClasses,me=te.classes;me?k.styleClasses=me:ie&&(k.styleClasses=null);for(var xe=!Y||Y.length!=k.styles.length||ie!=me&&(!ie||!me||ie.bgClass!=me.bgClass||ie.textClass!=me.textClass),Ne=0;!xe&&Neo)return Yr(e,e.options.workDelay),!0}),t.highlightFrontier=i.line,t.modeFrontier=Math.max(t.modeFrontier,i.line),m.length&&Ui(e,function(){for(var k=0;k=o.viewFrom&&t.visible.to<=o.viewTo&&(o.updateLineNumbers==null||o.updateLineNumbers>=o.viewTo)&&o.renderedView==o.view&&Co(e)==0)return!1;Uo(e)&&(sr(e),t.dims=Ua(e));var m=i.first+i.size,k=Math.max(t.visible.from-e.options.viewportMargin,i.first),Y=Math.min(m,t.visible.to+e.options.viewportMargin);o.viewFromY&&o.viewTo-Y<20&&(Y=Math.min(m,o.viewTo)),Gt&&(k=Vi(e.doc,k),Y=Ni(e.doc,Y));var Z=k!=o.viewFrom||Y!=o.viewTo||o.lastWrapHeight!=t.wrapperHeight||o.lastWrapWidth!=t.wrapperWidth;Vs(e,k,Y),o.viewOffset=Kn(Dt(e.doc,o.viewFrom)),e.display.mover.style.top=o.viewOffset+"px";var te=Co(e);if(!Z&&te==0&&!t.force&&o.renderedView==o.view&&(o.updateLineNumbers==null||o.updateLineNumbers>=o.viewTo))return!1;var ie=sl(e);return te>4&&(o.lineDiv.style.display="none"),ul(e,o.updateLineNumbers,t.dims),te>4&&(o.lineDiv.style.display=""),o.renderedView=o.view,ll(ie),v(o.cursorDiv),v(o.selectionDiv),o.gutters.style.height=o.sizer.style.minHeight=0,Z&&(o.lastWrapHeight=t.wrapperHeight,o.lastWrapWidth=t.wrapperWidth,Yr(e,400)),o.updateLineNumbers=null,!0}function ko(e,t){for(var o=t.viewport,i=!0;;i=!1){if(!i||!e.options.lineWrapping||t.oldDisplayWidth==vi(e)){if(o&&o.top!=null&&(o={top:Math.min(e.doc.height+Yi(e.display)-wi(e),o.top)}),t.visible=ma(e.display,e.doc,o),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else i&&(t.visible=ma(e.display,e.doc,o));if(!Ga(e,t))break;pa(e);var m=Vr(e);Kr(e),Rr(e,m),Xa(e,m),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function za(e,t){var o=new va(e,t);if(Ga(e,o)){pa(e),ko(e,o);var i=Vr(e);Kr(e),Rr(e,i),Xa(e,i),o.finish()}}function ul(e,t,o){var i=e.display,m=e.options.lineNumbers,k=i.lineDiv,Y=k.firstChild;function Z(Ze){var lt=Ze.nextSibling;return D&&n&&e.display.currentWheelTarget==Ze?Ze.style.display="none":Ze.parentNode.removeChild(Ze),lt}for(var te=i.view,ie=i.viewFrom,me=0;me-1&&(De=!1),Qi(e,xe,ie,o)),De&&(v(xe.lineNumber),xe.lineNumber.appendChild(document.createTextNode(li(e.options,ie)))),Y=xe.node.nextSibling}ie+=xe.size}for(;Y;)Y=Z(Y)}function Va(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Xa(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+$n(e)+"px"}function No(e){var t=e.display,o=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var i=ja(t)-t.scroller.scrollLeft+e.doc.scrollLeft,m=t.gutters.offsetWidth,k=i+"px",Y=0;YY.clientWidth,te=Y.scrollHeight>Y.clientHeight;if(!(i&&Z||m&&te))return;if(m&&n&&D){e:for(var ie=t.target,me=k.view;ie!=Y;ie=ie.parentNode)for(var xe=0;xe=0&&St(e,i.to())<=0)return o}return-1};var An=function(e,t){this.anchor=e,this.head=t};An.prototype.from=function(){return ki(this.anchor,this.head)},An.prototype.to=function(){return ui(this.anchor,this.head)},An.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Ji(e,t,o){var i=e&&e.options.selectionsMayTouch,m=t[o];t.sort(function(Ne,De){return St(Ne.from(),De.from())}),o=ne(t,m);for(var k=1;k0:te>=0){var ie=ki(Z.from(),Y.from()),me=ui(Z.to(),Y.to()),xe=Z.empty()?Y.from()==Y.head:Z.from()==Z.head;k<=o&&--o,t.splice(--k,2,new An(xe?me:ie,xe?ie:me))}}return new Hi(t,o)}function lr(e,t){return new Hi([new An(e,t||e)],0)}function ur(e){return e.text?ct(e.from.line+e.text.length-1,Le(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Wo(e,t){if(St(e,t.from)<0)return e;if(St(e,t.to)<=0)return ur(t);var o=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=ur(t).ch-t.to.ch),ct(o,i)}function $a(e,t){for(var o=[],i=0;i1&&e.remove(Z.line+1,Ze-1),e.insert(Z.line+1,Lt)}gn(e,"change",e,t)}function dr(e,t,o){function i(m,k,Y){if(m.linked)for(var Z=0;Z1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Le(e.done)}function Xo(e,t,o,i){var m=e.history;m.undone.length=0;var k=+new Date,Y,Z;if((m.lastOp==i||m.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&m.lastModTime>k-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(Y=pl(m,m.lastOp==i)))Z=Le(Y.changes),St(t.from,t.to)==0&&St(t.from,Z.to)==0?Z.to=ur(t):Y.changes.push(Qa(e,t));else{var te=Le(m.done);for((!te||!te.ranges)&&ba(e.sel,m.done),Y={changes:[Qa(e,t)],generation:m.generation},m.done.push(Y);m.done.length>m.undoDepth;)m.done.shift(),m.done[0].ranges||m.done.shift()}m.done.push(o),m.generation=++m.maxGeneration,m.lastModTime=m.lastSelTime=k,m.lastOp=m.lastSelOp=i,m.lastOrigin=m.lastSelOrigin=t.origin,Z||Re(e,"historyAdded")}function ml(e,t,o,i){var m=t.charAt(0);return m=="*"||m=="+"&&o.ranges.length==i.ranges.length&&o.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,o,i){var m=e.history,k=i&&i.origin;o==m.lastSelOp||k&&m.lastSelOrigin==k&&(m.lastModTime==m.lastSelTime&&m.lastOrigin==k||ml(e,k,Le(m.done),t))?m.done[m.done.length-1]=t:ba(t,m.done),m.lastSelTime=+new Date,m.lastSelOrigin=k,m.lastSelOp=o,i&&i.clearRedo!==!1&&Vo(m.undone)}function ba(e,t){var o=Le(t);o&&o.ranges&&o.equals(e)||t.push(e)}function Yo(e,t,o,i){var m=t["spans_"+e.id],k=0;e.iter(Math.max(e.first,o),Math.min(e.first+e.size,i),function(Y){Y.markedSpans&&((m||(m=t["spans_"+e.id]={}))[k]=Y.markedSpans),++k})}function vl(e){if(!e)return null;for(var t,o=0;o-1&&(Le(Z)[xe]=ie[xe],delete ie[xe]))}}return i}function qa(e,t,o,i){if(i){var m=e.anchor;if(o){var k=St(t,m)<0;k!=St(o,m)<0?(m=t,t=o):k!=St(t,o)<0&&(t=o)}return new An(m,t)}else return new An(o||t,t)}function Ea(e,t,o,i,m){m==null&&(m=e.cm&&(e.cm.display.shift||e.extend)),xi(e,new Hi([qa(e.sel.primary(),t,o,m)],0),i)}function Jo(e,t,o){for(var i=[],m=e.cm&&(e.cm.display.shift||e.extend),k=0;k=t.ch:Z.to>t.ch))){if(m&&(Re(te,"beforeCursorEnter"),te.explicitlyCleared))if(k.markedSpans){--Y;continue}else break;if(!te.atomic)continue;if(o){var xe=te.find(i<0?1:-1),Ne=void 0;if((i<0?me:ie)&&(xe=ns(e,xe,-i,xe&&xe.line==t.line?k:null)),xe&&xe.line==t.line&&(Ne=St(xe,o))&&(i<0?Ne<0:Ne>0))return Ir(e,xe,t,i,m)}var De=te.find(i<0?-1:1);return(i<0?ie:me)&&(De=ns(e,De,i,De.line==t.line?k:null)),De?Ir(e,De,t,i,m):null}}return t}function Ta(e,t,o,i,m){var k=i||1,Y=Ir(e,t,o,k,m)||!m&&Ir(e,t,o,k,!0)||Ir(e,t,o,-k,m)||!m&&Ir(e,t,o,-k,!0);return Y||(e.cantEdit=!0,ct(e.first,0))}function ns(e,t,o,i){return o<0&&t.ch==0?t.line>e.first?w(e,ct(t.line-1)):null:o>0&&t.ch==(i||Dt(e,t.line)).text.length?t.line=0;--m)as(e,{from:i[m].from,to:i[m].to,text:m?[""]:t.text,origin:t.origin});else as(e,t)}function as(e,t){if(t.text.length==1&&t.text[0]==""&&St(t.from,t.to)==0)return;var o=$a(e,t);Xo(e,t,o,e.cm?e.cm.curOp.id:NaN),Zr(e,t,o,_n(e,t));var i=[];dr(e,function(m,k){!k&&ne(i,m.history)==-1&&(us(m.history,t),i.push(m.history)),Zr(m,t,null,_n(m,t))})}function Ca(e,t,o){var i=e.cm&&e.cm.state.suppressEdits;if(i&&!o)return;for(var m=e.history,k,Y=e.sel,Z=t=="undo"?m.done:m.undone,te=t=="undo"?m.undone:m.done,ie=0;ie=0;--De){var Ze=Ne(De);if(Ze)return Ze.v}}function os(e,t){if(t==0)return;if(e.first+=t,e.sel=new Hi(Ye(e.sel.ranges,function(m){return new An(ct(m.anchor.line+t,m.anchor.ch),ct(m.head.line+t,m.head.ch))}),e.sel.primIndex),e.cm){Li(e.cm,e.first,e.first-t,t);for(var o=e.cm.display,i=o.viewFrom;ie.lastLine())return;if(t.from.linek&&(t={from:t.from,to:ct(k,Dt(e,k).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Rn(e,t.from,t.to),o||(o=$a(e,t)),e.cm?bl(e.cm,t,i):Za(e,t,i),xa(e,o,pe),e.cantEdit&&Ta(e,ct(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,o){var i=e.doc,m=e.display,k=t.from,Y=t.to,Z=!1,te=k.line;e.options.lineWrapping||(te=Qt(Zn(Dt(i,k.line))),i.iter(te,Y.line+1,function(De){if(De==m.maxLine)return Z=!0,!0})),i.sel.contains(t.from,t.to)>-1&&ge(e),Za(i,t,o,To(e)),e.options.lineWrapping||(i.iter(te,k.line+t.text.length,function(De){var Ze=Ht(De);Ze>m.maxLineLength&&(m.maxLine=De,m.maxLineLength=Ze,m.maxLineChanged=!0,Z=!1)}),Z&&(e.curOp.updateMaxLine=!0)),Zt(i,k.line),Yr(e,400);var ie=t.text.length-(Y.line-k.line)-1;t.full?Li(e):k.line==Y.line&&t.text.length==1&&!Ko(e.doc,t)?or(e,k.line,"text"):Li(e,k.line,Y.line+1,ie);var me=de(e,"changes"),xe=de(e,"change");if(xe||me){var Ne={from:k,to:Y,text:t.text,removed:t.removed,origin:t.origin};xe&&gn(e,"change",e,Ne),me&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ne)}e.display.selForContextMenu=null}function Mr(e,t,o,i,m){var k;i||(i=o),St(i,o)<0&&(k=[i,o],o=k[0],i=k[1]),typeof t=="string"&&(t=e.splitLines(t)),Dr(e,{from:o,to:i,text:t,origin:m})}function ss(e,t,o,i){o1||!(this.children[0]instanceof qr))){var Z=[];this.collapse(Z),this.children=[new qr(Z)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var Y=m.lines.length%25+25,Z=Y;Z10);e.parent.maybeSpill()},iterN:function(e,t,o){for(var i=0;ie.display.maxLineLength&&(e.display.maxLine=ie,e.display.maxLineLength=me,e.display.maxLineChanged=!0)}i!=null&&e&&this.collapsed&&Li(e,i,m+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&es(e.doc)),e&&gn(e,"markerCleared",e,this,i,m),t&&br(e),this.parent&&this.parent.clear()},cr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var o,i,m=0;m0||Y==0&&k.clearWhenEmpty!==!1)return k;if(k.replacedWith&&(k.collapsed=!0,k.widgetNode=E("span",[k.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||k.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(k.widgetNode.insertLeft=!0)),k.collapsed){if(sn(e,t.line,t,o,k)||t.line!=o.line&&sn(e,o.line,t,o,k))throw new Error("Inserting collapsed marker partially overlapping an existing one");On()}k.addToHistory&&Xo(e,{from:t,to:o,origin:"markText"},e.sel,NaN);var Z=t.line,te=e.cm,ie;if(e.iter(Z,o.line+1,function(xe){te&&k.collapsed&&!te.options.lineWrapping&&Zn(xe)==te.display.maxLine&&(ie=!0),k.collapsed&&Z!=t.line&&Cn(xe,0),Hn(xe,new Ln(k,Z==t.line?t.ch:null,Z==o.line?o.ch:null)),++Z}),k.collapsed&&e.iter(t.line,o.line+1,function(xe){Ri(e,xe)&&Cn(xe,0)}),k.clearOnEnter&&Ce(k,"beforeCursorEnter",function(){return k.clear()}),k.readOnly&&(wn(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),k.collapsed&&(k.id=++cs,k.atomic=!0),te){if(ie&&(te.curOp.updateMaxLine=!0),k.collapsed)Li(te,t.line,o.line+1);else if(k.className||k.startStyle||k.endStyle||k.css||k.attributes||k.title)for(var me=t.line;me<=o.line;me++)or(te,me,"text");k.atomic&&es(te.doc),gn(te,"markerAdded",te,k)}return k}var na=function(e,t){this.markers=e,this.primary=t;for(var o=0;o=0;te--)Dr(this,i[te]);Z?Qo(this,Z):this.cm&&Ar(this.cm)}),undo:ci(function(){Ca(this,"undo")}),redo:ci(function(){Ca(this,"redo")}),undoSelection:ci(function(){Ca(this,"undo",!0)}),redoSelection:ci(function(){Ca(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,o=0,i=0;i=e.ch)&&t.push(m.marker.parent||m.marker)}return t},findMarks:function(e,t,o){e=w(this,e),t=w(this,t);var i=[],m=e.line;return this.iter(e.line,t.line+1,function(k){var Y=k.markedSpans;if(Y)for(var Z=0;Z=te.to||te.from==null&&m!=e.line||te.from!=null&&m==t.line&&te.from>=t.ch)&&(!o||o(te.marker))&&i.push(te.marker.parent||te.marker)}++m}),i},getAllMarks:function(){var e=[];return this.iter(function(t){var o=t.markedSpans;if(o)for(var i=0;ie)return t=e,!0;e-=k,++o}),w(this,ct(o,t))},indexFromPos:function(e){e=w(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var me=e.dataTransfer.getData("Text");if(me){var xe;if(t.state.draggingText&&!t.state.draggingText.copy&&(xe=t.listSelections()),xa(t.doc,lr(o,o)),xe)for(var Ne=0;Ne=0;Z--)Mr(e.doc,"",i[Z].from,i[Z].to,"+delete");Ar(e)})}function to(e,t,o){var i=Je(e.text,t+o,o);return i<0||i>e.text.length?null:i}function no(e,t,o){var i=to(e,t.ch,o);return i==null?null:new ct(t.line,i,o<0?"after":"before")}function io(e,t,o,i,m){if(e){t.doc.direction=="rtl"&&(m=-m);var k=Ot(o,t.doc.direction);if(k){var Y=m<0?Le(k):k[0],Z=m<0==(Y.level==1),te=Z?"after":"before",ie;if(Y.level>0||t.doc.direction=="rtl"){var me=Ei(t,o);ie=m<0?o.text.length-1:0;var xe=er(t,me,ie).top;ie=vt(function(Ne){return er(t,me,Ne).top==xe},m<0==(Y.level==1)?Y.from:Y.to-1,ie),te=="before"&&(ie=to(o,ie,1))}else ie=m<0?Y.to:Y.from;return new ct(i,ie,te)}}return new ct(i,m<0?o.text.length:0,m<0?"before":"after")}function Pl(e,t,o,i){var m=Ot(t,e.doc.direction);if(!m)return no(t,o,i);o.ch>=t.text.length?(o.ch=t.text.length,o.sticky="before"):o.ch<=0&&(o.ch=0,o.sticky="after");var k=xt(m,o.ch,o.sticky),Y=m[k];if(e.doc.direction=="ltr"&&Y.level%2==0&&(i>0?Y.to>o.ch:Y.from=Y.from&&Ne>=me.begin)){var De=xe?"before":"after";return new ct(o.line,Ne,De)}}var Ze=function(Lt,Ut,It){for(var jt=function(Nn,hi){return hi?new ct(o.line,Z(Nn,1),"before"):new ct(o.line,Nn,"after")};Lt>=0&&Lt0==(Yt.level!=1),un=Vt?It.begin:Z(It.end,-1);if(Yt.from<=un&&un0?me.end:Z(me.begin,-1);return _t!=null&&!(i>0&&_t==t.text.length)&&(lt=Ze(i>0?0:m.length-1,i,ie(_t)),lt)?lt:null}var aa={selectAll:is,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),pe)},killLine:function(e){return Nr(e,function(t){if(t.empty()){var o=Dt(e.doc,t.head.line).text.length;return t.head.ch==o&&t.head.line0)m=new ct(m.line,m.ch+1),e.replaceRange(k.charAt(m.ch-1)+k.charAt(m.ch-2),ct(m.line,m.ch-2),m,"+transpose");else if(m.line>e.doc.first){var Y=Dt(e.doc,m.line-1).text;Y&&(m=new ct(m.line,1),e.replaceRange(k.charAt(0)+e.doc.lineSeparator()+Y.charAt(Y.length-1),ct(m.line-1,Y.length-1),m,"+transpose"))}}o.push(new An(m,m))}e.setSelections(o)})},newlineAndIndent:function(e){return Ui(e,function(){for(var t=e.listSelections(),o=t.length-1;o>=0;o--)e.replaceRange(e.doc.lineSeparator(),t[o].anchor,t[o].head,"+input");t=e.listSelections();for(var i=0;ie&&St(t,this.pos)==0&&o==this.button};var sa,la;function Wl(e,t){var o=+new Date;return la&&la.compare(o,e,t)?(sa=la=null,"triple"):sa&&sa.compare(o,e,t)?(la=new ao(o,e,t),sa=null,"double"):(sa=new ao(o,e,t),la=null,"single")}function Os(e){var t=this,o=t.display;if(je(t,e)||o.activeTouch&&o.input.supportsTouch())return;if(o.input.ensurePolled(),o.shift=e.shiftKey,vn(o,e)){D||(o.scroller.draggable=!1,setTimeout(function(){return o.scroller.draggable=!0},100));return}if(oo(t,e))return;var i=mr(t,e),m=Ie(e),k=i?Wl(i,m):"single";if(window.focus(),m==1&&t.state.selectingText&&t.state.selectingText(e),i&&Hl(t,m,i,k,e))return;m==1?i?Gl(t,i,k,e):be(e)==o.scroller&&re(e):m==2?(i&&Ea(t.doc,i),setTimeout(function(){return o.input.focus()},20)):m==3&&(A?t.display.input.onContextMenu(e):Ao(t))}function Hl(e,t,o,i,m){var k="Click";return i=="double"?k="Double"+k:i=="triple"&&(k="Triple"+k),k=(t==1?"Left":t==2?"Middle":"Right")+k,oa(e,ys(k,m),m,function(Y){if(typeof Y=="string"&&(Y=aa[Y]),!Y)return!1;var Z=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),Z=Y(e,o)!=_e}finally{e.state.suppressEdits=!1}return Z})}function Kl(e,t,o){var i=e.getOption("configureMouse"),m=i?i(e,t,o):{};if(m.unit==null){var k=h?o.shiftKey&&o.metaKey:o.altKey;m.unit=k?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(m.extend==null||e.doc.extend)&&(m.extend=e.doc.extend||o.shiftKey),m.addNew==null&&(m.addNew=n?o.metaKey:o.ctrlKey),m.moveOnDrag==null&&(m.moveOnDrag=!(n?o.altKey:o.ctrlKey)),m}function Gl(e,t,o,i){H?setTimeout(B(Oo,e),0):e.curOp.focus=P();var m=Kl(e,o,i),k=e.doc.sel,Y;e.options.dragDrop&&Xe&&!e.isReadOnly()&&o=="single"&&(Y=k.contains(t))>-1&&(St((Y=k.ranges[Y]).from(),t)<0||t.xRel>0)&&(St(Y.to(),t)>0||t.xRel<0)?zl(e,i,t,m):Vl(e,i,t,m)}function zl(e,t,o,i){var m=e.display,k=!1,Y=di(e,function(ie){D&&(m.scroller.draggable=!1),e.state.draggingText=!1,ze(m.wrapper.ownerDocument,"mouseup",Y),ze(m.wrapper.ownerDocument,"mousemove",Z),ze(m.scroller,"dragstart",te),ze(m.scroller,"drop",Y),k||(re(ie),i.addNew||Ea(e.doc,o,null,null,i.extend),D&&!u||H&&F==9?setTimeout(function(){m.wrapper.ownerDocument.body.focus({preventScroll:!0}),m.input.focus()},20):m.input.focus())}),Z=function(ie){k=k||Math.abs(t.clientX-ie.clientX)+Math.abs(t.clientY-ie.clientY)>=10},te=function(){return k=!0};D&&(m.scroller.draggable=!0),e.state.draggingText=Y,Y.copy=!i.moveOnDrag,m.scroller.dragDrop&&m.scroller.dragDrop(),Ce(m.wrapper.ownerDocument,"mouseup",Y),Ce(m.wrapper.ownerDocument,"mousemove",Z),Ce(m.scroller,"dragstart",te),Ce(m.scroller,"drop",Y),Ao(e),setTimeout(function(){return m.input.focus()},20)}function As(e,t,o){if(o=="char")return new An(t,t);if(o=="word")return e.findWordAt(t);if(o=="line")return new An(ct(t.line,0),w(e.doc,ct(t.line+1,0)));var i=o(e,t);return new An(i.from,i.to)}function Vl(e,t,o,i){var m=e.display,k=e.doc;re(t);var Y,Z,te=k.sel,ie=te.ranges;if(i.addNew&&!i.extend?(Z=k.sel.contains(o),Z>-1?Y=ie[Z]:Y=new An(o,o)):(Y=k.sel.primary(),Z=k.sel.primIndex),i.unit=="rectangle")i.addNew||(Y=new An(o,o)),o=mr(e,t,!0,!0),Z=-1;else{var me=As(e,o,i.unit);i.extend?Y=qa(Y,me.anchor,me.head,i.extend):Y=me}i.addNew?Z==-1?(Z=ie.length,xi(k,Ji(e,ie.concat([Y]),Z),{scroll:!1,origin:"*mouse"})):ie.length>1&&ie[Z].empty()&&i.unit=="char"&&!i.extend?(xi(k,Ji(e,ie.slice(0,Z).concat(ie.slice(Z+1)),0),{scroll:!1,origin:"*mouse"}),te=k.sel):eo(k,Z,Y,Ee):(Z=0,xi(k,new Hi([Y],0),Ee),te=k.sel);var xe=o;function Ne(It){if(St(xe,It)==0)return;if(xe=It,i.unit=="rectangle"){for(var jt=[],Yt=e.options.tabSize,Vt=G(Dt(k,o.line).text,o.ch,Yt),un=G(Dt(k,It.line).text,It.ch,Yt),Nn=Math.min(Vt,un),hi=Math.max(Vt,un),Gn=Math.min(o.line,It.line),ji=Math.min(e.lastLine(),Math.max(o.line,It.line));Gn<=ji;Gn++){var Di=Dt(k,Gn).text,ni=we(Di,Nn,Yt);Nn==hi?jt.push(new An(ct(Gn,ni),ct(Gn,ni))):Di.length>ni&&jt.push(new An(ct(Gn,ni),ct(Gn,we(Di,hi,Yt))))}jt.length||jt.push(new An(o,o)),xi(k,Ji(e,te.ranges.slice(0,Z).concat(jt),Z),{origin:"*mouse",scroll:!1}),e.scrollIntoView(It)}else{var Mi=Y,yi=As(e,It,i.unit),si=Mi.anchor,ii;St(yi.anchor,si)>0?(ii=yi.head,si=ki(Mi.from(),yi.anchor)):(ii=yi.anchor,si=ui(Mi.to(),yi.head));var Yn=te.ranges.slice(0);Yn[Z]=Xl(e,new An(w(k,si),ii)),xi(k,Ji(e,Yn,Z),Ee)}}var De=m.wrapper.getBoundingClientRect(),Ze=0;function lt(It){var jt=++Ze,Yt=mr(e,It,!0,i.unit=="rectangle");if(!Yt)return;if(St(Yt,xe)!=0){e.curOp.focus=P(),Ne(Yt);var Vt=ma(m,k);(Yt.line>=Vt.to||Yt.lineDe.bottom?20:0;un&&setTimeout(di(e,function(){if(Ze!=jt)return;m.scroller.scrollTop+=un,lt(It)}),50)}}function _t(It){e.state.selectingText=!1,Ze=Infinity,It&&(re(It),m.input.focus()),ze(m.wrapper.ownerDocument,"mousemove",Lt),ze(m.wrapper.ownerDocument,"mouseup",Ut),k.history.lastSelOrigin=null}var Lt=di(e,function(It){It.buttons===0||!Ie(It)?_t(It):lt(It)}),Ut=di(e,_t);e.state.selectingText=Ut,Ce(m.wrapper.ownerDocument,"mousemove",Lt),Ce(m.wrapper.ownerDocument,"mouseup",Ut)}function Xl(e,t){var o=t.anchor,i=t.head,m=Dt(e.doc,o.line);if(St(o,i)==0&&o.sticky==i.sticky)return t;var k=Ot(m);if(!k)return t;var Y=xt(k,o.ch,o.sticky),Z=k[Y];if(Z.from!=o.ch&&Z.to!=o.ch)return t;var te=Y+(Z.from==o.ch==(Z.level!=1)?0:1);if(te==0||te==k.length)return t;var ie;if(i.line!=o.line)ie=(i.line-o.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var me=xt(k,i.ch,i.sticky),xe=me-Y||(i.ch-o.ch)*(Z.level==1?-1:1);me==te-1||me==te?ie=xe<0:ie=xe>0}var Ne=k[te+(ie?-1:0)],De=ie==(Ne.level==1),Ze=De?Ne.from:Ne.to,lt=De?"after":"before";return o.ch==Ze&&o.sticky==lt?t:new An(new ct(o.line,Ze,lt),i)}function Rs(e,t,o,i){var m,k;if(t.touches)m=t.touches[0].clientX,k=t.touches[0].clientY;else try{m=t.clientX,k=t.clientY}catch(Ne){return!1}if(m>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&re(t);var Y=e.display,Z=Y.lineDiv.getBoundingClientRect();if(k>Z.bottom||!de(e,o))return ue(t);k-=Z.top-Y.viewOffset;for(var te=0;te=m){var me=Sn(e.doc,k),xe=e.display.gutterSpecs[te];return Re(e,o,e,me,xe.className,t),ue(t)}}}function oo(e,t){return Rs(e,t,"gutterClick",!0)}function Ls(e,t){if(vn(e.display,t)||Yl(e,t))return;if(je(e,t,"contextmenu"))return;A||e.display.input.onContextMenu(t)}function Yl(e,t){return de(e,"gutterContextMenu")?Rs(e,t,"gutterContextMenu",!1):!1}function Is(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Hr(e)}var Ur={toString:function(){return"CodeMirror.Init"}},Ds={},Aa={};function $l(e){var t=e.optionHandlers;function o(i,m,k,Y){e.defaults[i]=m,k&&(t[i]=Y?function(Z,te,ie){ie!=Ur&&k(Z,te,ie)}:k)}e.defineOption=o,e.Init=Ur,o("value","",function(i,m){return i.setValue(m)},!0),o("mode",null,function(i,m){i.doc.modeOption=m,Ja(i)},!0),o("indentUnit",2,Ja,!0),o("indentWithTabs",!1),o("smartIndent",!0),o("tabSize",4,function(i){Jr(i),Hr(i),Li(i)},!0),o("lineSeparator",null,function(i,m){if(i.doc.lineSep=m,!m)return;var k=[],Y=i.doc.first;i.doc.iter(function(te){for(var ie=0;;){var me=te.text.indexOf(m,ie);if(me==-1)break;ie=me+m.length,k.push(ct(Y,me))}Y++});for(var Z=k.length-1;Z>=0;Z--)Mr(i.doc,m,k[Z],ct(k[Z].line,k[Z].ch+m.length))}),o("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(i,m,k){i.state.specialChars=new RegExp(m.source+(m.test(" ")?"":"| "),"g"),k!=Ur&&i.refresh()}),o("specialCharPlaceholder",Tn,function(i){return i.refresh()},!0),o("electricChars",!0),o("inputStyle",a?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),o("spellcheck",!1,function(i,m){return i.getInputField().spellcheck=m},!0),o("autocorrect",!1,function(i,m){return i.getInputField().autocorrect=m},!0),o("autocapitalize",!1,function(i,m){return i.getInputField().autocapitalize=m},!0),o("rtlMoveVisually",!O),o("wholeLineUpdateBefore",!0),o("theme","default",function(i){Is(i),$r(i)},!0),o("keyMap","default",function(i,m,k){var Y=wa(m),Z=k!=Ur&&wa(k);Z&&Z.detach&&Z.detach(i,Y),Y.attach&&Y.attach(i,Z||null)}),o("extraKeys",null),o("configureMouse",null),o("lineWrapping",!1,Zl,!0),o("gutters",[],function(i,m){i.display.gutterSpecs=Ya(m,i.options.lineNumbers),$r(i)},!0),o("fixedGutter",!0,function(i,m){i.display.gutters.style.left=m?ja(i.display)+"px":"0",i.refresh()},!0),o("coverGutterNextToScrollbar",!1,function(i){return Rr(i)},!0),o("scrollbarStyle","native",function(i){Po(i),Rr(i),i.display.scrollbars.setScrollTop(i.doc.scrollTop),i.display.scrollbars.setScrollLeft(i.doc.scrollLeft)},!0),o("lineNumbers",!1,function(i,m){i.display.gutterSpecs=Ya(i.options.gutters,m),$r(i)},!0),o("firstLineNumber",1,$r,!0),o("lineNumberFormatter",function(i){return i},$r,!0),o("showCursorWhenSelecting",!1,Kr,!0),o("resetSelectionOnContextMenu",!0),o("lineWiseCopyCut",!0),o("pasteLinesPerSelection",!0),o("selectionsMayTouch",!1),o("readOnly",!1,function(i,m){m=="nocursor"&&(Or(i),i.display.input.blur()),i.display.input.readOnlyChanged(m)}),o("screenReaderLabel",null,function(i,m){m=m===""?null:m,i.display.input.screenReaderLabelChanged(m)}),o("disableInput",!1,function(i,m){m||i.display.input.reset()},!0),o("dragDrop",!0,Jl),o("allowDropFileTypes",null),o("cursorBlinkRate",530),o("cursorScrollMargin",0),o("cursorHeight",1,Kr,!0),o("singleCursorHeightPerLine",!0,Kr,!0),o("workTime",100),o("workDelay",100),o("flattenSpans",!0,Jr,!0),o("addModeClass",!1,Jr,!0),o("pollInterval",100),o("undoDepth",200,function(i,m){return i.doc.history.undoDepth=m}),o("historyEventDelay",1250),o("viewportMargin",10,function(i){return i.refresh()},!0),o("maxHighlightLength",1e4,Jr,!0),o("moveInputWithCursor",!0,function(i,m){m||i.display.input.resetPosition()}),o("tabindex",null,function(i,m){return i.display.input.getField().tabIndex=m||""}),o("autofocus",null),o("direction","ltr",function(i,m){return i.doc.setDirection(m)},!0),o("phrases",null)}function Jl(e,t,o){var i=o&&o!=Ur;if(!t!=!i){var m=e.display.dragFunctions,k=t?Ce:ze;k(e.display.scroller,"dragstart",m.start),k(e.display.scroller,"dragenter",m.enter),k(e.display.scroller,"dragover",m.over),k(e.display.scroller,"dragleave",m.leave),k(e.display.scroller,"drop",m.drop)}}function Zl(e){e.options.lineWrapping?(N(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(b(e.display.wrapper,"CodeMirror-wrap"),Xi(e)),Fa(e),Li(e),Hr(e),setTimeout(function(){return Rr(e)},100)}function Wn(e,t){var o=this;if(!(this instanceof Wn))return new Wn(e,t);this.options=t=t?R(t):{},R(Ds,t,!1);var i=t.value;typeof i=="string"?i=new Ii(i,t.mode,null,t.lineSeparator,t.direction):t.mode&&(i.modeOption=t.mode),this.doc=i;var m=new Wn.inputStyles[t.inputStyle](this),k=this.display=new dl(e,i,m,t);k.wrapper.CodeMirror=this,Is(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Po(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Q,keySeq:null,specialChars:null},t.autofocus&&!a&&k.input.focus(),H&&F<11&&setTimeout(function(){return o.display.input.reset(!0)},20),Ql(this),Rl(),_r(this),this.curOp.forceUpdate=!0,Go(this,i),t.autofocus&&!a||this.hasFocus()?setTimeout(function(){o.hasFocus()&&!o.state.focused&&Wa(o)},20):Or(this);for(var Y in Aa)Aa.hasOwnProperty(Y)&&Aa[Y](this,t[Y],Ur);Uo(this),t.finishInit&&t.finishInit(this);for(var Z=0;Z20*20}Ce(t.scroller,"touchstart",function(te){if(!je(e,te)&&!k(te)&&!oo(e,te)){t.input.ensurePolled(),clearTimeout(o);var ie=+new Date;t.activeTouch={start:ie,moved:!1,prev:ie-i.end<=300?i:null},te.touches.length==1&&(t.activeTouch.left=te.touches[0].pageX,t.activeTouch.top=te.touches[0].pageY)}}),Ce(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ce(t.scroller,"touchend",function(te){var ie=t.activeTouch;if(ie&&!vn(t,te)&&ie.left!=null&&!ie.moved&&new Date-ie.start<300){var me=e.coordsChar(t.activeTouch,"page"),xe;!ie.prev||Y(ie,ie.prev)?xe=new An(me,me):!ie.prev.prev||Y(ie,ie.prev.prev)?xe=e.findWordAt(me):xe=new An(ct(me.line,0),w(e.doc,ct(me.line+1,0))),e.setSelection(xe.anchor,xe.head),e.focus(),re(te)}m()}),Ce(t.scroller,"touchcancel",m),Ce(t.scroller,"scroll",function(){t.scroller.clientHeight&&(zr(e,t.scroller.scrollTop),vr(e,t.scroller.scrollLeft,!0),Re(e,"scroll",e))}),Ce(t.scroller,"mousewheel",function(te){return Bo(e,te)}),Ce(t.scroller,"DOMMouseScroll",function(te){return Bo(e,te)}),Ce(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(te){je(e,te)||fe(te)},over:function(te){je(e,te)||(Al(e,te),fe(te))},start:function(te){return Ol(e,te)},drop:di(e,wl),leave:function(te){je(e,te)||ps(e)}};var Z=t.input.getField();Ce(Z,"keyup",function(te){return Ss.call(e,te)}),Ce(Z,"keydown",di(e,Cs)),Ce(Z,"keypress",di(e,ws)),Ce(Z,"focus",function(te){return Wa(e,te)}),Ce(Z,"blur",function(te){return Or(e,te)})}var so=[];Wn.defineInitHook=function(e){return so.push(e)};function ua(e,t,o,i){var m=e.doc,k;o==null&&(o="add"),o=="smart"&&(m.mode.indent?k=ot(e,t).state:o="prev");var Y=e.options.tabSize,Z=Dt(m,t),te=G(Z.text,null,Y);Z.stateAfter&&(Z.stateAfter=null);var ie=Z.text.match(/^\s*/)[0],me;if(!i&&!/\S/.test(Z.text))me=0,o="not";else if(o=="smart"&&(me=m.mode.indent(k,Z.text.slice(ie.length),Z.text),me==_e||me>150)){if(!i)return;o="prev"}o=="prev"?t>m.first?me=G(Dt(m,t-1).text,null,Y):me=0:o=="add"?me=te+e.options.indentUnit:o=="subtract"?me=te-e.options.indentUnit:typeof o=="number"&&(me=te+o),me=Math.max(0,me);var xe="",Ne=0;if(e.options.indentWithTabs)for(var De=Math.floor(me/Y);De;--De)Ne+=Y,xe+=" ";if(NeY,te=Be(t),ie=null;if(Z&&i.ranges.length>1)if(Zi&&Zi.text.join(` `)==t){if(i.ranges.length%Zi.text.length==0){ie=[];for(var me=0;me=0;Ne--){var De=i.ranges[Ne],Ze=De.from(),lt=De.to();De.empty()&&(o&&o>0?Ze=ct(Ze.line,Ze.ch-o):e.state.overwrite&&!Z?lt=ct(lt.line,Math.min(Dt(k,lt.line).text.length,lt.ch+Le(te).length)):Z&&Zi&&Zi.lineWise&&Zi.text.join(` `)==te.join(` `)&&(Ze=lt=ct(Ze.line,0)));var _t={from:Ze,to:lt,text:ie?ie[Ne%ie.length]:te,origin:m||(Z?"paste":e.state.cutIncoming>Y?"cut":"+input")};Dr(e.doc,_t),gn(e,"inputRead",e,_t)}t&&!Z&&Ps(e,t),Ar(e),e.curOp.updateInput<2&&(e.curOp.updateInput=xe),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ms(e,t){var o=e.clipboardData&&e.clipboardData.getData("Text");if(o)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Ui(t,function(){return lo(t,o,0,null,"paste")}),!0}function Ps(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var o=e.doc.sel,i=o.ranges.length-1;i>=0;i--){var m=o.ranges[i];if(m.head.ch>100||i&&o.ranges[i-1].head.line==m.head.line)continue;var k=e.getModeAt(m.head),Y=!1;if(k.electricChars){for(var Z=0;Z-1){Y=ua(e,m.head.line,"smart");break}}else k.electricInput&&(k.electricInput.test(Dt(e.doc,m.head.line).text.slice(0,m.head.ch))&&(Y=ua(e,m.head.line,"smart")));Y&&gn(e,"electricInput",e,m.head.line)}}function ks(e){for(var t=[],o=[],i=0;ik&&(ua(this,Z.head.line,i,!0),k=Z.head.line,Y==this.doc.sel.primIndex&&Ar(this));else{var te=Z.from(),ie=Z.to(),me=Math.max(k,te.line);k=Math.min(this.lastLine(),ie.line-(ie.ch?0:1))+1;for(var xe=me;xe0&&eo(this.doc,Y,new An(te,Ne[Y].to()),pe)}}}),getTokenAt:function(i,m){return Mt(this,i,m)},getLineTokens:function(i,m){return Mt(this,ct(i),m,!0)},getTokenTypeAt:function(i){i=w(this.doc,i);var m=Ve(this,Dt(this.doc,i.line)),k=0,Y=(m.length-1)/2,Z=i.ch,te;if(Z==0)te=m[2];else for(;;){var ie=k+Y>>1;if((ie?m[ie*2-1]:0)>=Z)Y=ie;else if(m[ie*2+1]te&&(i=te,Y=!0),Z=Dt(this.doc,i)}else Z=i;return ca(this,Z,{top:0,left:0},m||"page",k||Y).top+(Y?this.doc.height-Kn(Z):0)},defaultTextHeight:function(){return Sr(this.display)},defaultCharWidth:function(){return wr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(i,m,k,Y,Z){var te=this.display;i=$i(this,w(this.doc,i));var ie=i.bottom,me=i.left;if(m.style.position="absolute",m.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(m),te.sizer.appendChild(m),Y=="over")ie=i.top;else if(Y=="above"||Y=="near"){var xe=Math.max(te.wrapper.clientHeight,this.doc.height),Ne=Math.max(te.sizer.clientWidth,te.lineSpace.clientWidth);(Y=="above"||i.bottom+m.offsetHeight>xe)&&i.top>m.offsetHeight?ie=i.top-m.offsetHeight:i.bottom+m.offsetHeight<=xe&&(ie=i.bottom),me+m.offsetWidth>Ne&&(me=Ne-m.offsetWidth)}m.style.top=ie+"px",m.style.left=m.style.right="",Z=="right"?(me=te.sizer.clientWidth-m.offsetWidth,m.style.right="0px"):(Z=="left"?me=0:Z=="middle"&&(me=(te.sizer.clientWidth-m.offsetWidth)/2),m.style.left=me+"px"),k&&Js(this,{left:me,top:ie,right:me+m.offsetWidth,bottom:ie+m.offsetHeight})},triggerOnKeyDown:Oi(Cs),triggerOnKeyPress:Oi(ws),triggerOnKeyUp:Ss,triggerOnMouseDown:Oi(Os),execCommand:function(i){if(aa.hasOwnProperty(i))return aa[i].call(null,this)},triggerElectric:Oi(function(i){Ps(this,i)}),findPosH:function(i,m,k,Y){var Z=1;m<0&&(Z=-1,m=-m);for(var te=w(this.doc,i),ie=0;ie0&&me(k.charAt(Y-1));)--Y;for(;Z.5||this.options.lineWrapping)&&Fa(this),Re(this,"refresh",this)}),swapDoc:Oi(function(i){var m=this.doc;return m.cm=null,this.state.selectingText&&this.state.selectingText(),Go(this,i),Hr(this),this.display.input.reset(),Gr(this,i.scrollLeft,i.scrollTop),this.curOp.forceScroll=!0,gn(this,"swapDoc",this,m),m}),phrase:function(i){var m=this.options.phrases;return m&&Object.prototype.hasOwnProperty.call(m,i)?m[i]:i},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ce(e),e.registerHelper=function(i,m,k){o.hasOwnProperty(i)||(o[i]=e[i]={_global:[]}),o[i][m]=k},e.registerGlobalHelper=function(i,m,k,Y){e.registerHelper(i,m,Y),o[i]._global.push({pred:k,val:Y})}}function uo(e,t,o,i,m){var k=t,Y=o,Z=Dt(e,t.line),te=m&&e.direction=="rtl"?-o:o;function ie(){var Ut=t.line+te;return Ut=e.first+e.size?!1:(t=new ct(Ut,t.ch,t.sticky),Z=Dt(e,Ut))}function me(Ut){var It;if(i=="codepoint"){var jt=Z.text.charCodeAt(t.ch+(i>0?0:-1));isNaN(jt)?It=null:It=new ct(t.line,Math.max(0,Math.min(Z.text.length,t.ch+o*(jt>=55296&&jt<56320?2:1))),-o)}else m?It=Pl(e.cm,Z,t,o):It=no(Z,t,o);if(It==null)if(!Ut&&ie())t=io(m,e.cm,Z,t.line,te);else return!1;else t=It;return!0}if(i=="char"||i=="codepoint")me();else if(i=="column")me(!0);else if(i=="word"||i=="group")for(var xe=null,Ne=i=="group",De=e.cm&&e.cm.getHelper(t,"wordChars"),Ze=!0;!(o<0&&!me(!Ze));Ze=!1){var lt=Z.text.charAt(t.ch)||` `,_t=Qe(lt,De)?"w":Ne&<==` `?"n":!Ne||/\s/.test(lt)?null:"p";if(Ne&&!Ze&&!_t&&(_t="s"),xe&&xe!=_t){o<0&&(o=1,me(),t.sticky="after");break}if(_t&&(xe=_t),o>0&&!me(!Ze))break}var Lt=Ta(e,t,k,Y,!0);return zn(k,Lt)&&(Lt.hitSide=!0),Lt}function js(e,t,o,i){var m=e.doc,k=t.left,Y;if(i=="page"){var Z=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),te=Math.max(Z-.5*Sr(e.display),3);Y=(o>0?t.bottom:t.top)+o*te}else i=="line"&&(Y=o>0?t.bottom+3:t.top-3);for(var ie;!(ie=ka(e,k,Y),!ie.outside);){if(o<0?Y<=0:Y>=m.height){ie.hitSide=!0;break}Y+=o*5}return ie}var Dn=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Q,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Dn.prototype.init=function(e){var t=this,o=this,i=o.cm,m=o.div=e.lineDiv;Ns(m,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize);function k(Z){for(var te=Z.target;te;te=te.parentNode){if(te==m)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(te.className))break}return!1}Ce(m,"paste",function(Z){if(!k(Z)||je(i,Z)||Ms(Z,i))return;F<=11&&setTimeout(di(i,function(){return t.updateFromDOM()}),20)}),Ce(m,"compositionstart",function(Z){t.composing={data:Z.data,done:!1}}),Ce(m,"compositionupdate",function(Z){t.composing||(t.composing={data:Z.data,done:!1})}),Ce(m,"compositionend",function(Z){t.composing&&(Z.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ce(m,"touchstart",function(){return o.forceCompositionEnd()}),Ce(m,"input",function(){t.composing||t.readFromDOMSoon()});function Y(Z){if(!k(Z)||je(i,Z))return;if(i.somethingSelected())Ra({lineWise:!1,text:i.getSelections()}),Z.type=="cut"&&i.replaceSelection("",null,"cut");else if(i.options.lineWiseCopyCut){var te=ks(i);Ra({lineWise:!0,text:te.text}),Z.type=="cut"&&i.operation(function(){i.setSelections(te.ranges,0,pe),i.replaceSelection("",null,"cut")})}else return;if(Z.clipboardData){Z.clipboardData.clearData();var ie=Zi.text.join(` `);if(Z.clipboardData.setData("Text",ie),Z.clipboardData.getData("Text")==ie){Z.preventDefault();return}}var me=Us(),xe=me.firstChild;i.display.lineSpace.insertBefore(me,i.display.lineSpace.firstChild),xe.value=Zi.text.join(` `);var Ne=document.activeElement;$(xe),setTimeout(function(){i.display.lineSpace.removeChild(me),Ne.focus(),Ne==m&&o.showPrimarySelection()},50)}Ce(m,"copy",Y),Ce(m,"cut",Y)},Dn.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Dn.prototype.prepareSelection=function(){var e=So(this.cm,!1);return e.focus=document.activeElement==this.div,e},Dn.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Dn.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Dn.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,o=t.doc.sel.primary(),i=o.from(),m=o.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||m.line=t.display.viewFrom&&Fs(t,i)||{node:Z[0].measure.map[2],offset:0},ie=m.linee.firstLine()&&(i=ct(i.line-1,Dt(e.doc,i.line-1).length)),m.ch==Dt(e.doc,m.line).text.length&&m.linet.viewTo-1)return!1;var k,Y,Z;i.line==t.viewFrom||(k=gr(e,i.line))==0?(Y=Qt(t.view[0].line),Z=t.view[0].node):(Y=Qt(t.view[k].line),Z=t.view[k-1].node.nextSibling);var te=gr(e,m.line),ie,me;if(te==t.view.length-1?(ie=t.viewTo-1,me=t.lineDiv.lastChild):(ie=Qt(t.view[te+1].line)-1,me=t.view[te+1].node.previousSibling),!Z)return!1;for(var xe=e.doc.splitLines(tu(e,Z,me,Y,ie)),Ne=Rn(e.doc,ct(Y,0),ct(ie,Dt(e.doc,ie).text.length));xe.length>1&&Ne.length>1;)if(Le(xe)==Le(Ne))xe.pop(),Ne.pop(),ie--;else if(xe[0]==Ne[0])xe.shift(),Ne.shift(),Y++;else break;for(var De=0,Ze=0,lt=xe[0],_t=Ne[0],Lt=Math.min(lt.length,_t.length);Dei.ch&&Ut.charCodeAt(Ut.length-Ze-1)==It.charCodeAt(It.length-Ze-1);)De--,Ze++;xe[xe.length-1]=Ut.slice(0,Ut.length-Ze).replace(/^\u200b+/,""),xe[0]=xe[0].slice(De).replace(/\u200b+$/,"");var Yt=ct(Y,De),Vt=ct(ie,Ne.length?Le(Ne).length-Ze:0);if(xe.length>1||xe[0]||St(Yt,Vt))return Mr(e.doc,xe,Yt,Vt,"+input"),!0},Dn.prototype.ensurePolled=function(){this.forceCompositionEnd()},Dn.prototype.reset=function(){this.forceCompositionEnd()},Dn.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Dn.prototype.readFromDOMSoon=function(){var e=this;if(this.readDOMTimeout!=null)return;this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80)},Dn.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Ui(this.cm,function(){return Li(e.cm)})},Dn.prototype.setUneditable=function(e){e.contentEditable="false"},Dn.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||di(this.cm,lo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Dn.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Dn.prototype.onContextMenu=function(){},Dn.prototype.resetPosition=function(){},Dn.prototype.needsContentAttribute=!0;function Fs(e,t){var o=da(e,t.line);if(!o||o.hidden)return null;var i=Dt(e.doc,t.line),m=zi(o,i,t.line),k=Ot(i,e.doc.direction),Y="left";if(k){var Z=xt(k,t.ch);Y=Z%2?"right":"left"}var te=po(m.map,t.ch,Y);return te.offset=te.collapse=="right"?te.end:te.start,te}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function jr(e,t){return t&&(e.bad=!0),e}function tu(e,t,o,i,m){var k="",Y=!1,Z=e.doc.lineSeparator(),te=!1;function ie(De){return function(Ze){return Ze.id==De}}function me(){Y&&(k+=Z,te&&(k+=Z),Y=te=!1)}function xe(De){De&&(me(),k+=De)}function Ne(De){if(De.nodeType==1){var Ze=De.getAttribute("cm-text");if(Ze){xe(Ze);return}var lt=De.getAttribute("cm-marker"),_t;if(lt){var Lt=e.findMarks(ct(i,0),ct(m+1,0),ie(+lt));Lt.length&&(_t=Lt[0].find(0))&&xe(Rn(e.doc,_t.from,_t.to).join(Z));return}if(De.getAttribute("contenteditable")=="false")return;var Ut=/^(pre|div|p|li|table|br)$/i.test(De.nodeName);if(!/^br$/i.test(De.nodeName)&&De.textContent.length==0)return;Ut&&me();for(var It=0;It=9&&t.hasSelection&&(t.hasSelection=null),o.poll()}),Ce(m,"paste",function(Y){if(je(i,Y)||Ms(Y,i))return;i.state.pasteIncoming=+new Date,o.fastPoll()});function k(Y){if(je(i,Y))return;if(i.somethingSelected())Ra({lineWise:!1,text:i.getSelections()});else if(i.options.lineWiseCopyCut){var Z=ks(i);Ra({lineWise:!0,text:Z.text}),Y.type=="cut"?i.setSelections(Z.ranges,null,pe):(o.prevInput="",m.value=Z.text.join(` `),$(m))}else return;Y.type=="cut"&&(i.state.cutIncoming=+new Date)}Ce(m,"cut",k),Ce(m,"copy",k),Ce(e.scroller,"paste",function(Y){if(vn(e,Y)||je(i,Y))return;if(!m.dispatchEvent){i.state.pasteIncoming=+new Date,o.focus();return}var Z=new Event("paste");Z.clipboardData=Y.clipboardData,m.dispatchEvent(Z)}),Ce(e.lineSpace,"selectstart",function(Y){vn(e,Y)||re(Y)}),Ce(m,"compositionstart",function(){var Y=i.getCursor("from");o.composing&&o.composing.range.clear(),o.composing={start:Y,range:i.markText(Y,i.getCursor("to"),{className:"CodeMirror-composing"})}}),Ce(m,"compositionend",function(){o.composing&&(o.poll(),o.composing.range.clear(),o.composing=null)})},Jn.prototype.createField=function(e){this.wrapper=Us(),this.textarea=this.wrapper.firstChild},Jn.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Jn.prototype.prepareSelection=function(){var e=this.cm,t=e.display,o=e.doc,i=So(e);if(e.options.moveInputWithCursor){var m=$i(e,o.sel.primary().head,"div"),k=t.wrapper.getBoundingClientRect(),Y=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,m.top+Y.top-k.top)),i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,m.left+Y.left-k.left))}return i},Jn.prototype.showSelection=function(e){var t=this.cm,o=t.display;p(o.cursorDiv,e.cursors),p(o.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Jn.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var o=t.getSelection();this.textarea.value=o,t.state.focused&&$(this.textarea),H&&F>=9&&(this.hasSelection=o)}else e||(this.prevInput=this.textarea.value="",H&&F>=9&&(this.hasSelection=null))},Jn.prototype.getField=function(){return this.textarea},Jn.prototype.supportsTouch=function(){return!1},Jn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!a||P()!=this.textarea))try{this.textarea.focus()}catch(e){}},Jn.prototype.blur=function(){this.textarea.blur()},Jn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Jn.prototype.receivedFocus=function(){this.slowPoll()},Jn.prototype.slowPoll=function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Jn.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function o(){var i=t.poll();!i&&!e?(e=!0,t.polling.set(60,o)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,o)},Jn.prototype.poll=function(){var e=this,t=this.cm,o=this.textarea,i=this.prevInput;if(this.contextMenuPending||!t.state.focused||We(o)&&!i&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var m=o.value;if(m==i&&!t.somethingSelected())return!1;if(H&&F>=9&&this.hasSelection===m||n&&/[\uf700-\uf7ff]/.test(m))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var k=m.charCodeAt(0);if(k==8203&&!i&&(i="\u200B"),k==8666)return this.reset(),this.cm.execCommand("undo")}for(var Y=0,Z=Math.min(i.length,m.length);Y1e3||m.indexOf(` `)>-1?o.value=e.prevInput="":e.prevInput=m,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Jn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Jn.prototype.onKeyPress=function(){H&&F>=9&&(this.hasSelection=null),this.fastPoll()},Jn.prototype.onContextMenu=function(e){var t=this,o=t.cm,i=o.display,m=t.textarea;t.contextMenuPending&&t.contextMenuPending();var k=mr(o,e),Y=i.scroller.scrollTop;if(!k||f)return;var Z=o.options.resetSelectionOnContextMenu;Z&&o.doc.sel.contains(k)==-1&&di(o,xi)(o.doc,lr(k),pe);var te=m.style.cssText,ie=t.wrapper.style.cssText,me=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",m.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-me.top-5)+"px; left: "+(e.clientX-me.left-5)+`px; z-index: 1000; background: `+(H?"rgba(255, 255, 255, .05)":"transparent")+`; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var xe;D&&(xe=window.scrollY),i.input.focus(),D&&window.scrollTo(null,xe),i.input.reset(),o.somethingSelected()||(m.value=t.prevInput=" "),t.contextMenuPending=De,i.selForContextMenu=o.doc.sel,clearTimeout(i.detectingSelectAll);function Ne(){if(m.selectionStart!=null){var lt=o.somethingSelected(),_t="\u200B"+(lt?m.value:"");m.value="\u21DA",m.value=_t,t.prevInput=lt?"":"\u200B",m.selectionStart=1,m.selectionEnd=_t.length,i.selForContextMenu=o.doc.sel}}function De(){if(t.contextMenuPending!=De)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=ie,m.style.cssText=te,H&&F<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=Y),m.selectionStart!=null){(!H||H&&F<9)&&Ne();var lt=0,_t=function(){i.selForContextMenu==o.doc.sel&&m.selectionStart==0&&m.selectionEnd>0&&t.prevInput=="\u200B"?di(o,is)(o):lt++<10?i.detectingSelectAll=setTimeout(_t,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(_t,200)}}if(H&&F>=9&&Ne(),A){fe(e);var Ze=function(){ze(window,"mouseup",Ze),setTimeout(De,20)};Ce(window,"mouseup",Ze)}else setTimeout(De,50)},Jn.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Jn.prototype.setUneditable=function(){},Jn.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?R(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var o=P();t.autofocus=o==e||e.getAttribute("autofocus")!=null&&o==document.body}function i(){e.value=Z.getValue()}var m;if(e.form&&(Ce(e.form,"submit",i),!t.leaveSubmitMethodAlone)){var k=e.form;m=k.submit;try{var Y=k.submit=function(){i(),k.submit=m,k.submit(),k.submit=Y}}catch(te){}}t.finishInit=function(te){te.save=i,te.getTextArea=function(){return e},te.toTextArea=function(){te.toTextArea=isNaN,i(),e.parentNode.removeChild(te.getWrapperElement()),e.style.display="",e.form&&(ze(e.form,"submit",i),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=m))}},e.style.display="none";var Z=Wn(function(te){return e.parentNode.insertBefore(te,e.nextSibling)},t);return Z}function ru(e){e.off=ze,e.on=Ce,e.wheelEventPixels=cl,e.Doc=Ii,e.splitLines=Be,e.countColumn=G,e.findColumn=we,e.isWordChar=$e,e.Pass=_e,e.signal=Re,e.Line=_i,e.changeEnd=ur,e.scrollbarModel=Mo,e.Pos=ct,e.cmpPos=St,e.modes=Ke,e.mimeModes=Pe,e.resolveMode=Te,e.getMode=ke,e.modeExtensions=rt,e.extendMode=Ct,e.copyState=At,e.startState=yn,e.innerMode=cn,e.commands=aa,e.keyMap=rr,e.keyName=_s,e.isModifierKey=vs,e.lookupKey=kr,e.normalizeKeyMap=Ml,e.StringStream=en,e.SharedTextMarker=na,e.TextMarker=cr,e.LineWidget=ta,e.e_preventDefault=re,e.e_stopPropagation=ae,e.e_stop=fe,e.addClass=N,e.contains=_,e.rmClass=b,e.keyNames=hr}$l(Wn),ql(Wn);var au="iter insert remove copy getEditor constructor".split(" ");for(var Ia in Ii.prototype)Ii.prototype.hasOwnProperty(Ia)&&ne(au,Ia)<0&&(Wn.prototype[Ia]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ii.prototype[Ia]));return ce(Ii),Wn.inputStyles={textarea:Jn,contenteditable:Dn},Wn.defineMode=function(e){!Wn.defaults.mode&&e!="null"&&(Wn.defaults.mode=e),st.apply(this,arguments)},Wn.defineMIME=dt,Wn.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Wn.defineMIME("text/plain","null"),Wn.defineExtension=function(e,t){Wn.prototype[e]=t},Wn.defineDocExtension=function(e,t){Ii.prototype[e]=t},Wn.fromTextArea=iu,ru(Wn),Wn.version="5.58.2",Wn})},WaYH:function(Fe,Se,W){"use strict";var q=W("rePB"),V=W("Ff2n"),M=W("VTBJ"),z=W("1OyB"),U=W("vuIU"),L=W("JX7q"),H=W("Ji7U"),F=W("LK+K"),D=W("q1tI"),I=W("TSYQ"),g=W.n(I),f=W("sboe"),u=W("OZM5"),d=function(A){var C=A.prefixCls,b=A.level,v=A.isStart,p=A.isEnd;if(!b)return null;for(var c="".concat(C,"-indent-unit"),E=[],y=0;y1&&arguments[1]!==void 0?arguments[1]:!1,Oe=pe.getAttribute("id")||pe.getAttribute("data-reactid")||pe.getAttribute("name");if(Ee&&P[Oe])return P[Oe];var we=window.getComputedStyle(pe),he=we.getPropertyValue("box-sizing")||we.getPropertyValue("-moz-box-sizing")||we.getPropertyValue("-webkit-box-sizing"),oe=parseFloat(we.getPropertyValue("padding-bottom"))+parseFloat(we.getPropertyValue("padding-top")),Le=parseFloat(we.getPropertyValue("border-bottom-width"))+parseFloat(we.getPropertyValue("border-top-width")),Ye=_.map(function(qe){return"".concat(qe,":").concat(we.getPropertyValue(qe))}).join(";"),nt={sizingStyle:Ye,paddingSize:oe,borderSize:Le,boxSizing:he};return Ee&&Oe&&(P[Oe]=nt),nt}function $(pe){var Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Oe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,we=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;N||(N=document.createElement("textarea"),N.setAttribute("tab-index","-1"),N.setAttribute("aria-hidden","true"),document.body.appendChild(N)),pe.getAttribute("wrap")?N.setAttribute("wrap",pe.getAttribute("wrap")):N.removeAttribute("wrap");var he=K(pe,Ee),oe=he.paddingSize,Le=he.borderSize,Ye=he.boxSizing,nt=he.sizingStyle;N.setAttribute("style","".concat(nt,";").concat(y)),N.value=pe.value||pe.placeholder||"";var qe=Number.MIN_SAFE_INTEGER,it=Number.MAX_SAFE_INTEGER,He=N.scrollHeight,$e;if(Ye==="border-box"?He+=Le:Ye==="content-box"&&(He-=oe),Oe!==null||we!==null){N.value=" ";var Qe=N.scrollHeight-oe;Oe!==null&&(qe=Qe*Oe,Ye==="border-box"&&(qe=qe+oe+Le),He=Math.max(qe,He)),we!==null&&(it=Qe*we,Ye==="border-box"&&(it=it+oe+Le),$e=He>it?"":"hidden",He=Math.min(it,He))}return{height:He,minHeight:qe,maxHeight:it,overflowY:$e,resize:"none"}}var B=W("Gytx"),R=W.n(B),G;(function(pe){pe[pe.NONE=0]="NONE",pe[pe.RESIZING=1]="RESIZING",pe[pe.RESIZED=2]="RESIZED"})(G||(G={}));var Q=function(pe){Object(z.a)(Oe,pe);var Ee=Object(U.a)(Oe);function Oe(we){var he;return Object(V.a)(this,Oe),he=Ee.call(this,we),he.nextFrameActionId=void 0,he.resizeFrameId=void 0,he.textArea=void 0,he.saveTextArea=function(oe){he.textArea=oe},he.handleResize=function(oe){var Le=he.state.resizeStatus,Ye=he.props,nt=Ye.autoSize,qe=Ye.onResize;if(Le!==G.NONE)return;typeof qe=="function"&&qe(oe),nt&&he.resizeOnNextFrame()},he.resizeOnNextFrame=function(){cancelAnimationFrame(he.nextFrameActionId),he.nextFrameActionId=requestAnimationFrame(he.resizeTextarea)},he.resizeTextarea=function(){var oe=he.props.autoSize;if(!oe||!he.textArea)return;var Le=oe.minRows,Ye=oe.maxRows,nt=$(he.textArea,!1,Le,Ye);he.setState({textareaStyles:nt,resizeStatus:G.RESIZING},function(){cancelAnimationFrame(he.resizeFrameId),he.resizeFrameId=requestAnimationFrame(function(){he.setState({resizeStatus:G.RESIZED},function(){he.resizeFrameId=requestAnimationFrame(function(){he.setState({resizeStatus:G.NONE}),he.fixFirefoxAutoScroll()})})})})},he.renderTextArea=function(){var oe=he.props,Le=oe.prefixCls,Ye=Le===void 0?"rc-textarea":Le,nt=oe.autoSize,qe=oe.onResize,it=oe.className,He=oe.disabled,$e=he.state,Qe=$e.textareaStyles,gt=$e.resizeStatus,et=Object(p.a)(he.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),tt=E()(Ye,it,Object(F.a)({},"".concat(Ye,"-disabled"),He));"value"in et&&(et.value=et.value||"");var Je=Object(H.a)(Object(H.a)(Object(H.a)({},he.props.style),Qe),gt===G.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return L.createElement(v,{onResize:he.handleResize,disabled:!(nt||qe)},L.createElement("textarea",Object(q.a)({},et,{className:tt,style:Je,ref:he.saveTextArea})))},he.state={textareaStyles:{},resizeStatus:G.NONE},he}return Object(M.a)(Oe,[{key:"componentDidUpdate",value:function(he){(he.value!==this.props.value||!R()(he.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var he=this.textArea.selectionStart,oe=this.textArea.selectionEnd;this.textArea.setSelectionRange(he,oe)}}catch(Le){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Oe}(L.Component),ne=Q,le=function(pe){Object(z.a)(Oe,pe);var Ee=Object(U.a)(Oe);function Oe(we){var he;Object(V.a)(this,Oe),he=Ee.call(this,we),he.resizableTextArea=void 0,he.focus=function(){he.resizableTextArea.textArea.focus()},he.saveTextArea=function(Le){he.resizableTextArea=Le},he.handleChange=function(Le){var Ye=he.props.onChange;he.setValue(Le.target.value,function(){he.resizableTextArea.resizeTextarea()}),Ye&&Ye(Le)},he.handleKeyDown=function(Le){var Ye=he.props,nt=Ye.onPressEnter,qe=Ye.onKeyDown;Le.keyCode===13&&nt&&nt(Le),qe&&qe(Le)};var oe=typeof we.value=="undefined"||we.value===null?we.defaultValue:we.value;return he.state={value:oe},he}return Object(M.a)(Oe,[{key:"setValue",value:function(he,oe){"value"in this.props||this.setState({value:he},oe)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return L.createElement(ne,Object(q.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(he){return"value"in he?{value:he.value}:null}}]),Oe}(L.Component),_e=Se.default=le},ZD9Y:function(Fe,Se,W){"use strict";var q=W("BoS7"),V=W("Sdc0"),M=W("OaEy"),z=W("2fM7"),U=W("q1tI"),L=W.n(U),H=W("lOMy"),F=W.n(H),D=z.a.Option;Se.a=function(I){var g=I.onFontSizeChange,f=I.cmFontSize,u=I.cmCodeMode,d=I.onCodeModeChange,s=I.onTabToSpace,l=I.className,r=l===void 0?"":l,a=I.tabToSpace,n=I.children;return L.a.createElement("div",{className:"tpi-code-setting ".concat(r)},L.a.createElement("h3",null,"\u4EE3\u7801\u683C\u5F0F"),L.a.createElement("section",null,L.a.createElement("div",{className:"file-item"},L.a.createElement("b",null,"\u663E\u793A\u6A21\u5F0F"),L.a.createElement(z.a,{bordered:!1,size:"small",value:u,onChange:d},L.a.createElement(D,{value:"vs"},"\u767D\u8272\u80CC\u666F"),L.a.createElement(D,{value:"vs-dark"},"\u9ED1\u8272\u80CC\u666F"))),L.a.createElement("div",{className:"file-item"},L.a.createElement("b",null,"\u5B57\u4F53\u5927\u5C0F"),L.a.createElement(z.a,{bordered:!1,size:"small",value:f,onChange:g},L.a.createElement(D,{value:12},"12px"),L.a.createElement(D,{value:14},"14px"),L.a.createElement(D,{value:16},"16px"),L.a.createElement(D,{value:18},"18px"),L.a.createElement(D,{value:20},"20px"),L.a.createElement(D,{value:22},"22px"))),L.a.createElement("div",{className:"file-item"},L.a.createElement("b",null,"Tab\u8F6C\u6362"),L.a.createElement(V.a,{checked:a,onChange:s}))),L.a.createElement("h3",null,"\u5FEB\u6377\u952E"),L.a.createElement("section",null,L.a.createElement("div",{className:"file-item"},L.a.createElement("b",null,"\u4FDD\u5B58\u4EE3\u7801"),L.a.createElement("span",null,"Ctrl + S")),L.a.createElement("div",{className:"file-item"},L.a.createElement("b",null,"\u5524\u51FA\u5FEB\u6377\u952E\u5217\u8868"),L.a.createElement("span",null,"F1 / Alt + F1")),L.a.createElement("div",{className:"file-item"},L.a.createElement("b",null,"\u5DE6\u53F3\u7F29\u8FDB"),L.a.createElement("span",null,"Ctrl + ]/[")),L.a.createElement("div",{className:"file-item"},L.a.createElement("b",null,"\u8DF3\u5230\u5339\u914D\u7684\u62EC\u53F7"),L.a.createElement("span",null,"Ctrl + Shift + \\")),L.a.createElement("div",{className:"file-item"},L.a.createElement("b",null,"\u8F6C\u5230\u884C\u9996"),L.a.createElement("span",null,"Home")),L.a.createElement("div",{className:"file-item"},L.a.createElement("b",null,"\u8F6C\u5230\u884C\u5C3E"),L.a.createElement("span",null,"End"))),n)}},ZW9T:function(Fe,Se,W){"use strict";W.d(Se,"a",function(){return $});var q=W("k1fw"),V=W("miYZ"),M=W("tsqr"),z=W("rAM+"),U=W("tJVT"),L=W("PpiC"),H=W("q1tI"),F=W.n(H),D=W("bdgK"),I=W("oBTY"),g=W("9og8"),f=W("WmNS"),u=W.n(f),d={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},s={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(` `)},{label:"System.out.println",content:["System.out.println($0)"].join(` `)},{label:"System.out.print",content:["System.out.print($0)"].join(` `)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},l={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","for","friend","gcnew","generic","goto","if","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(` `)},{label:"#include",content:'include "$0"'},{label:"printf",content:"printf($0)"},{label:"main",content:["int main () {"," $0","}"].join(` `)},{label:"for",content:["for( ; ; ){"," $0","}"].join(` `)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(` `)},{label:"using namespace std;",content:["using namespace std;"].join(` `)},{label:"#include ",content:["#include "].join(` `)},{label:"#include ",content:["#include "].join(` `)},{label:"#include ",content:["#include "].join(` `)},{label:"#include ",content:["#include "].join(` `)},{label:"#include ",content:["#include "].join(` `)}]},r={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(` `)}]},a=W("5VLF"),n=W.n(a),h={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},O=function(R,G){return G.map(function(Q){return{label:Q,kind:R.languages.CompletionItemKind.Keyword,insertText:Q}})},S=function(R){return Object.keys(h.tables).map(function(G){return{label:G,kind:R.languages.CompletionItemKind.Variable,insertText:G}})},x=function(R,G){var Q=h.tables[R];return Q?Q.map(function(ne){return{label:ne,kind:G.languages.CompletionItemKind.Field,insertText:ne}}):[]};function A(B,R,G,Q,ne){var le=R.getWordUntilPosition(G),_e={startLineNumber:G.lineNumber,endLineNumber:G.lineNumber,startColumn:le.startColumn,endColumn:le.endColumn},pe=Q.map(function(Ee){return{label:Ee,kind:B.languages.CompletionItemKind.Keyword,insertText:Ee,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:_e}});return ne.map(function(Ee){pe.push(Object(q.a)(Object(q.a)({},Ee),{},{range:_e}))}),pe}var C=function(B){h.languages.map(function(ne){return B.languages.registerDocumentFormattingEditProvider(ne,{provideDocumentFormattingEdits:function(_e,pe,Ee){return Object(g.a)(u.a.mark(function Oe(){var we;return u.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return we=n()(_e.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),oe.abrupt("return",[{range:_e.getFullModelRange(),text:we}]);case 2:case"end":return oe.stop()}},Oe)}))()}}),ne});var R=l.quickKey.map(function(ne){return{label:ne.label,kind:B.languages.CompletionItemKind.Method,insertText:ne.content,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),G=r.quickKey.map(function(ne){return{label:ne.label,kind:B.languages.CompletionItemKind.Method,insertText:ne.content,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),Q=s.quickKey.map(function(ne){return{label:ne.label,kind:B.languages.CompletionItemKind.Method,insertText:ne.content,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet}});B.languages.registerCompletionItemProvider("cpp",{triggerCharacters:["."," ","#"].concat(Object(I.a)(l.keywords),Object(I.a)(l.quickKey.map(function(ne){return ne.label}))),provideCompletionItems:function(le,_e){var pe=le.getValueInRange({startLineNumber:_e.lineNumber,startColumn:1,endLineNumber:_e.lineNumber,endColumn:_e.column}),Ee=pe.match(/cu/gim);console.log("match:",Ee,_e,pe,le);var Oe=[],we=_e.lineNumber,he=_e.column,oe=le.getValueInRange({startLineNumber:we,startColumn:0,endLineNumber:we,endColumn:he}),Le=oe.trim().split(/\s+/),Ye=Le[Le.length-1];if(Ye.endsWith(".")){var nt=Ye.slice(0,Ye.length-1);Object.keys(h.tables).includes(nt)&&(Oe=Object(I.a)(x(nt,B)))}else Ye==="."?Oe=[]:Oe=[].concat(Object(I.a)(S(B)),Object(I.a)(O(B,l.keywords)),Object(I.a)(R));return{suggestions:Oe}}}),B.languages.registerCompletionItemProvider("c",{triggerCharacters:["."," ","#"].concat(Object(I.a)(d.keywords)),provideCompletionItems:function(le,_e){var pe=le.getValueInRange({startLineNumber:_e.lineNumber,startColumn:1,endLineNumber:_e.lineNumber,endColumn:_e.column}),Ee=pe.match(/cu/gim);console.log("match:",Ee,_e,pe,le);var Oe=[],we=_e.lineNumber,he=_e.column,oe=le.getValueInRange({startLineNumber:we,startColumn:0,endLineNumber:we,endColumn:he}),Le=oe.trim().split(/\s+/),Ye=Le[Le.length-1];if(Ye.endsWith(".")){var nt=Ye.slice(0,Ye.length-1);Object.keys(h.tables).includes(nt)&&(Oe=Object(I.a)(x(nt,B)))}else Ye==="."?Oe=[]:Oe=[].concat(Object(I.a)(S(B)),Object(I.a)(O(B,d.keywords)));return{suggestions:Oe}}}),B.languages.registerCompletionItemProvider("java",{triggerCharacters:["."," "].concat(Object(I.a)(s.keywords)),provideCompletionItems:function(le,_e){var pe=[],Ee=_e.lineNumber,Oe=_e.column,we=le.getValueInRange({startLineNumber:Ee,startColumn:0,endLineNumber:Ee,endColumn:Oe}),he=we.trim().split(/\s+/),oe=he[he.length-1];if(oe.endsWith(".")){var Le=oe.slice(0,oe.length-1);Object.keys(h.tables).includes(Le)&&(pe=Object(I.a)(x(Le,B)))}else oe==="."?pe=[]:pe=[].concat(Object(I.a)(S(B)),Object(I.a)(O(B,s.keywords)),Object(I.a)(Q));return{suggestions:pe}}}),B.languages.registerCompletionItemProvider("python",{triggerCharacters:["."," "].concat(Object(I.a)(r.keywords)),provideCompletionItems:function(le,_e){var pe=[],Ee=_e.lineNumber,Oe=_e.column,we=le.getValueInRange({startLineNumber:Ee,startColumn:0,endLineNumber:Ee,endColumn:Oe}),he=we.trim().split(/\s+/),oe=he[he.length-1];if(oe.endsWith(".")){var Le=oe.slice(0,oe.length-1);Object.keys(h.tables).includes(Le)&&(pe=Object(I.a)(x(Le,B)))}else oe==="."?pe=[]:pe=[].concat(Object(I.a)(S(B)),Object(I.a)(O(B,r.keywords)),Object(I.a)(G));return{suggestions:pe}}})},b="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",v=W("LvDl"),p=W("+ua5");function c(B){return/^\d+$/.test(B)?"".concat(B,"px"):B}function E(){}var y=!1,_={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function P(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],R=B;if(Array.isArray(B)){for(var G=0;G0||At.target.offsetWidth>0)&&Re.current.instance.layout()}}catch(cn){rt.e(cn)}finally{rt.f()}}),Te.observe(ze.current)),Te}function be(){M.b.warn(decodeURIComponent(b))}var Ie=function(){var ke=Re.current.instance;if(le!=null&&ke&&ae){var rt=ke.getModel();rt&&le!==rt.getValue()&&(y=!0,rt.setValue(le),ke.layout(),y=!1)}};Object(H.useEffect)(function(){je.current&&clearTimeout(je.current),je.current=setTimeout(function(){Ie()},500)},[le,ae,Re.current]),Object(H.useEffect)(function(){if(Ot&&Re.current&&Re.current.instance){var Te=Re.current.instance;Te.changeViewZones(function(rt){var Ct=document.createElement("div");Ct.style.padding="10px 20px",Ct.style.width="calc(100% - 20px)",Ct.className="my-error-line-wrp",Ct.innerHTML=Ce,rt.addZone({afterLineNumber:Ot||11,heightInLines:3,domNode:Ct})});var ke={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};Te.addOverlayWidget(ke),Te.revealPositionInCenter({lineNumber:20,column:1})}},[Ot,Re.current,ae]);function Xe(){var Te=Re.current.instance;if(Te){var ke=Te.getSelection(),rt=Re.current.pastePos||{},Ct=new N.Range(rt.startLineNumber||ke.endLineNumber,rt.startColumn||ke.endColumn,rt.endLineNumber||ke.endLineNumber,rt.endColumn||ke.endColumn);setTimeout(function(){Te.executeEdits("",[{range:Ct,text:""}])},300)}}function ut(Te){(window.navigator.platform.match("Mac")?Te.metaKey:Te.ctrlKey)&&Te.keyCode==83&&(Te.preventDefault(),it())}var bt=function(){if($e&&Re.current.instance){var ke=Re.current.instance.getContentHeight();st(ke0||Je.target.offsetWidth>0)&&$e.layout()}}catch(vt){et.e(vt)}finally{et.f()}}),Qe.observe(we.current)),Qe}Object(H.useEffect)(function(){we.current&&W.e(27).then(W.t.bind(null,"M/lh",7)).then(function($e){N=$e;var Qe=N.editor.createDiffEditor(we.current,Object(q.a)(Object(q.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},Oe),{},{wordWrap:!0}));Ye(Qe);var gt=nt(Qe);return function(){Qe.dispose();var et=Qe.getModel();et&&et.dispose(),gt.unobserve(we.current)}})},[]),Object(H.useEffect)(function(){Le&&Le.setModel({original:N.editor.createModel(le,pe),modified:N.editor.createModel(_e,pe)})},[le,_e,pe,Le]);var qe=c(G),it=c(ne),He={width:qe,height:it};return F.a.createElement("div",{className:"my-diff-editor",ref:we,style:He})}},ZpRC:function(Fe,Se,W){"use strict";function q(g){return typeof g=="object"&&g!=null&&g.nodeType===1}function V(g,f){return(!f||g!=="hidden")&&g!=="visible"&&g!=="clip"}function M(g,f){if(g.clientHeightf||l>g&&r=f&&a>=u?l-g-d:r>f&&au?r-f+s:0}var U=function(g,f){var u=window,d=f.scrollMode,s=f.block,l=f.inline,r=f.boundary,a=f.skipOverflowHiddenElements,n=typeof r=="function"?r:function(Qe){return Qe!==r};if(!q(g))throw new TypeError("Invalid target");for(var h=document.scrollingElement||document.documentElement,O=[],S=g;q(S)&&n(S);){if((S=S.parentElement)===h){O.push(S);break}S!=null&&S===document.body&&M(S)&&!M(document.documentElement)||S!=null&&M(S,a)&&O.push(S)}for(var x=u.visualViewport?u.visualViewport.width:innerWidth,A=u.visualViewport?u.visualViewport.height:innerHeight,C=window.scrollX||pageXOffset,b=window.scrollY||pageYOffset,v=g.getBoundingClientRect(),p=v.height,c=v.width,E=v.top,y=v.right,_=v.bottom,P=v.left,N=s==="start"||s==="nearest"?E:s==="end"?_:E+p/2,K=l==="center"?P+c/2:l==="end"?y:P,$=[],B=0;B=0&&P>=0&&_<=A&&y<=x&&E>=le&&_<=pe&&P>=Ee&&y<=_e)return $;var Oe=getComputedStyle(R),we=parseInt(Oe.borderLeftWidth,10),he=parseInt(Oe.borderTopWidth,10),oe=parseInt(Oe.borderRightWidth,10),Le=parseInt(Oe.borderBottomWidth,10),Ye=0,nt=0,qe="offsetWidth"in R?R.offsetWidth-R.clientWidth-we-oe:0,it="offsetHeight"in R?R.offsetHeight-R.clientHeight-he-Le:0;if(h===R)Ye=s==="start"?N:s==="end"?N-A:s==="nearest"?z(b,b+A,A,he,Le,b+N,b+N+p,p):N-A/2,nt=l==="start"?K:l==="center"?K-x/2:l==="end"?K-x:z(C,C+x,x,we,oe,C+K,C+K+c,c),Ye=Math.max(0,Ye+b),nt=Math.max(0,nt+C);else{Ye=s==="start"?N-le-he:s==="end"?N-pe+Le+it:s==="nearest"?z(le,pe,Q,he,Le+it,N,N+p,p):N-(le+Q/2)+it/2,nt=l==="start"?K-Ee-we:l==="center"?K-(Ee+ne/2)+qe/2:l==="end"?K-_e+oe+qe:z(Ee,_e,ne,we,oe+qe,K,K+c,c);var He=R.scrollLeft,$e=R.scrollTop;N+=$e-(Ye=Math.max(0,Math.min($e+Ye,R.scrollHeight-Q+it))),K+=He-(nt=Math.max(0,Math.min(He+nt,R.scrollWidth-ne+qe)))}$.push({el:R,top:Ye,left:nt})}return $};function L(g){return g===Object(g)&&Object.keys(g).length!==0}function H(g,f){f===void 0&&(f="auto");var u="scrollBehavior"in document.body.style;g.forEach(function(d){var s=d.el,l=d.top,r=d.left;s.scroll&&u?s.scroll({top:l,left:r,behavior:f}):(s.scrollTop=l,s.scrollLeft=r)})}function F(g){return g===!1?{block:"end",inline:"nearest"}:L(g)?g:{block:"start",inline:"nearest"}}function D(g,f){var u=!g.ownerDocument.documentElement.contains(g);if(L(f)&&typeof f.behavior=="function")return f.behavior(u?[]:U(g,f));if(u)return;var d=F(f);return H(U(g,d),d.behavior)}var I=Se.a=D},a4uL:function(Fe,Se,W){},bCnd:function(Fe,Se,W){"use strict";W.d(Se,"b",function(){return z}),W.d(Se,"a",function(){return U});var q=W("je13"),V=W.n(q),M=!1;function z(L,H){var F=V.a.get("__ec");F||(F={}),F[L]=H,V.a.set("__ec",F)}function U(L,H){var F=V.a.get("__ec");return F?F[L]===void 0?H:F[L]:H}},bT9E:function(Fe,Se,W){"use strict";W.d(Se,"a",function(){return V});var q=W("VTBJ");function V(M,z){var U=Object(q.a)({},M);return Array.isArray(z)&&z.forEach(function(L){delete U[L]}),U}},biw7:function(Fe,Se,W){"use strict";var q=W("q1tI"),V=W.n(q),M=q.createContext(null);Se.a=M},c5Ni:function(Fe,Se,W){},cDPC:function(Fe,Se,W){"use strict";var q=W("tJVT"),V=W("q1tI"),M=W.n(V),z=W("i3hx"),U=W.n(z);Se.a=function(L){var H=L.defaultX,F=H===void 0?"40%":H,D=L.leftChild,I=L.rightChild,g=L.className,f=L.hideResize,u=f===void 0?!1:f,d=Object(V.useState)(F),s=Object(q.a)(d,2),l=s[0],r=s[1],a=Object(V.useRef)();function n(){a.current=!0}Object(V.useEffect)(function(){function S(A){a.current&&r(A.pageX)}function x(){a.current=!1}return window.addEventListener("mousemove",S),window.addEventListener("mouseup",x),function(){window.removeEventListener("mousemove",S),window.removeEventListener("mouseup",x)}},[]);var h=typeof l=="number"&&l!==.01?"".concat(l,"px"):F,O="calc(100% - ".concat(u?"0px":"4px"," - ").concat(h,")");return M.a.createElement("div",{className:"split-panel-container ".concat(g)},M.a.createElement("section",{style:{width:h,display:l===.01?"none":""}},D),M.a.createElement("section",{className:"resize-x-bar",onMouseDown:n},M.a.createElement("a",{className:"btn-resize"},M.a.createElement("svg",{width:"16",height:"13",viewBox:"0 0 16 13"},M.a.createElement("path",{d:"M12.245 7.53H5.647v1.882h6.598v2.823L16 8.471l-3.755-3.765V7.53zM10.353 4.706H3.755v2.823L0 3.765 3.755 0v2.824h6.598v1.882z"})))),M.a.createElement("section",{style:{width:O}},I))}},dejd:function(Fe,Se,W){},dmUQ:function(Fe,Se,W){"use strict";var q=W("Ff2n"),V=W("rePB"),M=W("1OyB"),z=W("vuIU"),U=W("Ji7U"),L=W("md7G"),H=W("foSv"),F=W("q1tI"),D=W.n(F),I=W("TSYQ"),g=W.n(I),f=W("4IlW");function u(p,c){var E=Object.keys(p);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(p);c&&(y=y.filter(function(_){return Object.getOwnPropertyDescriptor(p,_).enumerable})),E.push.apply(E,y)}return E}function d(p){for(var c=1;c1?ne-1:0),_e=1;_e1?B-1:0),G=1;G=0)return parseInt($.slice($.indexOf("e-")+2),10);var B=0;return $.indexOf(".")>=0&&(B=$.length-$.indexOf(".")-1),B},_.getInputDisplayValue=function(K){var $=K||_.state,B=$.focused,R=$.inputValue,G=$.value,Q;B?Q=R:Q=_.toPrecisionAsStep(G),Q==null&&(Q="");var ne=_.formatWrapper(Q);return x(_.props.decimalSeparator)&&(ne=ne.toString().replace(".",_.props.decimalSeparator)),ne},_.recordCursorPosition=function(){try{_.cursorStart=_.input.selectionStart,_.cursorEnd=_.input.selectionEnd,_.currentValue=_.input.value,_.cursorBefore=_.input.value.substring(0,_.cursorStart),_.cursorAfter=_.input.value.substring(_.cursorEnd)}catch(K){}},_.restoreByAfter=function(K){if(K===void 0)return!1;var $=_.input.value,B=$.lastIndexOf(K);if(B===-1)return!1;var R=_.cursorBefore.length;return _.lastKeyCode===f.a.DELETE&&_.cursorBefore.charAt(R-1)===K[0]?(_.fixCaret(R,R),!0):B+K.length===$.length?(_.fixCaret(B,B),!0):!1},_.partRestoreByAfter=function(K){return K===void 0?!1:Array.prototype.some.call(K,function($,B){var R=K.substring(B);return _.restoreByAfter(R)})},_.isNotCompleteNumber=function(K){return isNaN(K)||K===""||K===null||K&&K.toString().indexOf(".")===K.toString().length-1},_.stop=function(){_.autoStepTimer&&clearTimeout(_.autoStepTimer)},_.down=function(K,$,B){_.pressingUpOrDown=!0,_.step("down",K,$,B)},_.up=function(K,$,B){_.pressingUpOrDown=!0,_.step("up",K,$,B)},_.saveInput=function(K){_.input=K};var P=y.value;P===void 0&&(P=y.defaultValue),_.state={focused:y.autoFocus};var N=_.getValidValue(_.toNumber(P));return _.state=d(d({},_.state),{},{inputValue:_.toPrecisionAsStep(N),value:N}),_}return Object(z.a)(E,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(_){var P=this.props,N=P.value,K=P.onChange,$=P.max,B=P.min,R=this.state.focused;if(_){if(!A(_.value,N)||!A(_.max,$)||!A(_.min,B)){var G=R?N:this.getValidValue(N),Q;this.pressingUpOrDown?Q=G:this.inputting?Q=this.rawInput:Q=this.toPrecisionAsStep(G),this.setState({value:G,inputValue:Q})}var ne="value"in this.props?N:this.state.value;"max"in this.props&&_.max!==$&&typeof ne=="number"&&ne>$&&K&&K($),"min"in this.props&&_.min!==B&&typeof ne=="number"&&ne1&&arguments[1]!==void 0?arguments[1]:this.props.min,N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,K=parseFloat(_);return isNaN(K)?_:(KN&&(K=N),K)}},{key:"setValue",value:function(_,P){var N=this.props.precision,K=this.isNotCompleteNumber(parseFloat(_))?null:parseFloat(_),$=this.state.value,B=$===void 0?null:$,R=this.state.inputValue,G=R===void 0?null:R,Q=typeof K=="number"?K.toFixed(N):"".concat(K),ne=K!==B||Q!=="".concat(G);return"value"in this.props?(G=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:G},P)):this.setState({value:K,inputValue:this.toPrecisionAsStep(_)},P),ne&&this.props.onChange(K),K}},{key:"getMaxPrecision",value:function(_){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,N=this.props,K=N.precision,$=N.step;if(x(K))return K;var B=this.getPrecision(P),R=this.getPrecision($),G=this.getPrecision(_);return _?Math.max(G,B+R):B+R}},{key:"getPrecisionFactor",value:function(_){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,N=this.getMaxPrecision(_,P);return Math.pow(10,N)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(_){return this.props.formatter?this.props.formatter(_):_}},{key:"toPrecisionAsStep",value:function(_){if(this.isNotCompleteNumber(_)||_==="")return _;var P=Math.abs(this.getMaxPrecision(_));return isNaN(P)?_.toString():Number(_).toFixed(P)}},{key:"toNumber",value:function(_){var P=this.props.precision,N=this.state.focused,K=_&&_.length>16&&N;return this.isNotCompleteNumber(_)||K?_:x(P)?Math.round(_*Math.pow(10,P))/Math.pow(10,P):Number(_)}},{key:"upStep",value:function(_,P){var N=this.props.step,K=this.getPrecisionFactor(_,P),$=Math.abs(this.getMaxPrecision(_,P)),B=((K*_+K*N*P)/K).toFixed($);return this.toNumber(B)}},{key:"downStep",value:function(_,P){var N=this.props.step,K=this.getPrecisionFactor(_,P),$=Math.abs(this.getMaxPrecision(_,P)),B=((K*_-K*N*P)/K).toFixed($);return this.toNumber(B)}},{key:"step",value:function(_,P){var N=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,$=arguments.length>3?arguments[3]:void 0;this.stop(),P&&(P.persist(),P.preventDefault());var B=this.props;if(B.disabled)return;var R=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(R))return;var G=this["".concat(_,"Step")](R,K),Q=G>B.max||GB.max?G=B.max:G=le),je=(kt||kt===0)&&(isNaN(kt)||Number(kt)<=_e),ge=Re||K||$,de=je||K||$,ce=g()("".concat(N,"-handler"),"".concat(N,"-handler-up"),Object(V.a)({},"".concat(N,"-handler-up-disabled"),ge)),re=g()("".concat(N,"-handler"),"".concat(N,"-handler-down"),Object(V.a)({},"".concat(N,"-handler-down-disabled"),de)),ae=B?{onTouchStart:ge?r:this.up,onTouchEnd:this.stop}:{onMouseDown:ge?r:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},ue=B?{onTouchStart:de?r:this.down,onTouchEnd:this.stop}:{onMouseDown:de?r:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return D.a.createElement("div",{className:Ae,style:pe,title:Ee,onMouseEnter:Oe,onMouseLeave:we,onMouseOver:he,onMouseOut:oe,onFocus:function(){return null},onBlur:function(){return null}},D.a.createElement("div",{className:"".concat(N,"-handler-wrap")},D.a.createElement("span",Object.assign({unselectable:"on"},ae,{role:"button","aria-label":"Increase Value","aria-disabled":ge,className:ce}),G||D.a.createElement("span",{unselectable:"on",className:"".concat(N,"-handler-up-inner"),onClick:a})),D.a.createElement("span",Object.assign({unselectable:"on"},ue,{role:"button","aria-label":"Decrease Value","aria-disabled":de,className:re}),Q||D.a.createElement("span",{unselectable:"on",className:"".concat(N,"-handler-down-inner"),onClick:a}))),D.a.createElement("div",{className:"".concat(N,"-input-wrap")},D.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":_e,"aria-valuemax":le,"aria-valuenow":kt,required:Le,type:qe,placeholder:it,onPaste:vt,onClick:Ye,onMouseUp:this.onMouseUp,className:"".concat(N,"-input"),tabIndex:nt,autoComplete:R,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Ge?this.onKeyDown:r,onKeyUp:Ge?this.onKeyUp:r,autoFocus:tt,maxLength:et,readOnly:$,disabled:K,max:le,min:_e,step:gt,name:Je,title:Ee,id:He,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(ze),pattern:Qe,inputMode:$e,onInput:wt},Ce))))}}]),E}(D.a.Component);C.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:S,min:-S,step:1,style:{},onChange:r,onKeyDown:r,onPressEnter:r,onFocus:r,onBlur:r,parser:n,required:!1,autoComplete:"off"};var b=C,v=Se.a=b},fcSX:function(Fe,Se,W){"use strict";var q=W("Ff2n"),V=W("1OyB"),M=W("vuIU"),z=W("Ji7U"),U=W("md7G"),L=W("foSv"),H=W("1W/9"),F=W("q1tI"),D=W("rePB"),I=W("JX7q"),g=W("TSYQ"),f=W.n(g),u=W("qx4F"),d=W("4IlW");function s(K){return Array.isArray(K)?K:[K]}var l={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},r=Object.keys(l).filter(function(K){if(typeof document=="undefined")return!1;var $=document.getElementsByTagName("html")[0];return K in($?$.style:{})})[0],a=l[r];function n(K,$,B,R){K.addEventListener?K.addEventListener($,B,R):K.attachEvent&&K.attachEvent("on".concat($),B)}function h(K,$,B,R){K.removeEventListener?K.removeEventListener($,B,R):K.attachEvent&&K.detachEvent("on".concat($),B)}function O(K,$){var B=typeof K=="function"?K($):K;return Array.isArray(B)?B.length===2?B:[B[0],B[1]]:[B]}var S=function($){return!isNaN(parseFloat($))&&isFinite($)},x=!(typeof window!="undefined"&&window.document&&window.document.createElement),A=function K($,B,R,G){if(!B||B===document||B instanceof Document)return!1;if(B===$.parentNode)return!0;var Q=Math.max(Math.abs(R),Math.abs(G))===Math.abs(G),ne=Math.max(Math.abs(R),Math.abs(G))===Math.abs(R),le=B.scrollHeight-B.clientHeight,_e=B.scrollWidth-B.clientWidth,pe=document.defaultView.getComputedStyle(B),Ee=pe.overflowY==="auto"||pe.overflowY==="scroll",Oe=pe.overflowX==="auto"||pe.overflowX==="scroll",we=le&&Ee,he=_e&&Oe;return Q&&(!we||we&&(B.scrollTop>=le&&G<0||B.scrollTop<=0&&G>0))||ne&&(!he||he&&(B.scrollLeft>=_e&&R<0||B.scrollLeft<=0&&R>0))?K($,B.parentNode,R,G):!1};function C(K){var $=b();return function(){var R=Object(L.a)(K),G;if($){var Q=Object(L.a)(this).constructor;G=Reflect.construct(R,arguments,Q)}else G=R.apply(this,arguments);return Object(U.a)(this,G)}}function b(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(K){return!1}}var v={},p=function(K){Object(z.a)(B,K);var $=C(B);function B(R){var G;return Object(V.a)(this,B),G=$.call(this,R),G.domFocus=function(){G.dom&&G.dom.focus()},G.removeStartHandler=function(Q){if(Q.touches.length>1)return;G.startPos={x:Q.touches[0].clientX,y:Q.touches[0].clientY}},G.removeMoveHandler=function(Q){if(Q.changedTouches.length>1)return;var ne=Q.currentTarget,le=Q.changedTouches[0].clientX-G.startPos.x,_e=Q.changedTouches[0].clientY-G.startPos.y;(ne===G.maskDom||ne===G.handlerDom||ne===G.contentDom&&A(ne,Q.target,le,_e))&&Q.cancelable&&Q.preventDefault()},G.transitionEnd=function(Q){var ne=Q.target;h(ne,a,G.transitionEnd),ne.style.transition=""},G.onKeyDown=function(Q){if(Q.keyCode===d.a.ESC){var ne=G.props.onClose;Q.stopPropagation(),ne&&ne(Q)}},G.onWrapperTransitionEnd=function(Q){var ne=G.props,le=ne.open,_e=ne.afterVisibleChange;Q.target===G.contentWrapper&&Q.propertyName.match(/transform$/)&&(G.dom.style.transition="",!le&&G.getCurrentDrawerSome()&&(document.body.style.overflowX="",G.maskDom&&(G.maskDom.style.left="",G.maskDom.style.width="")),_e&&_e(!!le))},G.openLevelTransition=function(){var Q=G.props,ne=Q.open,le=Q.width,_e=Q.height,pe=G.getHorizontalBoolAndPlacementName(),Ee=pe.isHorizontal,Oe=pe.placementName,we=G.contentDom?G.contentDom.getBoundingClientRect()[Ee?"width":"height"]:0,he=(Ee?le:_e)||we;G.setLevelAndScrolling(ne,Oe,he)},G.setLevelTransform=function(Q,ne,le,_e){var pe=G.props,Ee=pe.placement,Oe=pe.levelMove,we=pe.duration,he=pe.ease,oe=pe.showMask;G.levelDom.forEach(function(Le){Le.style.transition="transform ".concat(we," ").concat(he),n(Le,a,G.transitionEnd);var Ye=Q?le:0;if(Oe){var nt=O(Oe,{target:Le,open:Q});Ye=Q?nt[0]:nt[1]||0}var qe=typeof Ye=="number"?"".concat(Ye,"px"):Ye,it=Ee==="left"||Ee==="top"?qe:"-".concat(qe);it=oe&&Ee==="right"&&_e?"calc(".concat(it," + ").concat(_e,"px)"):it,Le.style.transform=Ye?"".concat(ne,"(").concat(it,")"):""})},G.setLevelAndScrolling=function(Q,ne,le){var _e=G.props.onChange;if(!x){var pe=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(u.a)(!0):0;G.setLevelTransform(Q,ne,le,pe),G.toggleScrollingToDrawerAndBody(pe)}_e&&_e(Q)},G.toggleScrollingToDrawerAndBody=function(Q){var ne=G.props,le=ne.getOpenCount,_e=ne.getContainer,pe=ne.showMask,Ee=ne.open,Oe=_e&&_e(),we=le&&le();if(Oe&&Oe.parentNode===document.body&&pe){var he=["touchstart"],oe=[document.body,G.maskDom,G.handlerDom,G.contentDom];Ee&&document.body.style.overflow!=="hidden"?(Q&&G.addScrollingEffect(Q),we===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",oe.forEach(function(Le,Ye){if(!Le)return;n(Le,he[Ye]||"touchmove",Ye?G.removeMoveHandler:G.removeStartHandler,G.passive)})):G.getCurrentDrawerSome()&&(we||(document.body.style.overflow=""),document.body.style.touchAction="",Q&&G.remScrollingEffect(Q),oe.forEach(function(Le,Ye){if(!Le)return;h(Le,he[Ye]||"touchmove",Ye?G.removeMoveHandler:G.removeStartHandler,G.passive)}))}},G.addScrollingEffect=function(Q){var ne=G.props,le=ne.placement,_e=ne.duration,pe=ne.ease,Ee=ne.getOpenCount,Oe=ne.switchScrollingEffect,we=Ee&&Ee();we===1&&Oe();var he="width ".concat(_e," ").concat(pe),oe="transform ".concat(_e," ").concat(pe);G.dom.style.transition="none";switch(le){case"right":G.dom.style.transform="translateX(-".concat(Q,"px)");break;case"top":case"bottom":G.dom.style.width="calc(100% - ".concat(Q,"px)"),G.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(G.timeout),G.timeout=setTimeout(function(){G.dom&&(G.dom.style.transition="".concat(oe,",").concat(he),G.dom.style.width="",G.dom.style.transform="")})},G.remScrollingEffect=function(Q){var ne=G.props,le=ne.placement,_e=ne.duration,pe=ne.ease,Ee=ne.getOpenCount,Oe=ne.switchScrollingEffect,we=Ee&&Ee();we||Oe(!0),r&&(document.body.style.overflowX="hidden"),G.dom.style.transition="none";var he,oe="width ".concat(_e," ").concat(pe),Le="transform ".concat(_e," ").concat(pe);switch(le){case"left":{G.dom.style.width="100%",oe="width 0s ".concat(pe," ").concat(_e);break}case"right":{G.dom.style.transform="translateX(".concat(Q,"px)"),G.dom.style.width="100%",oe="width 0s ".concat(pe," ").concat(_e),G.maskDom&&(G.maskDom.style.left="-".concat(Q,"px"),G.maskDom.style.width="calc(100% + ".concat(Q,"px)"));break}case"top":case"bottom":{G.dom.style.width="calc(100% + ".concat(Q,"px)"),G.dom.style.height="100%",G.dom.style.transform="translateZ(0)",he="height 0s ".concat(pe," ").concat(_e);break}default:break}clearTimeout(G.timeout),G.timeout=setTimeout(function(){G.dom&&(G.dom.style.transition="".concat(Le,",").concat(he?"".concat(he,","):"").concat(oe),G.dom.style.transform="",G.dom.style.width="",G.dom.style.height="")})},G.getCurrentDrawerSome=function(){return!Object.keys(v).some(function(Q){return v[Q]})},G.getLevelDom=function(Q){var ne=Q.level,le=Q.getContainer;if(x)return;var _e=le&&le(),pe=_e?_e.parentNode:null;if(G.levelDom=[],ne==="all"){var Ee=pe?Array.prototype.slice.call(pe.children):[];Ee.forEach(function(Oe){Oe.nodeName!=="SCRIPT"&&Oe.nodeName!=="STYLE"&&Oe.nodeName!=="LINK"&&Oe!==_e&&G.levelDom.push(Oe)})}else ne&&s(ne).forEach(function(Oe){document.querySelectorAll(Oe).forEach(function(we){G.levelDom.push(we)})})},G.getHorizontalBoolAndPlacementName=function(){var Q=G.props.placement,ne=Q==="left"||Q==="right",le="translate".concat(ne?"X":"Y");return{isHorizontal:ne,placementName:le}},G.state={_self:Object(I.a)(G)},G}return Object(M.a)(B,[{key:"componentDidMount",value:function(){var G=this;if(!x){var Q=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return Q=!0,null}}))}catch(Ee){}this.passive=Q?{passive:!1}:!1}var ne=this.props,le=ne.open,_e=ne.getContainer,pe=_e&&_e();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),le&&(pe&&pe.parentNode===document.body&&(v[this.drawerId]=le),this.openLevelTransition(),this.forceUpdate(function(){G.domFocus()}))}},{key:"componentDidUpdate",value:function(G){var Q=this.props,ne=Q.open,le=Q.getContainer,_e=le&&le();ne!==G.open&&(ne&&this.domFocus(),_e&&_e.parentNode===document.body&&(v[this.drawerId]=!!ne),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var G=this.props,Q=G.getOpenCount,ne=G.open,le=G.switchScrollingEffect,_e=typeof Q=="function"&&Q();delete v[this.drawerId],ne&&(this.setLevelTransform(!1),document.body.style.touchAction=""),_e||(document.body.style.overflow="",le(!0))}},{key:"render",value:function(){var G,Q=this,ne=this.props,le=ne.className,_e=ne.children,pe=ne.style,Ee=ne.width,Oe=ne.height,we=ne.defaultOpen,he=ne.open,oe=ne.prefixCls,Le=ne.placement,Ye=ne.level,nt=ne.levelMove,qe=ne.ease,it=ne.duration,He=ne.getContainer,$e=ne.handler,Qe=ne.onChange,gt=ne.afterVisibleChange,et=ne.showMask,tt=ne.maskClosable,Je=ne.maskStyle,vt=ne.onClose,wt=ne.onHandleClick,Et=ne.keyboard,xt=ne.getOpenCount,kt=ne.switchScrollingEffect,Ot=Object(q.a)(ne,["className","children","style","width","height","defaultOpen","open","prefixCls","placement","level","levelMove","ease","duration","getContainer","handler","onChange","afterVisibleChange","showMask","maskClosable","maskStyle","onClose","onHandleClick","keyboard","getOpenCount","switchScrollingEffect"]),Ae=this.dom?he:!1,Ce=f()(oe,(G={},Object(D.a)(G,"".concat(oe,"-").concat(Le),!0),Object(D.a)(G,"".concat(oe,"-open"),Ae),Object(D.a)(G,le||"",!!le),Object(D.a)(G,"no-mask",!et),G)),Ge=this.getHorizontalBoolAndPlacementName(),ze=Ge.placementName,Re=Le==="left"||Le==="top"?"-100%":"100%",je=Ae?"":"".concat(ze,"(").concat(Re,")"),ge=$e&&F.cloneElement($e,{onClick:function(ce){$e.props.onClick&&$e.props.onClick(),wt&&wt(ce)},ref:function(ce){Q.handlerDom=ce}});return F.createElement("div",Object.assign({},Ot,{tabIndex:-1,className:Ce,style:pe,ref:function(ce){Q.dom=ce},onKeyDown:Ae&&Et?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),et&&F.createElement("div",{className:"".concat(oe,"-mask"),onClick:tt?vt:void 0,style:Je,ref:function(ce){Q.maskDom=ce}}),F.createElement("div",{className:"".concat(oe,"-content-wrapper"),style:{transform:je,msTransform:je,width:S(Ee)?"".concat(Ee,"px"):Ee,height:S(Oe)?"".concat(Oe,"px"):Oe},ref:function(ce){Q.contentWrapper=ce}},F.createElement("div",{className:"".concat(oe,"-content"),ref:function(ce){Q.contentDom=ce},onTouchStart:Ae&&et?this.removeStartHandler:void 0,onTouchMove:Ae&&et?this.removeMoveHandler:void 0},_e),ge))}}],[{key:"getDerivedStateFromProps",value:function(G,Q){var ne=Q.prevProps,le=Q._self,_e={prevProps:G};if(ne!==void 0){var pe=G.placement,Ee=G.level;pe!==ne.placement&&(le.contentDom=null),Ee!==ne.level&&le.getLevelDom(G)}return _e}}]),B}(F.Component);p.defaultProps={switchScrollingEffect:function(){}};var c=p;function E(K){var $=y();return function(){var R=Object(L.a)(K),G;if($){var Q=Object(L.a)(this).constructor;G=Reflect.construct(R,arguments,Q)}else G=R.apply(this,arguments);return Object(U.a)(this,G)}}function y(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(K){return!1}}var _=function(K){Object(z.a)(B,K);var $=E(B);function B(R){var G;Object(V.a)(this,B),G=$.call(this,R),G.onHandleClick=function(ne){var le=G.props,_e=le.onHandleClick,pe=le.open;if(_e&&_e(ne),typeof pe=="undefined"){var Ee=G.state.open;G.setState({open:!Ee})}},G.onClose=function(ne){var le=G.props,_e=le.onClose,pe=le.open;_e&&_e(ne),typeof pe=="undefined"&&G.setState({open:!1})};var Q=typeof R.open!="undefined"?R.open:!!R.defaultOpen;return G.state={open:Q},"onMaskClick"in R&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),G}return Object(M.a)(B,[{key:"render",value:function(){var G=this,Q=this.props,ne=Q.defaultOpen,le=Q.getContainer,_e=Q.wrapperClassName,pe=Q.forceRender,Ee=Q.handler,Oe=Object(q.a)(Q,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),we=this.state.open;if(!le)return F.createElement("div",{className:_e,ref:function(Le){G.dom=Le}},F.createElement(c,Object.assign({},Oe,{open:we,handler:Ee,getContainer:function(){return G.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var he=!!Ee||pe;return F.createElement(H.a,{visible:we,forceRender:he,getContainer:le,wrapperClassName:_e},function(oe){var Le=oe.visible,Ye=oe.afterClose,nt=Object(q.a)(oe,["visible","afterClose"]);return F.createElement(c,Object.assign({},Oe,nt,{open:Le!==void 0?Le:we,afterVisibleChange:Ye!==void 0?Ye:Oe.afterVisibleChange,handler:Ee,onClose:G.onClose,onHandleClick:G.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(G,Q){var ne=Q.prevProps,le={prevProps:G};return typeof ne!="undefined"&&G.open!==ne.open&&(le.open=G.open),le}}]),B}(F.Component);_.defaultProps={prefixCls:"drawer",placement:"left",getContainer:"body",defaultOpen:!1,level:"all",duration:".3s",ease:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",onChange:function(){},afterVisibleChange:function(){},handler:F.createElement("div",{className:"drawer-handle"},F.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var P=_,N=Se.a=P},fcyK:function(Fe,Se,W){},fyJ8:function(Fe,Se,W){"use strict";var q=W("rePB"),V=W("VTBJ"),M=W("Ff2n"),z=W("U8pU"),U=W("q1tI"),L=W.n(U),H=W("TSYQ"),F=W.n(H),D=W("c+Xe"),I=W("sR1s");function g(l){return l&&Object(z.a)(l)==="object"&&!Array.isArray(l)&&!U.isValidElement(l)}function f(l){return typeof l=="string"?!0:Object(D.c)(l)}function u(l,r){var a,n=l.prefixCls,h=l.className,O=l.record,S=l.index,x=l.dataIndex,A=l.render,C=l.children,b=l.component,v=b===void 0?"td":b,p=l.colSpan,c=l.rowSpan,E=l.fixLeft,y=l.fixRight,_=l.firstFixLeft,P=l.lastFixLeft,N=l.firstFixRight,K=l.lastFixRight,$=l.appendNode,B=l.additionalProps,R=B===void 0?{}:B,G=l.ellipsis,Q=l.align,ne=l.rowType,le=l.isSticky,_e="".concat(n,"-cell"),pe,Ee;if(C)Ee=C;else{var Oe=Object(I.b)(O,x);if(Ee=Oe,A){var we=A(Oe,O,S);g(we)?(Ee=we.children,pe=we.props):Ee=we}}Object(z.a)(Ee)==="object"&&!Array.isArray(Ee)&&!U.isValidElement(Ee)&&(Ee=null),G&&(P||N)&&(Ee=U.createElement("span",{className:"".concat(_e,"-content")},Ee));var he=pe||{},oe=he.colSpan,Le=he.rowSpan,Ye=he.style,nt=he.className,qe=Object(M.a)(he,["colSpan","rowSpan","style","className"]),it=oe!==void 0?oe:p,He=Le!==void 0?Le:c;if(it===0||He===0)return null;var $e={},Qe=typeof E=="number",gt=typeof y=="number";Qe&&($e.position="sticky",$e.left=E),gt&&($e.position="sticky",$e.right=y);var et={};Q&&(et.textAlign=Q);var tt,Je=G===!0?{showTitle:!0}:G;Je&&(Je.showTitle||ne==="header")&&(typeof Ee=="string"||typeof Ee=="number"?tt=Ee.toString():U.isValidElement(Ee)&&typeof Ee.props.children=="string"&&(tt=Ee.props.children));var vt=Object(V.a)(Object(V.a)(Object(V.a)({title:tt},qe),R),{},{colSpan:it&&it!==1?it:null,rowSpan:He&&He!==1?He:null,className:F()(_e,h,(a={},Object(q.a)(a,"".concat(_e,"-fix-left"),Qe),Object(q.a)(a,"".concat(_e,"-fix-left-first"),_),Object(q.a)(a,"".concat(_e,"-fix-left-last"),P),Object(q.a)(a,"".concat(_e,"-fix-right"),gt),Object(q.a)(a,"".concat(_e,"-fix-right-first"),N),Object(q.a)(a,"".concat(_e,"-fix-right-last"),K),Object(q.a)(a,"".concat(_e,"-ellipsis"),G),Object(q.a)(a,"".concat(_e,"-with-append"),$),Object(q.a)(a,"".concat(_e,"-fix-sticky"),(Qe||gt)&&le),a),R.className,nt),style:Object(V.a)(Object(V.a)(Object(V.a)(Object(V.a)({},R.style),et),$e),Ye),ref:f(v)?r:null});return U.createElement(v,Object.assign({},vt),$,Ee)}var d=U.forwardRef(u);d.displayName="Cell";var s=U.memo(d,function(l,r){return r.shouldCellUpdate?!r.shouldCellUpdate(r.record,l.record):!1});Se.a=s},gRFJ:function(Fe,Se,W){Fe.exports=[W("rdUC"),W("ynwM"),W("RELg"),W("DlR+"),W("CrYA"),W("PD8m")]},gaXo:function(module,exports){typeof JSON!="object"&&(JSON={}),function(){"use strict";var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;function f(Fe){return Fe<10?"0"+Fe:Fe}function this_value(){return this.valueOf()}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value);var gap,indent,meta,rep;function quote(Fe){return rx_escapable.lastIndex=0,rx_escapable.test(Fe)?'"'+Fe.replace(rx_escapable,function(Se){var W=meta[Se];return typeof W=="string"?W:"\\u"+("0000"+Se.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+Fe+'"'}function str(Fe,Se){var W,q,V,M,z=gap,U,L=Se[Fe];L&&typeof L=="object"&&typeof L.toJSON=="function"&&(L=L.toJSON(Fe)),typeof rep=="function"&&(L=rep.call(Se,Fe,L));switch(typeof L){case"string":return quote(L);case"number":return isFinite(L)?String(L):"null";case"boolean":case"null":return String(L);case"object":if(!L)return"null";if(gap+=indent,U=[],Object.prototype.toString.apply(L)==="[object Array]"){for(M=L.length,W=0;W` "'(~:]+/,s=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,l=/^\s*\[[^\]]+?\]:.*$/,r=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,a=" ";function n(B,R,G){return R.f=R.inline=G,G(B,R)}function h(B,R,G){return R.f=R.block=G,G(B,R)}function O(B){return!B||!/\S/.test(B.string)}function S(B){if(B.linkTitle=!1,B.linkHref=!1,B.linkText=!1,B.em=!1,B.strong=!1,B.strikethrough=!1,B.quote=0,B.indentedCode=!1,B.f==A){var R=U;if(!R){var G=q.innerMode(z,B.htmlState);R=G.mode.name=="xml"&&G.state.tagStart===null&&!G.state.context&&G.state.tokenize.isInText}R&&(B.f=p,B.block=x,B.htmlState=null)}return B.trailingSpace=0,B.trailingSpaceNewLine=!1,B.prevLine=B.thisLine,B.thisLine={stream:null},null}function x(B,R){var G=B.column()===R.indentation,Q=O(R.prevLine.stream),ne=R.indentedCode,le=R.prevLine.hr,_e=R.list!==!1,pe=(R.listStack[R.listStack.length-1]||0)+3;R.indentedCode=!1;var Ee=R.indentation;if(R.indentationDiff===null&&(R.indentationDiff=R.indentation,_e)){for(R.list=null;Ee=4&&(ne||R.prevLine.fencedCodeEnd||R.prevLine.header||Q))return B.skipToEnd(),R.indentedCode=!0,H.code;if(B.eatSpace())return null;if(G&&R.indentation<=pe&&(he=B.match(f))&&he[1].length<=6)return R.quote=0,R.header=he[1].length,R.thisLine.header=!0,M.highlightFormatting&&(R.formatting="header"),R.f=R.inline,b(R);if(R.indentation<=pe&&B.eat(">"))return R.quote=G?1:R.quote+1,M.highlightFormatting&&(R.formatting="quote"),B.eatSpace(),b(R);if(!we&&!R.setext&&G&&R.indentation<=pe&&(he=B.match(I))){var oe=he[1]?"ol":"ul";return R.indentation=Ee+B.current().length,R.list=!0,R.quote=0,R.listStack.push(R.indentation),R.em=!1,R.strong=!1,R.code=!1,R.strikethrough=!1,M.taskLists&&B.match(g,!1)&&(R.taskList=!0),R.f=R.inline,M.highlightFormatting&&(R.formatting=["list","list-"+oe]),b(R)}else{if(G&&R.indentation<=pe&&(he=B.match(s,!0)))return R.quote=0,R.fencedEndRE=new RegExp(he[1]+"+ *$"),R.localMode=M.fencedCodeBlockHighlighting&&L(he[2]||M.fencedCodeBlockDefaultMode),R.localMode&&(R.localState=q.startState(R.localMode)),R.f=R.block=C,M.highlightFormatting&&(R.formatting="code-block"),R.code=-1,b(R);if(R.setext||(!Oe||!_e)&&!R.quote&&R.list===!1&&!R.code&&!we&&!l.test(B.string)&&(he=B.lookAhead(1))&&(he=he.match(u)))return R.setext?(R.header=R.setext,R.setext=0,B.skipToEnd(),M.highlightFormatting&&(R.formatting="header")):(R.header=he[0].charAt(0)=="="?1:2,R.setext=R.header),R.thisLine.header=!0,R.f=R.inline,b(R);if(we)return B.skipToEnd(),R.hr=!0,R.thisLine.hr=!0,H.hr;if(B.peek()==="[")return n(B,R,P)}return n(B,R,R.inline)}function A(B,R){var G=z.token(B,R.htmlState);if(!U){var Q=q.innerMode(z,R.htmlState);(Q.mode.name=="xml"&&Q.state.tagStart===null&&!Q.state.context&&Q.state.tokenize.isInText||R.md_inside&&B.current().indexOf(">")>-1)&&(R.f=p,R.block=x,R.htmlState=null)}return G}function C(B,R){var G=R.listStack[R.listStack.length-1]||0,Q=R.indentation=B.quote?R.push(H.formatting+"-"+B.formatting[G]+"-"+B.quote):R.push("error"))}if(B.taskOpen)return R.push("meta"),R.length?R.join(" "):null;if(B.taskClosed)return R.push("property"),R.length?R.join(" "):null;if(B.linkHref?R.push(H.linkHref,"url"):(B.strong&&R.push(H.strong),B.em&&R.push(H.em),B.strikethrough&&R.push(H.strikethrough),B.emoji&&R.push(H.emoji),B.linkText&&R.push(H.linkText),B.code&&R.push(H.code),B.image&&R.push(H.image),B.imageAltText&&R.push(H.imageAltText,"link"),B.imageMarker&&R.push(H.imageMarker)),B.header&&R.push(H.header,H.header+"-"+B.header),B.quote&&(R.push(H.quote),!M.maxBlockquoteDepth||M.maxBlockquoteDepth>=B.quote?R.push(H.quote+"-"+B.quote):R.push(H.quote+"-"+M.maxBlockquoteDepth)),B.list!==!1){var Q=(B.listStack.length-1)%3;Q?Q===1?R.push(H.list2):R.push(H.list3):R.push(H.list1)}return B.trailingSpaceNewLine?R.push("trailing-space-new-line"):B.trailingSpace&&R.push("trailing-space-"+(B.trailingSpace%2?"a":"b")),R.length?R.join(" "):null}function v(B,R){return B.match(d,!0)?b(R):void 0}function p(B,R){var G=R.text(B,R);if(typeof G!="undefined")return G;if(R.list)return R.list=null,b(R);if(R.taskList){var Q=B.match(g,!0)[1]===" ";return Q?R.taskOpen=!0:R.taskClosed=!0,M.highlightFormatting&&(R.formatting="task"),R.taskList=!1,b(R)}if(R.taskOpen=!1,R.taskClosed=!1,R.header&&B.match(/^#+$/,!0))return M.highlightFormatting&&(R.formatting="header"),b(R);var ne=B.next();if(R.linkTitle){R.linkTitle=!1;var le=ne;ne==="("&&(le=")"),le=(le+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var _e="^\\s*(?:[^"+le+"\\\\]+|\\\\\\\\|\\\\.)"+le;if(B.match(new RegExp(_e),!0))return H.linkHref}if(ne==="`"){var pe=R.formatting;M.highlightFormatting&&(R.formatting="code"),B.eatWhile("`");var Ee=B.current().length;if(R.code==0&&(!R.quote||Ee==1))return R.code=Ee,b(R);if(Ee==R.code){var Oe=b(R);return R.code=0,Oe}else return R.formatting=pe,b(R)}else if(R.code)return b(R);if(ne==="\\"&&(B.next(),M.highlightFormatting)){var we=b(R),he=H.formatting+"-escape";return we?we+" "+he:he}if(ne==="!"&&B.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return R.imageMarker=!0,R.image=!0,M.highlightFormatting&&(R.formatting="image"),b(R);if(ne==="["&&R.imageMarker&&B.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return R.imageMarker=!1,R.imageAltText=!0,M.highlightFormatting&&(R.formatting="image"),b(R);if(ne==="]"&&R.imageAltText){M.highlightFormatting&&(R.formatting="image");var we=b(R);return R.imageAltText=!1,R.image=!1,R.inline=R.f=E,we}if(ne==="["&&!R.image)return R.linkText&&B.match(/^.*?\]/)||(R.linkText=!0,M.highlightFormatting&&(R.formatting="link")),b(R);if(ne==="]"&&R.linkText){M.highlightFormatting&&(R.formatting="link");var we=b(R);return R.linkText=!1,R.inline=R.f=B.match(/\(.*?\)| ?\[.*?\]/,!1)?E:p,we}if(ne==="<"&&B.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){R.f=R.inline=c,M.highlightFormatting&&(R.formatting="link");var we=b(R);return we?we+=" ":we="",we+H.linkInline}if(ne==="<"&&B.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){R.f=R.inline=c,M.highlightFormatting&&(R.formatting="link");var we=b(R);return we?we+=" ":we="",we+H.linkEmail}if(M.xml&&ne==="<"&&B.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var oe=B.string.indexOf(">",B.pos);if(oe!=-1){var Le=B.string.substring(B.start,oe);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Le)&&(R.md_inside=!0)}return B.backUp(1),R.htmlState=q.startState(z),h(B,R,A)}if(M.xml&&ne==="<"&&B.match(/^\/\w*?>/))return R.md_inside=!1,"tag";if(ne==="*"||ne==="_"){for(var Ye=1,nt=B.pos==1?" ":B.string.charAt(B.pos-2);Ye<3&&B.eat(ne);)Ye++;var qe=B.peek()||" ",it=!/\s/.test(qe)&&(!r.test(qe)||/\s/.test(nt)||r.test(nt)),He=!/\s/.test(nt)&&(!r.test(nt)||/\s/.test(qe)||r.test(qe)),$e=null,Qe=null;if(Ye%2&&(!R.em&&it&&(ne==="*"||!He||r.test(nt))?$e=!0:R.em==ne&&He&&(ne==="*"||!it||r.test(qe))&&($e=!1)),Ye>1&&(!R.strong&&it&&(ne==="*"||!He||r.test(nt))?Qe=!0:R.strong==ne&&He&&(ne==="*"||!it||r.test(qe))&&(Qe=!1)),Qe!=null||$e!=null){M.highlightFormatting&&(R.formatting=$e==null?"strong":Qe==null?"em":"strong em"),$e===!0&&(R.em=ne),Qe===!0&&(R.strong=ne);var Oe=b(R);return $e===!1&&(R.em=!1),Qe===!1&&(R.strong=!1),Oe}}else if(ne===" "&&(B.eat("*")||B.eat("_"))){if(B.peek()===" ")return b(R);B.backUp(1)}if(M.strikethrough){if(ne==="~"&&B.eatWhile(ne)){if(R.strikethrough){M.highlightFormatting&&(R.formatting="strikethrough");var Oe=b(R);return R.strikethrough=!1,Oe}else if(B.match(/^[^\s]/,!1))return R.strikethrough=!0,M.highlightFormatting&&(R.formatting="strikethrough"),b(R)}else if(ne===" "&&B.match(/^~~/,!0)){if(B.peek()===" ")return b(R);B.backUp(2)}}if(M.emoji&&ne===":"&&B.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){R.emoji=!0,M.highlightFormatting&&(R.formatting="emoji");var gt=b(R);return R.emoji=!1,gt}return ne===" "&&(B.match(/^ +$/,!1)?R.trailingSpace++:R.trailingSpace&&(R.trailingSpaceNewLine=!0)),b(R)}function c(B,R){var G=B.next();if(G===">"){R.f=R.inline=p,M.highlightFormatting&&(R.formatting="link");var Q=b(R);return Q?Q+=" ":Q="",Q+H.linkInline}return B.match(/^[^>]+/,!0),H.linkInline}function E(B,R){if(B.eatSpace())return null;var G=B.next();return G==="("||G==="["?(R.f=R.inline=_(G==="("?")":"]"),M.highlightFormatting&&(R.formatting="link-string"),R.linkHref=!0,b(R)):"error"}var y={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function _(B){return function(R,G){var Q=R.next();if(Q===B){G.f=G.inline=p,M.highlightFormatting&&(G.formatting="link-string");var ne=b(G);return G.linkHref=!1,ne}return R.match(y[B]),G.linkHref=!0,b(G)}}function P(B,R){return B.match(/^([^\]\\]|\\.)*\]:/,!1)?(R.f=N,B.next(),M.highlightFormatting&&(R.formatting="link"),R.linkText=!0,b(R)):n(B,R,p)}function N(B,R){if(B.match(/^\]:/,!0)){R.f=R.inline=K,M.highlightFormatting&&(R.formatting="link");var G=b(R);return R.linkText=!1,G}return B.match(/^([^\]\\]|\\.)+/,!0),H.linkText}function K(B,R){return B.eatSpace()?null:(B.match(/^[^\s]+/,!0),B.peek()===void 0?R.linkTitle=!0:B.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),R.f=R.inline=p,H.linkHref+" url")}var $={startState:function(){return{f:x,prevLine:{stream:null},thisLine:{stream:null},block:x,htmlState:null,indentation:0,inline:p,text:v,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(B){return{f:B.f,prevLine:B.prevLine,thisLine:B.thisLine,block:B.block,htmlState:B.htmlState&&q.copyState(z,B.htmlState),indentation:B.indentation,localMode:B.localMode,localState:B.localMode?q.copyState(B.localMode,B.localState):null,inline:B.inline,text:B.text,formatting:!1,linkText:B.linkText,linkTitle:B.linkTitle,linkHref:B.linkHref,code:B.code,em:B.em,strong:B.strong,strikethrough:B.strikethrough,emoji:B.emoji,header:B.header,setext:B.setext,hr:B.hr,taskList:B.taskList,list:B.list,listStack:B.listStack.slice(0),quote:B.quote,indentedCode:B.indentedCode,trailingSpace:B.trailingSpace,trailingSpaceNewLine:B.trailingSpaceNewLine,md_inside:B.md_inside,fencedEndRE:B.fencedEndRE}},token:function(B,R){if(R.formatting=!1,B!=R.thisLine.stream){if(R.header=0,R.hr=!1,B.match(/^\s*$/,!0))return S(R),null;if(R.prevLine=R.thisLine,R.thisLine={stream:B},R.taskList=!1,R.trailingSpace=0,R.trailingSpaceNewLine=!1,!R.localState&&(R.f=R.block,R.f!=A)){var G=B.match(/^\s*/,!0)[0].replace(/\t/g,a).length;if(R.indentation=G,R.indentationDiff=null,G>0)return null}}return R.f(B,R)},innerMode:function(B){return B.block==A?{state:B.htmlState,mode:z}:B.localState?{state:B.localState,mode:B.localMode}:{state:B,mode:$}},indent:function(B,R,G){return B.block==A&&z.indent?z.indent(B.htmlState,R,G):B.localState&&B.localMode.indent?B.localMode.indent(B.localState,R,G):q.Pass},blankLine:S,getType:b,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return $},"xml"),q.defineMIME("text/markdown","markdown"),q.defineMIME("text/x-markdown","markdown")})},n6Qo:function(Fe,Se,W){"use strict";W.d(Se,"a",function(){return F});var q=W("q1tI"),V=W("biw7"),M=W("fyJ8");function z(D){var I=D.className,g=D.index,f=D.children,u=D.colSpan,d=D.rowSpan,s=q.useContext(V.a),l=s.prefixCls,r=s.fixedInfoList,a=r[g];return q.createElement(M.a,Object.assign({className:I,index:g,component:"td",prefixCls:l,record:null,dataIndex:null,render:function(){return{children:f,props:{colSpan:u,rowSpan:d}}}},a))}function U(D){return q.createElement("tr",Object.assign({},D))}function L(D){var I=D.children,g=q.useContext(V.a),f=g.prefixCls;return q.createElement("tfoot",{className:"".concat(f,"-summary")},I)}var H=Se.b=L,F={Cell:z,Row:U}},nWbc:function(Fe,Se,W){},oFv4:function(Fe,Se,W){Fe.exports=W.p+"static/internal.da228387.png"},osHv:function(Fe,Se,W){(function(q){q(W("VrN/"))})(function(q){"use strict";var V=q.Pos;function M(r,a){return r.line-a.line||r.ch-a.ch}var z="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",U=z+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",L=new RegExp("<(/?)(["+z+"]["+U+"]*)","g");function H(r,a,n,h){this.line=a,this.ch=n,this.cm=r,this.text=r.getLine(a),this.min=h?Math.max(h.from,r.firstLine()):r.firstLine(),this.max=h?Math.min(h.to-1,r.lastLine()):r.lastLine()}function F(r,a){var n=r.cm.getTokenTypeAt(V(r.line,a));return n&&/\btag\b/.test(n)}function D(r){return r.line>=r.max?void 0:(r.ch=0,r.text=r.cm.getLine(++r.line),!0)}function I(r){return r.line<=r.min?void 0:(r.text=r.cm.getLine(--r.line),r.ch=r.text.length,!0)}function g(r){for(;;){var a=r.text.indexOf(">",r.ch);if(a==-1){if(D(r))continue;return}if(!F(r,a+1)){r.ch=a+1;continue}var n=r.text.lastIndexOf("/",a),h=n>-1&&!/\S/.test(r.text.slice(n+1,a));return r.ch=a+1,h?"selfClose":"regular"}}function f(r){for(;;){var a=r.ch?r.text.lastIndexOf("<",r.ch-1):-1;if(a==-1){if(I(r))continue;return}if(!F(r,a+1)){r.ch=a;continue}L.lastIndex=a,r.ch=a;var n=L.exec(r.text);if(n&&n.index==a)return n}}function u(r){for(;;){L.lastIndex=r.ch;var a=L.exec(r.text);if(!a){if(D(r))continue;return}if(!F(r,a.index+1)){r.ch=a.index+1;continue}return r.ch=a.index+a[0].length,a}}function d(r){for(;;){var a=r.ch?r.text.lastIndexOf(">",r.ch-1):-1;if(a==-1){if(I(r))continue;return}if(!F(r,a+1)){r.ch=a;continue}var n=r.text.lastIndexOf("/",a),h=n>-1&&!/\S/.test(r.text.slice(n+1,a));return r.ch=a+1,h?"selfClose":"regular"}}function s(r,a){for(var n=[];;){var h=u(r),O,S=r.line,x=r.ch-(h?h[0].length:0);if(!h||!(O=g(r)))return;if(O=="selfClose")continue;if(h[1]){for(var A=n.length-1;A>=0;--A)if(n[A]==h[2]){n.length=A;break}if(A<0&&(!a||a==h[2]))return{tag:h[2],from:V(S,x),to:V(r.line,r.ch)}}else n.push(h[2])}}function l(r,a){for(var n=[];;){var h=d(r);if(!h)return;if(h=="selfClose"){f(r);continue}var O=r.line,S=r.ch,x=f(r);if(!x)return;if(x[1])n.push(x[2]);else{for(var A=n.length-1;A>=0;--A)if(n[A]==x[2]){n.length=A;break}if(A<0&&(!a||a==x[2]))return{tag:x[2],from:V(r.line,r.ch),to:V(O,S)}}}}q.registerHelper("fold","xml",function(r,a){for(var n=new H(r,a.line,0);;){var h=u(n);if(!h||n.line!=a.line)return;var O=g(n);if(!O)return;if(!h[1]&&O!="selfClose"){var S=V(n.line,n.ch),x=s(n,h[2]);return x&&M(x.from,S)>0?{from:S,to:x.from}:null}}}),q.findMatchingTag=function(r,a,n){var h=new H(r,a.line,a.ch,n);if(h.text.indexOf(">")==-1&&h.text.indexOf("<")==-1)return;var O=g(h),S=O&&V(h.line,h.ch),x=O&&f(h);if(!O||!x||M(h,a)>0)return;var A={from:V(h.line,h.ch),to:S,tag:x[2]};return O=="selfClose"?{open:A,close:null,at:"open"}:x[1]?{open:l(h,x[2]),close:A,at:"close"}:(h=new H(r,S.line,S.ch,n),{open:A,close:s(h,x[2]),at:"open"})},q.findEnclosingTag=function(r,a,n,h){for(var O=new H(r,a.line,a.ch,n);;){var S=l(O,h);if(!S)break;var x=new H(r,a.line,a.ch,n),A=s(x,S.tag);if(A)return{open:S,close:A}}},q.scanForClosingTag=function(r,a,n,h){var O=new H(r,a.line,a.ch,h?{from:0,to:h}:null);return s(O,n)}})},"p/48":function(Fe,Se,W){},p5ED:function(Fe,Se,W){"use strict";var q=W("+L6B"),V=W("2/Rp"),M=W("5Dmo"),z=W("3S7+"),U=W("k1fw"),L=W("tJVT"),H=W("q1tI"),F=W.n(H),D=W("vHTk"),I=W.n(D),g=W("yEEn"),f=W("ZW9T"),u=W("1vsH");Se.a=function(d){var s=d.name,l=d.data,r=d.theme,a=d.type,n=d.filename,h=d.monacoEditor,O=d.className,S=d.style,x=d.close,A=d.onClose,C=d.hasMask,b=Object(H.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),v=Object(L.a)(b,2),p=v[0],c=v[1],E=Object(H.useState)(""),y=Object(L.a)(E,2),_=y[0],P=y[1],N,K=1024*1024,$=10*K,B=Object(H.useRef)();a==="office"&&(N=Object(u.T)(l).filesize,N>$&&(a="other")),n&&(h.filename=n),Object(H.useEffect)(function(){var Q,ne,le=(Q=document.cookie)===null||Q===void 0||((ne=Q.replace(/\s/g,""))===null||ne===void 0)?void 0:ne.split(";");le==null||le.map(function(_e){var pe=_e.split("=");pe[0]==="_educoder_session"&&P(pe[1])})},[]);var R=function(){if(l.startsWith("http")||l.startsWith("/")){G();return}Object(u.z)(n||"educoder",l,n)},G=function(){Object(u.x)(n||s,l)};return console.log("data:",l,"fileanme:",n," name:",s),F.a.createElement("div",{style:Object(U.a)({},S||{}),className:"".concat(C&&I.a.bgBlack," ").concat(a?I.a.wrp:"hide")},x&&F.a.createElement("div",{className:I.a.close,ref:B},F.a.createElement(z.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return B.current}},F.a.createElement("span",{onClick:G},F.a.createElement("i",{className:"icon-quxiaozhiding"}))),F.a.createElement(z.a,{title:"\u5173\u95ED",getPopupContainer:function(){return B.current}},F.a.createElement("span",{className:"",onClick:A},F.a.createElement("i",{className:"icon-guanbi1"})))),F.a.createElement("div",{className:"".concat(I.a[O]," ").concat(O," ").concat(I.a.monaco," ").concat(a==="txt"?"show":"hide")},a==="txt"&&F.a.createElement(f.b,h)),a==="audio"&&F.a.createElement("audio",{src:"".concat(l!=null&&l.startsWith("/")||(l==null?void 0:l.indexOf("https://"))>-1?l:"data:audio/mp3;base64,").concat(l),autoPlay:!0}),a==="video"&&F.a.createElement(F.a.Fragment,null,l!=null&&l.startsWith("/")?F.a.createElement("video",{controls:!0,src:"".concat(l),autoPlay:!0}):F.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(l),autoPlay:!0})),a==="html"&&F.a.createElement("iframe",{src:l+"&disposition=inline"}),a==="pdf"&&F.a.createElement("embed",{className:I.a.embed,src:l}),a==="image"&&F.a.createElement(F.a.Fragment,null,F.a.createElement("img",{src:"".concat(l!=null&&l.startsWith("/")||(l==null?void 0:l.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(l)})),a==="other"&&F.a.createElement("div",null,F.a.createElement(V.a,{type:"primary",size:"large",onClick:R},F.a.createElement(g.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(a==="download"||a==="office")&&F.a.createElement(V.a,{type:"primary",size:"large",onClick:R},F.a.createElement(g.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Fe,Se,W){},pPuO:function(Fe,Se,W){Fe.exports={desc:"desc___2o_2w",info:"info___Uro3x","commit-info":"commit-info___o2-Ex"}},psGv:function(Fe,Se,W){var q,V;(function(){var M;(function(){"use strict";var H=[,,function(g){function f(s){this.__parent=s,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}f.prototype.clone_empty=function(){var s=new f(this.__parent);return s.set_indent(this.__indent_count,this.__alignment_count),s},f.prototype.item=function(s){return s<0?this.__items[this.__items.length+s]:this.__items[s]},f.prototype.has_match=function(s){for(var l=this.__items.length-1;l>=0;l--)if(this.__items[l].match(s))return!0;return!1},f.prototype.set_indent=function(s,l){this.is_empty()&&(this.__indent_count=s||0,this.__alignment_count=l||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},f.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)},f.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},f.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var s=this.__parent.current_line;return s.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),s.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),s.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,s.__items[0]===" "&&(s.__items.splice(0,1),s.__character_count-=1),!0}return!1},f.prototype.is_empty=function(){return this.__items.length===0},f.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},f.prototype.push=function(s){this.__items.push(s);var l=s.lastIndexOf(` `);l!==-1?this.__character_count=s.length-l:this.__character_count+=s.length},f.prototype.pop=function(){var s=null;return this.is_empty()||(s=this.__items.pop(),this.__character_count-=s.length),s},f.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},f.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},f.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},f.prototype.toString=function(){var s="";return this.is_empty()?this.__parent.indent_empty_lines&&(s=this.__parent.get_indent_string(this.__indent_count)):(s=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),s+=this.__items.join("")),s};function u(s,l){this.__cache=[""],this.__indent_size=s.indent_size,this.__indent_string=s.indent_char,s.indent_with_tabs||(this.__indent_string=new Array(s.indent_size+1).join(s.indent_char)),l=l||"",s.indent_level>0&&(l=new Array(s.indent_level+1).join(this.__indent_string)),this.__base_string=l,this.__base_string_length=l.length}u.prototype.get_indent_size=function(s,l){var r=this.__base_string_length;return l=l||0,s<0&&(r=0),r+=s*this.__indent_size,r+=l,r},u.prototype.get_indent_string=function(s,l){var r=this.__base_string;return l=l||0,s<0&&(s=0,r=""),l+=s*this.__indent_size,this.__ensure_cache(l),r+=this.__cache[l],r},u.prototype.__ensure_cache=function(s){for(;s>=this.__cache.length;)this.__add_column()},u.prototype.__add_column=function(){var s=this.__cache.length,l=0,r="";this.__indent_size&&s>=this.__indent_size&&(l=Math.floor(s/this.__indent_size),s-=l*this.__indent_size,r=new Array(l+1).join(this.__indent_string)),s&&(r+=new Array(s+1).join(" ")),this.__cache.push(r)};function d(s,l){this.__indent_cache=new u(s,l),this.raw=!1,this._end_with_newline=s.end_with_newline,this.indent_size=s.indent_size,this.wrap_line_length=s.wrap_line_length,this.indent_empty_lines=s.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new f(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}d.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},d.prototype.get_line_number=function(){return this.__lines.length},d.prototype.get_indent_string=function(s,l){return this.__indent_cache.get_indent_string(s,l)},d.prototype.get_indent_size=function(s,l){return this.__indent_cache.get_indent_size(s,l)},d.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},d.prototype.add_new_line=function(s){return this.is_empty()||!s&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},d.prototype.get_code=function(s){this.trim(!0);var l=this.current_line.pop();l&&(l[l.length-1]===` `&&(l=l.replace(/\n+$/g,"")),this.current_line.push(l)),this._end_with_newline&&this.__add_outputline();var r=this.__lines.join(` `);return s!==` `&&(r=r.replace(/[\n]/g,s)),r},d.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},d.prototype.set_indent=function(s,l){return s=s||0,l=l||0,this.next_line.set_indent(s,l),this.__lines.length>1?(this.current_line.set_indent(s,l),!0):(this.current_line.set_indent(),!1)},d.prototype.add_raw_token=function(s){for(var l=0;l1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},d.prototype.just_added_newline=function(){return this.current_line.is_empty()},d.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},d.prototype.ensure_empty_line_above=function(s,l){for(var r=this.__lines.length-2;r>=0;){var a=this.__lines[r];if(a.is_empty())break;if(a.item(0).indexOf(s)!==0&&a.item(-1)!==l){this.__lines.splice(r+1,0,new f(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},g.exports.Output=d},function(g){function f(u,d,s,l){this.type=u,this.text=d,this.comments_before=null,this.newlines=s||0,this.whitespace_before=l||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}g.exports.Token=f},,,function(g){function f(s,l){this.raw_options=u(s,l),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}f.prototype._get_array=function(s,l){var r=this.raw_options[s],a=l||[];return typeof r=="object"?r!==null&&typeof r.concat=="function"&&(a=r.concat()):typeof r=="string"&&(a=r.split(/[^a-zA-Z0-9_\/\-]+/)),a},f.prototype._get_boolean=function(s,l){var r=this.raw_options[s],a=r===void 0?!!l:!!r;return a},f.prototype._get_characters=function(s,l){var r=this.raw_options[s],a=l||"";return typeof r=="string"&&(a=r.replace(/\\r/,"\r").replace(/\\n/,` `).replace(/\\t/," ")),a},f.prototype._get_number=function(s,l){var r=this.raw_options[s];l=parseInt(l,10),isNaN(l)&&(l=0);var a=parseInt(r,10);return isNaN(a)&&(a=l),a},f.prototype._get_selection=function(s,l,r){var a=this._get_selection_list(s,l,r);if(a.length!==1)throw new Error("Invalid Option Value: The option '"+s+`' can only be one of the following values: `+l+` You passed in: '`+this.raw_options[s]+"'");return a[0]},f.prototype._get_selection_list=function(s,l,r){if(!l||l.length===0)throw new Error("Selection list cannot be empty.");if(r=r||[l[0]],!this._is_valid_selection(r,l))throw new Error("Invalid Default Value!");var a=this._get_array(s,r);if(!this._is_valid_selection(a,l))throw new Error("Invalid Option Value: The option '"+s+`' can contain only the following values: `+l+` You passed in: '`+this.raw_options[s]+"'");return a},f.prototype._is_valid_selection=function(s,l){return s.length&&l.length&&!s.some(function(r){return l.indexOf(r)===-1})};function u(s,l){var r={};s=d(s);var a;for(a in s)a!==l&&(r[a]=s[a]);if(l&&s[l])for(a in s[l])r[a]=s[l][a];return r}function d(s){var l={},r;for(r in s){var a=r.replace(/-/g,"_");l[a]=s[r]}return l}g.exports.Options=f,g.exports.normalizeOpts=d,g.exports.mergeOpts=u},,function(g){var f=RegExp.prototype.hasOwnProperty("sticky");function u(d){this.__input=d||"",this.__input_length=this.__input.length,this.__position=0}u.prototype.restart=function(){this.__position=0},u.prototype.back=function(){this.__position>0&&(this.__position-=1)},u.prototype.hasNext=function(){return this.__position=0&&d=0&&s=d.length&&this.__input.substring(s-d.length,s).toLowerCase()===d},g.exports.InputScanner=u},function(g,f,u){var d=u(8).InputScanner,s=u(3).Token,l=u(10).TokenStream,r=u(11).WhitespacePattern,a={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},n=function(h,O){this._input=new d(h),this._options=O||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new r(this._input)};n.prototype.tokenize=function(){this._input.restart(),this.__tokens=new l,this._reset();for(var h,O=new s(a.START,""),S=null,x=[],A=new l;O.type!==a.EOF;){for(h=this._get_next_token(O,S);this._is_comment(h);)A.add(h),h=this._get_next_token(O,S);A.isEmpty()||(h.comments_before=A,A=new l),h.parent=S,this._is_opening(h)?(x.push(S),S=h):S&&this._is_closing(h,S)&&(h.opened=S,S.closed=h,S=x.pop(),h.parent=S),h.previous=O,O.next=h,this.__tokens.add(h),O=h}return this.__tokens},n.prototype._is_first_token=function(){return this.__tokens.isEmpty()},n.prototype._reset=function(){},n.prototype._get_next_token=function(h,O){this._readWhitespace();var S=this._input.read(/.+/g);return S?this._create_token(a.RAW,S):this._create_token(a.EOF,"")},n.prototype._is_comment=function(h){return!1},n.prototype._is_opening=function(h){return!1},n.prototype._is_closing=function(h,O){return!1},n.prototype._create_token=function(h,O){var S=new s(h,O,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return S},n.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},g.exports.Tokenizer=n,g.exports.TOKEN=a},function(g){function f(u){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=u}f.prototype.restart=function(){this.__position=0},f.prototype.isEmpty=function(){return this.__tokens_length===0},f.prototype.hasNext=function(){return this.__position=0&&u/),erb:n.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:n.starting_with(/{%/).until_after(/%}/),django_value:n.starting_with(/{{/).until_after(/}}/),django_comment:n.starting_with(/{#/).until_after(/#}/),smarty:n.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:n.starting_with(/{\*/).until_after(/\*}/),smarty_literal:n.starting_with(/{literal}/).until_after(/{\/literal}/)}}l.prototype=new d,l.prototype._create=function(){return new l(this._input,this)},l.prototype._update=function(){this.__set_templated_pattern()},l.prototype.disable=function(r){var a=this._create();return a._disabled[r]=!0,a._update(),a},l.prototype.read_options=function(r){var a=this._create();for(var n in s)a._disabled[n]=r.templating.indexOf(n)===-1;return a._update(),a},l.prototype.exclude=function(r){var a=this._create();return a._excluded[r]=!0,a._update(),a},l.prototype.read=function(){var r="";this._match_pattern?r=this._input.read(this._starting_pattern):r=this._input.read(this._starting_pattern,this.__template_pattern);for(var a=this._read_template();a;)this._match_pattern?a+=this._input.read(this._match_pattern):a+=this._input.readUntil(this.__template_pattern),r+=a,a=this._read_template();return this._until_after&&(r+=this._input.readUntilAfter(this._until_pattern)),r},l.prototype.__set_templated_pattern=function(){var r=[];this._disabled.php||r.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||r.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||r.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(r.push(this.__patterns.django._starting_pattern.source),r.push(this.__patterns.django_value._starting_pattern.source),r.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||r.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&r.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+r.join("|")+")")},l.prototype._read_template=function(){var r="",a=this._input.peek();if(a==="<"){var n=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&n==="?"&&(r=r||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&n==="%"&&(r=r||this.__patterns.erb.read())}else a==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(r=r||this.__patterns.handlebars_comment.read(),r=r||this.__patterns.handlebars_unescaped.read(),r=r||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(r=r||this.__patterns.django_value.read()),this._excluded.django||(r=r||this.__patterns.django_comment.read(),r=r||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(r=r||this.__patterns.smarty_comment.read(),r=r||this.__patterns.smarty_literal.read(),r=r||this.__patterns.smarty.read()));return r},g.exports.TemplatablePattern=l},,,,function(g,f,u){var d=u(19).Beautifier,s=u(20).Options;function l(r,a,n,h){var O=new d(r,a,n,h);return O.beautify()}g.exports=l,g.exports.defaultOptions=function(){return new s}},function(g,f,u){var d=u(20).Options,s=u(2).Output,l=u(21).Tokenizer,r=u(21).TOKEN,a=/\r\n|[\r\n]/,n=/\r\n|[\r\n]/g,h=function(E,y){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=E.max_preserve_newlines,this.preserve_newlines=E.preserve_newlines,this._output=new s(E,y)};h.prototype.current_line_has_match=function(E){return this._output.current_line.has_match(E)},h.prototype.set_space_before_token=function(E,y){this._output.space_before_token=E,this._output.non_breaking_space=y},h.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},h.prototype.add_raw_token=function(E){this._output.add_raw_token(E)},h.prototype.print_preserved_newlines=function(E){var y=0;E.type!==r.TEXT&&E.previous.type!==r.TEXT&&(y=E.newlines?1:0),this.preserve_newlines&&(y=E.newlines0);return y!==0},h.prototype.traverse_whitespace=function(E){return E.whitespace_before||E.newlines?(this.print_preserved_newlines(E)||(this._output.space_before_token=!0),!0):!1},h.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},h.prototype.print_newline=function(E){this._output.add_new_line(E)},h.prototype.print_token=function(E){E.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(E.text))},h.prototype.indent=function(){this.indent_level++},h.prototype.get_full_indent=function(E){return E=this.indent_level+(E||0),E<1?"":this._output.get_indent_string(E)};var O=function(E){for(var y=null,_=E.next;_.type!==r.EOF&&E.closed!==_;){if(_.type===r.ATTRIBUTE&&_.text==="type"){_.next&&_.next.type===r.EQUALS&&_.next.next&&_.next.next.type===r.VALUE&&(y=_.next.next.text);break}_=_.next}return y},S=function(E,y){var _=null,P=null;return y.closed?(E==="script"?_="text/javascript":E==="style"&&(_="text/css"),_=O(y)||_,_.search("text/css")>-1?P="css":_.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?P="javascript":_.search(/(text|application|dojo)\/(x-)?(html)/)>-1?P="html":_.search(/test\/null/)>-1&&(P="null"),P):null};function x(E,y){return y.indexOf(E)!==-1}function A(E,y,_){this.parent=E||null,this.tag=y?y.tag_name:"",this.indent_level=_||0,this.parser_token=y||null}function C(E){this._printer=E,this._current_frame=null}C.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},C.prototype.record_tag=function(E){var y=new A(this._current_frame,E,this._printer.indent_level);this._current_frame=y},C.prototype._try_pop_frame=function(E){var y=null;return E&&(y=E.parser_token,this._printer.indent_level=E.indent_level,this._current_frame=E.parent),y},C.prototype._get_frame=function(E,y){for(var _=this._current_frame;_&&!(E.indexOf(_.tag)!==-1);){if(y&&y.indexOf(_.tag)!==-1){_=null;break}_=_.parent}return _},C.prototype.try_pop=function(E,y){var _=this._get_frame([E],y);return this._try_pop_frame(_)},C.prototype.indent_to_tag=function(E){var y=this._get_frame(E);y&&(this._printer.indent_level=y.indent_level)};function b(E,y,_,P){this._source_text=E||"",y=y||{},this._js_beautify=_,this._css_beautify=P,this._tag_stack=null;var N=new d(y,"html");this._options=N,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}b.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var E=this._source_text,y=this._options.eol;this._options.eol==="auto"&&(y=` `,E&&a.test(E)&&(y=E.match(a)[0])),E=E.replace(n,` `);var _=E.match(/^[\t ]*/)[0],P={text:"",type:""},N=new v,K=new h(this._options,_),$=new l(E,this._options).tokenize();this._tag_stack=new C(K);for(var B=null,R=$.next();R.type!==r.EOF;)R.type===r.TAG_OPEN||R.type===r.COMMENT?(B=this._handle_tag_open(K,R,N,P),N=B):R.type===r.ATTRIBUTE||R.type===r.EQUALS||R.type===r.VALUE||R.type===r.TEXT&&!N.tag_complete?B=this._handle_inside_tag(K,R,N,$):R.type===r.TAG_CLOSE?B=this._handle_tag_close(K,R,N):R.type===r.TEXT?B=this._handle_text(K,R,N):K.add_raw_token(R),P=B,R=$.next();var G=K._output.get_code(y);return G},b.prototype._handle_tag_close=function(E,y,_){var P={text:y.text,type:y.type};return E.alignment_size=0,_.tag_complete=!0,E.set_space_before_token(y.newlines||y.whitespace_before!=="",!0),_.is_unformatted?E.add_raw_token(y):(_.tag_start_char==="<"&&(E.set_space_before_token(y.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&_.has_wrapped_attrs&&E.print_newline(!1)),E.print_token(y)),_.indent_content&&!(_.is_unformatted||_.is_content_unformatted)&&(E.indent(),_.indent_content=!1),!_.is_inline_element&&!(_.is_unformatted||_.is_content_unformatted)&&E.set_wrap_point(),P},b.prototype._handle_inside_tag=function(E,y,_,P){var N=_.has_wrapped_attrs,K={text:y.text,type:y.type};if(E.set_space_before_token(y.newlines||y.whitespace_before!=="",!0),_.is_unformatted)E.add_raw_token(y);else if(_.tag_start_char==="{"&&y.type===r.TEXT)E.print_preserved_newlines(y)?(y.newlines=0,E.add_raw_token(y)):E.print_token(y);else{if(y.type===r.ATTRIBUTE?(E.set_space_before_token(!0),_.attr_count+=1):(y.type===r.EQUALS||y.type===r.VALUE&&y.previous.type===r.EQUALS)&&E.set_space_before_token(!1),y.type===r.ATTRIBUTE&&_.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(E.traverse_whitespace(y),N=N||y.newlines!==0),this._is_wrap_attributes_force)){var $=_.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&_.attr_count===1){var B=!0,R=0,G;do{if(G=P.peek(R),G.type===r.ATTRIBUTE){B=!1;break}R+=1}while(R<4&&G.type!==r.EOF&&G.type!==r.TAG_CLOSE);$=!B}$&&(E.print_newline(!1),N=!0)}E.print_token(y),N=N||E.previous_token_wrapped(),_.has_wrapped_attrs=N}return K},b.prototype._handle_text=function(E,y,_){var P={text:y.text,type:"TK_CONTENT"};return _.custom_beautifier_name?this._print_custom_beatifier_text(E,y,_):_.is_unformatted||_.is_content_unformatted?E.add_raw_token(y):(E.traverse_whitespace(y),E.print_token(y)),P},b.prototype._print_custom_beatifier_text=function(E,y,_){var P=this;if(y.text!==""){var N=y.text,K,$=1,B="",R="";_.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?K=this._js_beautify:_.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?K=this._css_beautify:_.custom_beautifier_name==="html"&&(K=function(pe,Ee){var Oe=new b(pe,Ee,P._js_beautify,P._css_beautify);return Oe.beautify()}),this._options.indent_scripts==="keep"?$=0:this._options.indent_scripts==="separate"&&($=-E.indent_level);var G=E.get_full_indent($);if(N=N.replace(/\n[ \t]*$/,""),_.custom_beautifier_name!=="html"&&N[0]==="<"&&N.match(/^(|]]>)$/.exec(N);if(!Q){E.add_raw_token(y);return}B=G+Q[1]+` `,N=Q[4],Q[5]&&(R=G+Q[5]),N=N.replace(/\n[ \t]*$/,""),(Q[2]||Q[3].indexOf(` `)!==-1)&&(Q=Q[3].match(/[ \t]+$/),Q&&(y.whitespace_before=Q[0]))}if(N)if(K){var ne=function(){this.eol=` `};ne.prototype=this._options.raw_options;var le=new ne;N=K(G+N,le)}else{var _e=y.whitespace_before;_e&&(N=N.replace(new RegExp(` (`+_e+")?","g"),` `)),N=G+N.replace(/\n/g,` `+G)}B&&(N?N=B+N+` `+R:N=B+R),E.print_newline(!1),N&&(y.text=N,y.whitespace_before="",y.newlines=0,E.add_raw_token(y),E.print_newline(!0))}},b.prototype._handle_tag_open=function(E,y,_,P){var N=this._get_tag_open_token(y);return(_.is_unformatted||_.is_content_unformatted)&&!_.is_empty_element&&y.type===r.TAG_OPEN&&y.text.indexOf("]*)/),this.tag_check=_?_[1]:""):(_=y.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=_?_[1]:"",(y.text.startsWith("{{#>")||y.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&y.next!==null?this.tag_check=y.next.text.split(" ")[0]:this.tag_check=y.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),y.type===r.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||y.closed&&y.closed.text==="/>";var P=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(P=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(P)))}};b.prototype._get_tag_open_token=function(E){var y=new v(this._tag_stack.get_parser_token(),E);return y.alignment_size=this._options.wrap_attributes_indent_size,y.is_end_tag=y.is_end_tag||x(y.tag_check,this._options.void_elements),y.is_empty_element=y.tag_complete||y.is_start_tag&&y.is_end_tag,y.is_unformatted=!y.tag_complete&&x(y.tag_check,this._options.unformatted),y.is_content_unformatted=!y.is_empty_element&&x(y.tag_check,this._options.content_unformatted),y.is_inline_element=x(y.tag_name,this._options.inline)||y.tag_name.includes("-")||y.tag_start_char==="{",y},b.prototype._set_tag_position=function(E,y,_,P,N){if(_.is_empty_element||(_.is_end_tag?_.start_tag_token=this._tag_stack.try_pop(_.tag_name):(this._do_optional_end_element(_)&&(_.is_inline_element||E.print_newline(!1)),this._tag_stack.record_tag(_),(_.tag_name==="script"||_.tag_name==="style")&&!(_.is_unformatted||_.is_content_unformatted)&&(_.custom_beautifier_name=S(_.tag_check,y)))),x(_.tag_check,this._options.extra_liners)&&(E.print_newline(!1),E._output.just_added_blankline()||E.print_newline(!0)),_.is_empty_element){if(_.tag_start_char==="{"&&_.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),_.indent_content=!0;var K=E.current_line_has_match(/{{#if/);K||E.print_newline(!1)}_.tag_name==="!--"&&N.type===r.TAG_CLOSE&&P.is_end_tag&&_.text.indexOf(` `)===-1||(_.is_inline_element||_.is_unformatted||E.print_newline(!1),this._calcluate_parent_multiline(E,_))}else if(_.is_end_tag){var $=!1;$=_.start_tag_token&&_.start_tag_token.multiline_content,$=$||!_.is_inline_element&&!(P.is_inline_element||P.is_unformatted)&&!(N.type===r.TAG_CLOSE&&_.start_tag_token===P)&&N.type!=="TK_CONTENT",(_.is_content_unformatted||_.is_unformatted)&&($=!1),$&&E.print_newline(!1)}else _.indent_content=!_.custom_beautifier_name,_.tag_start_char==="<"&&(_.tag_name==="html"?_.indent_content=this._options.indent_inner_html:_.tag_name==="head"?_.indent_content=this._options.indent_head_inner_html:_.tag_name==="body"&&(_.indent_content=this._options.indent_body_inner_html)),!(_.is_inline_element||_.is_unformatted)&&(N.type!=="TK_CONTENT"||_.is_content_unformatted)&&E.print_newline(!1),this._calcluate_parent_multiline(E,_)},b.prototype._calcluate_parent_multiline=function(E,y){y.parent&&E._output.just_added_newline()&&!((y.is_inline_element||y.is_unformatted)&&y.parent.is_inline_element)&&(y.parent.multiline_content=!0)};var p=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],c=["a","audio","del","ins","map","noscript","video"];b.prototype._do_optional_end_element=function(E){var y=null;if(E.is_empty_element||!E.is_start_tag||!E.parent)return;if(E.tag_name==="body")y=y||this._tag_stack.try_pop("head");else if(E.tag_name==="li")y=y||this._tag_stack.try_pop("li",["ol","ul"]);else if(E.tag_name==="dd"||E.tag_name==="dt")y=y||this._tag_stack.try_pop("dt",["dl"]),y=y||this._tag_stack.try_pop("dd",["dl"]);else if(E.parent.tag_name==="p"&&p.indexOf(E.tag_name)!==-1){var _=E.parent.parent;(!_||c.indexOf(_.tag_name)===-1)&&(y=y||this._tag_stack.try_pop("p"))}else E.tag_name==="rp"||E.tag_name==="rt"?(y=y||this._tag_stack.try_pop("rt",["ruby","rtc"]),y=y||this._tag_stack.try_pop("rp",["ruby","rtc"])):E.tag_name==="optgroup"?y=y||this._tag_stack.try_pop("optgroup",["select"]):E.tag_name==="option"?y=y||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):E.tag_name==="colgroup"?y=y||this._tag_stack.try_pop("caption",["table"]):E.tag_name==="thead"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"])):E.tag_name==="tbody"||E.tag_name==="tfoot"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"]),y=y||this._tag_stack.try_pop("thead",["table"]),y=y||this._tag_stack.try_pop("tbody",["table"])):E.tag_name==="tr"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"]),y=y||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(E.tag_name==="th"||E.tag_name==="td")&&(y=y||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),y=y||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return E.parent=this._tag_stack.get_parser_token(),y},g.exports.Beautifier=b},function(g,f,u){var d=u(6).Options;function s(l){d.call(this,l,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}s.prototype=new d,g.exports.Options=s},function(g,f,u){var d=u(9).Tokenizer,s=u(9).TOKEN,l=u(13).Directives,r=u(14).TemplatablePattern,a=u(12).Pattern,n={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:s.START,RAW:s.RAW,EOF:s.EOF},h=new l(/<\!--/,/-->/),O=function(S,x){d.call(this,S,x),this._current_tag_name="";var A=new r(this._input).read_options(this._options),C=new a(this._input);if(this.__patterns={word:A.until(/[\n\r\t <]/),single_quote:A.until_after(/'/),double_quote:A.until_after(/"/),attribute:A.until(/[\n\r\t =>]|\/>/),element_name:A.until(/[\n\r\t >\/]/),handlebars_comment:C.starting_with(/{{!--/).until_after(/--}}/),handlebars:C.starting_with(/{{/).until_after(/}}/),handlebars_open:C.until(/[\n\r\t }]/),handlebars_raw_close:C.until(/}}/),comment:C.starting_with(//),cdata:C.starting_with(//),conditional_comment:C.starting_with(//),processing:C.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var b=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=C.matching(b).until_after(b)}};O.prototype=new d,O.prototype._is_comment=function(S){return!1},O.prototype._is_opening=function(S){return S.type===n.TAG_OPEN},O.prototype._is_closing=function(S,x){return S.type===n.TAG_CLOSE&&x&&((S.text===">"||S.text==="/>")&&x.text[0]==="<"||S.text==="}}"&&x.text[0]==="{"&&x.text[1]==="{")},O.prototype._reset=function(){this._current_tag_name=""},O.prototype._get_next_token=function(S,x){var A=null;this._readWhitespace();var C=this._input.peek();return C===null?this._create_token(n.EOF,""):(A=A||this._read_open_handlebars(C,x),A=A||this._read_attribute(C,S,x),A=A||this._read_close(C,x),A=A||this._read_raw_content(C,S,x),A=A||this._read_content_word(C),A=A||this._read_comment_or_cdata(C),A=A||this._read_processing(C),A=A||this._read_open(C,x),A=A||this._create_token(n.UNKNOWN,this._input.next()),A)},O.prototype._read_comment_or_cdata=function(S){var x=null,A=null,C=null;if(S==="<"){var b=this._input.peek(1);b==="!"&&(A=this.__patterns.comment.read(),A?(C=h.get_directives(A),C&&C.ignore==="start"&&(A+=h.readIgnored(this._input))):A=this.__patterns.cdata.read()),A&&(x=this._create_token(n.COMMENT,A),x.directives=C)}return x},O.prototype._read_processing=function(S){var x=null,A=null,C=null;if(S==="<"){var b=this._input.peek(1);(b==="!"||b==="?")&&(A=this.__patterns.conditional_comment.read(),A=A||this.__patterns.processing.read()),A&&(x=this._create_token(n.COMMENT,A),x.directives=C)}return x},O.prototype._read_open=function(S,x){var A=null,C=null;return x||S==="<"&&(A=this._input.next(),this._input.peek()==="/"&&(A+=this._input.next()),A+=this.__patterns.element_name.read(),C=this._create_token(n.TAG_OPEN,A)),C},O.prototype._read_open_handlebars=function(S,x){var A=null,C=null;return x||this._options.indent_handlebars&&S==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(A=this.__patterns.handlebars_comment.read(),A=A||this.__patterns.handlebars.read(),C=this._create_token(n.COMMENT,A)):(A=this.__patterns.handlebars_open.read(),C=this._create_token(n.TAG_OPEN,A))),C},O.prototype._read_close=function(S,x){var A=null,C=null;return x&&(x.text[0]==="<"&&(S===">"||S==="/"&&this._input.peek(1)===">")?(A=this._input.next(),S==="/"&&(A+=this._input.next()),C=this._create_token(n.TAG_CLOSE,A)):x.text[0]==="{"&&S==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),C=this._create_token(n.TAG_CLOSE,"}}"))),C},O.prototype._read_attribute=function(S,x,A){var C=null,b="";if(A&&A.text[0]==="<")if(S==="=")C=this._create_token(n.EQUALS,this._input.next());else if(S==='"'||S==="'"){var v=this._input.next();S==='"'?v+=this.__patterns.double_quote.read():v+=this.__patterns.single_quote.read(),C=this._create_token(n.VALUE,v)}else b=this.__patterns.attribute.read(),b&&(x.type===n.EQUALS?C=this._create_token(n.VALUE,b):C=this._create_token(n.ATTRIBUTE,b));return C},O.prototype._is_content_unformatted=function(S){return this._options.void_elements.indexOf(S)===-1&&(this._options.content_unformatted.indexOf(S)!==-1||this._options.unformatted.indexOf(S)!==-1)},O.prototype._read_raw_content=function(S,x,A){var C="";if(A&&A.text[0]==="{")C=this.__patterns.handlebars_raw_close.read();else if(x.type===n.TAG_CLOSE&&x.opened.text[0]==="<"&&x.text[0]!=="/"){var b=x.opened.text.substr(1).toLowerCase();if(b==="script"||b==="style"){var v=this._read_comment_or_cdata(S);if(v)return v.type=n.TEXT,v;C=this._input.readUntil(new RegExp("","ig"))}else this._is_content_unformatted(b)&&(C=this._input.readUntil(new RegExp("","ig")))}return C?this._create_token(n.TEXT,C):null},O.prototype._read_content_word=function(S){var x="";if(this._options.unformatted_content_delimiter&&(S===this._options.unformatted_content_delimiter[0]&&(x=this.__patterns.unformatted_content_delimiter.read())),x||(x=this.__patterns.word.read()),x)return this._create_token(n.TEXT,x)},g.exports.Tokenizer=O,g.exports.TOKEN=n}],F={};function D(g){var f=F[g];if(f!==void 0)return f.exports;var u=F[g]={exports:{}};return H[g](u,u.exports,D),u.exports}var I=D(18);M=I})();var z=M;if(!0)!(q=[W,W("6UM0"),W("TXwP")],V=function(H){var F=W("6UM0"),D=W("TXwP");return{html_beautify:function(I,g){return z(I,g,F.js_beautify,D.css_beautify)}}}.apply(Se,q),V!==void 0&&(Fe.exports=V));else var U,L})()},"qJ4+":function(Fe,Se,W){},"rAM+":function(Fe,Se,W){"use strict";W.d(Se,"a",function(){return V});var q=W("Qw5x");function V(M,z){var U;if(typeof Symbol=="undefined"||M[Symbol.iterator]==null){if(Array.isArray(M)||(U=Object(q.a)(M))||z&&M&&typeof M.length=="number"){U&&(M=U);var L=0,H=function(){};return{s:H,n:function(){return L>=M.length?{done:!0}:{done:!1,value:M[L++]}},e:function(f){throw f},f:H}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var F=!0,D=!1,I;return{s:function(){U=M[Symbol.iterator]()},n:function(){var f=U.next();return F=f.done,f},e:function(f){D=!0,I=f},f:function(){try{!F&&U.return!=null&&U.return()}finally{if(D)throw I}}}}},rUJ1:function(Fe,Se){const W=/[&<>"']/,q=/[&<>"']/g,V=/[<>"']|&(?!#?\w+;)/,M=/[<>"']|&(?!#?\w+;)/g,z={"&":"&","<":"<",">":">",'"':""","'":"'"},U=C=>z[C];function L(C,b){if(b){if(W.test(C))return C.replace(q,U)}else if(V.test(C))return C.replace(M,U);return C}const H=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function F(C){return C.replace(H,(b,v)=>(v=v.toLowerCase(),v==="colon"?":":v.charAt(0)==="#"?v.charAt(1)==="x"?String.fromCharCode(parseInt(v.substring(2),16)):String.fromCharCode(+v.substring(1)):""))}const D=/(^|[^\[])\^/g;function I(C,b){C=C.source||C,b=b||"";const v={replace:(p,c)=>(c=c.source||c,c=c.replace(D,"$1"),C=C.replace(p,c),v),getRegex:()=>new RegExp(C,b)};return v}const g=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function u(C,b,v){if(C){let p;try{p=decodeURIComponent(F(v)).replace(g,"").toLowerCase()}catch(c){return null}if(p.indexOf("javascript:")===0||p.indexOf("vbscript:")===0||p.indexOf("data:")===0)return null}b&&!f.test(v)&&(v=a(b,v));try{v=encodeURI(v).replace(/%25/g,"%")}catch(p){return null}return v}const d={},s=/^[^:]+:\/*[^/]*$/,l=/^([^:]+:)[\s\S]*$/,r=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(C,b){d[" "+C]||(s.test(C)?d[" "+C]=C+"/":d[" "+C]=S(C,"/",!0)),C=d[" "+C];const v=C.indexOf(":")===-1;return b.substring(0,2)==="//"?v?b:C.replace(l,"$1")+b:b.charAt(0)==="/"?v?b:C.replace(r,"$1")+b:C+b}const n={exec:function(){}};function h(C){let b=1,v,p;for(;b{let P=!1,N=y;for(;--N>=0&&_[N]==="\\";)P=!P;return P?"|":" |"}),p=v.split(/ \|/);let c=0;if(p.length>b)p.splice(b);else for(;p.length=0;I--){var g=M().key(I);D(z(g),g)}}function H(D){return M().removeItem(D)}function F(){return M().clear()}},sR1s:function(Fe,Se,W){"use strict";W.d(Se,"b",function(){return z}),W.d(Se,"a",function(){return U}),W.d(Se,"c",function(){return L}),W.d(Se,"d",function(){return H});var q=W("U8pU"),V="RC_TABLE_KEY";function M(F){return F==null?[]:Array.isArray(F)?F:[F]}function z(F,D){if(!D&&typeof D!="number")return F;for(var I=M(D),g=F,f=0;f1)Object(I.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(h.length===0)return Object(I.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var O=h[0];if(L.isValidElement(O)&&Object(g.c)(O)){var S=O.ref;h[0]=L.cloneElement(O,{ref:Object(g.a)(S,this.setChildNode)})}return h.length===1?h[0]:h.map(function(x,A){return!L.isValidElement(x)||"key"in x&&x.key!==null?x:L.cloneElement(x,{key:"".concat(u,"-").concat(A)})})}}]),r}(L.Component);d.displayName="ResizeObserver",Se.a=d},uD2n:function(Fe,Se,W){Fe.exports={"dis-input-editor-container":"dis-input-editor-container___3uf7A",active:"active___20tmT","input-mask":"input-mask___1kijM","text-area":"text-area___2gTEA","tip-container":"tip-container___2tKkE",hide:"hide___3jIwM","md-container":"md-container___14zRI","btn-send":"btn-send___3TabT"}},uMZB:function(Fe,Se,W){Fe.exports={header:"header___3a50V",checkboxs:"checkboxs___3TnBC",field:"field___SHW6f","oj-form-container":"oj-form-container___36KBv","oj-left-panel":"oj-left-panel___3Fdj5","oj-form-info":"oj-form-info___dilPb",footer:"footer___1Ie9U","test-case-name":"test-case-name___356US","btn-remove-case":"btn-remove-case___1Z5cd","icon-tag":"icon-tag___3zUaP",btn_back:"btn_back___2UBbR",testJi:"testJi___1dyLk",upBtn:"upBtn___1I0SJ"}},uQRt:function(Fe,Se,W){Fe.exports=q;function q(){return W("gaXo"),{}}},ulZh:function(Fe,Se,W){typeof window!="undefined"&&function(V,M){Fe.exports=M()}(this,function(){return function(q){var V={};function M(z){if(V[z])return V[z].exports;var U=V[z]={i:z,l:!1,exports:{}};return q[z].call(U.exports,U,U.exports,M),U.l=!0,U.exports}return M.m=q,M.c=V,M.d=function(z,U,L){M.o(z,U)||Object.defineProperty(z,U,{enumerable:!0,get:L})},M.r=function(z){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(z,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(z,"__esModule",{value:!0})},M.t=function(z,U){if(U&1&&(z=M(z)),U&8)return z;if(U&4&&typeof z=="object"&&z&&z.__esModule)return z;var L=Object.create(null);if(M.r(L),Object.defineProperty(L,"default",{enumerable:!0,value:z}),U&2&&typeof z!="string")for(var H in z)M.d(L,H,function(F){return z[F]}.bind(null,H));return L},M.n=function(z){var U=z&&z.__esModule?function(){return z.default}:function(){return z};return M.d(U,"a",U),U},M.o=function(z,U){return Object.prototype.hasOwnProperty.call(z,U)},M.p="/dist/",M(M.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(q,V,M){"use strict";var z=Object.prototype.hasOwnProperty,U="~";function L(){}Object.create&&(L.prototype=Object.create(null),new L().__proto__||(U=!1));function H(g,f,u){this.fn=g,this.context=f,this.once=u||!1}function F(g,f,u,d,s){if(typeof u!="function")throw new TypeError("The listener must be a function");var l=new H(u,d||g,s),r=U?U+f:f;return g._events[r]?g._events[r].fn?g._events[r]=[g._events[r],l]:g._events[r].push(l):(g._events[r]=l,g._eventsCount++),g}function D(g,f){--g._eventsCount===0?g._events=new L:delete g._events[f]}function I(){this._events=new L,this._eventsCount=0}I.prototype.eventNames=function(){var f=[],u,d;if(this._eventsCount===0)return f;for(d in u=this._events)z.call(u,d)&&f.push(U?d.slice(1):d);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(u)):f},I.prototype.listeners=function(f){var u=U?U+f:f,d=this._events[u];if(!d)return[];if(d.fn)return[d.fn];for(var s=0,l=d.length,r=new Array(l);s0},!1)}function g(f,u){for(var d={main:[u]},s={main:[]},l={main:{}};I(d);)for(var r=Object.keys(d),a=0;a=2*A/b||_<=N)return;var K=Number.POSITIVE_INFINITY,$;for($=r.level-1;$>p;$--){var B=v[$].maxBitrate;if(K=A*B/(8*.8*y),K=_)return;var R=this.bwEstimator.getEstimate();I.logger.warn("Fragment "+r.sn+(a?" part "+a.index:"")+" of level "+r.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+$+` Current BW estimate: `+(Object(z.isFiniteNumber)(R)?(R/1024).toFixed(3):"Unknown")+` Kb/s Estimated load time for current fragment: `+_.toFixed(3)+` s Estimated load time for the next fragment: `+K.toFixed(3)+` s Time to underbuffer: `+N.toFixed(3)+" s"),n.nextLoadLevel=$,this.bwEstimator.sample(C,x.loaded),this.clearTimer(),r.loader&&(this.fragCurrent=this.partCurrent=null,r.loader.abort()),n.trigger(L.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:r,part:a,stats:x})},s.onFragLoaded=function(r,a){var n=a.frag,h=a.part;if(n.type===D.PlaylistLevelType.MAIN&&Object(z.isFiniteNumber)(n.sn)){var O=h?h.stats:n.stats,S=h?h.duration:n.duration;if(this.clearTimer(),this.lastLoadedFragLevel=n.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var x=this.hls.levels[n.level],A=(x.loaded?x.loaded.bytes:0)+O.loaded,C=(x.loaded?x.loaded.duration:0)+S;x.loaded={bytes:A,duration:C},x.realBitrate=Math.round(8*A/C)}if(n.bitrateTest){var b={stats:O,frag:n,part:h,id:n.type};this.onFragBuffered(L.Events.FRAG_BUFFERED,b),n.bitrateTest=!1}}},s.onFragBuffered=function(r,a){var n=a.frag,h=a.part,O=h?h.stats:n.stats;if(O.aborted)return;if(n.type!==D.PlaylistLevelType.MAIN||n.sn==="initSegment")return;var S=O.parsing.end-O.loading.start;this.bwEstimator.sample(S,O.loaded),O.bwEstimate=this.bwEstimator.getEstimate(),n.bitrateTest?this.bitrateTestDelay=S/1e3:this.bitrateTestDelay=0},s.onError=function(r,a){switch(a.details){case F.ErrorDetails.FRAG_LOAD_ERROR:case F.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},s.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},s.getNextABRAutoLevel=function(){var r=this.fragCurrent,a=this.partCurrent,n=this.hls,h=n.maxAutoLevel,O=n.config,S=n.minAutoLevel,x=n.media,A=a?a.duration:r?r.duration:0,C=x?x.currentTime:0,b=x&&x.playbackRate!==0?Math.abs(x.playbackRate):1,v=this.bwEstimator?this.bwEstimator.getEstimate():O.abrEwmaDefaultEstimate,p=(H.BufferHelper.bufferInfo(x,C,O.maxBufferHole).end-C)/b,c=this.findBestLevel(v,S,h,p,O.abrBandWidthFactor,O.abrBandWidthUpFactor);if(c>=0)return c;I.logger.trace((p?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var E=A?Math.min(A,O.maxStarvationDelay):O.maxStarvationDelay,y=O.abrBandWidthFactor,_=O.abrBandWidthUpFactor;if(!p){var P=this.bitrateTestDelay;if(P){var N=A?Math.min(A,O.maxLoadingDelay):O.maxLoadingDelay;E=N-P,I.logger.trace("bitrate test took "+Math.round(1e3*P)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*E)+" ms"),y=_=1}}return c=this.findBestLevel(v,S,h,p+E,y,_),Math.max(c,0)},s.findBestLevel=function(r,a,n,h,O,S){for(var x,A=this.fragCurrent,C=this.partCurrent,b=this.lastLoadedFragLevel,v=this.hls.levels,p=v[b],c=!!(p!=null&&(x=p.details)!==null&&x!==void 0&&x.live),E=p==null?void 0:p.codecSet,y=C?C.duration:A?A.duration:0,_=n;_>=a;_--){var P=v[_];if(!P||E&&P.codecSet!==E)continue;var N=P.details,K=(C?N==null?void 0:N.partTarget:N==null?void 0:N.averagetargetduration)||y,$=void 0;_<=b?$=O*r:$=S*r;var B=v[_].maxBitrate,R=B*K/$;if(I.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+_+"/"+Math.round($)+"/"+B+"/"+K+"/"+h+"/"+R),$>B&&(!R||c&&!this.bitrateTestDelay||R0&&p===-1?(this.log("Override startPosition with lastCurrentTime @"+c.toFixed(3)),this.state=U.State.IDLE):(this.loadedmetadata=!1,this.state=U.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=p,this.tick()},b.doTick=function(){switch(this.state){case U.State.IDLE:this.doTickIdle();break;case U.State.WAITING_TRACK:{var p,c=this.levels,E=this.trackId,y=c==null||((p=c[E])===null||p===void 0)?void 0:p.details;if(y){if(this.waitForCdnTuneIn(y))break;this.state=U.State.WAITING_INIT_PTS}break}case U.State.FRAG_LOADING_WAITING_RETRY:{var _,P=performance.now(),N=this.retryDate;(!N||P>=N||(_=this.media)!==null&&_!==void 0&&_.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=U.State.IDLE);break}case U.State.WAITING_INIT_PTS:{var K=this.waitingData;if(K){var $=K.frag,B=K.part,R=K.cache,G=K.complete;if(this.initPTS[$.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=U.State.FRAG_LOADING;var Q=R.flush(),ne={frag:$,part:B,payload:Q,networkDetails:null};this._handleFragmentLoadProgress(ne),G&&A.prototype._handleFragmentLoadComplete.call(this,ne)}else if(this.videoTrackCC!==this.waitingVideoCC)a.logger.log("Waiting fragment cc ("+$.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var le=this.getLoadPosition(),_e=H.BufferHelper.bufferInfo(this.mediaBuffer,le,this.config.maxBufferHole),pe=Object(s.fragmentWithinToleranceTest)(_e.end,this.config.maxFragLookUpTolerance,$);pe<0&&(a.logger.log("Waiting fragment cc ("+$.cc+") @ "+$.start+" cancelled because another fragment at "+_e.end+" is needed"),this.clearWaitingFragment())}}else this.state=U.State.IDLE}}this.onTickEnd()},b.clearWaitingFragment=function(){var p=this.waitingData;p&&(this.fragmentTracker.removeFragment(p.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=U.State.IDLE)},b.onTickEnd=function(){var p=this.media;if(!p||!p.readyState)return;var c=this.mediaBuffer?this.mediaBuffer:p,E=c.buffered;!this.loadedmetadata&&E.length&&(this.loadedmetadata=!0),this.lastCurrentTime=p.currentTime},b.doTickIdle=function(){var p,c,E=this.hls,y=this.levels,_=this.media,P=this.trackId,N=E.config;if(!y||!y[P])return;if(!_&&(this.startFragRequested||!N.startFragPrefetch))return;var K=y[P],$=K.details;if(!$||$.live&&this.levelLastLoaded!==P||this.waitForCdnTuneIn($)){this.state=U.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,g.ElementaryStreamTypes.AUDIO,I.PlaylistLevelType.AUDIO));var B=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,I.PlaylistLevelType.AUDIO);if(B===null)return;var R=B.len,G=this.getMaxBufferLength(),Q=this.audioSwitch;if(R>=G&&!Q)return;if(!Q&&this._streamEnded(B,$)){E.trigger(L.Events.BUFFER_EOS,{type:"audio"}),this.state=U.State.ENDED;return}var ne=$.fragments,le=ne[0].start,_e=B.end;if(Q){var pe=this.getLoadPosition();_e=pe,$.PTSKnown&&pele||B.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),_.currentTime=le+.05))}var Ee=this.getNextFragment(_e,$);if(!Ee){this.bufferFlushed=!0;return}((p=Ee.decryptdata)===null||p===void 0?void 0:p.keyFormat)==="identity"&&!((c=Ee.decryptdata)!==null&&c!==void 0&&c.key)?this.loadKey(Ee,$):this.loadFragment(Ee,$,_e)},b.getMaxBufferLength=function(){var p=A.prototype.getMaxBufferLength.call(this),c=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,I.PlaylistLevelType.MAIN);return c===null?p:Math.max(p,c.len)},b.onMediaDetaching=function(){this.videoBuffer=null,A.prototype.onMediaDetaching.call(this)},b.onAudioTracksUpdated=function(p,c){var E=c.audioTracks;this.resetTransmuxer(),this.levels=E.map(function(y){return new D.Level(y)})},b.onAudioTrackSwitching=function(p,c){var E=!!c.url;this.trackId=c.id;var y=this.fragCurrent;y!=null&&y.loader&&y.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),E?this.setInterval(S):this.resetTransmuxer(),E?(this.audioSwitch=!0,this.state=U.State.IDLE):this.state=U.State.STOPPED,this.tick()},b.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},b.onLevelLoaded=function(p,c){this.mainDetails=c.details},b.onAudioTrackLoaded=function(p,c){var E,y=this.levels,_=c.details,P=c.id;if(!y){this.warn("Audio tracks were reset while loading level "+P);return}this.log("Track "+P+" loaded ["+_.startSN+","+_.endSN+"],duration:"+_.totalduration);var N=y[P],K=0;if(_.live||(E=N.details)!==null&&E!==void 0&&E.live){var $=this.mainDetails;if(_.fragments[0]||(_.deltaUpdateFailed=!0),_.deltaUpdateFailed||!$)return;!N.details&&_.hasProgramDateTime&&$.hasProgramDateTime?(Object(l.alignMediaPlaylistByPDT)(_,$),K=_.fragments[0].start):K=this.alignPlaylists(_,N.details)}N.details=_,this.levelLastLoaded=P,!this.startFragRequested&&(this.mainDetails||!_.live)&&this.setStartPosition(N.details,K),this.state===U.State.WAITING_TRACK&&!this.waitForCdnTuneIn(_)&&(this.state=U.State.IDLE),this.tick()},b._handleFragmentLoadProgress=function(p){var c,E=p.frag,y=p.part,_=p.payload,P=this.config,N=this.trackId,K=this.levels;if(!K){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+E.sn+" of level "+E.level+" will not be buffered");return}var $=K[N];console.assert($,"Audio track is defined on fragment load progress");var B=$.details;console.assert(B,"Audio track details are defined on fragment load progress");var R=P.defaultAudioCodec||$.audioCodec||"mp4a.40.2",G=this.transmuxer;G||(G=this.transmuxer=new u.default(this.hls,I.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var Q=this.initPTS[E.cc],ne=(c=E.initSegment)===null||c===void 0?void 0:c.data;if(Q!==void 0){var le=!1,_e=y?y.index:-1,pe=_e!==-1,Ee=new d.ChunkMetadata(E.level,E.sn,E.stats.chunkCount,_.byteLength,_e,pe);G.push(_,ne,R,"",E,y,B.totalduration,le,Ee,Q)}else{a.logger.log("Unknown video PTS for cc "+E.cc+", waiting for video PTS before demuxing audio frag "+E.sn+" of ["+B.startSN+" ,"+B.endSN+"],track "+N);var Oe=this.waitingData=this.waitingData||{frag:E,part:y,cache:new f.default,complete:!1},we=Oe.cache;we.push(new Uint8Array(_)),this.waitingVideoCC=this.videoTrackCC,this.state=U.State.WAITING_INIT_PTS}},b._handleFragmentLoadComplete=function(p){if(this.waitingData){this.waitingData.complete=!0;return}A.prototype._handleFragmentLoadComplete.call(this,p)},b.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},b.onBufferCreated=function(p,c){var E=c.tracks.audio;E&&(this.mediaBuffer=E.buffer),c.tracks.video&&(this.videoBuffer=c.tracks.video.buffer)},b.onFragBuffered=function(p,c){var E=c.frag,y=c.part;if(E.type!==I.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(E)){this.warn("Fragment "+E.sn+(y?" p: "+y.index:"")+" of level "+E.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}E.sn!=="initSegment"&&(this.fragPrevious=E,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(L.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(E,y)},b.onError=function(p,c){switch(c.details){case r.ErrorDetails.FRAG_LOAD_ERROR:case r.ErrorDetails.FRAG_LOAD_TIMEOUT:case r.ErrorDetails.KEY_LOAD_ERROR:case r.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(I.PlaylistLevelType.AUDIO,c);break;case r.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case r.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==U.State.ERROR&&this.state!==U.State.STOPPED&&(this.state=c.fatal?U.State.ERROR:U.State.IDLE,this.warn(c.details+" while loading frag, switching to "+this.state+" state"));break;case r.ErrorDetails.BUFFER_FULL_ERROR:if(c.parent==="audio"&&(this.state===U.State.PARSING||this.state===U.State.PARSED)){var E=!0,y=this.getFwdBufferInfo(this.mediaBuffer,I.PlaylistLevelType.AUDIO);y&&y.len>.5&&(E=!this.reduceMaxBufferLength(y.len)),E&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,A.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},b.onBufferFlushed=function(p,c){var E=c.type;E===g.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},b._handleTransmuxComplete=function(p){var c,E="audio",y=this.hls,_=p.remuxResult,P=p.chunkMeta,N=this.getCurrentContext(P);if(!N){this.warn("The loading context changed while buffering fragment "+P.sn+" of level "+P.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(P.level);return}var K=N.frag,$=N.part,B=_.audio,R=_.text,G=_.id3,Q=_.initSegment;if(this.fragContextChanged(K))return;if(this.state=U.State.PARSING,this.audioSwitch&&B&&this.completeAudioSwitch(),Q!=null&&Q.tracks&&(this._bufferInitSegment(Q.tracks,K,P),y.trigger(L.Events.FRAG_PARSING_INIT_SEGMENT,{frag:K,id:E,tracks:Q.tracks})),B){var ne=B.startPTS,le=B.endPTS,_e=B.startDTS,pe=B.endDTS;$&&($.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:ne,endPTS:le,startDTS:_e,endDTS:pe}),K.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,ne,le,_e,pe),this.bufferFragmentData(B,K,$,P)}if(G!=null&&(c=G.samples)!==null&&c!==void 0&&c.length){var Ee=n({frag:K,id:E},G);y.trigger(L.Events.FRAG_PARSING_METADATA,Ee)}if(R){var Oe=n({frag:K,id:E},R);y.trigger(L.Events.FRAG_PARSING_USERDATA,Oe)}},b._bufferInitSegment=function(p,c,E){if(this.state!==U.State.PARSING)return;p.video&&delete p.video;var y=p.audio;if(!y)return;y.levelCodec=y.codec,y.id="audio",this.log("Init audio buffer, container:"+y.container+", codecs[parsed]=["+y.codec+"]"),this.hls.trigger(L.Events.BUFFER_CODECS,p);var _=y.initSegment;if(_!=null&&_.byteLength){var P={type:"audio",frag:c,part:null,chunkMeta:E,parent:c.type,data:_};this.hls.trigger(L.Events.BUFFER_APPENDING,P)}this.tick()},b.loadFragment=function(p,c,E){var y=this.fragmentTracker.getState(p);this.fragCurrent=p,(this.audioSwitch||y===F.FragmentState.NOT_LOADED||y===F.FragmentState.PARTIAL)&&(p.sn==="initSegment"?this._loadInitSegment(p):c.live&&!Object(z.isFiniteNumber)(this.initPTS[p.cc])?(this.log("Waiting for video PTS in continuity counter "+p.cc+" of live stream before loading audio fragment "+p.sn+" of level "+this.trackId),this.state=U.State.WAITING_INIT_PTS):(this.startFragRequested=!0,A.prototype.loadFragment.call(this,p,c,E)))},b.completeAudioSwitch=function(){var p=this.hls,c=this.media,E=this.trackId;c&&(this.log("Switching audio track : flushing all audio"),A.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,p.trigger(L.Events.AUDIO_TRACK_SWITCHED,{id:E})},C}(U.default);V.default=x},"./src/controller/audio-track-controller.ts":function(q,V,M){"use strict";M.r(V);var z=M("./src/events.ts"),U=M("./src/errors.ts"),L=M("./src/controller/base-playlist-controller.ts"),H=M("./src/types/loader.ts");function F(u,d){for(var s=0;s=a.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var n=a[this.trackId];this.log("Now switching to audio-track index "+r);var h=a[r],O=h.id,S=h.groupId,x=S===void 0?"":S,A=h.name,C=h.type,b=h.url;if(this.trackId=r,this.trackName=A,this.selectDefaultTrack=!1,this.hls.trigger(z.Events.AUDIO_TRACK_SWITCHING,{id:O,groupId:x,name:A,type:C,url:b}),h.details&&!h.details.live)return;var v=this.switchParams(h.url,n==null?void 0:n.details);this.loadPlaylist(v)},s.selectInitialTrack=function(){var r=this.tracksInGroup;console.assert(r.length,"Initial audio track should be selected when tracks are known");var a=this.trackName,n=this.findTrackId(a)||this.findTrackId();n!==-1?this.setAudioTrack(n):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(z.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},s.findTrackId=function(r){for(var a=this.tracksInGroup,n=0;nd.partTarget&&(h+=1)}if(Object(z.isFiniteNumber)(n))return new U.HlsUrlParameters(n,Object(z.isFiniteNumber)(h)?h:void 0,U.HlsSkip.No)}}},g.loadPlaylist=function(u){},g.shouldLoadTrack=function(u){return this.canLoad&&u&&!!u.url&&(!u.details||u.details.live)},g.playlistLoaded=function(u,d,s){var l=this,r=d.details,a=d.stats,n=a.loading.end?Math.max(0,self.performance.now()-a.loading.end):0;if(r.advancedDateTime=Date.now()-n,r.live||s!=null&&s.live){if(r.reloaded(s),s&&this.log("live playlist "+u+" "+(r.advanced?"REFRESHED "+r.lastPartSn+"-"+r.lastPartIndex:"MISSED")),s&&r.fragments.length>0&&Object(L.mergeDetails)(s,r),!this.canLoad||!r.live)return;var h,O=void 0,S=void 0;if(r.canBlockReload&&r.endSN&&r.advanced){var x=this.hls.config.lowLatencyMode,A=r.lastPartSn,C=r.endSN,b=r.lastPartIndex,v=b!==-1,p=A===C,c=x?0:b;v?(O=p?C+1:A,S=p?c:b+1):O=C+1;var E=r.age,y=E+r.ageHeader,_=Math.min(y-r.partTarget,r.targetduration*1.5);if(_>0){if(s&&_>s.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+s.tuneInGoal+" to: "+_+" with playlist age: "+r.age),_=0;else{var P=Math.floor(_/r.targetduration);if(O+=P,S!==void 0){var N=Math.round(_%r.targetduration/r.partTarget);S+=N}this.log("CDN Tune-in age: "+r.ageHeader+"s last advanced "+E.toFixed(2)+"s goal: "+_+" skip sn "+P+" to part "+S)}r.tuneInGoal=_}if(h=this.getDeliveryDirectives(r,d.deliveryDirectives,O,S),x||!p){this.loadPlaylist(h);return}}else h=this.getDeliveryDirectives(r,d.deliveryDirectives,O,S);var K=Object(L.computeReloadInterval)(r,a);O!==void 0&&r.canBlockReload&&(K-=r.partTarget||1),this.log("reload live playlist "+u+" in "+Math.round(K)+" ms"),this.timer=self.setTimeout(function(){return l.loadPlaylist(h)},K)}else this.clearTimer()},g.getDeliveryDirectives=function(u,d,s,l){var r=Object(U.getSkipValue)(u,s);return d!=null&&d.skip&&u.deltaUpdateFailed&&(s=d.msn,l=d.part,r=U.HlsSkip.No),new U.HlsUrlParameters(s,l,r)},g.retryLoadingOrFail=function(u){var d=this,s=this.hls.config,l=this.retryCount-1&&(r=u.context)!==null&&r!==void 0&&r.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+u.details+'"'),this.loadPlaylist();else{var a=Math.min(Math.pow(2,this.retryCount)*s.levelLoadingRetryDelay,s.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return d.loadPlaylist()},a),this.warn("retry playlist loading #"+this.retryCount+" in "+a+' ms after "'+u.details+'"')}}else this.warn('cannot recover from error "'+u.details+'"'),this.clearTimer(),u.fatal=!0;return l},I}()},"./src/controller/base-stream-controller.ts":function(q,V,M){"use strict";M.r(V),M.d(V,"State",function(){return C}),M.d(V,"default",function(){return b});var z=M("./src/polyfills/number.ts"),U=M("./src/task-loop.ts"),L=M("./src/controller/fragment-tracker.ts"),H=M("./src/utils/buffer-helper.ts"),F=M("./src/utils/logger.ts"),D=M("./src/events.ts"),I=M("./src/errors.ts"),g=M("./src/types/transmuxer.ts"),f=M("./src/utils/mp4-tools.ts"),u=M("./src/utils/discontinuities.ts"),d=M("./src/controller/fragment-finders.ts"),s=M("./src/controller/level-helper.ts"),l=M("./src/loader/fragment-loader.ts"),r=M("./src/crypt/decrypter.ts"),a=M("./src/utils/time-ranges.ts"),n=M("./src/types/loader.ts");function h(v,p){for(var c=0;cQ;($0&&$&&$.key&&$.iv&&$.method==="AES-128"){var B=self.performance.now();return _.decrypter.webCryptoDecrypt(new Uint8Array(K),$.key.buffer,$.iv.buffer).then(function(R){var G=self.performance.now();return N.trigger(D.Events.FRAG_DECRYPTED,{frag:y,payload:R,stats:{tstart:B,tdecrypt:G}}),P.payload=R,P})}return P}).then(function(P){var N=_.fragCurrent,K=_.hls,$=_.levels;if(!$)throw new Error("init load aborted, missing levels");var B=$[y.level].details;console.assert(B,"Level details are defined when init segment is loaded");var R=y.stats;_.state=C.IDLE,_.fragLoadError=0,y.data=new Uint8Array(P.payload),R.parsing.start=R.buffering.start=self.performance.now(),R.parsing.end=R.buffering.end=self.performance.now(),P.frag===N&&K.trigger(D.Events.FRAG_BUFFERED,{stats:R,frag:N,part:null,id:y.type}),_.tick()}).catch(function(P){_.warn(P),_.resetFragmentLoading(y)})},c.fragContextChanged=function(y){var _=this.fragCurrent;return!y||!_||y.level!==_.level||y.sn!==_.sn||y.urlId!==_.urlId},c.fragBufferedComplete=function(y,_){var P=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+y.type+" sn: "+y.sn+(_?" part: "+_.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level+" "+a.default.toString(H.BufferHelper.getBuffered(P))),this.state=C.IDLE,this.tick()},c._handleFragmentLoadComplete=function(y){var _=this.transmuxer;if(!_)return;var P=y.frag,N=y.part,K=y.partsLoaded,$=!K||K.length===0||K.some(function(R){return!R}),B=new g.ChunkMetadata(P.level,P.sn,P.stats.chunkCount+1,0,N?N.index:-1,!$);_.flush(B)},c._handleFragmentLoadProgress=function(y){},c._doFragLoad=function(y,_,P,N){var K=this;if(P===void 0&&(P=null),!this.levels)throw new Error("frag load aborted, missing levels");if(P=Math.max(y.start,P||0),this.config.lowLatencyMode&&_){var $=_.partList;if($&&N){P>y.end&&_.fragmentHint&&(y=_.fragmentHint);var B=this.getNextPart($,y,P);if(B>-1){var R=$[B];return this.log("Loading part sn: "+y.sn+" p: "+R.index+" cc: "+y.cc+" of playlist ["+_.startSN+"-"+_.endSN+"] parts [0-"+B+"-"+($.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(P.toFixed(3))),this.nextLoadPosition=R.start+R.duration,this.state=C.FRAG_LOADING,this.hls.trigger(D.Events.FRAG_LOADING,{frag:y,part:$[B],targetBufferTime:P}),this.doFragPartsLoad(y,$,B,N).catch(function(G){return K.handleFragLoadError(G)})}else if(!y.url||this.loadedEndOfParts($,P))return Promise.resolve(null)}}return this.log("Loading fragment "+y.sn+" cc: "+y.cc+" "+(_?"of ["+_.startSN+"-"+_.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(P.toFixed(3))),Object(z.isFiniteNumber)(y.sn)&&!this.bitrateTest&&(this.nextLoadPosition=y.start+y.duration),this.state=C.FRAG_LOADING,this.hls.trigger(D.Events.FRAG_LOADING,{frag:y,targetBufferTime:P}),this.fragmentLoader.load(y,N).catch(function(G){return K.handleFragLoadError(G)})},c.doFragPartsLoad=function(y,_,P,N){var K=this;return new Promise(function($,B){var R=[],G=function Q(ne){var le=_[ne];K.fragmentLoader.loadPart(y,le,N).then(function(_e){R[le.index]=_e;var pe=_e.part;K.hls.trigger(D.Events.FRAG_LOADED,_e);var Ee=_[ne+1];if(Ee&&Ee.fragment===y)Q(ne+1);else return $({frag:y,part:pe,partsLoaded:R})}).catch(B)};G(P)})},c.handleFragLoadError=function(y){var _=y.data;return _&&_.details===I.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(_.frag,_.part):this.hls.trigger(D.Events.ERROR,_),null},c._handleTransmuxerFlush=function(y){var _=this.getCurrentContext(y);if(!_||this.state!==C.PARSING){this.fragCurrent||(this.state=C.IDLE);return}var P=_.frag,N=_.part,K=_.level,$=self.performance.now();P.stats.parsing.end=$,N&&(N.stats.parsing.end=$),this.updateLevelTiming(P,N,K,y.partial)},c.getCurrentContext=function(y){var _=this.levels,P=y.level,N=y.sn,K=y.part;if(!_||!_[P])return this.warn("Levels object was unset while buffering fragment "+N+" of level "+P+". The current chunk will not be buffered."),null;var $=_[P],B=K>-1?Object(s.getPartWith)($,N,K):null,R=B?B.fragment:Object(s.getFragmentWithSN)($,N,this.fragCurrent);return R?{frag:R,part:B,level:$}:null},c.bufferFragmentData=function(y,_,P,N){if(!y||this.state!==C.PARSING)return;var K=y.data1,$=y.data2,B=K;if(K&&$&&(B=Object(f.appendUint8Array)(K,$)),!B||!B.length)return;var R={type:y.type,frag:_,part:P,chunkMeta:N,parent:_.type,data:B};this.hls.trigger(D.Events.BUFFER_APPENDING,R),y.dropped&&y.independent&&!P&&this.flushBufferGap(_)},c.flushBufferGap=function(y){var _=this.media;if(!_)return;if(!H.BufferHelper.isBuffered(_,_.currentTime)){this.flushMainBuffer(0,y.start);return}var P=_.currentTime,N=H.BufferHelper.bufferInfo(_,P,0),K=y.duration,$=Math.min(this.config.maxFragLookUpTolerance*2,K*.25),B=Math.max(Math.min(y.start-$,N.end-$),P+$);y.start-B>$&&this.flushMainBuffer(B,y.start)},c.getFwdBufferInfo=function(y,_){var P=this.config,N=this.getLoadPosition();if(!Object(z.isFiniteNumber)(N))return null;var K=H.BufferHelper.bufferInfo(y,N,P.maxBufferHole);if(K.len===0&&K.nextStart!==void 0){var $=this.fragmentTracker.getBufferedFrag(N,_);if($&&K.nextStart<$.end)return H.BufferHelper.bufferInfo(y,N,Math.max(K.nextStart,P.maxBufferHole))}return K},c.getMaxBufferLength=function(y){var _=this.config,P;return y?P=Math.max(8*_.maxBufferSize/y,_.maxBufferLength):P=_.maxBufferLength,Math.min(P,_.maxMaxBufferLength)},c.reduceMaxBufferLength=function(y){var _=this.config,P=y||_.maxBufferLength;return _.maxMaxBufferLength>=P?(_.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+_.maxMaxBufferLength+"s"),!0):!1},c.getNextFragment=function(y,_){var P,N,K=_.fragments,$=K.length;if(!$)return null;var B=this.config,R=K[0].start,G;if(_.live){var Q=B.initialLiveManifestSize;if($-1&&PP.start&&P.loaded},c.getInitialLiveFragment=function(y,_){var P=this.fragPrevious,N=null;if(P){if(y.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+P.programDateTime),N=Object(d.findFragmentByPDT)(_,P.endProgramDateTime,this.config.maxFragLookUpTolerance)),!N){var K=P.sn+1;if(K>=y.startSN&&K<=y.endSN){var $=_[K-y.startSN];P.cc===$.cc&&(N=$,this.log("Live playlist, switching playlist, load frag with next SN: "+N.sn))}N||(N=Object(d.findFragWithCC)(_,P.cc),N&&this.log("Live playlist, switching playlist, load frag with same CC: "+N.sn))}}else{var B=this.hls.liveSyncPosition;B!==null&&(N=this.getFragmentAtPosition(B,this.bitrateTest?y.fragmentEnd:y.edge,y))}return N},c.getFragmentAtPosition=function(y,_,P){var N=this.config,K=this.fragPrevious,$=P.fragments,B=P.endSN,R=P.fragmentHint,G=N.maxFragLookUpTolerance,Q=!!(N.lowLatencyMode&&P.partList&&R);Q&&R&&!this.bitrateTest&&($=$.concat(R),B=R.sn);var ne;if(y<_){var le=y>_-G?0:G;ne=Object(d.findFragmentByPTS)(K,$,y,le)}else ne=$[$.length-1];if(ne){var _e=ne.sn-P.startSN,pe=K&&ne.level===K.level,Ee=$[_e+1],Oe=this.fragmentTracker.getState(ne);if(Oe===L.FragmentState.BACKTRACKED){ne=null;for(var we=_e;$[we]&&this.fragmentTracker.getState($[we])===L.FragmentState.BACKTRACKED;)K?ne=$[we--]:ne=$[--we];ne||(ne=Ee)}else K&&ne.sn===K.sn&&!Q&&(pe&&(ne.sn=$-_.maxFragLookUpTolerance&&K<=B;if(N!==null&&P.duration>N&&(K"+y.startSN+" prev-sn: "+(K?K.sn:"na")+" fragments: "+B),ne}return R},c.waitForCdnTuneIn=function(y){var _=3;return y.live&&y.canBlockReload&&y.tuneInGoal>Math.max(y.partHoldBack,y.partTarget*_)},c.setStartPosition=function(y,_){var P=this.startPosition;if(P<_&&(P=-1),P===-1||this.lastCurrentTime===-1){var N=y.startTimeOffset;Object(z.isFiniteNumber)(N)?(P=_+N,N<0&&(P+=y.totalduration),P=Math.min(Math.max(_,P),_+y.totalduration),this.log("Start time offset "+N+" found in playlist, adjust startPosition to "+P),this.startPosition=P):y.live?P=this.hls.liveSyncPosition||_:this.startPosition=P=0,this.lastCurrentTime=P}this.nextLoadPosition=P},c.getLoadPosition=function(){var y=this.media,_=0;return this.loadedmetadata&&y?_=y.currentTime:this.nextLoadPosition&&(_=this.nextLoadPosition),_},c.handleFragLoadAborted=function(y,_){this.transmuxer&&y.sn!=="initSegment"&&y.stats.aborted&&(this.warn("Fragment "+y.sn+(_?" part"+_.index:"")+" of level "+y.level+" was aborted"),this.resetFragmentLoading(y))},c.resetFragmentLoading=function(y){(!this.fragCurrent||!this.fragContextChanged(y))&&(this.state=C.IDLE)},c.onFragmentOrKeyLoadError=function(y,_){if(_.fatal)return;var P=_.frag;if(!P||P.type!==y)return;var N=this.fragCurrent;console.assert(N&&P.sn===N.sn&&P.level===N.level&&P.urlId===N.urlId,"Frag load error must match current frag to retry");var K=this.config;if(this.fragLoadError+1<=K.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(P.level))return;var $=Math.min(Math.pow(2,this.fragLoadError)*K.fragLoadingRetryDelay,K.fragLoadingMaxRetryTimeout);this.warn("Fragment "+P.sn+" of "+y+" "+P.level+" failed to load, retrying in "+$+"ms"),this.retryDate=self.performance.now()+$,this.fragLoadError++,this.state=C.FRAG_LOADING_WAITING_RETRY}else _.levelRetry?(y===n.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=C.IDLE):(F.logger.error(_.details+" reaches max retry, redispatch as fatal ..."),_.fatal=!0,this.hls.stopLoad(),this.state=C.ERROR)},c.afterBufferFlushed=function(y,_,P){if(!y)return;var N=H.BufferHelper.getBuffered(y);this.fragmentTracker.detectEvictedFragments(_,N,P),this.state===C.ENDED&&this.resetLoadingState()},c.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=C.IDLE},c.resetLiveStartWhenNotLoaded=function(y){if(!this.loadedmetadata){this.startFragRequested=!1;var _=this.levels?this.levels[y].details:null;if(_!=null&&_.live)return this.startPosition=-1,this.setStartPosition(_,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},c.updateLevelTiming=function(y,_,P,N){var K=this,$=P.details;console.assert(!!$,"level.details must be defined");var B=Object.keys(y.elementaryStreams).reduce(function(R,G){var Q=y.elementaryStreams[G];if(Q){var ne=Q.endPTS-Q.startPTS;if(ne<=0)return K.warn("Could not parse fragment "+y.sn+" "+G+" duration reliably ("+ne+") resetting transmuxer to fallback to playlist timing"),K.resetTransmuxer(),R||!1;var le=N?0:Object(s.updateFragPTSDTS)($,y,Q.startPTS,Q.endPTS,Q.startDTS,Q.endDTS);return K.hls.trigger(D.Events.LEVEL_PTS_UPDATED,{details:$,level:P,drift:le,type:G,frag:y,start:Q.startPTS,end:Q.endPTS}),!0}return R},!1);B?(this.state=C.PARSED,this.hls.trigger(D.Events.FRAG_PARSED,{frag:y,part:_})):this.resetLoadingState()},c.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},O(p,[{key:"state",get:function(){return this._state},set:function(y){var _=this._state;_!==y&&(this._state=y,this.log(_+"->"+y))}}]),p}(U.default)},"./src/controller/buffer-controller.ts":function(q,V,M){"use strict";M.r(V),M.d(V,"default",function(){return d});var z=M("./src/polyfills/number.ts"),U=M("./src/events.ts"),L=M("./src/utils/logger.ts"),H=M("./src/errors.ts"),F=M("./src/utils/buffer-helper.ts"),D=M("./src/utils/mediasource-helper.ts"),I=M("./src/loader/fragment.ts"),g=M("./src/controller/buffer-operation-queue.ts"),f=Object(D.getMediaSource)(),u=/([ha]vc.)(?:\.[^.,]+)+/,d=function(){function s(r){var a=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var n=a.hls,h=a.media,O=a.mediaSource;L.logger.log("[buffer-controller]: Media source opened"),h&&(a.updateMediaElementDuration(),n.trigger(U.Events.MEDIA_ATTACHED,{media:h})),O&&O.removeEventListener("sourceopen",a._onMediaSourceOpen),a.checkPendingTracks()},this._onMediaSourceClose=function(){L.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){L.logger.log("[buffer-controller]: Media source ended")},this.hls=r,this._initSourceBuffer(),this.registerListeners()}var l=s.prototype;return l.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},l.destroy=function(){this.unregisterListeners(),this.details=null},l.registerListeners=function(){var a=this.hls;a.on(U.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.on(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(U.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(U.Events.BUFFER_RESET,this.onBufferReset,this),a.on(U.Events.BUFFER_APPENDING,this.onBufferAppending,this),a.on(U.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.on(U.Events.BUFFER_EOS,this.onBufferEos,this),a.on(U.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),a.on(U.Events.LEVEL_UPDATED,this.onLevelUpdated,this),a.on(U.Events.FRAG_PARSED,this.onFragParsed,this),a.on(U.Events.FRAG_CHANGED,this.onFragChanged,this)},l.unregisterListeners=function(){var a=this.hls;a.off(U.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.off(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(U.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(U.Events.BUFFER_RESET,this.onBufferReset,this),a.off(U.Events.BUFFER_APPENDING,this.onBufferAppending,this),a.off(U.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.off(U.Events.BUFFER_EOS,this.onBufferEos,this),a.off(U.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),a.off(U.Events.LEVEL_UPDATED,this.onLevelUpdated,this),a.off(U.Events.FRAG_PARSED,this.onFragParsed,this),a.off(U.Events.FRAG_CHANGED,this.onFragChanged,this)},l._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new g.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},l.onManifestParsed=function(a,n){var h=2;(n.audio&&!n.video||!n.altAudio)&&(h=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=h,this.details=null,L.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},l.onMediaAttaching=function(a,n){var h=this.media=n.media;if(h&&f){var O=this.mediaSource=new f;O.addEventListener("sourceopen",this._onMediaSourceOpen),O.addEventListener("sourceended",this._onMediaSourceEnded),O.addEventListener("sourceclose",this._onMediaSourceClose),h.src=self.URL.createObjectURL(O),this._objectUrl=h.src}},l.onMediaDetaching=function(){var a=this.media,n=this.mediaSource,h=this._objectUrl;if(n){if(L.logger.log("[buffer-controller]: media source detaching"),n.readyState==="open")try{n.endOfStream()}catch(O){L.logger.warn("[buffer-controller]: onMediaDetaching: "+O.message+" while calling endOfStream")}this.onBufferReset(),n.removeEventListener("sourceopen",this._onMediaSourceOpen),n.removeEventListener("sourceended",this._onMediaSourceEnded),n.removeEventListener("sourceclose",this._onMediaSourceClose),a&&(h&&self.URL.revokeObjectURL(h),a.src===h?(a.removeAttribute("src"),a.load()):L.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(U.Events.MEDIA_DETACHED,void 0)},l.onBufferReset=function(){var a=this;this.getSourceBufferTypes().forEach(function(n){var h=a.sourceBuffer[n];try{h&&(a.removeBufferListeners(n),a.mediaSource&&a.mediaSource.removeSourceBuffer(h),a.sourceBuffer[n]=void 0)}catch(O){L.logger.warn("[buffer-controller]: Failed to reset the "+n+" buffer",O)}}),this._initSourceBuffer()},l.onBufferCodecs=function(a,n){var h=this,O=this.getSourceBufferTypes().length;if(Object.keys(n).forEach(function(S){if(O){var x=h.tracks[S];if(x&&typeof x.buffer.changeType=="function"){var A=n[S],C=A.codec,b=A.levelCodec,v=A.container,p=(x.levelCodec||x.codec).replace(u,"$1"),c=(b||C).replace(u,"$1");if(p!==c){var E=v+";codecs="+(b||C);h.appendChangeType(S,E)}}}else h.pendingTracks[S]=n[S]}),O)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},l.appendChangeType=function(a,n){var h=this,O=this.operationQueue,S={execute:function(){var A=h.sourceBuffer[a];A&&(L.logger.log("[buffer-controller]: changing "+a+" sourceBuffer type to "+n),A.changeType(n)),O.shiftAndExecuteNext(a)},onStart:function(){},onComplete:function(){},onError:function(A){L.logger.warn("[buffer-controller]: Failed to change "+a+" SourceBuffer type",A)}};O.append(S,a)},l.onBufferAppending=function(a,n){var h=this,O=this.hls,S=this.operationQueue,x=this.tracks,A=n.data,C=n.type,b=n.frag,v=n.part,p=n.chunkMeta,c=p.buffering[C],E=self.performance.now();c.start=E;var y=b.stats.buffering,_=v?v.stats.buffering:null;y.start===0&&(y.start=E),_&&_.start===0&&(_.start=E);var P=x.audio,N=C==="audio"&&p.id===1&&(P==null?void 0:P.container)==="audio/mpeg",K={execute:function(){if(c.executeStart=self.performance.now(),N){var B=h.sourceBuffer[C];if(B){var R=b.start-B.timestampOffset;Math.abs(R)>=.1&&(L.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+b.start+" (delta: "+R+") sn: "+b.sn+")"),B.timestampOffset=b.start)}}h.appendExecutor(A,C)},onStart:function(){},onComplete:function(){var B=self.performance.now();c.executeEnd=c.end=B,y.first===0&&(y.first=B),_&&_.first===0&&(_.first=B);var R=h.sourceBuffer,G={};for(var Q in R)G[Q]=F.BufferHelper.getBuffered(R[Q]);h.appendError=0,h.hls.trigger(U.Events.BUFFER_APPENDED,{type:C,frag:b,part:v,chunkMeta:p,parent:b.type,timeRanges:G})},onError:function(B){L.logger.error("[buffer-controller]: Error encountered while trying to append to the "+C+" SourceBuffer",B);var R={type:H.ErrorTypes.MEDIA_ERROR,parent:b.type,details:H.ErrorDetails.BUFFER_APPEND_ERROR,err:B,fatal:!1};B.code===DOMException.QUOTA_EXCEEDED_ERR?R.details=H.ErrorDetails.BUFFER_FULL_ERROR:(h.appendError++,R.details=H.ErrorDetails.BUFFER_APPEND_ERROR,h.appendError>O.config.appendErrorMaxRetry&&(L.logger.error("[buffer-controller]: Failed "+O.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),R.fatal=!0)),O.trigger(U.Events.ERROR,R)}};S.append(K,C)},l.onBufferFlushing=function(a,n){var h=this,O=this.operationQueue,S=function(A){return{execute:h.removeExecutor.bind(h,A,n.startOffset,n.endOffset),onStart:function(){},onComplete:function(){h.hls.trigger(U.Events.BUFFER_FLUSHED,{type:A})},onError:function(b){L.logger.warn("[buffer-controller]: Failed to remove from "+A+" SourceBuffer",b)}}};n.type?O.append(S(n.type),n.type):this.getSourceBufferTypes().forEach(function(x){O.append(S(x),x)})},l.onFragParsed=function(a,n){var h=this,O=n.frag,S=n.part,x=[],A=S?S.elementaryStreams:O.elementaryStreams;A[I.ElementaryStreamTypes.AUDIOVIDEO]?x.push("audiovideo"):(A[I.ElementaryStreamTypes.AUDIO]&&x.push("audio"),A[I.ElementaryStreamTypes.VIDEO]&&x.push("video"));var C=function(){var v=self.performance.now();O.stats.buffering.end=v,S&&(S.stats.buffering.end=v);var p=S?S.stats:O.stats;h.hls.trigger(U.Events.FRAG_BUFFERED,{frag:O,part:S,stats:p,id:O.type})};x.length===0&&L.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+O.type+" level: "+O.level+" sn: "+O.sn),this.blockBuffers(C,x)},l.onFragChanged=function(a,n){this.flushBackBuffer()},l.onBufferEos=function(a,n){var h=this,O=this.getSourceBufferTypes().reduce(function(S,x){var A=h.sourceBuffer[x];return(!n.type||n.type===x)&&(A&&!A.ended&&(A.ended=!0,L.logger.log("[buffer-controller]: "+x+" sourceBuffer now EOS"))),S&&!!(!A||A.ended)},!0);O&&this.blockBuffers(function(){var S=h.mediaSource;if(!S||S.readyState!=="open")return;S.endOfStream()})},l.onLevelUpdated=function(a,n){var h=n.details;if(!h.fragments.length)return;this.details=h,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},l.flushBackBuffer=function(){var a=this.hls,n=this.details,h=this.media,O=this.sourceBuffer;if(!h||n===null)return;var S=this.getSourceBufferTypes();if(!S.length)return;var x=n.live&&a.config.liveBackBufferLength!==null?a.config.liveBackBufferLength:a.config.backBufferLength;if(!Object(z.isFiniteNumber)(x)||x<0)return;var A=h.currentTime,C=n.levelTargetDuration,b=Math.max(x,C),v=Math.floor(A/C)*C-b;S.forEach(function(p){var c=O[p];if(c){var E=F.BufferHelper.getBuffered(c);E.length>0&&v>E.start(0)&&(a.trigger(U.Events.BACK_BUFFER_REACHED,{bufferEnd:v}),n.live&&a.trigger(U.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:v}),a.trigger(U.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:v,type:p}))}})},l.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var a=this.details,n=this.hls,h=this.media,O=this.mediaSource,S=a.fragments[0].start+a.totalduration,x=h.duration,A=Object(z.isFiniteNumber)(O.duration)?O.duration:0;a.live&&n.config.liveDurationInfinity?(L.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),O.duration=Infinity,this.updateSeekableRange(a)):(S>A&&S>x||!Object(z.isFiniteNumber)(x))&&(L.logger.log("[buffer-controller]: Updating Media Source duration to "+S.toFixed(3)),O.duration=S)},l.updateSeekableRange=function(a){var n=this.mediaSource,h=a.fragments,O=h.length;if(O&&a.live&&n!==null&&n!==void 0&&n.setLiveSeekableRange){var S=Math.max(0,h[0].start),x=Math.max(S,S+a.totalduration);n.setLiveSeekableRange(S,x)}},l.checkPendingTracks=function(){var a=this.bufferCodecEventsExpected,n=this.operationQueue,h=this.pendingTracks,O=Object.keys(h).length;if(O&&!a||O===2){this.createSourceBuffers(h),this.pendingTracks={};var S=this.getSourceBufferTypes();if(S.length===0){this.hls.trigger(U.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}S.forEach(function(x){n.executeNext(x)})}},l.createSourceBuffers=function(a){var n=this.sourceBuffer,h=this.mediaSource;if(!h)throw Error("createSourceBuffers called when mediaSource was null");var O=0;for(var S in a)if(!n[S]){var x=a[S];if(!x)throw Error("source buffer exists for track "+S+", however track does not");var A=x.levelCodec||x.codec,C=x.container+";codecs="+A;L.logger.log("[buffer-controller]: creating sourceBuffer("+C+")");try{var b=n[S]=h.addSourceBuffer(C),v=S;this.addBufferListener(v,"updatestart",this._onSBUpdateStart),this.addBufferListener(v,"updateend",this._onSBUpdateEnd),this.addBufferListener(v,"error",this._onSBUpdateError),this.tracks[S]={buffer:b,codec:A,container:x.container,levelCodec:x.levelCodec,id:x.id},O++}catch(p){L.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+p.message),this.hls.trigger(U.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:p,mimeType:C})}}O&&this.hls.trigger(U.Events.BUFFER_CREATED,{tracks:this.tracks})},l._onSBUpdateStart=function(a){var n=this.operationQueue,h=n.current(a);h.onStart()},l._onSBUpdateEnd=function(a){var n=this.operationQueue,h=n.current(a);h.onComplete(),n.shiftAndExecuteNext(a)},l._onSBUpdateError=function(a,n){L.logger.error("[buffer-controller]: "+a+" SourceBuffer error",n),this.hls.trigger(U.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var h=this.operationQueue.current(a);h&&h.onError(n)},l.removeExecutor=function(a,n,h){var O=this.media,S=this.mediaSource,x=this.operationQueue,A=this.sourceBuffer,C=A[a];if(!O||!S||!C){L.logger.warn("[buffer-controller]: Attempting to remove from the "+a+" SourceBuffer, but it does not exist"),x.shiftAndExecuteNext(a);return}var b=Object(z.isFiniteNumber)(O.duration)?O.duration:Infinity,v=Object(z.isFiniteNumber)(S.duration)?S.duration:Infinity,p=Math.max(0,n),c=Math.min(h,b,v);c>p?(L.logger.log("[buffer-controller]: Removing ["+p+","+c+"] from the "+a+" SourceBuffer"),console.assert(!C.updating,a+" sourceBuffer must not be updating"),C.remove(p,c)):x.shiftAndExecuteNext(a)},l.appendExecutor=function(a,n){var h=this.operationQueue,O=this.sourceBuffer,S=O[n];if(!S){L.logger.warn("[buffer-controller]: Attempting to append to the "+n+" SourceBuffer, but it does not exist"),h.shiftAndExecuteNext(n);return}S.ended=!1,console.assert(!S.updating,n+" sourceBuffer must not be updating"),S.appendBuffer(a)},l.blockBuffers=function(a,n){var h=this;if(n===void 0&&(n=this.getSourceBufferTypes()),!n.length){L.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(a);return}var O=this.operationQueue,S=n.map(function(x){return O.appendBlocker(x)});Promise.all(S).then(function(){a(),n.forEach(function(x){var A=h.sourceBuffer[x];(!A||!A.updating)&&O.shiftAndExecuteNext(x)})})},l.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},l.addBufferListener=function(a,n,h){var O=this.sourceBuffer[a];if(!O)return;var S=h.bind(this,a);this.listeners[a].push({event:n,listener:S}),O.addEventListener(n,S)},l.removeBufferListeners=function(a){var n=this.sourceBuffer[a];if(!n)return;this.listeners[a].forEach(function(h){n.removeEventListener(h.event,h.listener)})},s}()},"./src/controller/buffer-operation-queue.ts":function(q,V,M){"use strict";M.r(V),M.d(V,"default",function(){return U});var z=M("./src/utils/logger.ts"),U=function(){function L(F){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=F}var H=L.prototype;return H.append=function(D,I){var g=this.queues[I];g.push(D),g.length===1&&this.buffers[I]&&this.executeNext(I)},H.insertAbort=function(D,I){var g=this.queues[I];g.unshift(D),this.executeNext(I)},H.appendBlocker=function(D){var I,g=new Promise(function(u){I=u}),f={execute:I,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(f,D),g},H.executeNext=function(D){var I=this.buffers,g=this.queues,f=I[D],u=g[D];if(u.length){var d=u[0];try{d.execute()}catch(s){z.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),d.onError(s),(!f||!f.updating)&&(u.shift(),this.executeNext(D))}}},H.shiftAndExecuteNext=function(D){this.queues[D].shift(),this.executeNext(D)},H.current=function(D){return this.queues[D][0]},L}()},"./src/controller/cap-level-controller.ts":function(q,V,M){"use strict";M.r(V);var z=M("./src/events.ts");function U(F,D){for(var I=0;I0&&this.mediaWidth>0){var g=this.hls.levels;if(g.length){var f=this.hls;f.autoLevelCapping=this.getMaxLevel(g.length-1),f.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=f.autoLevelCapping}}},D.getMaxLevel=function(g){var f=this,u=this.hls.levels;if(!u.length)return-1;var d=u.filter(function(s,l){return F.isLevelAllowed(l,f.restrictedLevels)&&l<=g});return this.clientRect=null,F.getMaxLevelByMediaSize(d,this.mediaWidth,this.mediaHeight)},D.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},D.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},D.getDimensions=function(){if(this.clientRect)return this.clientRect;var g=this.media,f={width:0,height:0};if(g){var u=g.getBoundingClientRect();f.width=u.width,f.height=u.height,!f.width&&!f.height&&(f.width=u.right-u.left||g.width||0,f.height=u.bottom-u.top||g.height||0)}return this.clientRect=f,f},F.isLevelAllowed=function(g,f){return f===void 0&&(f=[]),f.indexOf(g)===-1},F.getMaxLevelByMediaSize=function(g,f,u){if(!g||!g.length)return-1;for(var d=function(n,h){return h?n.width!==h.width||n.height!==h.height:!0},s=g.length-1,l=0;l=f||r.height>=u)&&d(r,g[l+1])){s=l;break}}return s},L(F,[{key:"mediaWidth",get:function(){return this.getDimensions().width*F.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*F.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var g=1;try{g=self.devicePixelRatio}catch(f){}return g}}]),F}();V.default=H},"./src/controller/cmcd-controller.ts":function(q,V,M){"use strict";M.r(V),M.d(V,"default",function(){return d});var z=M("./src/events.ts"),U=M("./src/types/cmcd.ts"),L=M("./src/utils/buffer-helper.ts"),H=M("./src/utils/logger.ts");function F(s,l){for(var r=0;r=s.length?{done:!0}:{done:!1,value:s[a++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function g(s,l){if(!s)return;if(typeof s=="string")return f(s,l);var r=Object.prototype.toString.call(s).slice(8,-1);if(r==="Object"&&s.constructor&&(r=s.constructor.name),r==="Map"||r==="Set")return Array.from(s);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(s,l)}function f(s,l){(l==null||l>s.length)&&(l=s.length);for(var r=0,a=new Array(l);rn&&(n=x.bitrate)}return n>0?n:NaN},l.getBufferLength=function(a){var n=this.hls.media,h=a===U.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!h||!n)return NaN;var O=L.BufferHelper.bufferInfo(h,n.currentTime,this.config.maxBufferHole);return O.len*1e3},l.createPlaylistLoader=function(){var a=this.config.pLoader,n=this.applyPlaylistData,h=a||this.config.loader;return function(){function O(x){this.loader=void 0,this.loader=new h(x)}var S=O.prototype;return S.destroy=function(){this.loader.destroy()},S.abort=function(){this.loader.abort()},S.load=function(A,C,b){n(A),this.loader.load(A,C,b)},D(O,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),O}()},l.createFragmentLoader=function(){var a=this.config.fLoader,n=this.applyFragmentData,h=a||this.config.loader;return function(){function O(x){this.loader=void 0,this.loader=new h(x)}var S=O.prototype;return S.destroy=function(){this.loader.destroy()},S.abort=function(){this.loader.abort()},S.load=function(A,C,b){n(A),this.loader.load(A,C,b)},D(O,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),O}()},s.uuid=function(){var a=URL.createObjectURL(new Blob),n=a.toString();return URL.revokeObjectURL(a),n.substr(n.lastIndexOf("/")+1)},s.serialize=function(a){for(var n=[],h=function(N){return!Number.isNaN(N)&&N!=null&&N!==""&&N!==!1},O=function(N){return Math.round(N)},S=function(N){return O(N/100)*100},x=function(N){return encodeURIComponent(N)},A={br:O,d:O,bl:S,dl:S,mtp:S,nor:x,rtp:S,tb:O},C=Object.keys(a||{}).sort(),b=I(C),v;!(v=b()).done;){var p=v.value,c=a[p];if(!h(c))continue;if(p==="v"&&c===1)continue;if(p=="pr"&&c===1)continue;var E=A[p];E&&(c=E(c));var y=typeof c,_=void 0;p==="ot"||p==="sf"||p==="st"?_=p+"="+c:y==="boolean"?_=p:y==="number"?_=p+"="+c:_=p+"="+JSON.stringify(c),n.push(_)}return n.join(",")},s.toHeaders=function(a){for(var n=Object.keys(a),h={},O=["Object","Request","Session","Status"],S=[{},{},{},{}],x={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},A=0,C=n;AI){this.hls.trigger(z.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var x=I-this._requestLicenseFailureCount+1;L.logger.warn("Retrying license request, "+x+" attempts left"),this._requestLicense(n,h)}break}},s._generateLicenseRequestChallenge=function(r,a){switch(r.mediaKeySystemDomain){case H.KeySystems.WIDEVINE:return a}throw new Error("unsupported key-system: "+r.mediaKeySystemDomain)},s._requestLicense=function(r,a){L.logger.log("Requesting content license for key-system");var n=this._mediaKeysList[0];if(!n){L.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(z.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var h=this.getLicenseServerUrl(n.mediaKeySystemDomain),O=this._createLicenseXhr(h,r,a);L.logger.log("Sending license request to URL: "+h);var S=this._generateLicenseRequestChallenge(n,r);O.send(S)}catch(x){L.logger.error("Failure requesting DRM license: "+x),this.hls.trigger(z.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},s.onMediaAttached=function(r,a){if(!this._emeEnabled)return;var n=a.media;this._media=n,n.addEventListener("encrypted",this._onMediaEncrypted)},s.onMediaDetached=function(){var r=this._media,a=this._mediaKeysList;if(!r)return;r.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(a.map(function(n){if(n.mediaKeysSession)return n.mediaKeysSession.close().catch(function(){})})).then(function(){return r.setMediaKeys(null)}).catch(function(){})},s.onManifestParsed=function(r,a){if(!this._emeEnabled)return;var n=a.levels.map(function(O){return O.audioCodec}).filter(function(O){return!!O}),h=a.levels.map(function(O){return O.videoCodec}).filter(function(O){return!!O});this._attemptKeySystemAccess(H.KeySystems.WIDEVINE,n,h)},D(d,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),d}();V.default=u},"./src/controller/fps-controller.ts":function(q,V,M){"use strict";M.r(V);var z=M("./src/events.ts"),U=M("./src/utils/logger.ts"),L=function(){function H(D){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=D,this.registerListeners()}var F=H.prototype;return F.setStreamController=function(I){this.streamController=I},F.registerListeners=function(){this.hls.on(z.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},F.unregisterListeners=function(){this.hls.off(z.Events.MEDIA_ATTACHING,this.onMediaAttaching)},F.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},F.onMediaAttaching=function(I,g){var f=this.hls.config;if(f.capLevelOnFPSDrop){var u=g.media instanceof self.HTMLVideoElement?g.media:null;this.media=u,u&&typeof u.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),f.fpsDroppedMonitoringPeriod)}},F.checkFPS=function(I,g,f){var u=performance.now();if(g){if(this.lastTime){var d=u-this.lastTime,s=f-this.lastDroppedFrames,l=g-this.lastDecodedFrames,r=1e3*s/d,a=this.hls;if(a.trigger(z.Events.FPS_DROP,{currentDropped:s,currentDecoded:l,totalDroppedFrames:f}),r>0&&s>a.config.fpsDroppedMonitoringThreshold*l){var n=a.currentLevel;U.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+n),n>0&&(a.autoLevelCapping===-1||a.autoLevelCapping>=n)&&(n=n-1,a.trigger(z.Events.FPS_DROP_LEVEL_CAPPING,{level:n,droppedLevel:a.currentLevel}),a.autoLevelCapping=n,this.streamController.nextLevelSwitch())}}this.lastTime=u,this.lastDroppedFrames=f,this.lastDecodedFrames=g}},F.checkFPSInterval=function(){var I=this.media;if(I)if(this.isVideoPlaybackQualityAvailable){var g=I.getVideoPlaybackQuality();this.checkFPS(I,g.totalVideoFrames,g.droppedVideoFrames)}else this.checkFPS(I,I.webkitDecodedFrameCount,I.webkitDroppedFrameCount)},H}();V.default=L},"./src/controller/fragment-finders.ts":function(q,V,M){"use strict";M.r(V),M.d(V,"findFragmentByPDT",function(){return L}),M.d(V,"findFragmentByPTS",function(){return H}),M.d(V,"fragmentWithinToleranceTest",function(){return F}),M.d(V,"pdtWithinToleranceTest",function(){return D}),M.d(V,"findFragWithCC",function(){return I});var z=M("./src/polyfills/number.ts"),U=M("./src/utils/binary-search.ts");function L(g,f,u){if(f===null||!Array.isArray(g)||!g.length||!Object(z.isFiniteNumber)(f))return null;var d=g[0].programDateTime;if(f<(d||0))return null;var s=g[g.length-1].endProgramDateTime;if(f>=(s||0))return null;u=u||0;for(var l=0;lg&&u.start?-1:0}function D(g,f,u){var d=Math.min(f,u.duration+(u.deltaPTS?u.deltaPTS:0))*1e3,s=u.endProgramDateTime||0;return s-d>g}function I(g,f){return U.default.search(g,function(u){return u.ccf?-1:0})}},"./src/controller/fragment-tracker.ts":function(q,V,M){"use strict";M.r(V),M.d(V,"FragmentState",function(){return L}),M.d(V,"FragmentTracker",function(){return H});var z=M("./src/events.ts"),U=M("./src/types/loader.ts"),L;(function(I){I.NOT_LOADED="NOT_LOADED",I.BACKTRACKED="BACKTRACKED",I.APPENDING="APPENDING",I.PARTIAL="PARTIAL",I.OK="OK"})(L||(L={}));var H=function(){function I(f){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=f,this._registerListeners()}var g=I.prototype;return g._registerListeners=function(){var u=this.hls;u.on(z.Events.BUFFER_APPENDED,this.onBufferAppended,this),u.on(z.Events.FRAG_BUFFERED,this.onFragBuffered,this),u.on(z.Events.FRAG_LOADED,this.onFragLoaded,this)},g._unregisterListeners=function(){var u=this.hls;u.off(z.Events.BUFFER_APPENDED,this.onBufferAppended,this),u.off(z.Events.FRAG_BUFFERED,this.onFragBuffered,this),u.off(z.Events.FRAG_LOADED,this.onFragLoaded,this)},g.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},g.getAppendedFrag=function(u,d){if(d===U.PlaylistLevelType.MAIN){var s=this.activeFragment,l=this.activeParts;if(!s)return null;if(l)for(var r=l.length;r--;){var a=l[r],n=a?a.end:s.appendedPTS;if(a.start<=u&&n!==void 0&&u<=n)return r>9&&(this.activeParts=l.slice(r-9)),a}else if(s.start<=u&&s.appendedPTS!==void 0&&u<=s.appendedPTS)return s}return this.getBufferedFrag(u,d)},g.getBufferedFrag=function(u,d){for(var s=this.fragments,l=Object.keys(s),r=l.length;r--;){var a=s[l[r]];if((a==null?void 0:a.body.type)===d&&a.buffered){var n=a.body;if(n.start<=u&&u<=n.end)return n}}return null},g.detectEvictedFragments=function(u,d,s){var l=this;Object.keys(this.fragments).forEach(function(r){var a=l.fragments[r];if(!a)return;if(!a.buffered){a.body.type===s&&l.removeFragment(a.body);return}var n=a.range[u];if(!n)return;n.time.some(function(h){var O=!l.isTimeBuffered(h.startPTS,h.endPTS,d);return O&&l.removeFragment(a.body),O})})},g.detectPartialFragments=function(u){var d=this,s=this.timeRanges,l=u.frag,r=u.part;if(!s||l.sn==="initSegment")return;var a=D(l),n=this.fragments[a];if(!n)return;Object.keys(s).forEach(function(h){var O=l.elementaryStreams[h];if(!O)return;var S=s[h],x=r!==null||O.partial===!0;n.range[h]=d.getBufferedTimes(l,r,x,S)}),n.backtrack=n.loaded=null,Object.keys(n.range).length?n.buffered=!0:this.removeFragment(n.body)},g.fragBuffered=function(u){var d=D(u),s=this.fragments[d];s&&(s.backtrack=s.loaded=null,s.buffered=!0)},g.getBufferedTimes=function(u,d,s,l){for(var r={time:[],partial:s},a=d?d.start:u.start,n=d?d.end:u.end,h=u.minEndPTS||n,O=u.maxStartPTS||a,S=0;S=x&&h<=A){r.time.push({startPTS:Math.max(a,l.start(S)),endPTS:Math.min(n,l.end(S))});break}else if(ax)r.partial=!0,r.time.push({startPTS:Math.max(a,l.start(S)),endPTS:Math.min(n,l.end(S))});else if(n<=x)break}return r},g.getPartialFragment=function(u){var d=null,s,l,r,a=0,n=this.bufferPadding,h=this.fragments;return Object.keys(h).forEach(function(O){var S=h[O];if(!S)return;F(S)&&(l=S.body.start-n,r=S.body.end+n,u>=l&&u<=r&&(s=Math.min(u-l,r-u),a<=s&&(d=S.body,a=s)))}),d},g.getState=function(u){var d=D(u),s=this.fragments[d];return s?s.buffered?F(s)?L.PARTIAL:L.OK:s.backtrack?L.BACKTRACKED:L.APPENDING:L.NOT_LOADED},g.backtrack=function(u,d){var s=D(u),l=this.fragments[s];if(!l||l.backtrack)return null;var r=l.backtrack=d||l.loaded;return l.loaded=null,r},g.getBacktrackData=function(u){var d=D(u),s=this.fragments[d];if(s){var l,r=s.backtrack;if(r!=null&&(l=r.payload)!==null&&l!==void 0&&l.byteLength)return r;this.removeFragment(u)}return null},g.isTimeBuffered=function(u,d,s){for(var l,r,a=0;a=l&&d<=r)return!0;if(d<=l)return!1}return!1},g.onFragLoaded=function(u,d){var s=d.frag,l=d.part;if(s.sn==="initSegment"||s.bitrateTest||l)return;var r=D(s);this.fragments[r]={body:s,loaded:d,backtrack:null,buffered:!1,range:Object.create(null)}},g.onBufferAppended=function(u,d){var s=this,l=d.frag,r=d.part,a=d.timeRanges;if(l.type===U.PlaylistLevelType.MAIN)if(this.activeFragment=l,r){var n=this.activeParts;n||(this.activeParts=n=[]),n.push(r)}else this.activeParts=null;this.timeRanges=a,Object.keys(a).forEach(function(h){var O=a[h];if(s.detectEvictedFragments(h,O),!r)for(var S=0;Su&&l.removeFragment(n)}})},g.removeFragment=function(u){var d=D(u);u.stats.loaded=0,u.clearElementaryStreamInfo(),delete this.fragments[d]},g.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},I}();function F(I){var g,f;return I.buffered&&(((g=I.range.video)===null||g===void 0?void 0:g.partial)||((f=I.range.audio)===null||f===void 0?void 0:f.partial))}function D(I){return I.type+"_"+I.level+"_"+I.urlId+"_"+I.sn}},"./src/controller/gap-controller.ts":function(q,V,M){"use strict";M.r(V),M.d(V,"STALL_MINIMUM_DURATION_MS",function(){return F}),M.d(V,"MAX_START_GAP_JUMP",function(){return D}),M.d(V,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return I}),M.d(V,"SKIP_BUFFER_RANGE_START",function(){return g}),M.d(V,"default",function(){return f});var z=M("./src/utils/buffer-helper.ts"),U=M("./src/errors.ts"),L=M("./src/events.ts"),H=M("./src/utils/logger.ts"),F=250,D=2,I=.1,g=.05,f=function(){function u(s,l,r,a){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=s,this.media=l,this.fragmentTracker=r,this.hls=a}var d=u.prototype;return d.destroy=function(){this.hls=this.fragmentTracker=this.media=null},d.poll=function(l){var r=this.config,a=this.media,n=this.stalled,h=a.currentTime,O=a.seeking,S=this.seeking&&!O,x=!this.seeking&&O;if(this.seeking=O,h!==l){if(this.moved=!0,n!==null){if(this.stallReported){var A=self.performance.now()-n;H.logger.warn("playback not stuck anymore @"+h+", after "+Math.round(A)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((x||S)&&(this.stalled=null),a.paused||a.ended||a.playbackRate===0||!z.BufferHelper.getBuffered(a).length)return;var C=z.BufferHelper.bufferInfo(a,h,0),b=C.len>0,v=C.nextStart||0;if(!b&&!v)return;if(O){var p=C.len>D,c=!v||v-h>D&&!this.fragmentTracker.getPartialFragment(h);if(p||c)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var E,y=Math.max(v,C.start||0)-h,_=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,P=_==null||((E=_.details)===null||E===void 0)?void 0:E.live,N=P?_.details.targetduration*2:D;if(y>0&&y<=N){this._trySkipBufferHole(null);return}}var K=self.performance.now();if(n===null){this.stalled=K;return}var $=K-n;!O&&$>=F&&this._reportStall(C.len);var B=z.BufferHelper.bufferInfo(a,h,r.maxBufferHole);this._tryFixBufferStall(B,$)},d._tryFixBufferStall=function(l,r){var a=this.config,n=this.fragmentTracker,h=this.media,O=h.currentTime,S=n.getPartialFragment(O);if(S){var x=this._trySkipBufferHole(S);if(x)return}l.len>a.maxBufferHole&&r>a.highBufferWatchdogPeriod*1e3&&(H.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},d._reportStall=function(l){var r=this.hls,a=this.media,n=this.stallReported;n||(this.stallReported=!0,H.logger.warn("Playback stalling at @"+a.currentTime+" due to low buffer (buffer="+l+")"),r.trigger(L.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:l}))},d._trySkipBufferHole=function(l){for(var r=this.config,a=this.hls,n=this.media,h=n.currentTime,O=0,S=z.BufferHelper.getBuffered(n),x=0;x=O&&h.05&&this.forwardBufferLength>1){var x=Math.min(2,Math.max(1,a)),A=Math.round(2/(1+Math.exp(-.75*h-this.edgeStalled))*20)/20;u.playbackRate=Math.min(x,Math.max(1,A))}else u.playbackRate!==1&&u.playbackRate!==0&&(u.playbackRate=1)},g.estimateLiveEdge=function(){var u=this.levelDetails;return u===null?null:u.edge+u.age},g.computeLatency=function(){var u=this.estimateLiveEdge();return u===null?null:u-this.currentTime},F(I,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var u=this.config,d=this.levelDetails;return u.liveMaxLatencyDuration!==void 0?u.liveMaxLatencyDuration:d?u.liveMaxLatencyDurationCount*d.targetduration:0}},{key:"targetLatency",get:function(){var u=this.levelDetails;if(u===null)return null;var d=u.holdBack,s=u.partHoldBack,l=u.targetduration,r=this.config,a=r.liveSyncDuration,n=r.liveSyncDurationCount,h=r.lowLatencyMode,O=this.hls.userConfig,S=h&&s||d;(O.liveSyncDuration||O.liveSyncDurationCount||S===0)&&(S=a!==void 0?a:n*l);var x=l,A=1;return S+Math.min(this.stallCount*A,x)}},{key:"liveSyncPosition",get:function(){var u=this.estimateLiveEdge(),d=this.targetLatency,s=this.levelDetails;if(u===null||d===null||s===null)return null;var l=s.edge,r=u-d-this.edgeStalled,a=l-s.totalduration,n=l-(this.config.lowLatencyMode&&s.partTarget||s.targetduration);return Math.min(Math.max(a,r),n)}},{key:"drift",get:function(){var u=this.levelDetails;return u===null?1:u.drift}},{key:"edgeStalled",get:function(){var u=this.levelDetails;if(u===null)return 0;var d=(this.config.lowLatencyMode&&u.partTarget||u.targetduration)*3;return Math.max(u.age-d,0)}},{key:"forwardBufferLength",get:function(){var u=this.media,d=this.levelDetails;if(!u||!d)return 0;var s=u.buffered.length;return s?u.buffered.end(s-1):d.edge-this.currentTime}}]),I}()},"./src/controller/level-controller.ts":function(q,V,M){"use strict";M.r(V),M.d(V,"default",function(){return r});var z=M("./src/types/level.ts"),U=M("./src/events.ts"),L=M("./src/errors.ts"),H=M("./src/utils/codecs.ts"),F=M("./src/controller/level-helper.ts"),D=M("./src/controller/base-playlist-controller.ts"),I=M("./src/types/loader.ts");function g(){return g=Object.assign||function(a){for(var n=1;n0){v=A[0].bitrate,A.sort(function($,B){return $.bitrate-B.bitrate}),this._levels=A;for(var P=0;Pthis.hls.config.fragLoadingMaxRetry&&(p=x.frag.level)):p=x.frag.level}break;case L.ErrorDetails.LEVEL_LOAD_ERROR:case L.ErrorDetails.LEVEL_LOAD_TIMEOUT:A&&(A.deliveryDirectives&&(v=!1),p=A.level),b=!0;break;case L.ErrorDetails.REMUX_ALLOC_ERROR:p=x.level,b=!0;break}p!==void 0&&this.recoverLevel(x,p,b,v)},h.recoverLevel=function(S,x,A,C){var b=S.details,v=this._levels[x];if(v.loadError++,A){var p=this.retryLoadingOrFail(S);if(p)S.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(C){var c=v.url.length;if(c>1&&v.loadError1){var C=(x.urlId+1)%A;this.warn("Switching to redundant URL-id "+C),this._levels.forEach(function(b){b.urlId=C}),this.level=S}},h.onFragLoaded=function(S,x){var A=x.frag;if(A!==void 0&&A.type===I.PlaylistLevelType.MAIN){var C=this._levels[A.level];C!==void 0&&(C.fragmentError=0,C.loadError=0)}},h.onLevelLoaded=function(S,x){var A,C=x.level,b=x.details,v=this._levels[C];if(!v){var p;this.warn("Invalid level index "+C),(p=x.deliveryDirectives)!==null&&p!==void 0&&p.skip&&(b.deltaUpdateFailed=!0);return}C===this.currentLevelIndex?(v.fragmentError===0&&(v.loadError=0,this.retryCount=0),this.playlistLoaded(C,x,v.details)):(A=x.deliveryDirectives)!==null&&A!==void 0&&A.skip&&(b.deltaUpdateFailed=!0)},h.onAudioTrackSwitched=function(S,x){var A=this.hls.levels[this.currentLevelIndex];if(!A)return;if(A.audioGroupIds){for(var C=-1,b=this.hls.audioTracks[x.id].groupId,v=0;v0){var C=A.urlId,b=A.url[C];if(S)try{b=S.addDirectives(b)}catch(v){this.warn("Could not construct new URL with HLS Delivery Directives: "+v)}this.log("Attempt loading level index "+x+(S?" at sn "+S.msn+" part "+S.part:"")+" with URL-id "+C+" "+b),this.clearTimer(),this.hls.trigger(U.Events.LEVEL_LOADING,{url:b,level:x,id:C,deliveryDirectives:S||null})}},h.removeLevel=function(S,x){var A=function(v,p){return p!==x},C=this._levels.filter(function(b,v){return v!==S?!0:b.url.length>1&&x!==void 0?(b.url=b.url.filter(A),b.audioGroupIds&&(b.audioGroupIds=b.audioGroupIds.filter(A)),b.textGroupIds&&(b.textGroupIds=b.textGroupIds.filter(A)),b.urlId=0,!0):!1}).map(function(b,v){var p=b.details;return p!=null&&p.fragments&&p.fragments.forEach(function(c){c.level=v}),b});this._levels=C,this.hls.trigger(U.Events.LEVELS_UPDATED,{levels:C})},u(n,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(S){var x,A=this._levels;if(A.length===0)return;if(this.currentLevelIndex===S&&(x=A[S])!==null&&x!==void 0&&x.details)return;if(S<0||S>=A.length){var C=S<0;if(this.hls.trigger(U.Events.ERROR,{type:L.ErrorTypes.OTHER_ERROR,details:L.ErrorDetails.LEVEL_SWITCH_ERROR,level:S,fatal:C,reason:"invalid level idx"}),C)return;S=Math.min(S,A.length-1)}this.clearTimer();var b=this.currentLevelIndex,v=A[b],p=A[S];this.log("switching to level "+S+" from "+b),this.currentLevelIndex=S;var c=g({},p,{level:S,maxBitrate:p.maxBitrate,uri:p.uri,urlId:p.urlId});delete c._urlId,this.hls.trigger(U.Events.LEVEL_SWITCHING,c);var E=p.details;if(!E||E.live){var y=this.switchParams(p.uri,v==null?void 0:v.details);this.loadPlaylist(y)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(S){this.manualLevelIndex=S,this._startLevel===void 0&&(this._startLevel=S),S!==-1&&(this.level=S)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(S){this._firstLevel=S}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var S=this.hls.config.startLevel;return S!==void 0?S:this._firstLevel}else return this._startLevel},set:function(S){this._startLevel=S}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(S){this.level=S,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=S)}}]),n}(D.default)},"./src/controller/level-helper.ts":function(q,V,M){"use strict";M.r(V),M.d(V,"addGroupId",function(){return L}),M.d(V,"assignTrackIdsByGroup",function(){return H}),M.d(V,"updatePTS",function(){return F}),M.d(V,"updateFragPTSDTS",function(){return I}),M.d(V,"mergeDetails",function(){return g}),M.d(V,"mapPartIntersection",function(){return f}),M.d(V,"mapFragmentIntersection",function(){return u}),M.d(V,"adjustSliding",function(){return d}),M.d(V,"addSliding",function(){return s}),M.d(V,"computeReloadInterval",function(){return l}),M.d(V,"getFragmentWithSN",function(){return r}),M.d(V,"getPartWith",function(){return a});var z=M("./src/polyfills/number.ts"),U=M("./src/utils/logger.ts");function L(n,h,O){switch(h){case"audio":n.audioGroupIds||(n.audioGroupIds=[]),n.audioGroupIds.push(O);break;case"text":n.textGroupIds||(n.textGroupIds=[]),n.textGroupIds.push(O);break}}function H(n){var h={};n.forEach(function(O){var S=O.groupId||"";O.id=h[S]=h[S]||0,h[S]++})}function F(n,h,O){var S=n[h],x=n[O];D(S,x)}function D(n,h){var O=h.startPTS;if(Object(z.isFiniteNumber)(O)){var S=0,x;h.sn>n.sn?(S=O-n.start,x=n):(S=n.start-O,x=h),x.duration!==S&&(x.duration=S)}else if(h.sn>n.sn){var A=n.cc===h.cc;A&&n.minEndPTS?h.start=n.start+(n.minEndPTS-n.start):h.start=n.start+n.duration}else h.start=Math.max(n.start-h.duration,0)}function I(n,h,O,S,x,A){var C=S-O;C<=0&&(U.logger.warn("Fragment should have a positive duration",h),S=O+h.duration,A=x+h.duration);var b=O,v=S,p=h.startPTS,c=h.endPTS;if(Object(z.isFiniteNumber)(p)){var E=Math.abs(p-O);Object(z.isFiniteNumber)(h.deltaPTS)?h.deltaPTS=Math.max(E,h.deltaPTS):h.deltaPTS=E,b=Math.max(O,p),O=Math.min(O,p),x=Math.min(x,h.startDTS),v=Math.min(S,c),S=Math.max(S,c),A=Math.max(A,h.endDTS)}h.duration=S-O;var y=O-h.start;h.appendedPTS=S,h.start=h.startPTS=O,h.maxStartPTS=b,h.startDTS=x,h.endPTS=S,h.minEndPTS=v,h.endDTS=A;var _=h.sn;if(!n||_n.endSN)return 0;var P,N=_-n.startSN,K=n.fragments;for(K[N]=h,P=N;P>0;P--)D(K[P],K[P-1]);for(P=N;P=0;x--){var A=S[x].initSegment;if(A){O=A;break}}n.fragmentHint&&delete n.fragmentHint.endPTS;var C=0,b;if(u(n,h,function(P,N){P.relurl&&(C=P.cc-N.cc),Object(z.isFiniteNumber)(P.startPTS)&&Object(z.isFiniteNumber)(P.endPTS)&&(N.start=N.startPTS=P.startPTS,N.startDTS=P.startDTS,N.appendedPTS=P.appendedPTS,N.maxStartPTS=P.maxStartPTS,N.endPTS=P.endPTS,N.endDTS=P.endDTS,N.minEndPTS=P.minEndPTS,N.duration=P.endPTS-P.startPTS,N.duration&&(b=N),h.PTSKnown=h.alignedSliding=!0),N.elementaryStreams=P.elementaryStreams,N.loader=P.loader,N.stats=P.stats,N.urlId=P.urlId,P.initSegment&&(N.initSegment=P.initSegment,O=P.initSegment)}),O){var v=h.fragmentHint?h.fragments.concat(h.fragmentHint):h.fragments;v.forEach(function(P){var N;(!P.initSegment||P.initSegment.relurl===((N=O)===null||N===void 0?void 0:N.relurl))&&(P.initSegment=O)})}if(h.skippedSegments&&(h.deltaUpdateFailed=h.fragments.some(function(P){return!P}),h.deltaUpdateFailed)){U.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var p=h.skippedSegments;p--;)h.fragments.shift();h.startSN=h.fragments[0].sn,h.startCC=h.fragments[0].cc}var c=h.fragments;if(C){U.logger.warn("discontinuity sliding from playlist, take drift into account");for(var E=0;E=S.length)return;s(h,S[O].start)}function s(n,h){if(h){for(var O=n.fragments,S=n.skippedSegments;S0&&x0&&v===-1&&(this.log("Override startPosition with lastCurrentTime @"+p.toFixed(3)),v=p),this.state=U.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=v,this.tick()}else this._forceStartLoad=!0,this.state=U.State.STOPPED},C.stopLoad=function(){this._forceStartLoad=!1,x.prototype.stopLoad.call(this)},C.doTick=function(){switch(this.state){case U.State.IDLE:this.doTickIdle();break;case U.State.WAITING_LEVEL:{var v,p=this.levels,c=this.level,E=p==null||((v=p[c])===null||v===void 0)?void 0:v.details;if(E&&(!E.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(E))break;this.state=U.State.IDLE;break}break}case U.State.FRAG_LOADING_WAITING_RETRY:{var y,_=self.performance.now(),P=this.retryDate;(!P||_>=P||(y=this.media)!==null&&y!==void 0&&y.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=U.State.IDLE)}break;default:break}this.onTickEnd()},C.onTickEnd=function(){x.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},C.doTickIdle=function(){var v,p,c=this.hls,E=this.levelLastLoaded,y=this.levels,_=this.media,P=c.config,N=c.nextLoadLevel;if(E===null||!_&&(this.startFragRequested||!P.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!y||!y[N])return;var K=y[N];this.level=c.nextLoadLevel=N;var $=K.details;if(!$||this.state===U.State.WAITING_LEVEL||$.live&&this.levelLastLoaded!==N){this.state=U.State.WAITING_LEVEL;return}var B=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:_,I.PlaylistLevelType.MAIN);if(B===null)return;var R=B.len,G=this.getMaxBufferLength(K.maxBitrate);if(R>=G)return;if(this._streamEnded(B,$)){var Q={};this.altAudio&&(Q.type="video"),this.hls.trigger(H.Events.BUFFER_EOS,Q),this.state=U.State.ENDED;return}var ne=B.end,le=this.getNextFragment(ne,$);if(this.couldBacktrack&&!this.fragPrevious&&le&&le.sn!=="initSegment"){var _e=le.sn-$.startSN;_e>1&&(le=$.fragments[_e-1],this.fragmentTracker.removeFragment(le))}if(le&&this.fragmentTracker.getState(le)===D.FragmentState.OK&&this.nextLoadPosition>ne){var pe=this.audioOnly&&!this.altAudio?g.ElementaryStreamTypes.AUDIO:g.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(_,pe,I.PlaylistLevelType.MAIN),le=this.getNextFragment(this.nextLoadPosition,$)}if(!le)return;le.initSegment&&!le.initSegment.data&&!this.bitrateTest&&(le=le.initSegment),((v=le.decryptdata)===null||v===void 0?void 0:v.keyFormat)==="identity"&&!((p=le.decryptdata)!==null&&p!==void 0&&p.key)?this.loadKey(le,$):this.loadFragment(le,$,ne)},C.loadFragment=function(v,p,c){var E,y=this.fragmentTracker.getState(v);if(this.fragCurrent=v,y===D.FragmentState.BACKTRACKED){var _=this.fragmentTracker.getBacktrackData(v);if(_){this._handleFragmentLoadProgress(_),this._handleFragmentLoadComplete(_);return}else y=D.FragmentState.NOT_LOADED}y===D.FragmentState.NOT_LOADED||y===D.FragmentState.PARTIAL?v.sn==="initSegment"?this._loadInitSegment(v):this.bitrateTest?(v.bitrateTest=!0,this.log("Fragment "+v.sn+" of level "+v.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(v)):(this.startFragRequested=!0,x.prototype.loadFragment.call(this,v,p,c)):y===D.FragmentState.APPENDING?this.reduceMaxBufferLength(v.duration)&&this.fragmentTracker.removeFragment(v):((E=this.media)===null||E===void 0?void 0:E.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},C.getAppendedFrag=function(v){var p=this.fragmentTracker.getAppendedFrag(v,I.PlaylistLevelType.MAIN);return p&&"fragment"in p?p.fragment:p},C.getBufferedFrag=function(v){return this.fragmentTracker.getBufferedFrag(v,I.PlaylistLevelType.MAIN)},C.followingBufferedFrag=function(v){return v?this.getBufferedFrag(v.end+.5):null},C.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},C.nextLevelSwitch=function(){var v=this.levels,p=this.media;if(p!=null&&p.readyState){var c,E=this.getAppendedFrag(p.currentTime);if(E&&E.start>1&&this.flushMainBuffer(0,E.start-1),!p.paused&&v){var y=this.hls.nextLoadLevel,_=v[y],P=this.fragLastKbps;P&&this.fragCurrent?c=this.fragCurrent.duration*_.maxBitrate/(1e3*P)+1:c=0}else c=0;var N=this.getBufferedFrag(p.currentTime+c);if(N){var K=this.followingBufferedFrag(N);if(K){this.abortCurrentFrag();var $=K.maxStartPTS?K.maxStartPTS:K.start,B=K.duration,R=Math.max(N.end,$+Math.min(Math.max(B-this.config.maxFragLookUpTolerance,B*.5),B*.75));this.flushMainBuffer(R,Number.POSITIVE_INFINITY)}}}},C.abortCurrentFrag=function(){var v=this.fragCurrent;this.fragCurrent=null,v!=null&&v.loader&&v.loader.abort(),this.state===U.State.KEY_LOADING&&(this.state=U.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},C.flushMainBuffer=function(v,p){x.prototype.flushMainBuffer.call(this,v,p,this.altAudio?"video":null)},C.onMediaAttached=function(v,p){x.prototype.onMediaAttached.call(this,v,p);var c=p.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),c.addEventListener("playing",this.onvplaying),c.addEventListener("seeked",this.onvseeked),this.gapController=new d.default(this.config,c,this.fragmentTracker,this.hls)},C.onMediaDetaching=function(){var v=this.media;v&&(v.removeEventListener("playing",this.onvplaying),v.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),x.prototype.onMediaDetaching.call(this)},C.onMediaPlaying=function(){this.tick()},C.onMediaSeeked=function(){var v=this.media,p=v?v.currentTime:null;Object(z.isFiniteNumber)(p)&&this.log("Media seeked to "+p.toFixed(3)),this.tick()},C.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(H.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},C.onManifestParsed=function(v,p){var c=!1,E=!1,y;p.levels.forEach(function(_){y=_.audioCodec,y&&(y.indexOf("mp4a.40.2")!==-1&&(c=!0),y.indexOf("mp4a.40.5")!==-1&&(E=!0))}),this.audioCodecSwitch=c&&E&&!Object(L.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=p.levels,this.startFragRequested=!1},C.onLevelLoading=function(v,p){var c=this.levels;if(!c||this.state!==U.State.IDLE)return;var E=c[p.level];(!E.details||E.details.live&&this.levelLastLoaded!==p.level||this.waitForCdnTuneIn(E.details))&&(this.state=U.State.WAITING_LEVEL)},C.onLevelLoaded=function(v,p){var c,E=this.levels,y=p.level,_=p.details,P=_.totalduration;if(!E){this.warn("Levels were reset while loading level "+y);return}this.log("Level "+y+" loaded ["+_.startSN+","+_.endSN+"], cc ["+_.startCC+", "+_.endCC+"] duration:"+P);var N=this.fragCurrent;N&&(this.state===U.State.FRAG_LOADING||this.state===U.State.FRAG_LOADING_WAITING_RETRY)&&(N.level!==p.level&&N.loader&&(this.state=U.State.IDLE,N.loader.abort()));var K=E[y],$=0;if(_.live||(c=K.details)!==null&&c!==void 0&&c.live){if(_.fragments[0]||(_.deltaUpdateFailed=!0),_.deltaUpdateFailed)return;$=this.alignPlaylists(_,K.details)}if(K.details=_,this.levelLastLoaded=y,this.hls.trigger(H.Events.LEVEL_UPDATED,{details:_,level:y}),this.state===U.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(_))return;this.state=U.State.IDLE}this.startFragRequested?_.live&&this.synchronizeToLiveEdge(_):this.setStartPosition(_,$),this.tick()},C._handleFragmentLoadProgress=function(v){var p,c=v.frag,E=v.part,y=v.payload,_=this.levels;if(!_){this.warn("Levels were reset while fragment load was in progress. Fragment "+c.sn+" of level "+c.level+" will not be buffered");return}var P=_[c.level],N=P.details;if(!N){this.warn("Dropping fragment "+c.sn+" of level "+c.level+" after level details were reset");return}var K=P.videoCodec,$=N.PTSKnown||!N.live,B=(p=c.initSegment)===null||p===void 0?void 0:p.data,R=this._getAudioCodec(P),G=this.transmuxer=this.transmuxer||new f.default(this.hls,I.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),Q=E?E.index:-1,ne=Q!==-1,le=new u.ChunkMetadata(c.level,c.sn,c.stats.chunkCount,y.byteLength,Q,ne),_e=this.initPTS[c.cc];G.push(y,B,R,K,c,E,N.totalduration,$,le,_e)},C.onAudioTrackSwitching=function(v,p){var c=this.altAudio,E=!!p.url,y=p.id;if(!E){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var _=this.fragCurrent;_!=null&&_.loader&&(this.log("Switching to main audio track, cancel main fragment load"),_.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var P=this.hls;c&&P.trigger(H.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),P.trigger(H.Events.AUDIO_TRACK_SWITCHED,{id:y})}},C.onAudioTrackSwitched=function(v,p){var c=p.id,E=!!this.hls.audioTracks[c].url;if(E){var y=this.videoBuffer;y&&this.mediaBuffer!==y&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=y)}this.altAudio=E,this.tick()},C.onBufferCreated=function(v,p){var c=p.tracks,E,y,_=!1;for(var P in c){var N=c[P];if(N.id==="main"){if(y=P,E=N,P==="video"){var K=c[P];K&&(this.videoBuffer=K.buffer)}}else _=!0}_&&E?(this.log("Alternate track found, use "+y+".buffered to schedule main fragment loading"),this.mediaBuffer=E.buffer):this.mediaBuffer=this.media},C.onFragBuffered=function(v,p){var c=p.frag,E=p.part;if(c&&c.type!==I.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(c)){this.warn("Fragment "+c.sn+(E?" p: "+E.index:"")+" of level "+c.level+" finished buffering, but was aborted. state: "+this.state),this.state===U.State.PARSED&&(this.state=U.State.IDLE);return}var y=E?E.stats:c.stats;this.fragLastKbps=Math.round(8*y.total/(y.buffering.end-y.loading.first)),c.sn!=="initSegment"&&(this.fragPrevious=c),this.fragBufferedComplete(c,E)},C.onError=function(v,p){switch(p.details){case s.ErrorDetails.FRAG_LOAD_ERROR:case s.ErrorDetails.FRAG_LOAD_TIMEOUT:case s.ErrorDetails.KEY_LOAD_ERROR:case s.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(I.PlaylistLevelType.MAIN,p);break;case s.ErrorDetails.LEVEL_LOAD_ERROR:case s.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==U.State.ERROR&&(p.fatal?(this.warn(""+p.details),this.state=U.State.ERROR):!p.levelRetry&&this.state===U.State.WAITING_LEVEL&&(this.state=U.State.IDLE));break;case s.ErrorDetails.BUFFER_FULL_ERROR:if(p.parent==="main"&&(this.state===U.State.PARSING||this.state===U.State.PARSED)){var c=!0,E=this.getFwdBufferInfo(this.media,I.PlaylistLevelType.MAIN);E&&E.len>.5&&(c=!this.reduceMaxBufferLength(E.len)),c&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},C.checkBuffer=function(){var v=this.media,p=this.gapController;if(!v||!p||!v.readyState)return;var c=F.BufferHelper.getBuffered(v);!this.loadedmetadata&&c.length?(this.loadedmetadata=!0,this.seekToStartPos()):p.poll(this.lastCurrentTime),this.lastCurrentTime=v.currentTime},C.onFragLoadEmergencyAborted=function(){this.state=U.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},C.onBufferFlushed=function(v,p){var c=p.type;if(c!==g.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var E=(c===g.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(E,c,I.PlaylistLevelType.MAIN)}},C.onLevelsUpdated=function(v,p){this.levels=p.levels},C.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},C.seekToStartPos=function(){var v=this.media,p=v.currentTime,c=this.startPosition;if(c>=0&&p0&&(_1&&v.seeking===!1){var c=v.currentTime;if(F.BufferHelper.isBuffered(v,c)?p=this.getAppendedFrag(c):F.BufferHelper.isBuffered(v,c+.1)&&(p=this.getAppendedFrag(c+.1)),p){var E=this.fragPlaying,y=p.level;(!E||p.sn!==E.sn||E.level!==y||p.urlId!==E.urlId)&&(this.hls.trigger(H.Events.FRAG_CHANGED,{frag:p}),(!E||E.level!==y)&&this.hls.trigger(H.Events.LEVEL_SWITCHED,{level:y}),this.fragPlaying=p)}}},a(A,[{key:"nextLevel",get:function(){var v=this.nextBufferedFrag;return v?v.level:-1}},{key:"currentLevel",get:function(){var v=this.media;if(v){var p=this.getAppendedFrag(v.currentTime);if(p)return p.level}return-1}},{key:"nextBufferedFrag",get:function(){var v=this.media;if(v){var p=this.getAppendedFrag(v.currentTime);return this.followingBufferedFrag(p)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),A}(U.default)},"./src/controller/subtitle-stream-controller.ts":function(q,V,M){"use strict";M.r(V),M.d(V,"SubtitleStreamController",function(){return n});var z=M("./src/events.ts"),U=M("./src/utils/logger.ts"),L=M("./src/utils/buffer-helper.ts"),H=M("./src/controller/fragment-finders.ts"),F=M("./src/utils/discontinuities.ts"),D=M("./src/controller/level-helper.ts"),I=M("./src/controller/fragment-tracker.ts"),g=M("./src/controller/base-stream-controller.ts"),f=M("./src/types/loader.ts"),u=M("./src/types/level.ts");function d(h,O){for(var S=0;S=p[y].start&&E<=p[y].end){c=p[y];break}var _=b.start+b.duration;c?c.end=_:(c={start:E,end:_},p.push(c)),this.fragmentTracker.fragBuffered(b)},S.onBufferFlushing=function(A,C){var b=C.startOffset,v=C.endOffset;if(b===0&&v!==Number.POSITIVE_INFINITY){var p=this.currentTrackId,c=this.levels;if(!c.length||!c[p]||!c[p].details)return;var E=c[p].details,y=E.targetduration,_=v-y;if(_<=0)return;C.endOffsetSubtitles=Math.max(0,_),this.tracksBuffered.forEach(function(P){for(var N=0;N=E.length||p!==c||!y)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,v.live||(b=y.details)!==null&&b!==void 0&&b.live){var _=this.mainDetails;if(v.deltaUpdateFailed||!_)return;var P=_.fragments[0];if(!y.details)v.hasProgramDateTime&&_.hasProgramDateTime?Object(F.alignMediaPlaylistByPDT)(v,_):P&&Object(D.addSliding)(v,P.start);else{var N=this.alignPlaylists(v,y.details);N===0&&P&&Object(D.addSliding)(v,P.start)}}if(y.details=v,this.levelLastLoaded=p,this.tick(),v.live&&!this.fragCurrent&&this.media&&this.state===g.State.IDLE){var K=Object(H.findFragmentByPTS)(null,v.fragments,this.media.currentTime,0);K||(this.warn("Subtitle playlist not aligned with playback"),y.details=void 0)}},S._handleFragmentLoadComplete=function(A){var C=A.frag,b=A.payload,v=C.decryptdata,p=this.hls;if(this.fragContextChanged(C))return;if(b&&b.byteLength>0&&v&&v.key&&v.iv&&v.method==="AES-128"){var c=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(b),v.key.buffer,v.iv.buffer).then(function(E){var y=performance.now();p.trigger(z.Events.FRAG_DECRYPTED,{frag:C,payload:E,stats:{tstart:c,tdecrypt:y}})})}},S.doTick=function(){if(!this.media){this.state=g.State.IDLE;return}if(this.state===g.State.IDLE){var A,C=this.currentTrackId,b=this.levels;if(!b.length||!b[C]||!b[C].details)return;var v=b[C].details,p=v.targetduration,c=this.config,E=this.media,y=L.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,E.currentTime-p,c.maxBufferHole),_=y.end,P=y.len,N=this.getMaxBufferLength()+p;if(P>N)return;console.assert(v,"Subtitle track details are defined on idle subtitle stream controller tick");var K=v.fragments,$=K.length,B=v.edge,R,G=this.fragPrevious;if(_-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},l.pollTrackChange=function(a){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,a)},l.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var a=u(this.media.textTracks);a.forEach(function(n){Object(U.clearCurrentCues)(n)}),this.subtitleTrack=-1,this.media=null},l.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},l.onManifestParsed=function(a,n){this.tracks=n.subtitleTracks},l.onSubtitleTrackLoaded=function(a,n){var h=n.id,O=n.details,S=this.trackId,x=this.tracksInGroup[S];if(!x){this.warn("Invalid subtitle track id "+h);return}var A=x.details;x.details=n.details,this.log("subtitle track "+h+" loaded ["+O.startSN+"-"+O.endSN+"]"),h===this.trackId&&(this.retryCount=0,this.playlistLoaded(h,n,A))},l.onLevelLoading=function(a,n){this.switchLevel(n.level)},l.onLevelSwitching=function(a,n){this.switchLevel(n.level)},l.switchLevel=function(a){var n=this.hls.levels[a];if(!(n!=null&&n.textGroupIds))return;var h=n.textGroupIds[n.urlId];if(this.groupId!==h){var O=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,S=this.tracks.filter(function(C){return!h||C.groupId===h});this.tracksInGroup=S;var x=this.findTrackId(O==null?void 0:O.name)||this.findTrackId();this.groupId=h;var A={subtitleTracks:S};this.log("Updating subtitle tracks, "+S.length+' track(s) found in "'+h+'" group-id'),this.hls.trigger(z.Events.SUBTITLE_TRACKS_UPDATED,A),x!==-1&&this.setSubtitleTrack(x,O)}},l.findTrackId=function(a){for(var n=this.tracksInGroup,h=0;h=O.length)return;this.clearTimer();var S=O[a];if(this.log("Switching to subtitle track "+a),this.trackId=a,S){var x=S.id,A=S.groupId,C=A===void 0?"":A,b=S.name,v=S.type,p=S.url;this.hls.trigger(z.Events.SUBTITLE_TRACK_SWITCH,{id:x,groupId:C,name:b,type:v,url:p});var c=this.switchParams(S.url,n==null?void 0:n.details);this.loadPlaylist(c)}else this.hls.trigger(z.Events.SUBTITLE_TRACK_SWITCH,{id:a})},l.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var a=-1,n=u(this.media.textTracks),h=0;h=0&&(v[0]=Math.min(v[0],O),v[1]=Math.max(v[1],S),C=!0,p/(S-O)>.5))return}if(C||A.push([O,S]),this.config.renderTextTracksNatively){var c=this.captionsTracks[h];this.Cues.newCue(c,O,S,x)}else{var E=this.Cues.newCue(null,O,S,x);this.hls.trigger(U.Events.CUES_PARSED,{type:"captions",cues:E,track:h})}},a.onInitPtsFound=function(h,O){var S=this,x=O.frag,A=O.id,C=O.initPTS,b=O.timescale,v=this.unparsedVttFrags;A==="main"&&(this.initPTS[x.cc]=C,this.timescale[x.cc]=b),v.length&&(this.unparsedVttFrags=[],v.forEach(function(p){S.onFragLoaded(U.Events.FRAG_LOADED,p)}))},a.getExistingTrack=function(h){var O=this.media;if(O)for(var S=0;S>>8^b&255^99,I[x]=b,g[b]=x;var v=S[x],p=S[v],c=S[p],E=S[b]*257^b*16843008;u[x]=E<<24|E>>>8,d[x]=E<<16|E>>>16,s[x]=E<<8|E>>>24,l[x]=E,E=c*16843009^p*65537^v*257^x*16843008,a[b]=E<<24|E>>>8,n[b]=E<<16|E>>>16,h[b]=E<<8|E>>>24,O[b]=E,x?(x=v^S[S[S[c^v]]],A^=S[S[A]]):x=A=1}},F.expandKey=function(I){for(var g=this.uint8ArrayToUint32Array_(I),f=!0,u=0;u>>6)+1;var E=(h[O+2]&60)>>>2;if(E>c.length-1){n.trigger(L.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+E});return}return C=(h[O+2]&1)<<2,C|=(h[O+3]&192)>>>6,z.logger.log("manifest codec:"+S+", ADTS type:"+x+", samplingIndex:"+E),/firefox/i.test(v)?E>=6?(x=5,b=new Array(4),A=E-3):(x=2,b=new Array(2),A=E):v.indexOf("android")!==-1?(x=2,b=new Array(2),A=E):(x=5,b=new Array(4),S&&(S.indexOf("mp4a.40.29")!==-1||S.indexOf("mp4a.40.5")!==-1)||!S&&E>=6?A=E-3:((S&&S.indexOf("mp4a.40.2")!==-1&&(E>=6&&C===1||/vivaldi/i.test(v))||!S&&C===1)&&(x=2,b=new Array(2)),A=E)),b[0]=x<<3,b[0]|=(E&14)>>1,b[1]|=(E&1)<<7,b[1]|=C<<3,x===5&&(b[1]|=(A&14)>>1,b[2]=(A&1)<<7,b[2]|=2<<2,b[3]=0),{config:b,samplerate:c[E],channelCount:C,codec:"mp4a.40."+x,manifestCodec:p}}function F(n,h){return n[h]===255&&(n[h+1]&246)===240}function D(n,h){return n[h+1]&1?7:9}function I(n,h){return(n[h+3]&3)<<11|n[h+4]<<3|(n[h+5]&224)>>>5}function g(n,h){return h+5=n.length)return!1;var S=I(n,h);if(S<=O)return!1;var x=h+S;return x===n.length||f(n,x)}return!1}function s(n,h,O,S,x){if(!n.samplerate){var A=H(h,O,S,x);if(!A)return;n.config=A.config,n.samplerate=A.samplerate,n.channelCount=A.channelCount,n.codec=A.codec,n.manifestCodec=A.manifestCodec,z.logger.log("parsed codec:"+n.codec+", rate:"+A.samplerate+", channels:"+A.channelCount)}}function l(n){return 1024*9e4/n}function r(n,h,O,S,x){var A=D(n,h),C=I(n,h);if(C-=A,C>0){var b=O+S*x;return{headerLength:A,frameLength:C,stamp:b}}}function a(n,h,O,S,x){var A=l(n.samplerate),C=r(h,O,S,x,A);if(C){var b=C.frameLength,v=C.headerLength,p=C.stamp,c=v+b,E=Math.max(0,O+c-h.length),y;E?(y=new Uint8Array(c-v),y.set(h.subarray(O+v,h.length),0)):y=h.subarray(O+v,O+c);var _={unit:y,pts:p};return E||n.samples.push(_),{sample:_,length:c,missing:E}}}},"./src/demux/base-audio-demuxer.ts":function(q,V,M){"use strict";M.r(V),M.d(V,"initPTSFn",function(){return I});var z=M("./src/polyfills/number.ts"),U=M("./src/demux/id3.ts"),L=M("./src/demux/dummy-demuxed-track.ts"),H=M("./src/utils/mp4-tools.ts"),F=M("./src/utils/typed-array.ts"),D=function(){function g(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var f=g.prototype;return f.resetInitSegment=function(d,s,l){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},f.resetTimeStamp=function(){},f.resetContiguity=function(){},f.canParse=function(d,s){return!1},f.appendFrame=function(d,s,l){},f.demux=function(d,s){this.cachedData&&(d=Object(H.appendUint8Array)(this.cachedData,d),this.cachedData=null);var l=U.getID3Data(d,0),r=l?l.length:0,a,n,h=this._audioTrack,O=this._id3Track,S=l?U.getTimeStamp(l):void 0,x=d.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=I(S,s)),l&&l.length>0&&O.samples.push({pts:this.initPTS,dts:this.initPTS,data:l}),n=this.initPTS;rD?(this.word<<=D,this.bitsAvailable-=D):(D-=this.bitsAvailable,I=D>>3,D-=I>>3,this.bytesAvailable-=I,this.loadWord(),this.word<<=D,this.bitsAvailable-=D)},H.readBits=function(D){var I=Math.min(this.bitsAvailable,D),g=this.word>>>32-I;return D>32&&z.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=I,this.bitsAvailable>0?this.word<<=I:this.bytesAvailable>0&&this.loadWord(),I=D-I,I>0&&this.bitsAvailable?g<>>D)!==0)return this.word<<=D,this.bitsAvailable-=D,D;return this.loadWord(),D+this.skipLZ()},H.skipUEG=function(){this.skipBits(1+this.skipLZ())},H.skipEG=function(){this.skipBits(1+this.skipLZ())},H.readUEG=function(){var D=this.skipLZ();return this.readBits(D+1)-1},H.readEG=function(){var D=this.readUEG();return 1&D?1+D>>>1:-1*(D>>>1)},H.readBoolean=function(){return this.readBits(1)===1},H.readUByte=function(){return this.readBits(8)},H.readUShort=function(){return this.readBits(16)},H.readUInt=function(){return this.readBits(32)},H.skipScalingList=function(D){for(var I=8,g=8,f,u=0;u0?x.subarray(C,C+b):void 0},H=function(x,A){var C=0;return C=(x[A]&127)<<21,C|=(x[A+1]&127)<<14,C|=(x[A+2]&127)<<7,C|=x[A+3]&127,C},F=function(x,A){return z(x,A)&&H(x,A+6)+10<=x.length-A},D=function(x){for(var A=f(x),C=0;C>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:_+=String.fromCharCode(c);break;case 12:case 13:E=x[P++],_+=String.fromCharCode((c&31)<<6|E&63);break;case 14:E=x[P++],y=x[P++],_+=String.fromCharCode((c&15)<<12|(E&63)<<6|(y&63)<<0);break;default:}}return _},n={decodeTextFrame:s},h;function O(){return!h&&typeof self.TextDecoder!="undefined"&&(h=new self.TextDecoder("utf-8")),h}},"./src/demux/mp3demuxer.ts":function(q,V,M){"use strict";M.r(V);var z=M("./src/demux/base-audio-demuxer.ts"),U=M("./src/demux/id3.ts"),L=M("./src/utils/logger.ts"),H=M("./src/demux/mpegaudio.ts");function F(g,f){g.prototype=Object.create(f.prototype),g.prototype.constructor=g,D(g,f)}function D(g,f){return D=Object.setPrototypeOf||function(d,s){return d.__proto__=s,d},D(g,f)}var I=function(g){F(f,g);function f(){return g.apply(this,arguments)||this}var u=f.prototype;return u.resetInitSegment=function(s,l,r){g.prototype.resetInitSegment.call(this,s,l,r),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:s,duration:r,inputTimeScale:9e4,dropped:0}},f.probe=function(s){if(!s)return!1;for(var l=U.getID3Data(s,0)||[],r=l.length,a=s.length;r0},F.demux=function(I){var g=I,f=Object(U.dummyTrack)();if(this.config.progressive){this.remainderData&&(g=Object(z.appendUint8Array)(this.remainderData,I));var u=Object(z.segmentValidRange)(g);this.remainderData=u.remainder,f.samples=u.valid||new Uint8Array}else f.samples=g;return{audioTrack:Object(U.dummyTrack)(),avcTrack:f,id3Track:Object(U.dummyTrack)(),textTrack:Object(U.dummyTrack)()}},F.flush=function(){var I=Object(U.dummyTrack)();return I.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(U.dummyTrack)(),avcTrack:I,id3Track:Object(U.dummyTrack)(),textTrack:Object(U.dummyTrack)()}},F.demuxSampleAes=function(I,g,f){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},F.destroy=function(){},H}();L.minProbeByteLength=1024,V.default=L},"./src/demux/mpegaudio.ts":function(q,V,M){"use strict";M.r(V),M.d(V,"appendFrame",function(){return D}),M.d(V,"parseHeader",function(){return I}),M.d(V,"isHeaderPattern",function(){return g}),M.d(V,"isHeader",function(){return f}),M.d(V,"canParse",function(){return u}),M.d(V,"probe",function(){return d});var z=null,U=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],L=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],H=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],F=[0,1,1,4];function D(s,l,r,a,n){if(r+24>l.length)return;var h=I(l,r);if(h&&r+h.frameLength<=l.length){var O=h.samplesPerFrame*9e4/h.sampleRate,S=a+n*O,x={unit:l.subarray(r,r+h.frameLength),pts:S,dts:S};return s.config=[],s.channelCount=h.channelCount,s.samplerate=h.sampleRate,s.samples.push(x),{sample:x,length:h.frameLength,missing:0}}}function I(s,l){var r=s[l+1]>>3&3,a=s[l+1]>>1&3,n=s[l+2]>>4&15,h=s[l+2]>>2&3;if(r!==1&&n!==0&&n!==15&&h!==3){var O=s[l+2]>>1&1,S=s[l+3]>>6,x=r===3?3-a:a===3?3:4,A=U[x*14+n-1]*1e3,C=r===3?0:r===2?1:2,b=L[C*3+h],v=S===3?1:2,p=H[r][a],c=F[a],E=p*8*c,y=Math.floor(p*A/b+O)*c;if(z===null){var _=navigator.userAgent||"",P=_.match(/Chrome\/(\d+)/i);z=P?parseInt(P[1]):0}var N=!!z&&z<=87;return N&&a===2&&A>=224e3&&S===0&&(s[l+3]=s[l+3]|128),{sampleRate:b,channelCount:v,frameLength:y,samplesPerFrame:E}}}function g(s,l){return s[l]===255&&(s[l+1]&224)===224&&(s[l+1]&6)!==0}function f(s,l){return l+1=I.length){f();return}if(I[g].unit.length<32)continue;var u=this.decrypter.isSync();if(this.decryptAacSample(I,g,f,u),!u)return}},F.getAvcEncryptedData=function(I){for(var g=Math.floor((I.length-48)/160)*16+16,f=new Int8Array(g),u=0,d=32;d<=I.length-16;d+=160,u+=16)f.set(I.subarray(d,d+16),u);return f},F.getAvcDecryptedUnit=function(I,g){for(var f=new Uint8Array(g),u=0,d=32;d<=I.length-16;d+=160,u+=16)I.set(f.subarray(u,u+16),d);return I},F.decryptAvcSample=function(I,g,f,u,d,s){var l=Object(U.discardEPB)(d.data),r=this.getAvcEncryptedData(l),a=this;this.decryptBuffer(r.buffer,function(n){d.data=a.getAvcDecryptedUnit(l,n),s||a.decryptAvcSamples(I,g,f+1,u)})},F.decryptAvcSamples=function(I,g,f,u){if(I instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;g++,f=0){if(g>=I.length){u();return}for(var d=I[g].units;!(f>=d.length);f++){var s=d[f];if(s.data.length<=48||s.type!==1&&s.type!==5)continue;var l=this.decrypter.isSync();if(this.decryptAvcSample(I,g,f,u,s,l),!l)return}}},H}();V.default=L},"./src/demux/transmuxer-interface.ts":function(q,V,M){"use strict";M.r(V),M.d(V,"default",function(){return d});var z=M("./node_modules/webworkify-webpack/index.js"),U=M.n(z),L=M("./src/events.ts"),H=M("./src/demux/transmuxer.ts"),F=M("./src/utils/logger.ts"),D=M("./src/errors.ts"),I=M("./src/utils/mediasource-helper.ts"),g=M("./node_modules/eventemitter3/index.js"),f=M.n(g),u=Object(I.getMediaSource)()||{isTypeSupported:function(){return!1}},d=function(){function s(r,a,n,h){var O=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=r,this.id=a,this.onTransmuxComplete=n,this.onFlush=h;var S=r.config,x=function(p,c){c=c||{},c.frag=O.frag,c.id=O.id,r.trigger(p,c)};this.observer=new g.EventEmitter,this.observer.on(L.Events.FRAG_DECRYPTED,x),this.observer.on(L.Events.ERROR,x);var A={mp4:u.isTypeSupported("video/mp4"),mpeg:u.isTypeSupported("audio/mpeg"),mp3:u.isTypeSupported('audio/mp4; codecs="mp3"')},C=navigator.vendor;if(S.enableWorker&&typeof Worker!="undefined"){F.logger.log("demuxing in webworker");var b;try{b=this.worker=z("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),b.addEventListener("message",this.onwmsg),b.onerror=function(v){r.trigger(L.Events.ERROR,{type:D.ErrorTypes.OTHER_ERROR,details:D.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(v.message+" ("+v.filename+":"+v.lineno+")")})},b.postMessage({cmd:"init",typeSupported:A,vendor:C,id:a,config:JSON.stringify(S)})}catch(v){F.logger.warn("Error in worker:",v),F.logger.error("Error while initializing DemuxerWorker, fallback to inline"),b&&self.URL.revokeObjectURL(b.objectURL),this.transmuxer=new H.default(this.observer,A,S,C,a),this.worker=null}}else this.transmuxer=new H.default(this.observer,A,S,C,a)}var l=s.prototype;return l.destroy=function(){var a=this.worker;if(a)a.removeEventListener("message",this.onwmsg),a.terminate(),this.worker=null;else{var n=this.transmuxer;n&&(n.destroy(),this.transmuxer=null)}var h=this.observer;h&&h.removeAllListeners(),this.observer=null},l.push=function(a,n,h,O,S,x,A,C,b,v){var p=this;b.transmuxing.start=self.performance.now();var c=this.transmuxer,E=this.worker,y=x?x.start:S.start,_=S.decryptdata,P=this.frag,N=!(P&&S.cc===P.cc),K=!(P&&b.level===P.level),$=P?b.sn-P.sn:-1,B=this.part?b.part-this.part.index:1,R=!K&&($===1||$===0&&B===1),G=self.performance.now();(K||$||S.stats.parsing.start===0)&&(S.stats.parsing.start=G),x&&(B||!R)&&(x.stats.parsing.start=G);var Q=new H.TransmuxState(N,R,C,K,y);if(!R||N){F.logger.log("[transmuxer-interface, "+S.type+"]: Starting new transmux session for sn: "+b.sn+" p: "+b.part+" level: "+b.level+" id: "+b.id+` discontinuity: `+N+` trackSwitch: `+K+` contiguous: `+R+` accurateTimeOffset: `+C+` timeOffset: `+y);var ne=new H.TransmuxConfig(h,O,n,A,v);this.configureTransmuxer(ne)}if(this.frag=S,this.part=x,E)E.postMessage({cmd:"demux",data:a,decryptdata:_,chunkMeta:b,state:Q},a instanceof ArrayBuffer?[a]:[]);else if(c){var le=c.push(a,_,b,Q);Object(H.isPromise)(le)?le.then(function(_e){p.handleTransmuxComplete(_e)}):this.handleTransmuxComplete(le)}},l.flush=function(a){var n=this;a.transmuxing.start=self.performance.now();var h=this.transmuxer,O=this.worker;if(O)O.postMessage({cmd:"flush",chunkMeta:a});else if(h){var S=h.flush(a);Object(H.isPromise)(S)?S.then(function(x){n.handleFlushResult(x,a)}):this.handleFlushResult(S,a)}},l.handleFlushResult=function(a,n){var h=this;a.forEach(function(O){h.handleTransmuxComplete(O)}),this.onFlush(n)},l.onWorkerMessage=function(a){var n=a.data,h=this.hls;switch(n.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(n.data);break}case"flush":{this.onFlush(n.data);break}default:{n.data=n.data||{},n.data.frag=this.frag,n.data.id=this.id,h.trigger(n.event,n.data);break}}},l.configureTransmuxer=function(a){var n=this.worker,h=this.transmuxer;n?n.postMessage({cmd:"configure",config:a}):h&&h.configure(a)},l.handleTransmuxComplete=function(a){a.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(a)},s}()},"./src/demux/transmuxer-worker.ts":function(q,V,M){"use strict";M.r(V),M.d(V,"default",function(){return D});var z=M("./src/demux/transmuxer.ts"),U=M("./src/events.ts"),L=M("./src/utils/logger.ts"),H=M("./node_modules/eventemitter3/index.js"),F=M.n(H);function D(d){var s=new H.EventEmitter,l=function(a,n){d.postMessage({event:a,data:n})};s.on(U.Events.FRAG_DECRYPTED,l),s.on(U.Events.ERROR,l),d.addEventListener("message",function(r){var a=r.data;switch(a.cmd){case"init":{var n=JSON.parse(a.config);d.transmuxer=new z.default(s,a.typeSupported,n,a.vendor,a.id),Object(L.enableLogs)(n.debug),l("init",null);break}case"configure":{d.transmuxer.configure(a.config);break}case"demux":{var h=d.transmuxer.push(a.data,a.decryptdata,a.chunkMeta,a.state);Object(z.isPromise)(h)?h.then(function(x){I(d,x)}):I(d,h);break}case"flush":{var O=a.chunkMeta,S=d.transmuxer.flush(O);Object(z.isPromise)(S)?S.then(function(x){f(d,x,O)}):f(d,S,O);break}default:break}})}function I(d,s){if(u(s.remuxResult))return;var l=[],r=s.remuxResult,a=r.audio,n=r.video;a&&g(l,a),n&&g(l,n),d.postMessage({event:"transmuxComplete",data:s},l)}function g(d,s){s.data1&&d.push(s.data1.buffer),s.data2&&d.push(s.data2.buffer)}function f(d,s,l){s.forEach(function(r){I(d,r)}),d.postMessage({event:"flush",data:l})}function u(d){return!d.audio&&!d.video&&!d.text&&!d.id3&&!d.initSegment}},"./src/demux/transmuxer.ts":function(q,V,M){"use strict";M.r(V),M.d(V,"default",function(){return n}),M.d(V,"isPromise",function(){return S}),M.d(V,"TransmuxConfig",function(){return x}),M.d(V,"TransmuxState",function(){return A});var z=M("./src/events.ts"),U=M("./src/errors.ts"),L=M("./src/crypt/decrypter.ts"),H=M("./src/demux/aacdemuxer.ts"),F=M("./src/demux/mp4demuxer.ts"),D=M("./src/demux/tsdemuxer.ts"),I=M("./src/demux/mp3demuxer.ts"),g=M("./src/remux/mp4-remuxer.ts"),f=M("./src/remux/passthrough-remuxer.ts"),u=M("./src/demux/chunk-cache.ts"),d=M("./src/utils/mp4-tools.ts"),s=M("./src/utils/logger.ts"),l;try{l=self.performance.now.bind(self.performance)}catch(C){s.logger.debug("Unable to use Performance API on this environment"),l=self.Date.now}var r=[{demux:D.default,remux:g.default},{demux:F.default,remux:f.default},{demux:H.default,remux:g.default},{demux:I.default,remux:g.default}],a=1024;r.forEach(function(C){var b=C.demux;a=Math.max(a,b.minProbeByteLength)});var n=function(){function C(v,p,c,E,y){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new u.default,this.observer=v,this.typeSupported=p,this.config=c,this.vendor=E,this.id=y}var b=C.prototype;return b.configure=function(p){this.transmuxConfig=p,this.decrypter&&this.decrypter.reset()},b.push=function(p,c,E,y){var _=this,P=E.transmuxing;P.executeStart=l();var N=new Uint8Array(p),K=this.cache,$=this.config,B=this.currentTransmuxState,R=this.transmuxConfig;y&&(this.currentTransmuxState=y);var G=h(N,c);if(G&&G.method==="AES-128"){var Q=this.getDecrypter();if($.enableSoftwareAES){var ne=Q.softwareDecrypt(N,G.key.buffer,G.iv.buffer);if(!ne)return P.executeEnd=l(),O(E);N=new Uint8Array(ne)}else return this.decryptionPromise=Q.webCryptoDecrypt(N,G.key.buffer,G.iv.buffer).then(function($e){var Qe=_.push($e,null,E);return _.decryptionPromise=null,Qe}),this.decryptionPromise}var le=y||B,_e=le.contiguous,pe=le.discontinuity,Ee=le.trackSwitch,Oe=le.accurateTimeOffset,we=le.timeOffset,he=R.audioCodec,oe=R.videoCodec,Le=R.defaultInitPts,Ye=R.duration,nt=R.initSegmentData;if((pe||Ee)&&this.resetInitSegment(nt,he,oe,Ye),pe&&this.resetInitialTimestamp(Le),_e||this.resetContiguity(),this.needsProbing(N,pe,Ee)){if(K.dataLength){var qe=K.flush();N=Object(d.appendUint8Array)(qe,N)}this.configureTransmuxer(N,R)}var it=this.transmux(N,G,we,Oe,E),He=this.currentTransmuxState;return He.contiguous=!0,He.discontinuity=!1,He.trackSwitch=!1,P.executeEnd=l(),it},b.flush=function(p){var c=this,E=p.transmuxing;E.executeStart=l();var y=this.decrypter,_=this.cache,P=this.currentTransmuxState,N=this.decryptionPromise;if(N)return N.then(function(){return c.flush(p)});var K=[],$=P.timeOffset;if(y){var B=y.flush();B&&K.push(this.push(B,null,p))}var R=_.dataLength;_.reset();var G=this.demuxer,Q=this.remuxer;if(!G||!Q)return R>=a&&this.observer.emit(z.Events.ERROR,z.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),E.executeEnd=l(),[O(p)];var ne=G.flush($);return S(ne)?ne.then(function(le){return c.flushRemux(K,le,p),K}):(this.flushRemux(K,ne,p),K)},b.flushRemux=function(p,c,E){var y=c.audioTrack,_=c.avcTrack,P=c.id3Track,N=c.textTrack,K=this.currentTransmuxState,$=K.accurateTimeOffset,B=K.timeOffset;s.logger.log("[transmuxer.ts]: Flushed fragment "+E.sn+(E.part>-1?" p: "+E.part:"")+" of level "+E.level);var R=this.remuxer.remux(y,_,P,N,B,$,!0,this.id);p.push({remuxResult:R,chunkMeta:E}),E.transmuxing.executeEnd=l()},b.resetInitialTimestamp=function(p){var c=this.demuxer,E=this.remuxer;if(!c||!E)return;c.resetTimeStamp(p),E.resetTimeStamp(p)},b.resetContiguity=function(){var p=this.demuxer,c=this.remuxer;if(!p||!c)return;p.resetContiguity(),c.resetNextTimestamp()},b.resetInitSegment=function(p,c,E,y){var _=this.demuxer,P=this.remuxer;if(!_||!P)return;_.resetInitSegment(c,E,y),P.resetInitSegment(p,c,E)},b.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},b.transmux=function(p,c,E,y,_){var P;return c&&c.method==="SAMPLE-AES"?P=this.transmuxSampleAes(p,c,E,y,_):P=this.transmuxUnencrypted(p,E,y,_),P},b.transmuxUnencrypted=function(p,c,E,y){var _=this.demuxer.demux(p,c,!1,!this.config.progressive),P=_.audioTrack,N=_.avcTrack,K=_.id3Track,$=_.textTrack,B=this.remuxer.remux(P,N,K,$,c,E,!1,this.id);return{remuxResult:B,chunkMeta:y}},b.transmuxSampleAes=function(p,c,E,y,_){var P=this;return this.demuxer.demuxSampleAes(p,c,E).then(function(N){var K=P.remuxer.remux(N.audioTrack,N.avcTrack,N.id3Track,N.textTrack,E,y,!1,P.id);return{remuxResult:K,chunkMeta:_}})},b.configureTransmuxer=function(p,c){for(var E=this.config,y=this.observer,_=this.typeSupported,P=this.vendor,N=c.audioCodec,K=c.defaultInitPts,$=c.duration,B=c.initSegmentData,R=c.videoCodec,G,Q=0,ne=r.length;Q0&&b!=null&&b.key!=null&&b.iv!==null&&b.method!=null&&(v=b),v}var O=function(b){return{remuxResult:{},chunkMeta:b}};function S(C){return"then"in C&&C.then instanceof Function}var x=function(b,v,p,c,E){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=b,this.videoCodec=v,this.initSegmentData=p,this.duration=c,this.defaultInitPts=E},A=function(b,v,p,c,E){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=b,this.contiguous=v,this.accurateTimeOffset=p,this.trackSwitch=c,this.timeOffset=E}},"./src/demux/tsdemuxer.ts":function(q,V,M){"use strict";M.r(V),M.d(V,"discardEPB",function(){return O});var z=M("./src/demux/adts.ts"),U=M("./src/demux/mpegaudio.ts"),L=M("./src/demux/exp-golomb.ts"),H=M("./src/demux/id3.ts"),F=M("./src/demux/sample-aes.ts"),D=M("./src/events.ts"),I=M("./src/utils/mp4-tools.ts"),g=M("./src/utils/logger.ts"),f=M("./src/errors.ts"),u={video:1,audio:2,id3:3,text:4},d=function(){function S(A,C,b){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=A,this.config=C,this.typeSupported=b}S.probe=function(C){var b=S.syncOffset(C);return b<0?!1:(b&&g.logger.warn("MPEG2-TS detected but first sync word found @ offset "+b+", junk ahead ?"),!0)},S.syncOffset=function(C){for(var b=Math.min(1e3,C.length-3*188),v=0;v>4,he=void 0;if(we>1){if(he=pe+5+C[pe+4],he===pe+188)continue}else he=pe+4;switch(Oe){case P:Ee&&(N&&(c=a(N))&&this.parseAVCPES(c,!1),N={data:[],size:0}),N&&(N.data.push(C.subarray(he,pe+188)),N.size+=pe+188-he);break;case K:Ee&&(B&&(c=a(B))&&(y.isAAC?this.parseAACPES(c):this.parseMPEGPES(c)),B={data:[],size:0}),B&&(B.data.push(C.subarray(he,pe+188)),B.size+=pe+188-he);break;case $:Ee&&(R&&(c=a(R))&&this.parseID3PES(c),R={data:[],size:0}),R&&(R.data.push(C.subarray(he,pe+188)),R.size+=pe+188-he);break;case 0:Ee&&(he+=C[he]+1),ne=this._pmtId=l(C,he);break;case ne:{Ee&&(he+=C[he]+1);var oe=r(C,he,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,v);P=oe.avc,P>0&&(E.pid=P),K=oe.audio,K>0&&(y.pid=K,y.isAAC=oe.isAAC),$=oe.id3,$>0&&(_.pid=$),G&&!Q&&(g.logger.log("reparse from beginning"),G=!1,pe=_e-188),Q=this.pmtParsed=!0;break}case 17:case 8191:break;default:G=!0;break}}else this.observer.emit(D.Events.ERROR,D.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});E.pesData=N,y.pesData=B,_.pesData=R;var Le={audioTrack:y,avcTrack:E,id3Track:_,textTrack:this._txtTrack};return p&&this.extractRemainingSamples(Le),Le},x.flush=function(){var C=this.remainderData;this.remainderData=null;var b;return C?b=this.demux(C,-1,!1,!0):b={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(b),this.sampleAes?this.decrypt(b,this.sampleAes):b},x.extractRemainingSamples=function(C){var b=C.audioTrack,v=C.avcTrack,p=C.id3Track,c=v.pesData,E=b.pesData,y=p.pesData,_;c&&(_=a(c))?(this.parseAVCPES(_,!0),v.pesData=null):v.pesData=c,E&&(_=a(E))?(b.isAAC?this.parseAACPES(_):this.parseMPEGPES(_),b.pesData=null):(E!=null&&E.size&&g.logger.log("last AAC PES packet truncated,might overlap between fragments"),b.pesData=E),y&&(_=a(y))?(this.parseID3PES(_),p.pesData=null):p.pesData=y},x.demuxSampleAes=function(C,b,v){var p=this.demux(C,v,!0,!this.config.progressive),c=this.sampleAes=new F.default(this.observer,this.config,b);return this.decrypt(p,c)},x.decrypt=function(C,b){return new Promise(function(v){var p=C.audioTrack,c=C.avcTrack;p.samples&&p.isAAC?b.decryptAacSamples(p.samples,0,function(){c.samples?b.decryptAvcSamples(c.samples,0,0,function(){v(C)}):v(C)}):c.samples&&b.decryptAvcSamples(c.samples,0,0,function(){v(C)})})},x.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},x.parseAVCPES=function(C,b){var v=this,p=this._avcTrack,c=this.parseAVCNALu(C.data),E=!1,y=this.avcSample,_,P=!1;C.data=null,y&&c.length&&!p.audFound&&(n(y,p),y=this.avcSample=s(!1,C.pts,C.dts,"")),c.forEach(function(N){switch(N.type){case 1:{_=!0,y||(y=v.avcSample=s(!0,C.pts,C.dts,"")),E&&(y.debug+="NDR "),y.frame=!0;var K=N.data;if(P&&K.length>4){var $=new L.default(K).readSliceType();($===2||$===4||$===7||$===9)&&(y.key=!0)}break}case 5:_=!0,y||(y=v.avcSample=s(!0,C.pts,C.dts,"")),E&&(y.debug+="IDR "),y.key=!0,y.frame=!0;break;case 6:{_=!0,E&&y&&(y.debug+="SEI ");var B=new L.default(O(N.data));B.readUByte();for(var R=0,G=0,Q=!1,ne=0;!Q&&B.bytesAvailable>1;){R=0;do ne=B.readUByte(),R+=ne;while(ne===255);G=0;do ne=B.readUByte(),G+=ne;while(ne===255);if(R===4&&B.bytesAvailable!==0){Q=!0;var le=B.readUByte();if(le===181){var _e=B.readUShort();if(_e===49){var pe=B.readUInt();if(pe===1195456820){var Ee=B.readUByte();if(Ee===3){for(var Oe=B.readUByte(),we=B.readUByte(),he=31&Oe,oe=[Oe,we],Le=0;Le16){for(var Ye=[],nt=0;nt<16;nt++)Ye.push(B.readUByte().toString(16)),(nt===3||nt===5||nt===7||nt===9)&&Ye.push("-");for(var qe=G-16,it=new Uint8Array(qe),He=0;He=0){var B={data:C.subarray(K,y-p-1),type:$};E.push(B)}else{var R=this.getLastNalUnit();if(R&&(c&&y<=4-c&&(R.state&&(R.data=R.data.subarray(0,R.data.byteLength-c))),P=y-p-1,P>0)){var G=new Uint8Array(R.data.byteLength+P);G.set(R.data,0),G.set(C.subarray(0,P),R.data.byteLength),R.data=G,R.state=0}}y=0&&p>=0){var Q={data:C.subarray(K,b),type:$,state:p};E.push(Q)}if(E.length===0){var ne=this.getLastNalUnit();if(ne){var le=new Uint8Array(ne.data.byteLength+C.byteLength);le.set(ne.data,0),le.set(C,ne.data.byteLength),ne.data=le}}return v.naluState=p,E},x.parseAACPES=function(C){var b=0,v=this._audioTrack,p=this.aacOverFlow,c=C.data;if(p){this.aacOverFlow=null;var E=p.sample.unit.byteLength,y=Math.min(p.missing,E),_=E-y;p.sample.unit.set(c.subarray(0,y),_),v.samples.push(p.sample),b=p.missing}var P,N;for(P=b,N=c.length;P1;){var E=new Uint8Array(c[0].length+c[1].length);E.set(c[0]),E.set(c[1],c[0].length),c[0]=E,c.splice(1,1)}A=c[0];var y=(A[0]<<16)+(A[1]<<8)+A[2];if(y===1){if(C=(A[4]<<8)+A[5],C&&C>S.size-6)return null;var _=A[7];_&192&&(v=(A[9]&14)*536870912+(A[10]&255)*4194304+(A[11]&254)*16384+(A[12]&255)*128+(A[13]&254)/2,_&64?(p=(A[14]&14)*536870912+(A[15]&255)*4194304+(A[16]&254)*16384+(A[17]&255)*128+(A[18]&254)/2,v-p>60*9e4&&(g.logger.warn(Math.round((v-p)/9e4)+"s delta between PTS and DTS, align them"),v=p)):p=v),b=A[8];var P=b+9;if(S.size<=P)return null;S.size-=P;for(var N=new Uint8Array(S.size),K=0,$=c.length;K<$;K++){A=c[K];var B=A.byteLength;if(P)if(P>B){P-=B;continue}else A=A.subarray(P),B-=P,P=0;N.set(A,x),x+=B}return C&&(C-=b+3),{data:N,pts:v,dts:p,len:C}}return null}function n(S,x){if(S.units.length&&S.frame){if(S.pts===void 0){var A=x.samples,C=A.length;if(C){var b=A[C-1];S.pts=b.pts,S.dts=b.dts}else{x.dropped++;return}}x.samples.push(S)}S.debug.length&&g.logger.log(S.pts+"/"+S.dts+":"+S.debug)}function h(S,x){var A=S.length;if(A>0){if(x.pts>=S[A-1].pts)S.push(x);else for(var C=A-1;C>=0;C--)if(x.ptsv)return c;return 0}},{key:"maxAutoLevel",get:function(){var b=this.levels,v=this.autoLevelCapping,p;return v===-1&&b&&b.length?p=b.length-1:p=v,p}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(b){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,b)}},{key:"audioTracks",get:function(){var b=this.audioTrackController;return b?b.audioTracks:[]}},{key:"audioTrack",get:function(){var b=this.audioTrackController;return b?b.audioTrack:-1},set:function(b){var v=this.audioTrackController;v&&(v.audioTrack=b)}},{key:"subtitleTracks",get:function(){var b=this.subtitleTrackController;return b?b.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var b=this.subtitleTrackController;return b?b.subtitleTrack:-1},set:function(b){var v=this.subtitleTrackController;v&&(v.subtitleTrack=b)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var b=this.subtitleTrackController;return b?b.subtitleDisplay:!1},set:function(b){var v=this.subtitleTrackController;v&&(v.subtitleDisplay=b)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(b){this.config.lowLatencyMode=b}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return a.Events}},{key:"ErrorTypes",get:function(){return n.ErrorTypes}},{key:"ErrorDetails",get:function(){return n.ErrorDetails}},{key:"DefaultConfig",get:function(){return x.defaultConfig?x.defaultConfig:s.hlsDefaultConfig},set:function(b){x.defaultConfig=b}}]),x}();S.defaultConfig=void 0},"./src/is-supported.ts":function(q,V,M){"use strict";M.r(V),M.d(V,"isSupported",function(){return L}),M.d(V,"changeTypeSupported",function(){return H});var z=M("./src/utils/mediasource-helper.ts");function U(){return self.SourceBuffer||self.WebKitSourceBuffer}function L(){var F=Object(z.getMediaSource)();if(!F)return!1;var D=U(),I=F&&typeof F.isTypeSupported=="function"&&F.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),g=!D||D.prototype&&typeof D.prototype.appendBuffer=="function"&&typeof D.prototype.remove=="function";return!!I&&!!g}function H(){var F,D=U();return typeof(D==null||((F=D.prototype)===null||F===void 0)?void 0:F.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(q,V,M){"use strict";M.r(V),M.d(V,"default",function(){return d}),M.d(V,"LoadError",function(){return l});var z=M("./src/polyfills/number.ts"),U=M("./src/errors.ts");function L(r,a){r.prototype=Object.create(a.prototype),r.prototype.constructor=r,g(r,a)}function H(r){var a=typeof Map=="function"?new Map:void 0;return H=function(h){if(h===null||!I(h))return h;if(typeof h!="function")throw new TypeError("Super expression must either be null or a function");if(typeof a!="undefined"){if(a.has(h))return a.get(h);a.set(h,O)}function O(){return F(h,arguments,f(this).constructor)}return O.prototype=Object.create(h.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),g(O,h)},H(r)}function F(r,a,n){return D()?F=Reflect.construct:F=function(O,S,x){var A=[null];A.push.apply(A,S);var C=Function.bind.apply(O,A),b=new C;return x&&g(b,x.prototype),b},F.apply(null,arguments)}function D(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(r){return!1}}function I(r){return Function.toString.call(r).indexOf("[native code]")!==-1}function g(r,a){return g=Object.setPrototypeOf||function(h,O){return h.__proto__=O,h},g(r,a)}function f(r){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},f(r)}var u=Math.pow(2,17),d=function(){function r(n){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=n}var a=r.prototype;return a.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},a.abort=function(){this.loader&&this.loader.abort()},a.load=function(h,O){var S=this,x=h.url;if(!x)return Promise.reject(new l({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:h,networkDetails:null},"Fragment does not have a "+(x?"part list":"url")));this.abort();var A=this.config,C=A.fLoader,b=A.loader;return new Promise(function(v,p){S.loader&&S.loader.destroy();var c=S.loader=h.loader=C?new C(A):new b(A),E=s(h),y={timeout:A.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:A.fragLoadingMaxRetryTimeout,highWaterMark:u};h.stats=c.stats,c.load(E,y,{onSuccess:function(P,N,K,$){S.resetLoader(h,c),v({frag:h,part:null,payload:P.data,networkDetails:$})},onError:function(P,N,K){S.resetLoader(h,c),p(new l({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:h,response:P,networkDetails:K}))},onAbort:function(P,N,K){S.resetLoader(h,c),p(new l({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:h,networkDetails:K}))},onTimeout:function(P,N,K){S.resetLoader(h,c),p(new l({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:h,networkDetails:K}))},onProgress:function(P,N,K,$){O&&O({frag:h,part:null,payload:K,networkDetails:$})}})})},a.loadPart=function(h,O,S){var x=this;this.abort();var A=this.config,C=A.fLoader,b=A.loader;return new Promise(function(v,p){x.loader&&x.loader.destroy();var c=x.loader=h.loader=C?new C(A):new b(A),E=s(h,O),y={timeout:A.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:A.fragLoadingMaxRetryTimeout,highWaterMark:u};O.stats=c.stats,c.load(E,y,{onSuccess:function(P,N,K,$){x.resetLoader(h,c),x.updateStatsFromPart(h,O);var B={frag:h,part:O,payload:P.data,networkDetails:$};S(B),v(B)},onError:function(P,N,K){x.resetLoader(h,c),p(new l({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:h,part:O,response:P,networkDetails:K}))},onAbort:function(P,N,K){h.stats.aborted=O.stats.aborted,x.resetLoader(h,c),p(new l({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:h,part:O,networkDetails:K}))},onTimeout:function(P,N,K){x.resetLoader(h,c),p(new l({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:h,part:O,networkDetails:K}))}})})},a.updateStatsFromPart=function(h,O){var S=h.stats,x=O.stats,A=x.total;if(S.loaded+=x.loaded,A){var C=Math.round(h.duration/O.duration),b=Math.min(Math.round(S.loaded/A),C),v=C-b,p=v*Math.round(S.loaded/b);S.total=S.loaded+p}else S.total=Math.max(S.loaded,S.total);var c=S.loading,E=x.loading;c.start?c.first+=E.first-E.start:(c.start=E.start,c.first=E.first),c.end=E.end},a.resetLoader=function(h,O){h.loader=null,this.loader===O&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),O.destroy()},r}();function s(r,a){a===void 0&&(a=null);var n=a||r,h={frag:r,part:a,responseType:"arraybuffer",url:n.url,headers:{},rangeStart:0,rangeEnd:0},O=n.byteRangeStartOffset,S=n.byteRangeEndOffset;return Object(z.isFiniteNumber)(O)&&Object(z.isFiniteNumber)(S)&&(h.rangeStart=O,h.rangeEnd=S),h}var l=function(r){L(a,r);function a(n){for(var h,O=arguments.length,S=new Array(O>1?O-1:0),x=1;x>8*(15-A)&255;return x},h.setDecryptDataFromLevelKey=function(S,x){var A=S;return(S==null?void 0:S.method)==="AES-128"&&S.uri&&!S.iv&&(A=F.LevelKey.fromURI(S.uri),A.method=S.method,A.iv=this.createInitializationVector(x),A.keyFormat="identity"),A},h.setElementaryStreamInfo=function(S,x,A,C,b,v){v===void 0&&(v=!1);var p=this.elementaryStreams,c=p[S];if(!c){p[S]={startPTS:x,endPTS:A,startDTS:C,endDTS:b,partial:v};return}c.startPTS=Math.min(c.startPTS,x),c.endPTS=Math.max(c.endPTS,A),c.startDTS=Math.min(c.startDTS,C),c.endDTS=Math.max(c.endDTS,b)},h.clearElementaryStreamInfo=function(){var S=this.elementaryStreams;S[d.AUDIO]=null,S[d.VIDEO]=null,S[d.AUDIOVIDEO]=null},u(n,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var S=this.sn;typeof S!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&H.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),S=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,S)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(z.isFiniteNumber)(this.programDateTime))return null;var S=Object(z.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+S*1e3}},{key:"encrypted",get:function(){var S;return!!((S=this.decryptdata)!==null&&S!==void 0&&S.keyFormat&&this.decryptdata.uri)}}]),n}(s),r=function(a){I(n,a);function n(h,O,S,x,A){var C;C=a.call(this,S)||this,C.fragOffset=0,C.duration=0,C.gap=!1,C.independent=!1,C.relurl=void 0,C.fragment=void 0,C.index=void 0,C.stats=new D.LoadStats,C.duration=h.decimalFloatingPoint("DURATION"),C.gap=h.bool("GAP"),C.independent=h.bool("INDEPENDENT"),C.relurl=h.enumeratedString("URI"),C.fragment=O,C.index=x;var b=h.enumeratedString("BYTERANGE");return b&&C.setByteRange(b,A),A&&(C.fragOffset=A.fragOffset+A.duration),C}return u(n,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var O=this.elementaryStreams;return!!(O.audio||O.video||O.audiovideo)}}]),n}(s)},"./src/loader/key-loader.ts":function(q,V,M){"use strict";M.r(V),M.d(V,"default",function(){return H});var z=M("./src/events.ts"),U=M("./src/errors.ts"),L=M("./src/utils/logger.ts"),H=function(){function F(I){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=I,this._registerListeners()}var D=F.prototype;return D._registerListeners=function(){this.hls.on(z.Events.KEY_LOADING,this.onKeyLoading,this)},D._unregisterListeners=function(){this.hls.off(z.Events.KEY_LOADING,this.onKeyLoading)},D.destroy=function(){this._unregisterListeners();for(var g in this.loaders){var f=this.loaders[g];f&&f.destroy()}this.loaders={}},D.onKeyLoading=function(g,f){var u=f.frag,d=u.type,s=this.loaders[d];if(!u.decryptdata){L.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var l=u.decryptdata.uri;if(l!==this.decrypturl||this.decryptkey===null){var r=this.hls.config;if(s&&(L.logger.warn("abort previous key loader for type:"+d),s.abort()),!l){L.logger.warn("key uri is falsy");return}var a=r.loader,n=u.loader=this.loaders[d]=new a(r);this.decrypturl=l,this.decryptkey=null;var h={url:l,frag:u,responseType:"arraybuffer"},O={timeout:r.fragLoadingTimeOut,maxRetry:0,retryDelay:r.fragLoadingRetryDelay,maxRetryDelay:r.fragLoadingMaxRetryTimeout,highWaterMark:0},S={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};n.load(h,O,S)}else this.decryptkey&&(u.decryptdata.key=this.decryptkey,this.hls.trigger(z.Events.KEY_LOADED,{frag:u}))},D.loadsuccess=function(g,f,u){var d=u.frag;if(!d.decryptdata){L.logger.error("after key load, decryptdata unset");return}this.decryptkey=d.decryptdata.key=new Uint8Array(g.data),d.loader=null,delete this.loaders[d.type],this.hls.trigger(z.Events.KEY_LOADED,{frag:d})},D.loaderror=function(g,f){var u=f.frag,d=u.loader;d&&d.abort(),delete this.loaders[u.type],this.hls.trigger(z.Events.ERROR,{type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:u,response:g})},D.loadtimeout=function(g,f){var u=f.frag,d=u.loader;d&&d.abort(),delete this.loaders[u.type],this.hls.trigger(z.Events.ERROR,{type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:u})},F}()},"./src/loader/level-details.ts":function(q,V,M){"use strict";M.r(V),M.d(V,"LevelDetails",function(){return F});var z=M("./src/polyfills/number.ts");function U(D,I){for(var g=0;gf.endSN||u>0||u===0&&d>0,this.updated||this.advanced?this.misses=Math.floor(f.misses*.6):this.misses=f.misses+1,this.availabilityDelay=f.availabilityDelay},L(D,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(z.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||H}},{key:"drift",get:function(){var f=this.driftEndTime-this.driftStartTime;if(f>0){var u=this.driftEnd-this.driftStart;return u*1e3/f}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var f;return(f=this.fragments)!==null&&f!==void 0&&f.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),D}()},"./src/loader/level-key.ts":function(q,V,M){"use strict";M.r(V),M.d(V,"LevelKey",function(){return F});var z=M("./node_modules/url-toolkit/src/url-toolkit.js"),U=M.n(z);function L(D,I){for(var g=0;g2){var p=v.shift()+".";return p+=parseInt(v.shift()).toString(16),p+=("000"+parseInt(v.shift()).toString(16)).substr(-4),p}return b},A.resolve=function(b,v){return U.buildAbsoluteURL(v,b,{alwaysNormalize:!0})},A.parseMasterPlaylist=function(b,v){var p=[],c={},E=!1;u.lastIndex=0;for(var y;(y=u.exec(b))!=null;)if(y[1]){var _=new I.AttrList(y[1]),P={attrs:_,bitrate:_.decimalInteger("AVERAGE-BANDWIDTH")||_.decimalInteger("BANDWIDTH"),name:_.NAME,url:A.resolve(y[2],v)},N=_.decimalResolution("RESOLUTION");N&&(P.width=N.width,P.height=N.height),h((_.CODECS||"").split(/[ ,]+/).filter(function($){return $}),P),P.videoCodec&&P.videoCodec.indexOf("avc1")!==-1&&(P.videoCodec=A.convertAVC1ToAVCOTI(P.videoCodec)),p.push(P)}else if(y[3]){var K=new I.AttrList(y[3]);K["DATA-ID"]&&(E=!0,c[K["DATA-ID"]]=K)}return{levels:p,sessionData:E?c:null}},A.parseMasterPlaylistMedia=function(b,v,p,c){c===void 0&&(c=[]);var E,y=[],_=0;for(d.lastIndex=0;(E=d.exec(b))!==null;){var P=new I.AttrList(E[1]);if(P.TYPE===p){var N={attrs:P,bitrate:0,id:_++,groupId:P["GROUP-ID"],instreamId:P["INSTREAM-ID"],name:P.NAME||P.LANGUAGE||"",type:p,default:P.bool("DEFAULT"),autoselect:P.bool("AUTOSELECT"),forced:P.bool("FORCED"),lang:P.LANGUAGE,url:P.URI?A.resolve(P.URI,v):""};if(c.length){var K=A.findGroup(c,N.groupId)||c[0];O(N,K,"audioCodec"),O(N,K,"textCodec")}y.push(N)}}return y},A.parseLevelPlaylist=function(b,v,p,c,E){var y=new F.LevelDetails(v),_=y.fragments,P=null,N=0,K=0,$=0,B=0,R=null,G=new H.Fragment(c,v),Q,ne,le,_e=-1,pe=!1;for(s.lastIndex=0,y.m3u8=b;(Q=s.exec(b))!==null;){pe&&(pe=!1,G=new H.Fragment(c,v),G.start=$,G.sn=N,G.cc=B,G.level=p,P&&(G.initSegment=P,G.rawProgramDateTime=P.rawProgramDateTime));var Ee=Q[1];if(Ee){G.duration=parseFloat(Ee);var Oe=(" "+Q[2]).slice(1);G.title=Oe||null,G.tagList.push(Oe?["INF",Ee,Oe]:["INF",Ee])}else if(Q[3])Object(z.isFiniteNumber)(G.duration)&&(G.start=$,le&&(G.levelkey=le),G.sn=N,G.level=p,G.cc=B,G.urlId=E,_.push(G),G.relurl=(" "+Q[3]).slice(1),x(G,R),R=G,$+=G.duration,N++,K=0,pe=!0);else if(Q[4]){var we=(" "+Q[4]).slice(1);R?G.setByteRange(we,R):G.setByteRange(we)}else if(Q[5])G.rawProgramDateTime=(" "+Q[5]).slice(1),G.tagList.push(["PROGRAM-DATE-TIME",G.rawProgramDateTime]),_e===-1&&(_e=_.length);else{if(Q=Q[0].match(l),!Q){g.logger.warn("No matches on slow regex match for level playlist!");continue}for(ne=1;ne-1){g.logger.warn("Keyformat "+vt+" is not supported from the manifest");continue}else if(vt!=="identity")continue;Qe&&(le=D.LevelKey.fromURL(v,gt),gt&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Qe)>=0&&(le.method=Qe,le.keyFormat=vt,Je&&(le.keyID=Je),tt&&(le.keyFormatVersions=tt),le.iv=et));break}case"START":{var Et=new I.AttrList(oe),xt=Et.decimalFloatingPoint("TIME-OFFSET");Object(z.isFiniteNumber)(xt)&&(y.startTimeOffset=xt);break}case"MAP":{var kt=new I.AttrList(oe);G.relurl=kt.URI,kt.BYTERANGE&&G.setByteRange(kt.BYTERANGE),G.level=p,G.sn="initSegment",le&&(G.levelkey=le),G.initSegment=null,P=G,pe=!0;break}case"SERVER-CONTROL":{var Ot=new I.AttrList(oe);y.canBlockReload=Ot.bool("CAN-BLOCK-RELOAD"),y.canSkipUntil=Ot.optionalFloat("CAN-SKIP-UNTIL",0),y.canSkipDateRanges=y.canSkipUntil>0&&Ot.bool("CAN-SKIP-DATERANGES"),y.partHoldBack=Ot.optionalFloat("PART-HOLD-BACK",0),y.holdBack=Ot.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ae=new I.AttrList(oe);y.partTarget=Ae.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ce=y.partList;Ce||(Ce=y.partList=[]);var Ge=K>0?Ce[Ce.length-1]:void 0,ze=K++,Re=new H.Part(new I.AttrList(oe),G,v,ze,Ge);Ce.push(Re),G.duration+=Re.duration;break}case"PRELOAD-HINT":{var je=new I.AttrList(oe);y.preloadHint=je;break}case"RENDITION-REPORT":{var ge=new I.AttrList(oe);y.renditionReports=y.renditionReports||[],y.renditionReports.push(ge);break}default:g.logger.warn("line parsed but not handled: "+Q);break}}}R&&!R.relurl?(_.pop(),$-=R.duration,y.partList&&(y.fragmentHint=R)):y.partList&&(x(G,R),G.cc=B,y.fragmentHint=G);var de=_.length,ce=_[0],re=_[de-1];if($+=y.skippedSegments*y.targetduration,$>0&&de&&re){y.averagetargetduration=$/de;var ae=re.sn;y.endSN=ae!=="initSegment"?ae:0,ce&&(y.startCC=ce.cc,ce.initSegment||y.fragments.every(function(ue){return ue.relurl&&a(ue.relurl)})&&(g.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),G=new H.Fragment(c,v),G.relurl=re.relurl,G.level=p,G.sn="initSegment",ce.initSegment=G,y.needSidxRanges=!0))}else y.endSN=0,y.startCC=0;return y.fragmentHint&&($+=y.fragmentHint.duration),y.totalduration=$,y.endCC=B,_e>0&&S(_,_e),y},A}();function h(A,C){["video","audio","text"].forEach(function(b){var v=A.filter(function(c){return Object(f.isCodecType)(c,b)});if(v.length){var p=v.filter(function(c){return c.lastIndexOf("avc1",0)===0||c.lastIndexOf("mp4a",0)===0});C[b+"Codec"]=p.length>0?p[0]:v[0],A=A.filter(function(c){return v.indexOf(c)===-1})}}),C.unknownCodecs=A}function O(A,C,b){var v=C[b];v&&(A[b]=v)}function S(A,C){for(var b=A[C],v=C;v--;){var p=A[v];if(!p)return;p.programDateTime=b.programDateTime-p.duration*1e3,b=p}}function x(A,C){A.rawProgramDateTime?A.programDateTime=Date.parse(A.rawProgramDateTime):C!=null&&C.programDateTime&&(A.programDateTime=C.endProgramDateTime),Object(z.isFiniteNumber)(A.programDateTime)||(A.programDateTime=null,A.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(q,V,M){"use strict";M.r(V);var z=M("./src/polyfills/number.ts"),U=M("./src/events.ts"),L=M("./src/errors.ts"),H=M("./src/utils/logger.ts"),F=M("./src/utils/mp4-tools.ts"),D=M("./src/loader/m3u8-parser.ts"),I=M("./src/types/loader.ts"),g=M("./src/utils/attr-list.ts");function f(s){var l=s.type;switch(l){case I.PlaylistContextType.AUDIO_TRACK:return I.PlaylistLevelType.AUDIO;case I.PlaylistContextType.SUBTITLE_TRACK:return I.PlaylistLevelType.SUBTITLE;default:return I.PlaylistLevelType.MAIN}}function u(s,l){var r=s.url;return(r===void 0||r.indexOf("data:")===0)&&(r=l.url),r}var d=function(){function s(r){this.hls=void 0,this.loaders=Object.create(null),this.hls=r,this.registerListeners()}var l=s.prototype;return l.registerListeners=function(){var a=this.hls;a.on(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(U.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(U.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),a.on(U.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},l.unregisterListeners=function(){var a=this.hls;a.off(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(U.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(U.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),a.off(U.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},l.createInternalLoader=function(a){var n=this.hls.config,h=n.pLoader,O=n.loader,S=h||O,x=new S(n);return a.loader=x,this.loaders[a.type]=x,x},l.getInternalLoader=function(a){return this.loaders[a.type]},l.resetInternalLoader=function(a){this.loaders[a]&&delete this.loaders[a]},l.destroyInternalLoaders=function(){for(var a in this.loaders){var n=this.loaders[a];n&&n.destroy(),this.resetInternalLoader(a)}},l.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},l.onManifestLoading=function(a,n){var h=n.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:I.PlaylistContextType.MANIFEST,url:h,deliveryDirectives:null})},l.onLevelLoading=function(a,n){var h=n.id,O=n.level,S=n.url,x=n.deliveryDirectives;this.load({id:h,groupId:null,level:O,responseType:"text",type:I.PlaylistContextType.LEVEL,url:S,deliveryDirectives:x})},l.onAudioTrackLoading=function(a,n){var h=n.id,O=n.groupId,S=n.url,x=n.deliveryDirectives;this.load({id:h,groupId:O,level:null,responseType:"text",type:I.PlaylistContextType.AUDIO_TRACK,url:S,deliveryDirectives:x})},l.onSubtitleTrackLoading=function(a,n){var h=n.id,O=n.groupId,S=n.url,x=n.deliveryDirectives;this.load({id:h,groupId:O,level:null,responseType:"text",type:I.PlaylistContextType.SUBTITLE_TRACK,url:S,deliveryDirectives:x})},l.load=function(a){var n,h=this.hls.config,O=this.getInternalLoader(a);if(O){var S=O.context;if(S&&S.url===a.url){H.logger.trace("[playlist-loader]: playlist request ongoing");return}H.logger.log("[playlist-loader]: aborting previous loader for type: "+a.type),O.abort()}var x,A,C,b;switch(a.type){case I.PlaylistContextType.MANIFEST:x=h.manifestLoadingMaxRetry,A=h.manifestLoadingTimeOut,C=h.manifestLoadingRetryDelay,b=h.manifestLoadingMaxRetryTimeout;break;case I.PlaylistContextType.LEVEL:case I.PlaylistContextType.AUDIO_TRACK:case I.PlaylistContextType.SUBTITLE_TRACK:x=0,A=h.levelLoadingTimeOut;break;default:x=h.levelLoadingMaxRetry,A=h.levelLoadingTimeOut,C=h.levelLoadingRetryDelay,b=h.levelLoadingMaxRetryTimeout;break}if(O=this.createInternalLoader(a),(n=a.deliveryDirectives)!==null&&n!==void 0&&n.part){var v;if(a.type===I.PlaylistContextType.LEVEL&&a.level!==null?v=this.hls.levels[a.level].details:a.type===I.PlaylistContextType.AUDIO_TRACK&&a.id!==null?v=this.hls.audioTracks[a.id].details:a.type===I.PlaylistContextType.SUBTITLE_TRACK&&a.id!==null&&(v=this.hls.subtitleTracks[a.id].details),v){var p=v.partTarget,c=v.targetduration;p&&c&&(A=Math.min(Math.max(p*3,c*.8)*1e3,A))}}var E={timeout:A,maxRetry:x,retryDelay:C,maxRetryDelay:b,highWaterMark:0},y={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};O.load(a,E,y)},l.loadsuccess=function(a,n,h,O){if(O===void 0&&(O=null),h.isSidxRequest){this.handleSidxRequest(a,h),this.handlePlaylistLoaded(a,n,h,O);return}this.resetInternalLoader(h.type);var S=a.data;if(S.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(a,h,"no EXTM3U delimiter",O);return}n.parsing.start=performance.now(),S.indexOf("#EXTINF:")>0||S.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(a,n,h,O):this.handleMasterPlaylist(a,n,h,O)},l.loaderror=function(a,n,h){h===void 0&&(h=null),this.handleNetworkError(n,h,!1,a)},l.loadtimeout=function(a,n,h){h===void 0&&(h=null),this.handleNetworkError(n,h,!0)},l.handleMasterPlaylist=function(a,n,h,O){var S=this.hls,x=a.data,A=u(a,h),C=D.default.parseMasterPlaylist(x,A),b=C.levels,v=C.sessionData;if(!b.length){this.handleManifestParsingError(a,h,"no level found in manifest",O);return}var p=b.map(function(N){return{id:N.attrs.AUDIO,audioCodec:N.audioCodec}}),c=b.map(function(N){return{id:N.attrs.SUBTITLES,textCodec:N.textCodec}}),E=D.default.parseMasterPlaylistMedia(x,A,"AUDIO",p),y=D.default.parseMasterPlaylistMedia(x,A,"SUBTITLES",c),_=D.default.parseMasterPlaylistMedia(x,A,"CLOSED-CAPTIONS");if(E.length){var P=E.some(function(N){return!N.url});!P&&b[0].audioCodec&&!b[0].attrs.AUDIO&&(H.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),E.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new g.AttrList({}),bitrate:0,url:""}))}S.trigger(U.Events.MANIFEST_LOADED,{levels:b,audioTracks:E,subtitles:y,captions:_,url:A,stats:n,networkDetails:O,sessionData:v})},l.handleTrackOrLevelPlaylist=function(a,n,h,O){var S=this.hls,x=h.id,A=h.level,C=h.type,b=u(a,h),v=Object(z.isFiniteNumber)(x)?x:0,p=Object(z.isFiniteNumber)(A)?A:v,c=f(h),E=D.default.parseLevelPlaylist(a.data,b,p,c,v);if(!E.fragments.length){S.trigger(U.Events.ERROR,{type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:b,reason:"no fragments found in level",level:typeof h.level=="number"?h.level:void 0});return}if(C===I.PlaylistContextType.MANIFEST){var y={attrs:new g.AttrList({}),bitrate:0,details:E,name:"",url:b};S.trigger(U.Events.MANIFEST_LOADED,{levels:[y],audioTracks:[],url:b,stats:n,networkDetails:O,sessionData:null})}if(n.parsing.end=performance.now(),E.needSidxRanges){var _,P=(_=E.fragments[0].initSegment)===null||_===void 0?void 0:_.url;this.load({url:P,isSidxRequest:!0,type:C,level:A,levelDetails:E,id:x,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}h.levelDetails=E,this.handlePlaylistLoaded(a,n,h,O)},l.handleSidxRequest=function(a,n){var h=Object(F.parseSegmentIndex)(new Uint8Array(a.data));if(!h)return;var O=h.references,S=n.levelDetails;O.forEach(function(x,A){var C=x.info,b=S.fragments[A];b.byteRange.length===0&&b.setByteRange(String(1+C.end-C.start)+"@"+String(C.start)),b.initSegment&&b.initSegment.setByteRange(String(h.moovEndOffset)+"@0")})},l.handleManifestParsingError=function(a,n,h,O){this.hls.trigger(U.Events.ERROR,{type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:n.type===I.PlaylistContextType.MANIFEST,url:a.url,reason:h,response:a,context:n,networkDetails:O})},l.handleNetworkError=function(a,n,h,O){h===void 0&&(h=!1),H.logger.warn("[playlist-loader]: A network "+(h?"timeout":"error")+" occurred while loading "+a.type+" level: "+a.level+" id: "+a.id+' group-id: "'+a.groupId+'"');var S=L.ErrorDetails.UNKNOWN,x=!1,A=this.getInternalLoader(a);switch(a.type){case I.PlaylistContextType.MANIFEST:S=h?L.ErrorDetails.MANIFEST_LOAD_TIMEOUT:L.ErrorDetails.MANIFEST_LOAD_ERROR,x=!0;break;case I.PlaylistContextType.LEVEL:S=h?L.ErrorDetails.LEVEL_LOAD_TIMEOUT:L.ErrorDetails.LEVEL_LOAD_ERROR,x=!1;break;case I.PlaylistContextType.AUDIO_TRACK:S=h?L.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:L.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,x=!1;break;case I.PlaylistContextType.SUBTITLE_TRACK:S=h?L.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:L.ErrorDetails.SUBTITLE_LOAD_ERROR,x=!1;break}A&&this.resetInternalLoader(a.type);var C={type:L.ErrorTypes.NETWORK_ERROR,details:S,fatal:x,url:a.url,loader:A,context:a,networkDetails:n};O&&(C.response=O),this.hls.trigger(U.Events.ERROR,C)},l.handlePlaylistLoaded=function(a,n,h,O){var S=h.type,x=h.level,A=h.id,C=h.groupId,b=h.loader,v=h.levelDetails,p=h.deliveryDirectives;if(!(v!=null&&v.targetduration)){this.handleManifestParsingError(a,h,"invalid target duration",O);return}if(!b)return;v.live&&(b.getCacheAge&&(v.ageHeader=b.getCacheAge()||0),(!b.getCacheAge||isNaN(v.ageHeader))&&(v.ageHeader=0));switch(S){case I.PlaylistContextType.MANIFEST:case I.PlaylistContextType.LEVEL:this.hls.trigger(U.Events.LEVEL_LOADED,{details:v,level:x||0,id:A||0,stats:n,networkDetails:O,deliveryDirectives:p});break;case I.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(U.Events.AUDIO_TRACK_LOADED,{details:v,id:A||0,groupId:C||"",stats:n,networkDetails:O,deliveryDirectives:p});break;case I.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(U.Events.SUBTITLE_TRACK_LOADED,{details:v,id:A||0,groupId:C||"",stats:n,networkDetails:O,deliveryDirectives:p});break}},s}();V.default=d},"./src/polyfills/number.ts":function(q,V,M){"use strict";M.r(V),M.d(V,"isFiniteNumber",function(){return z}),M.d(V,"MAX_SAFE_INTEGER",function(){return U});var z=Number.isFinite||function(L){return typeof L=="number"&&isFinite(L)},U=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(q,V,M){"use strict";M.r(V);var z=function(){function U(){}return U.getSilentFrame=function(H,F){switch(H){case"mp4a.40.2":if(F===1)return new Uint8Array([0,200,0,128,35,128]);if(F===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(F===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(F===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(F===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(F===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(F===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(F===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(F===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},U}();V.default=z},"./src/remux/mp4-generator.ts":function(q,V,M){"use strict";M.r(V);var z=Math.pow(2,32)-1,U=function(){function L(){}return L.init=function(){L.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var F;for(F in L.types)L.types.hasOwnProperty(F)&&(L.types[F]=[F.charCodeAt(0),F.charCodeAt(1),F.charCodeAt(2),F.charCodeAt(3)]);var D=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),I=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);L.HDLR_TYPES={video:D,audio:I};var g=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),f=new Uint8Array([0,0,0,0,0,0,0,0]);L.STTS=L.STSC=L.STCO=f,L.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),L.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),L.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),L.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var u=new Uint8Array([105,115,111,109]),d=new Uint8Array([97,118,99,49]),s=new Uint8Array([0,0,0,1]);L.FTYP=L.box(L.types.ftyp,u,s,u,d),L.DINF=L.box(L.types.dinf,L.box(L.types.dref,g))},L.box=function(F){for(var D=8,I=arguments.length,g=new Array(I>1?I-1:0),f=1;f>24&255,s[1]=D>>16&255,s[2]=D>>8&255,s[3]=D&255,s.set(F,4),u=0,D=8;u>24&255,F>>16&255,F>>8&255,F&255,I>>24,I>>16&255,I>>8&255,I&255,g>>24,g>>16&255,g>>8&255,g&255,85,196,0,0]))},L.mdia=function(F){return L.box(L.types.mdia,L.mdhd(F.timescale,F.duration),L.hdlr(F.type),L.minf(F))},L.mfhd=function(F){return L.box(L.types.mfhd,new Uint8Array([0,0,0,0,F>>24,F>>16&255,F>>8&255,F&255]))},L.minf=function(F){return F.type==="audio"?L.box(L.types.minf,L.box(L.types.smhd,L.SMHD),L.DINF,L.stbl(F)):L.box(L.types.minf,L.box(L.types.vmhd,L.VMHD),L.DINF,L.stbl(F))},L.moof=function(F,D,I){return L.box(L.types.moof,L.mfhd(F),L.traf(I,D))},L.moov=function(F){for(var D=F.length,I=[];D--;)I[D]=L.trak(F[D]);return L.box.apply(null,[L.types.moov,L.mvhd(F[0].timescale,F[0].duration)].concat(I).concat(L.mvex(F)))},L.mvex=function(F){for(var D=F.length,I=[];D--;)I[D]=L.trex(F[D]);return L.box.apply(null,[L.types.mvex].concat(I))},L.mvhd=function(F,D){D*=F;var I=Math.floor(D/(z+1)),g=Math.floor(D%(z+1)),f=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,F>>24&255,F>>16&255,F>>8&255,F&255,I>>24,I>>16&255,I>>8&255,I&255,g>>24,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]);return L.box(L.types.mvhd,f)},L.sdtp=function(F){var D=F.samples||[],I=new Uint8Array(4+D.length),g,f;for(g=0;g>>8&255),D.push(u&255),D=D.concat(Array.prototype.slice.call(f));for(g=0;g>>8&255),I.push(u&255),I=I.concat(Array.prototype.slice.call(f));var d=L.box(L.types.avcC,new Uint8Array([1,D[3],D[4],D[5],252|3,224|F.sps.length].concat(D).concat([F.pps.length]).concat(I))),s=F.width,l=F.height,r=F.pixelRatio[0],a=F.pixelRatio[1];return L.box(L.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,s>>8&255,s&255,l>>8&255,l&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),d,L.box(L.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),L.box(L.types.pasp,new Uint8Array([r>>24,r>>16&255,r>>8&255,r&255,a>>24,a>>16&255,a>>8&255,a&255])))},L.esds=function(F){var D=F.config.length;return new Uint8Array([0,0,0,0,3,23+D,0,1,0,4,15+D,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([D]).concat(F.config).concat([6,1,2]))},L.mp4a=function(F){var D=F.samplerate;return L.box(L.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,F.channelCount,0,16,0,0,0,0,D>>8&255,D&255,0,0]),L.box(L.types.esds,L.esds(F)))},L.mp3=function(F){var D=F.samplerate;return L.box(L.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,F.channelCount,0,16,0,0,0,0,D>>8&255,D&255,0,0]))},L.stsd=function(F){return F.type==="audio"?!F.isAAC&&F.codec==="mp3"?L.box(L.types.stsd,L.STSD,L.mp3(F)):L.box(L.types.stsd,L.STSD,L.mp4a(F)):L.box(L.types.stsd,L.STSD,L.avc1(F))},L.tkhd=function(F){var D=F.id,I=F.duration*F.timescale,g=F.width,f=F.height,u=Math.floor(I/(z+1)),d=Math.floor(I%(z+1));return L.box(L.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,D>>24&255,D>>16&255,D>>8&255,D&255,0,0,0,0,u>>24,u>>16&255,u>>8&255,u&255,d>>24,d>>16&255,d>>8&255,d&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,g>>8&255,g&255,0,0,f>>8&255,f&255,0,0]))},L.traf=function(F,D){var I=L.sdtp(F),g=F.id,f=Math.floor(D/(z+1)),u=Math.floor(D%(z+1));return L.box(L.types.traf,L.box(L.types.tfhd,new Uint8Array([0,0,0,0,g>>24,g>>16&255,g>>8&255,g&255])),L.box(L.types.tfdt,new Uint8Array([1,0,0,0,f>>24,f>>16&255,f>>8&255,f&255,u>>24,u>>16&255,u>>8&255,u&255])),L.trun(F,I.length+16+20+8+16+8+8),I)},L.trak=function(F){return F.duration=F.duration||4294967295,L.box(L.types.trak,L.tkhd(F),L.mdia(F))},L.trex=function(F){var D=F.id;return L.box(L.types.trex,new Uint8Array([0,0,0,0,D>>24,D>>16&255,D>>8&255,D&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},L.trun=function(F,D){var I=F.samples||[],g=I.length,f=12+16*g,u=new Uint8Array(f),d,s,l,r,a,n;for(D+=8+f,u.set([0,0,15,1,g>>>24&255,g>>>16&255,g>>>8&255,g&255,D>>>24&255,D>>>16&255,D>>>8&255,D&255],0),d=0;d>>24&255,l>>>16&255,l>>>8&255,l&255,r>>>24&255,r>>>16&255,r>>>8&255,r&255,a.isLeading<<2|a.dependsOn,a.isDependedOn<<6|a.hasRedundancy<<4|a.paddingValue<<1|a.isNonSync,a.degradPrio&240<<8,a.degradPrio&15,n>>>24&255,n>>>16&255,n>>>8&255,n&255],12+16*d);return L.box(L.types.trun,u)},L.initSegment=function(F){L.types||L.init();var D=L.moov(F),I=new Uint8Array(L.FTYP.byteLength+D.byteLength);return I.set(L.FTYP),I.set(D,L.FTYP.byteLength),I},L}();U.types=void 0,U.HDLR_TYPES=void 0,U.STTS=void 0,U.STSC=void 0,U.STCO=void 0,U.STSZ=void 0,U.VMHD=void 0,U.SMHD=void 0,U.STSD=void 0,U.FTYP=void 0,U.DINF=void 0,V.default=U},"./src/remux/mp4-remuxer.ts":function(q,V,M){"use strict";M.r(V),M.d(V,"default",function(){return n}),M.d(V,"normalizePts",function(){return h});var z=M("./src/polyfills/number.ts"),U=M("./src/remux/aac-helper.ts"),L=M("./src/remux/mp4-generator.ts"),H=M("./src/events.ts"),F=M("./src/errors.ts"),D=M("./src/utils/logger.ts"),I=M("./src/types/loader.ts"),g=M("./src/utils/timescale-conversion.ts");function f(){return f=Object.assign||function(A){for(var C=1;C0?E:y.pts},v[0].pts);return p&&D.logger.debug("PTS rollover detected"),c},C.remux=function(v,p,c,E,y,_,P,N){var K,$,B,R,G,Q,ne=y,le=y,_e=v.pid>-1,pe=p.pid>-1,Ee=p.samples.length,Oe=v.samples.length>0,we=Ee>1,he=(!_e||Oe)&&(!pe||we)||this.ISGenerated||P;if(he){this.ISGenerated||(B=this.generateIS(v,p,y));var oe=this.isVideoContiguous,Le=-1;if(we&&(Le=O(p.samples),!oe&&this.config.forceKeyFrameOnDiscontinuity))if(Q=!0,Le>0){D.logger.warn("[mp4-remuxer]: Dropped "+Le+" out of "+Ee+" video samples due to a missing keyframe");var Ye=this.getVideoStartPts(p.samples);p.samples=p.samples.slice(Le),p.dropped+=Le,le+=(p.samples[0].pts-Ye)/(p.timescale||9e4)}else Le===-1&&(D.logger.warn("[mp4-remuxer]: No keyframe found out of "+Ee+" video samples"),Q=!1);if(this.ISGenerated){if(Oe&&we){var nt=this.getVideoStartPts(p.samples),qe=h(v.samples[0].pts,nt)-nt,it=qe/p.inputTimeScale;ne+=Math.max(0,it),le+=Math.max(0,-it)}if(Oe){if(v.samplerate||(D.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),B=this.generateIS(v,p,y)),$=this.remuxAudio(v,ne,this.isAudioContiguous,_,pe||we||N===I.PlaylistLevelType.AUDIO?le:void 0),we){var He=$?$.endPTS-$.startPTS:0;p.inputTimeScale||(D.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),B=this.generateIS(v,p,y)),K=this.remuxVideo(p,le,oe,He)}}else we&&(K=this.remuxVideo(p,le,oe,0));K&&(K.firstKeyFrame=Le,K.independent=Le!==-1)}}return this.ISGenerated&&(c.samples.length&&(G=this.remuxID3(c,y)),E.samples.length&&(R=this.remuxText(E,y))),{audio:$,video:K,initSegment:B,independent:Q,text:R,id3:G}},C.generateIS=function(v,p,c){var E=v.samples,y=p.samples,_=this.typeSupported,P={},N=!Object(z.isFiniteNumber)(this._initPTS),K="audio/mp4",$,B,R;if(N&&($=B=Infinity),v.config&&E.length&&(v.timescale=v.samplerate,v.isAAC||(_.mpeg?(K="audio/mpeg",v.codec=""):_.mp3&&(v.codec="mp3")),P.audio={id:"audio",container:K,codec:v.codec,initSegment:!v.isAAC&&_.mpeg?new Uint8Array(0):L.default.initSegment([v]),metadata:{channelCount:v.channelCount}},N&&(R=v.inputTimeScale,$=B=E[0].pts-Math.round(R*c))),p.sps&&p.pps&&y.length&&(p.timescale=p.inputTimeScale,P.video={id:"main",container:"video/mp4",codec:p.codec,initSegment:L.default.initSegment([p]),metadata:{width:p.width,height:p.height}},N)){R=p.inputTimeScale;var G=this.getVideoStartPts(y),Q=Math.round(R*c);B=Math.min(B,h(y[0].dts,G)-Q),$=Math.min($,G-Q)}if(Object.keys(P).length)return this.ISGenerated=!0,N&&(this._initPTS=$,this._initDTS=B),{tracks:P,initPTS:$,timescale:R}},C.remuxVideo=function(v,p,c,E){var y=v.inputTimeScale,_=v.samples,P=[],N=_.length,K=this._initPTS,$=this.nextAvcDts,B=8,R,G,Q,ne=Number.POSITIVE_INFINITY,le=Number.NEGATIVE_INFINITY,_e=0,pe=!1;if(!c||$===null){var Ee=p*y,Oe=_[0].pts-h(_[0].dts,_[0].pts);$=Ee-Oe}for(var we=0;wehe.pts){var oe=9e4*.2;_e=Math.max(Math.min(_e,he.pts-he.dts),-1*oe)}he.dts<_[we>0?we-1:we].dts&&(pe=!0)}pe&&_.sort(function(at,Be){var We=at.dts-Be.dts,Me=at.pts-Be.pts;return We||Me}),G=_[0].dts,Q=_[_.length-1].dts;var Le=Math.round((Q-G)/(N-1));if(_e<0){if(_eLe,$e=it<-1;if(He||$e){He?D.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(it,!0)+" ms ("+it+"dts) hole between fragments detected, filling it"):D.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(-it,!0)+" ms ("+it+"dts) overlapping between fragments detected"),G=$;var Qe=_[0].pts-it;_[0].dts=G,_[0].pts=Qe,D.logger.log("Video: First PTS/DTS adjusted: "+Object(g.toMsFromMpegTsClock)(Qe,!0)+"/"+Object(g.toMsFromMpegTsClock)(G,!0)+", delta: "+Object(g.toMsFromMpegTsClock)(it,!0)+" ms")}}a&&(G=Math.max(0,G));for(var gt=0,et=0,tt=0;tt0?Ce-1:Ce].dts;if(ae.stretchShortVideoTrack&&this.nextAudioPts!==null){var fe=Math.floor(ae.maxBufferHole*y),be=(E?ne+E*y:this.nextAudioPts)-Ge.pts;be>fe?(R=be-ue,R<0&&(R=ue),D.logger.log("[mp4-remuxer]: It is approximately "+be/90+" ms to the next segment; using duration "+R/90+" ms for the last video frame.")):R=ue}else R=ue}var Ie=Math.round(Ge.pts-Ge.dts);P.push(new S(Ge.key,R,Re,Ie))}if(P.length&&l&&l<70){var Xe=P[0].flags;Xe.dependsOn=2,Xe.isNonSync=0}console.assert(R!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=$=Q+R,this.isVideoContiguous=!0;var ut=L.default.moof(v.sequenceNumber++,G,f({},v,{samples:P})),bt="video",ft={data1:ut,data2:Ot,startPTS:ne/y,endPTS:(le+R)/y,startDTS:G/y,endDTS:$/y,type:bt,hasAudio:!1,hasVideo:!0,nb:P.length,dropped:v.dropped};return v.samples=[],v.dropped=0,console.assert(Ot.length,"MDAT length must not be zero"),ft},C.remuxAudio=function(v,p,c,E,y){var _=v.inputTimeScale,P=v.samplerate?v.samplerate:_,N=_/P,K=v.isAAC?d:s,$=K*N,B=this._initPTS,R=!v.isAAC&&this.typeSupported.mpeg,G=[],Q=v.samples,ne=R?0:8,le=this.nextAudioPts||-1,_e=p*_;if(this.isAudioContiguous=c=c||Q.length&&le>0&&(E&&Math.abs(_e-le)<9e3||Math.abs(h(Q[0].pts-B,_e)-le)<20*$),Q.forEach(function(ce){ce.pts=h(ce.pts-B,_e)}),!c||le<0){if(Q=Q.filter(function(ce){return ce.pts>=0}),!Q.length)return;y===0?le=0:E?le=Math.max(0,_e):le=Q[0].pts}if(v.isAAC)for(var pe=y!==void 0,Ee=this.config.maxAudioFramesDrift,Oe=0,we=le;Oe=Ee*$&&Ye0){et+=ne;try{gt=new Uint8Array(et)}catch(ce){this.observer.emit(H.Events.ERROR,H.Events.ERROR,{type:F.ErrorTypes.MUX_ERROR,details:F.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:et,reason:"fail allocating audio mdat "+et});return}if(!R){var Ot=new DataView(gt.buffer);Ot.setUint32(0,et),gt.set(L.default.types.mdat,4)}}else return;gt.set(Et,ne);var Ae=Et.byteLength;ne+=Ae,G.push(new S(!0,K,Ae,0)),Qe=xt}var Ce=G.length;if(!Ce)return;var Ge=G[G.length-1];this.nextAudioPts=le=Qe+N*Ge.duration;var ze=R?new Uint8Array(0):L.default.moof(v.sequenceNumber++,$e/N,f({},v,{samples:G}));v.samples=[];var Re=$e/_,je=le/_,ge="audio",de={data1:ze,data2:gt,startPTS:Re,endPTS:je,startDTS:Re,endDTS:je,type:ge,hasAudio:!0,hasVideo:!1,nb:Ce};return this.isAudioContiguous=!0,console.assert(gt.length,"MDAT length must not be zero"),de},C.remuxEmptyAudio=function(v,p,c,E){var y=v.inputTimeScale,_=v.samplerate?v.samplerate:y,P=y/_,N=this.nextAudioPts,K=(N!==null?N:E.startDTS*y)+this._initDTS,$=E.endDTS*y+this._initDTS,B=P*d,R=Math.ceil(($-K)/B),G=U.default.getSilentFrame(v.manifestCodec||v.codec,v.channelCount);if(D.logger.warn("[mp4-remuxer]: remux empty Audio"),!G){D.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var Q=[],ne=0;ne4294967296;)A+=b;return A}function O(A){for(var C=0;C0?this.lastEndDTS=v:(H.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var p=!!A.audio,c=!!A.video,E="";p&&(E+="audio"),c&&(E+="video");var y={data1:S,startPTS:b,startDTS:b,endPTS:v,endDTS:v,type:E,hasAudio:p,hasVideo:c,nb:1,dropped:0};return O.audio=y.type==="audio"?y:void 0,O.video=y.type!=="audio"?y:void 0,O.text=r,O.id3=l,O.initSegment=x,O},g}(),D=function(f,u,d){return Object(U.getStartDTS)(f,u)-d};function I(g,f){var u=g==null?void 0:g.codec;return u&&u.length>4?u:u==="hvc1"?"hvc1.1.c.L120.90":u==="av01"?"av01.0.04M.08":u==="avc1"||f===L.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}V.default=F},"./src/task-loop.ts":function(q,V,M){"use strict";M.r(V),M.d(V,"default",function(){return z});var z=function(){function U(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var L=U.prototype;return L.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},L.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},L.onHandlerDestroyed=function(){},L.hasInterval=function(){return!!this._tickInterval},L.hasNextTick=function(){return!!this._tickTimer},L.setInterval=function(F){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,F),!0)},L.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},L.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},L.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},L.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},L.doTick=function(){},U}()},"./src/types/cmcd.ts":function(q,V,M){"use strict";M.r(V),M.d(V,"CMCDVersion",function(){return z}),M.d(V,"CMCDObjectType",function(){return U}),M.d(V,"CMCDStreamingFormat",function(){return L}),M.d(V,"CMCDStreamType",function(){return H});var z=1,U;(function(F){F.MANIFEST="m",F.AUDIO="a",F.VIDEO="v",F.MUXED="av",F.INIT="i",F.CAPTION="c",F.TIMED_TEXT="tt",F.KEY="k",F.OTHER="o"})(U||(U={}));var L;(function(F){F.DASH="d",F.HLS="h",F.SMOOTH="s",F.OTHER="o"})(L||(L={}));var H;(function(F){F.VOD="v",F.LIVE="l"})(H||(H={}))},"./src/types/level.ts":function(q,V,M){"use strict";M.r(V),M.d(V,"HlsSkip",function(){return L}),M.d(V,"getSkipValue",function(){return H}),M.d(V,"HlsUrlParameters",function(){return F}),M.d(V,"Level",function(){return D});function z(I,g){for(var f=0;fNumber.MAX_SAFE_INTEGER?Infinity:g},F.hexadecimalInteger=function(I){if(this[I]){var g=(this[I]||"0x").slice(2);g=(g.length&1?"0":"")+g;for(var f=new Uint8Array(g.length/2),u=0;uNumber.MAX_SAFE_INTEGER?Infinity:g},F.decimalFloatingPoint=function(I){return parseFloat(this[I])},F.optionalFloat=function(I,g){var f=this[I];return f?parseFloat(f):g},F.enumeratedString=function(I){return this[I]},F.bool=function(I){return this[I]==="YES"},F.decimalResolution=function(I){var g=z.exec(this[I]);return g===null?void 0:{width:parseInt(g[1],10),height:parseInt(g[2],10)}},H.parseAttrList=function(I){var g,f={},u='"';for(U.lastIndex=0;(g=U.exec(I))!==null;){var d=g[2];d.indexOf(u)===0&&d.lastIndexOf(u)===d.length-1&&(d=d.slice(1,-1)),f[g[1]]=d}return f},H}()},"./src/utils/binary-search.ts":function(q,V,M){"use strict";M.r(V);var z={search:function(L,H){for(var F=0,D=L.length-1,I=null,g=null;F<=D;){I=(F+D)/2|0,g=L[I];var f=H(g);if(f>0)F=I+1;else if(f<0)D=I-1;else return g}return null}};V.default=z},"./src/utils/buffer-helper.ts":function(q,V,M){"use strict";M.r(V),M.d(V,"BufferHelper",function(){return L});var z=M("./src/utils/logger.ts"),U={length:0,start:function(){return 0},end:function(){return 0}},L=function(){function H(){}return H.isBuffered=function(D,I){try{if(D){for(var g=H.getBuffered(D),f=0;f=g.start(f)&&I<=g.end(f))return!0}}catch(u){}return!1},H.bufferInfo=function(D,I,g){try{if(D){var f=H.getBuffered(D),u=[],d;for(d=0;ds&&(f[d-1].end=D[u].end):f.push(D[u])}else f.push(D[u])}else f=D;for(var l=0,r,a=I,n=I,h=0;h=O&&I=c&&z.logger.log(this.time+" ["+c+"] "+E)},b}(),l=function(v){for(var p=[],c=0;cF&&(this.logger.log(d.DEBUG,"Too large cursor position "+this.pos),this.pos=F)},v.moveCursor=function(c){var E=this.pos+c;if(c>1)for(var y=this.pos+1;y=144&&this.backSpace();var E=L(c);if(this.pos>=F){this.logger.log(d.ERROR,"Cannot insert "+c.toString(16)+" ("+E+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(E,this.currPenState),this.moveCursor(1)},v.clearFromPos=function(c){var E;for(E=c;E0&&(c?y="["+E.join(" | ")+"]":y=E.join(` `)),y},v.getTextAndFormat=function(){return this.rows},b}(),O=function(){function b(p,c,E){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=p,this.outputFilter=c,this.mode=null,this.verbose=0,this.displayedMemory=new h(E),this.nonDisplayedMemory=new h(E),this.lastOutputScreen=new h(E),this.currRollUpRow=this.displayedMemory.rows[H-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=E}var v=b.prototype;return v.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[H-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},v.getHandler=function(){return this.outputFilter},v.setHandler=function(c){this.outputFilter=c},v.setPAC=function(c){this.writeScreen.setPAC(c)},v.setBkgData=function(c){this.writeScreen.setBkgData(c)},v.setMode=function(c){if(c===this.mode)return;this.mode=c,this.logger.log(d.INFO,"MODE="+c),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=c},v.insertChars=function(c){for(var E=0;E=46,E.italics)E.foreground="white";else{var y=Math.floor(c/2)-16,_=["white","green","blue","cyan","red","yellow","magenta"];E.foreground=_[y]}this.logger.log(d.INFO,"MIDROW: "+JSON.stringify(E)),this.writeScreen.setPen(E)},v.outputDataUpdate=function(c){c===void 0&&(c=!1);var E=this.logger.time;if(E===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=E:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,E,this.lastOutputScreen),c&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:E),this.lastOutputScreen.copy(this.displayedMemory))},v.cueSplitAtTime=function(c){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,c,this.displayedMemory),this.cueStartTime=c))},b}(),S=function(){function b(p,c,E){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var y=new s;this.channels=[null,new O(p,c,y),new O(p+1,E,y)],this.cmdHistory=C(),this.logger=y}var v=b.prototype;return v.getHandler=function(c){return this.channels[c].getHandler()},v.setHandler=function(c,E){this.channels[c].setHandler(E)},v.addData=function(c,E){var y,_,P,N=!1;this.logger.time=c;for(var K=0;K ("+l([_,P])+")"),y=this.parseCmd(_,P),y||(y=this.parseMidrow(_,P)),y||(y=this.parsePAC(_,P)),y||(y=this.parseBackgroundAttributes(_,P)),!y&&(N=this.parseChars(_,P),N)){var $=this.currentChannel;if($&&$>0){var B=this.channels[$];B.insertChars(N)}else this.logger.log(d.WARNING,"No channel found yet. TEXT-MODE?")}!y&&!N&&this.logger.log(d.WARNING,"Couldn't parse cleaned data "+l([_,P])+" orig: "+l([E[K],E[K+1]]))}},v.parseCmd=function(c,E){var y=this.cmdHistory,_=(c===20||c===28||c===21||c===29)&&E>=32&&E<=47,P=(c===23||c===31)&&E>=33&&E<=35;if(!(_||P))return!1;if(A(c,E,y))return x(null,null,y),this.logger.log(d.DEBUG,"Repeated command ("+l([c,E])+") is dropped"),!0;var N=c===20||c===21||c===23?1:2,K=this.channels[N];return c===20||c===21||c===28||c===29?E===32?K.ccRCL():E===33?K.ccBS():E===34?K.ccAOF():E===35?K.ccAON():E===36?K.ccDER():E===37?K.ccRU(2):E===38?K.ccRU(3):E===39?K.ccRU(4):E===40?K.ccFON():E===41?K.ccRDC():E===42?K.ccTR():E===43?K.ccRTD():E===44?K.ccEDM():E===45?K.ccCR():E===46?K.ccENM():E===47&&K.ccEOC():K.ccTO(E-32),x(c,E,y),this.currentChannel=N,!0},v.parseMidrow=function(c,E){var y=0;if((c===17||c===25)&&E>=32&&E<=47){if(c===17?y=1:y=2,y!==this.currentChannel)return this.logger.log(d.ERROR,"Mismatch channel in midrow parsing"),!1;var _=this.channels[y];return _?(_.ccMIDROW(E),this.logger.log(d.DEBUG,"MIDROW ("+l([c,E])+")"),!0):!1}return!1},v.parsePAC=function(c,E){var y,_=this.cmdHistory,P=(c>=17&&c<=23||c>=25&&c<=31)&&E>=64&&E<=127,N=(c===16||c===24)&&E>=64&&E<=95;if(!(P||N))return!1;if(A(c,E,_))return x(null,null,_),!0;var K=c<=23?1:2;E>=64&&E<=95?y=K===1?D[c]:g[c]:y=K===1?I[c]:f[c];var $=this.channels[K];return $?($.setPAC(this.interpretPAC(y,E)),x(c,E,_),this.currentChannel=K,!0):!1},v.interpretPAC=function(c,E){var y,_={color:null,italics:!1,indent:null,underline:!1,row:c};return E>95?y=E-96:y=E-64,_.underline=(y&1)===1,y<=13?_.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(y/2)]:y<=15?(_.italics=!0,_.color="white"):_.indent=Math.floor((y-16)/2)*4,_},v.parseChars=function(c,E){var y,_=null,P=null;if(c>=25?(y=2,P=c-8):(y=1,P=c),P>=17&&P<=19){var N;P===17?N=E+80:P===18?N=E+112:N=E+144,this.logger.log(d.INFO,"Special char '"+L(N)+"' in channel "+y),_=[N]}else c>=32&&c<=127&&(_=E===0?[c]:[c,E]);if(_){var K=l(_);this.logger.log(d.DEBUG,"Char codes = "+K.join(",")),x(c,E,this.cmdHistory)}return _},v.parseBackgroundAttributes=function(c,E){var y=(c===16||c===24)&&E>=32&&E<=47,_=(c===23||c===31)&&E>=45&&E<=47;if(!(y||_))return!1;var P,N={};c===16||c===24?(P=Math.floor((E-32)/2),N.background=u[P],E%2===1&&(N.background=N.background+"_semi")):E===45?N.background="transparent":(N.foreground="black",E===47&&(N.underline=!0));var K=c<=23?1:2,$=this.channels[K];return $.setBkgData(N),x(c,E,this.cmdHistory),!0},v.reset=function(){for(var c=0;c=16?a--:a++;var x=Object(z.fixLineBreaks)(n.trim()),A=Object(U.generateCueId)(g,f,x);(!I||!I.cues||!I.cues.getCueById(A))&&(l=new h(g,f,x),l.id=A,l.line=O+1,l.align="left",l.position=10+Math.min(80,Math.floor(a*8/32)*10),d.push(l))}return I&&d.length&&(d.sort(function(C,b){return C.line==="auto"||b.line==="auto"?0:C.line>8&&b.line>8?b.line-C.line:C.line-b.line}),d.forEach(function(C){return Object(L.addCueToTrack)(I,C)})),d}};V.default=F},"./src/utils/discontinuities.ts":function(q,V,M){"use strict";M.r(V),M.d(V,"findFirstFragWithCC",function(){return H}),M.d(V,"shouldAlignOnDiscontinuities",function(){return F}),M.d(V,"findDiscontinuousReferenceFrag",function(){return D}),M.d(V,"adjustSlidingStart",function(){return g}),M.d(V,"alignStream",function(){return f}),M.d(V,"alignPDT",function(){return d}),M.d(V,"alignFragmentByPDTDelta",function(){return s}),M.d(V,"alignMediaPlaylistByPDT",function(){return l});var z=M("./src/polyfills/number.ts"),U=M("./src/utils/logger.ts"),L=M("./src/controller/level-helper.ts");function H(r,a){for(var n=null,h=0,O=r.length;hn.startCC||r&&r.cc=this.minWeight_},H.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},H.destroy=function(){},L}();V.default=U},"./src/utils/ewma.ts":function(q,V,M){"use strict";M.r(V);var z=function(){function U(H,F,D){F===void 0&&(F=0),D===void 0&&(D=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=H,this.alpha_=H?Math.exp(Math.log(.5)/H):0,this.estimate_=F,this.totalWeight_=D}var L=U.prototype;return L.sample=function(F,D){var I=Math.pow(this.alpha_,F);this.estimate_=D*(1-I)+I*this.estimate_,this.totalWeight_+=F},L.getTotalWeight=function(){return this.totalWeight_},L.getEstimate=function(){if(this.alpha_){var F=1-Math.pow(this.alpha_,this.totalWeight_);if(F)return this.estimate_/F}return this.estimate_},U}();V.default=z},"./src/utils/fetch-loader.ts":function(q,V,M){"use strict";M.r(V),M.d(V,"fetchSupported",function(){return s});var z=M("./src/polyfills/number.ts"),U=M("./src/loader/load-stats.ts"),L=M("./src/demux/chunk-cache.ts");function H(h,O){h.prototype=Object.create(O.prototype),h.prototype.constructor=h,f(h,O)}function F(h){var O=typeof Map=="function"?new Map:void 0;return F=function(x){if(x===null||!g(x))return x;if(typeof x!="function")throw new TypeError("Super expression must either be null or a function");if(typeof O!="undefined"){if(O.has(x))return O.get(x);O.set(x,A)}function A(){return D(x,arguments,u(this).constructor)}return A.prototype=Object.create(x.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),f(A,x)},F(h)}function D(h,O,S){return I()?D=Reflect.construct:D=function(A,C,b){var v=[null];v.push.apply(v,C);var p=Function.bind.apply(A,v),c=new p;return b&&f(c,b.prototype),c},D.apply(null,arguments)}function I(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(h){return!1}}function g(h){return Function.toString.call(h).indexOf("[native code]")!==-1}function f(h,O){return f=Object.setPrototypeOf||function(x,A){return x.__proto__=A,x},f(h,O)}function u(h){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(S){return S.__proto__||Object.getPrototypeOf(S)},u(h)}function d(){return d=Object.assign||function(h){for(var O=1;O=b&&v(A,C,p.flush(),x)):v(A,C,P,x),y()}).catch(function(){return Promise.reject()})};return E()},h}();function r(h,O){var S={method:"GET",mode:"cors",credentials:"same-origin",signal:O,headers:new self.Headers(d({},h.headers))};return h.rangeEnd&&S.headers.set("Range","bytes="+h.rangeStart+"-"+String(h.rangeEnd-1)),S}function a(h,O){return new self.Request(h.url,O)}var n=function(h){H(O,h);function O(S,x,A){var C;return C=h.call(this,S)||this,C.code=void 0,C.details=void 0,C.code=x,C.details=A,C}return O}(F(Error));V.default=l},"./src/utils/imsc1-ttml-parser.ts":function(q,V,M){"use strict";M.r(V),M.d(V,"IMSC1_CODEC",function(){return g}),M.d(V,"parseIMSC1",function(){return s});var z=M("./src/utils/mp4-tools.ts"),U=M("./src/utils/vttparser.ts"),L=M("./src/utils/vttcue.ts"),H=M("./src/demux/id3.ts"),F=M("./src/utils/timescale-conversion.ts"),D=M("./src/utils/webvtt-parser.ts");function I(){return I=Object.assign||function(b){for(var v=1;v"):z}function F(g){for(var f=arguments.length,u=new Array(f>1?f-1:0),d=1;d>24,O[S+1]=x>>16&255,O[S+2]=x>>8&255,O[S+3]=x&255}function f(O,S){var x=[];if(!S.length)return x;var A,C,b;"data"in O?(A=O.data,C=O.start,b=O.end):(A=O,C=0,b=A.byteLength);for(var v=C;v1?v+p:b;if(c===S[0])if(S.length===1)x.push({data:A,start:v+8,end:E});else{var y=f({data:A,start:v+8,end:E},S.slice(1));y.length&&H.apply(x,y)}v=E}return x}function u(O){var S=f(O,["moov"]),x=S[0],A=x?x.end:null,C=f(O,["sidx"]);if(!C||!C[0])return null;var b=[],v=C[0],p=v.data[0],c=p===0?8:16,E=I(v,c);c+=4;var y=0,_=0;p===0?c+=8:c+=16,c+=2;var P=v.end+_,N=D(v,c);c+=2;for(var K=0;K>>31;if(G===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var Q=I(v,$);$+=4,b.push({referenceSize:R,subsegmentDuration:Q,info:{duration:Q/E,start:P,end:P+R-1}}),P+=R,$+=4,c=$}return{earliestPresentationTime:y,timescale:E,version:p,referencesCount:N,references:b,moovEndOffset:A}}function d(O){for(var S=[],x=f(O,["moov","trak"]),A=0;AF)&&(this.startTime=F),this.endTime=D,this.screen=I,this.timelineController.createCaptionsTrack(this.trackName)},L.reset=function(){this.cueRanges=[]},U}()},"./src/utils/texttrack-utils.ts":function(q,V,M){"use strict";M.r(V),M.d(V,"sendAddTrackEvent",function(){return U}),M.d(V,"addCueToTrack",function(){return L}),M.d(V,"clearCurrentCues",function(){return H}),M.d(V,"removeCuesInRange",function(){return F}),M.d(V,"getCuesInRange",function(){return I});var z=M("./src/utils/logger.ts");function U(g,f){var u;try{u=new Event("addtrack")}catch(d){u=document.createEvent("Event"),u.initEvent("addtrack",!1,!1)}u.track=g,f.dispatchEvent(u)}function L(g,f){var u=g.mode;if(u==="disabled"&&(g.mode="hidden"),g.cues&&!g.cues.getCueById(f.id))try{if(g.addCue(f),!g.cues.getCueById(f.id))throw new Error("addCue is failed for: "+f)}catch(s){z.logger.debug("[texttrack-utils]: "+s);var d=new self.TextTrackCue(f.startTime,f.endTime,f.text);d.id=f.id,g.addCue(d)}u==="disabled"&&(g.mode=u)}function H(g){var f=g.mode;if(f==="disabled"&&(g.mode="hidden"),g.cues)for(var u=g.cues.length;u--;)g.removeCue(g.cues[u]);f==="disabled"&&(g.mode=f)}function F(g,f,u){var d=g.mode;if(d==="disabled"&&(g.mode="hidden"),g.cues&&g.cues.length>0)for(var s=I(g.cues,f,u),l=0;lg[u].endTime)return-1;for(var d=0,s=u;d<=s;){var l=Math.floor((s+d)/2);if(fg[l].startTime&&d-1)for(var l=s,r=g.length;l=f&&a.endTime<=u)d.push(a);else if(a.startTime>u)return d}return d}},"./src/utils/time-ranges.ts":function(q,V,M){"use strict";M.r(V);var z={toString:function(L){for(var H="",F=L.length,D=0;D1?f-1:0),d=1;d100)throw new Error("Position must be between 0 and 100.");b=y,this.hasBeenReset=!0}})),Object.defineProperty(d,"positionAlign",D({},s,{get:function(){return v},set:function(y){var _=F(y);if(!_)throw new SyntaxError("An invalid or illegal string was specified.");v=_,this.hasBeenReset=!0}})),Object.defineProperty(d,"size",D({},s,{get:function(){return p},set:function(y){if(y<0||y>100)throw new Error("Size must be between 0 and 100.");p=y,this.hasBeenReset=!0}})),Object.defineProperty(d,"align",D({},s,{get:function(){return c},set:function(y){var _=F(y);if(!_)throw new SyntaxError("An invalid or illegal string was specified.");c=_,this.hasBeenReset=!0}})),d.displayState=void 0}return I.prototype.getCueAsHTML=function(){var g=self.WebVTT;return g.convertCueToDOMTree(self,this.text)},I}()},"./src/utils/vttparser.ts":function(q,V,M){"use strict";M.r(V),M.d(V,"parseTimeStamp",function(){return L}),M.d(V,"fixLineBreaks",function(){return f}),M.d(V,"VTTParser",function(){return u});var z=M("./src/utils/vttcue.ts"),U=function(){function d(){}var s=d.prototype;return s.decode=function(r,a){if(!r)return"";if(typeof r!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(r))},d}();function L(d){function s(r,a,n,h){return(r|0)*3600+(a|0)*60+(n|0)+parseFloat(h||0)}var l=d.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return l?parseFloat(l[2])>59?s(l[2],l[3],0,l[4]):s(l[1],l[2],l[3],l[4]):null}var H=function(){function d(){this.values=Object.create(null)}var s=d.prototype;return s.set=function(r,a){!this.get(r)&&a!==""&&(this.values[r]=a)},s.get=function(r,a,n){return n?this.has(r)?this.values[r]:a[n]:this.has(r)?this.values[r]:a},s.has=function(r){return r in this.values},s.alt=function(r,a,n){for(var h=0;h=0&&n<=100)return this.set(r,n),!0}return!1},d}();function F(d,s,l,r){var a=r?d.split(r):[d];for(var n in a){if(typeof a[n]!="string")continue;var h=a[n].split(l);if(h.length!==2)continue;var O=h[0],S=h[1];s(O,S)}}var D=new z.default(0,0,""),I=D.align==="middle"?"middle":"center";function g(d,s,l){var r=d;function a(){var O=L(d);if(O===null)throw new Error("Malformed timestamp: "+r);return d=d.replace(/^[^\sa-zA-Z-]+/,""),O}function n(O,S){var x=new H;F(O,function(b,v){var p;switch(b){case"region":for(var c=l.length-1;c>=0;c--)if(l[c].id===v){x.set(b,l[c].region);break}break;case"vertical":x.alt(b,v,["rl","lr"]);break;case"line":p=v.split(","),x.integer(b,p[0]),x.percent(b,p[0])&&x.set("snapToLines",!1),x.alt(b,p[0],["auto"]),p.length===2&&x.alt("lineAlign",p[1],["start",I,"end"]);break;case"position":p=v.split(","),x.percent(b,p[0]),p.length===2&&x.alt("positionAlign",p[1],["start",I,"end","line-left","line-right","auto"]);break;case"size":x.percent(b,v);break;case"align":x.alt(b,v,["start",I,"end","left","right"]);break}},/:/,/\s/),S.region=x.get("region",null),S.vertical=x.get("vertical","");var A=x.get("line","auto");A==="auto"&&D.line===-1&&(A=-1),S.line=A,S.lineAlign=x.get("lineAlign","start"),S.snapToLines=x.get("snapToLines",!0),S.size=x.get("size",100),S.align=x.get("align",I);var C=x.get("position","auto");C==="auto"&&D.position===50&&(C=S.align==="start"||S.align==="left"?0:S.align==="end"||S.align==="right"?100:50),S.position=C}function h(){d=d.replace(/^\s+/,"")}if(h(),s.startTime=a(),h(),d.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+r);d=d.substr(3),h(),s.endTime=a(),h(),n(d,s)}function f(d){return d.replace(//gi,` `)}var u=function(){function d(){this.state="INITIAL",this.buffer="",this.decoder=new U,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var s=d.prototype;return s.parse=function(r){var a=this;r&&(a.buffer+=a.decoder.decode(r,{stream:!0}));function n(){var C=a.buffer,b=0;for(C=f(C);b")===-1){a.cue.id=O;continue}case"CUE":if(!a.cue){a.state="BADCUE";continue}try{g(O,a.cue,a.regionList)}catch(C){a.cue=null,a.state="BADCUE";continue}a.state="CUETEXT";continue;case"CUETEXT":{var A=O.indexOf("-->")!==-1;if(!O||A&&(x=!0)){a.oncue&&a.cue&&a.oncue(a.cue),a.cue=null,a.state="ID";continue}if(a.cue===null)continue;a.cue.text&&(a.cue.text+=` `),a.cue.text+=O}continue;case"BADCUE":O||(a.state="ID")}}}catch(C){a.state==="CUETEXT"&&a.cue&&a.oncue&&a.oncue(a.cue),a.cue=null,a.state=a.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},s.flush=function(){var r=this;try{if((r.cue||r.state==="HEADER")&&(r.buffer+=` `,r.parse()),r.state==="INITIAL"||r.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(a){r.onparsingerror&&r.onparsingerror(a)}return r.onflush&&r.onflush(),this},d}()},"./src/utils/webvtt-parser.ts":function(q,V,M){"use strict";M.r(V),M.d(V,"generateCueId",function(){return u}),M.d(V,"parseWebVTT",function(){return s});var z=M("./src/polyfills/number.ts"),U=M("./src/utils/vttparser.ts"),L=M("./src/demux/id3.ts"),H=M("./src/utils/timescale-conversion.ts"),F=M("./src/remux/mp4-remuxer.ts"),D=/\r\n|\n\r|\n|\r/g,I=function(r,a,n){return n===void 0&&(n=0),r.substr(n,a.length)===a},g=function(r){var a=parseInt(r.substr(-3)),n=parseInt(r.substr(-6,2)),h=parseInt(r.substr(-9,2)),O=r.length>9?parseInt(r.substr(0,r.indexOf(":"))):0;if(!Object(z.isFiniteNumber)(a)||!Object(z.isFiniteNumber)(n)||!Object(z.isFiniteNumber)(h)||!Object(z.isFiniteNumber)(O))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+r);return a+=1e3*n,a+=60*1e3*h,a+=60*60*1e3*O,a},f=function(r){for(var a=5381,n=r.length;n;)a=a*33^r.charCodeAt(--n);return(a>>>0).toString()};function u(l,r,a){return f(l.toString())+f(r.toString())+f(a)}var d=function(r,a,n){var h=r[a],O=r[h.prevCC];if(!O||!O.new&&h.new){r.ccOffset=r.presentationOffset=h.start,h.new=!1;return}for(;(S=O)!==null&&S!==void 0&&S.new;){var S;r.ccOffset+=h.start-O.start,h.new=!1,h=O,O=r[h.prevCC]}r.presentationOffset=n};function s(l,r,a,n,h,O,S,x){var A=new U.VTTParser,C=Object(L.utf8ArrayToStr)(new Uint8Array(l)).trim().replace(D,` `).split(` `),b=[],v=Object(H.toMpegTsClockFromTimescale)(r,a),p="00:00.000",c=0,E=0,y,_=!0,P=!1;A.oncue=function(N){var K=n[h],$=n.ccOffset,B=(c-v)/9e4;if(K!=null&&K.new&&(E!==void 0?$=n.ccOffset=K.start:d(n,h,B)),B&&($=B-n.presentationOffset),P){var R=N.endTime-N.startTime,G=Object(F.normalizePts)((N.startTime+$-E)*9e4,O*9e4)/9e4;N.startTime=G,N.endTime=G+R}var Q=N.text.trim();N.text=decodeURIComponent(encodeURIComponent(Q)),N.id||(N.id=u(N.startTime,N.endTime,Q)),N.endTime>0&&b.push(N)},A.onparsingerror=function(N){y=N},A.onflush=function(){if(y){x(y);return}S(b)},C.forEach(function(N){if(_)if(I(N,"X-TIMESTAMP-MAP=")){_=!1,P=!0,N.substr(16).split(",").forEach(function(K){I(K,"LOCAL:")?p=K.substr(6):I(K,"MPEGTS:")&&(c=parseInt(K.substr(7)))});try{E=g(p)/1e3}catch(K){P=!1,y=K}return}else N===""&&(_=!1);A.parse(N+` `)}),A.flush()}},"./src/utils/xhr-loader.ts":function(q,V,M){"use strict";M.r(V);var z=M("./src/utils/logger.ts"),U=M("./src/loader/load-stats.ts"),L=/^age:\s*[\d.]+\s*$/m,H=function(){function F(I){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=I?I.xhrSetup:null,this.stats=new U.LoadStats,this.retryDelay=0}var D=F.prototype;return D.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},D.abortInternal=function(){var g=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),g&&(g.onreadystatechange=null,g.onprogress=null,g.readyState!==4&&(this.stats.aborted=!0,g.abort()))},D.abort=function(){var g;this.abortInternal(),(g=this.callbacks)!==null&&g!==void 0&&g.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},D.load=function(g,f,u){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=g,this.config=f,this.callbacks=u,this.retryDelay=f.retryDelay,this.loadInternal()},D.loadInternal=function(){var g=this.config,f=this.context;if(!g)return;var u=this.loader=new self.XMLHttpRequest,d=this.stats;d.loading.first=0,d.loaded=0;var s=this.xhrSetup;try{if(s)try{s(u,f.url)}catch(a){u.open("GET",f.url,!0),s(u,f.url)}u.readyState||u.open("GET",f.url,!0);var l=this.context.headers;if(l)for(var r in l)u.setRequestHeader(r,l[r])}catch(a){this.callbacks.onError({code:u.status,text:a.message},f,u);return}f.rangeEnd&&u.setRequestHeader("Range","bytes="+f.rangeStart+"-"+(f.rangeEnd-1)),u.onreadystatechange=this.readystatechange.bind(this),u.onprogress=this.loadprogress.bind(this),u.responseType=f.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),g.timeout),u.send()},D.readystatechange=function(){var g=this.context,f=this.loader,u=this.stats;if(!g||!f)return;var d=f.readyState,s=this.config;if(u.aborted)return;if(d>=2)if(self.clearTimeout(this.requestTimeout),u.loading.first===0&&(u.loading.first=Math.max(self.performance.now(),u.loading.start)),d===4){f.onreadystatechange=null,f.onprogress=null;var l=f.status;if(l>=200&&l<300){u.loading.end=Math.max(self.performance.now(),u.loading.first);var r,a;if(g.responseType==="arraybuffer"?(r=f.response,a=r.byteLength):(r=f.responseText,a=r.length),u.loaded=u.total=a,!this.callbacks)return;var n=this.callbacks.onProgress;if(n&&n(u,g,r,f),!this.callbacks)return;var h={url:f.responseURL,data:r};this.callbacks.onSuccess(h,u,g,f)}else u.retry>=s.maxRetry||l>=400&&l<499?(z.logger.error(l+" while loading "+g.url),this.callbacks.onError({code:l,text:f.statusText},g,f)):(z.logger.warn(l+" while loading "+g.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,s.maxRetryDelay),u.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.timeout)},D.loadtimeout=function(){z.logger.warn("timeout while loading "+this.context.url);var g=this.callbacks;g&&(this.abortInternal(),g.onTimeout(this.stats,this.context,this.loader))},D.loadprogress=function(g){var f=this.stats;f.loaded=g.loaded,g.lengthComputable&&(f.total=g.total)},D.getCacheAge=function(){var g=null;if(this.loader&&L.test(this.loader.getAllResponseHeaders())){var f=this.loader.getResponseHeader("age");g=f?parseFloat(f):null}return g},F}();V.default=H}}).default})},vHTk:function(Fe,Se,W){Fe.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(Fe,Se,W){"use strict";W.d(Se,"a",function(){return Et});var q=W("rePB"),V=W("VTBJ"),M=W("KQm4"),z=W("U8pU"),U=W("ODXe"),L=W("q1tI"),H=W("TSYQ"),F=W.n(H),D=W("Gytx"),I=W.n(D),g=W("Kwbf"),f=W("t23M"),u=W("qx4F"),d=W("6eGT"),s=W("IBYe"),l=W("Ff2n"),r=W("c+Xe"),a=W("fyJ8"),n=W("biw7");function h(Ae,Ce,Ge,ze,Re){var je=Ge[Ae]||{},ge=Ge[Ce]||{},de,ce;je.fixed==="left"?de=ze.left[Ae]:ge.fixed==="right"&&(ce=ze.right[Ce]);var re=!1,ae=!1,ue=!1,fe=!1,be=Ge[Ce+1],Ie=Ge[Ae-1];if(Re==="rtl"){if(de!==void 0){var Xe=Ie&&Ie.fixed==="left";fe=!Xe}else if(ce!==void 0){var ut=be&&be.fixed==="right";ue=!ut}}else if(de!==void 0){var bt=be&&be.fixed==="left";re=!bt}else if(ce!==void 0){var ft=Ie&&Ie.fixed==="right";ae=!ft}return{fixLeft:de,fixRight:ce,lastFixLeft:re,firstFixRight:ae,lastFixRight:ue,firstFixLeft:fe,isSticky:ze.isSticky}}var O=W("sR1s");function S(Ae){var Ce=Ae.cells,Ge=Ae.stickyOffsets,ze=Ae.flattenColumns,Re=Ae.rowComponent,je=Ae.cellComponent,ge=Ae.onHeaderRow,de=Ae.index,ce=L.useContext(n.a),re=ce.prefixCls,ae=ce.direction,ue;ge&&(ue=ge(Ce.map(function(be){return be.column}),de));var fe=Object(O.a)(Ce.map(function(be){return be.column}));return L.createElement(Re,Object.assign({},ue),Ce.map(function(be,Ie){var Xe=be.column,ut=h(be.colStart,be.colEnd,ze,Ge,ae),bt;return Xe&&Xe.onHeaderCell&&(bt=be.column.onHeaderCell(Xe)),L.createElement(a.a,Object.assign({},be,{ellipsis:Xe.ellipsis,align:Xe.align,component:je,prefixCls:re,key:fe[Ie]},ut,{additionalProps:bt,rowType:"header"}))}))}S.displayName="HeaderRow";var x=S;function A(Ae){var Ce=[];function Ge(ge,de){var ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Ce[ce]=Ce[ce]||[];var re=de,ae=ge.filter(Boolean).map(function(ue){var fe={key:ue.key,className:ue.className||"",children:ue.title,column:ue,colStart:re},be=1,Ie=ue.children;return Ie&&Ie.length>0&&(be=Ge(Ie,re,ce+1).reduce(function(Xe,ut){return Xe+ut},0),fe.hasSubColumns=!0),"colSpan"in ue&&(be=ue.colSpan),"rowSpan"in ue&&(fe.rowSpan=ue.rowSpan),fe.colSpan=be,fe.colEnd=fe.colStart+be-1,Ce[ce].push(fe),re+=be,be});return ae}Ge(Ae,0);for(var ze=Ce.length,Re=function(de){Ce[de].forEach(function(ce){!("rowSpan"in ce)&&!ce.hasSubColumns&&(ce.rowSpan=ze-de)})},je=0;je=0;de-=1){var ce=Ce[de],re=Ge&&Ge[de],ae=re&&re[v.a];(ce||ae||ge)&&(Re.unshift(L.createElement("col",Object.assign({key:de,style:{width:ce,minWidth:ce}},ae))),ge=!0)}return L.createElement("colgroup",null,Re)}var c=p;function E(Ae,Ce){return Object(L.useMemo)(function(){for(var Ge=[],ze=0;ze1?j-1:0),X=1;X=ue&&(At=ue-fe),ge({scrollLeft:At/ue*(ae+2)}),ft.current.x=Te.pageX},Pe=function(){var Te=Object(gt.b)(je.current).top,ke=Te+je.current.offsetHeight,rt=document.documentElement.scrollTop+window.innerHeight;ke-Object(u.a)()<=rt||Te>=rt-de?bt(function(Ct){return Object(V.a)(Object(V.a)({},Ct),{},{isHiddenScrollBar:!0})}):bt(function(Ct){return Object(V.a)(Object(V.a)({},Ct),{},{isHiddenScrollBar:!1})})},st=function(Te){bt(function(ke){return Object(V.a)(Object(V.a)({},ke),{},{scrollLeft:Te/ae*ue||0})})};return L.useImperativeHandle(Ge,function(){return{setScrollLeft:st}}),L.useEffect(function(){var dt=Object(Qe.a)(document.body,"mouseup",se,!1),Te=Object(Qe.a)(document.body,"mousemove",Ke,!1);return Pe(),function(){dt.remove(),Te.remove()}},[fe,We]),L.useEffect(function(){var dt=Object(Qe.a)(window,"scroll",Pe,!1),Te=Object(Qe.a)(window,"resize",Pe,!1);return function(){dt.remove(),Te.remove()}},[]),L.useEffect(function(){ut.isHiddenScrollBar||bt(function(dt){var Te,ke;return Object(V.a)(Object(V.a)({},dt),{},{scrollLeft:je.current.scrollLeft/((Te=je.current)===null||Te===void 0?void 0:Te.scrollWidth)*((ke=je.current)===null||ke===void 0?void 0:ke.clientWidth)})})},[ut.isHiddenScrollBar]),ae<=ue||!fe||ut.isHiddenScrollBar?null:L.createElement("div",{style:{height:Object(u.a)(),width:ue,bottom:de},className:"".concat(re,"-sticky-scroll")},L.createElement("div",{onMouseDown:ve,ref:be,className:F()("".concat(re,"-sticky-scroll-bar"),Object(q.a)({},"".concat(re,"-sticky-scroll-bar-active"),We)),style:{width:"".concat(fe,"px"),transform:"translate3d(".concat(ut.scrollLeft,"px, 0, 0)")}}))},tt=L.forwardRef(et);function Je(Ae,Ce){return L.useMemo(function(){var Ge=!!Ae;return{isSticky:Ge,stickyClassName:Ge?"".concat(Ce,"-sticky-header"):"",offsetHeader:Object(z.a)(Ae)==="object"&&Ae.offsetHeader||0,offsetScroll:Object(z.a)(Ae)==="object"&&Ae.offsetScroll||0}},[Ae,Ce])}var vt=[],wt={},Et="rc-table-internal-hook",xt=L.memo(function(Ae){var Ce=Ae.children;return Ce},function(Ae,Ce){return I()(Ae.props,Ce.props)?Ae.pingLeft!==Ce.pingLeft||Ae.pingRight!==Ce.pingRight:!1});function kt(Ae){var Ce,Ge=Ae.prefixCls,ze=Ae.className,Re=Ae.rowClassName,je=Ae.style,ge=Ae.data,de=Ae.rowKey,ce=Ae.scroll,re=Ae.tableLayout,ae=Ae.direction,ue=Ae.title,fe=Ae.footer,be=Ae.summary,Ie=Ae.id,Xe=Ae.showHeader,ut=Ae.components,bt=Ae.emptyText,ft=Ae.onRow,at=Ae.onHeaderRow,Be=Ae.internalHooks,We=Ae.transformColumns,Me=Ae.internalRefs,se=Ae.sticky,ve=ge||vt,Ke=!!ve.length,Pe=L.useState(0),st=Object(U.a)(Pe,2),dt=st[0],Te=st[1];L.useEffect(function(){Te(Object(u.a)())});var ke=L.useMemo(function(){return Object(O.c)(ut,{})},[ut]),rt=L.useCallback(function(En,hn){return Object(O.b)(ke,En)||hn},[ke]),Ct=L.useMemo(function(){return typeof de=="function"?de:function(En){var hn=En&&En[de];return hn}},[de]),At=Object(v.c)(Ae),cn=At.expandIcon,yn=At.expandedRowKeys,en=At.defaultExpandedRowKeys,Dt=At.defaultExpandAllRows,Rn=At.expandedRowRender,Fn=At.onExpand,Cn=At.onExpandedRowsChange,Qt=At.expandRowByClick,Sn=At.rowExpandable,Bn=At.expandIconColumnIndex,li=At.expandedRowClassName,ct=At.childrenColumnName,St=At.indentSize,zn=cn||He,pi=ct||"children",ui=L.useMemo(function(){return Rn?"row":Ae.expandable&&Be===Et&&Ae.expandable.__PARENT_RENDER_ICON__||ve.some(function(En){return En&&Object(z.a)(En)==="object"&&En[pi]})?"nest":!1},[!!Rn,ve]),ki=L.useState(function(){return en||(Dt?$e(ve,Ct,pi):[])}),J=Object(U.a)(ki,2),w=J[0],T=J[1],j=L.useMemo(function(){return new Set(yn||w||[])},[yn,w]),ee=L.useCallback(function(En){var hn=Ct(En,ve.indexOf(En)),gn,gi=j.has(hn);gi?(j.delete(hn),gn=Object(M.a)(j)):gn=[].concat(Object(M.a)(j),[hn]),T(gn),Fn&&Fn(!gi,En),Cn&&Cn(gn)},[Ct,j,ve,Fn,Cn]),X=L.useState(0),ye=Object(U.a)(X,2),Ve=ye[0],ot=ye[1],ht=Object(Ee.b)(Object(V.a)(Object(V.a)(Object(V.a)({},Ae),At),{},{expandable:!!Rn,expandedKeys:j,getRowKey:Ct,onTriggerExpand:ee,expandIcon:zn,expandIconColumnIndex:Bn,direction:ae}),Be===Et?We:null),Ue=Object(U.a)(ht,2),mt=Ue[0],Rt=Ue[1],Mt=L.useMemo(function(){return{columns:mt,flattenColumns:Rt}},[mt,Rt]),Jt=L.useRef(),Tt=L.useRef(),qt=L.useRef(),Zt=L.useState(!1),Mn=Object(U.a)(Zt,2),Gt=Mn[0],wn=Mn[1],On=L.useState(!1),Ln=Object(U.a)(On,2),xn=Ln[0],In=Ln[1],Hn=he(new Map),ri=Object(U.a)(Hn,2),Vn=ri[0],_n=ri[1],jn=Object(O.a)(Rt),dn=jn.map(function(En){return Vn.get(En)}),pn=L.useMemo(function(){return dn},[dn.join("_")]),mn=Ye(pn,Rt.length,ae),zt=ce&&Object(O.d)(ce.y),yt=ce&&Object(O.d)(ce.x),Wt=yt&&Rt.some(function(En){var hn=En.fixed;return hn}),pt=L.useRef(),$t=Je(se,Ge),Nt=$t.isSticky,Xn=$t.offsetHeader,sn=$t.offsetScroll,Zn=$t.stickyClassName,Ki,Ci,Vi;zt&&(Ci={overflowY:"scroll",maxHeight:ce.y}),yt&&(Ki={overflowX:"auto"},zt||(Ci={overflowY:"hidden"}),Vi={width:ce.x===!0?"auto":ce.x,minWidth:"100%"});var Ni=L.useCallback(function(En,hn){_n(function(gn){var gi=new Map(gn);return gi.set(En,hn),gi})},[]),Ri=oe(null),Gi=Object(U.a)(Ri,2),Kn=Gi[0],Ht=Gi[1];function Xi(En,hn){if(!hn)return;typeof hn=="function"?hn(En):hn.scrollLeft!==En&&(hn.scrollLeft=En)}var _i=function(hn){var gn=hn.currentTarget,gi=hn.scrollLeft,Qi=typeof gi=="number"?gi:gn.scrollLeft,qi=gn||wt;if(!Ht()||Ht()===qi){var ir;Kn(qi),Xi(Qi,Tt.current),Xi(Qi,qt.current),Xi(Qi,(ir=pt.current)===null||ir===void 0?void 0:ir.setScrollLeft)}if(gn){var Tr=gn.scrollWidth,on=gn.clientWidth;wn(Qi>0),In(Qi0?[].concat(Object(V.a)(l),Object(V.a)(g(h).map(function(O){return Object(M.a)({fixed:n},O)}))):[].concat(Object(V.a)(l),[Object(M.a)(Object(M.a)({},r),{},{fixed:n})])},[])}function f(s){for(var l=!0,r=0;r=0;h-=1){var O=s[h];if(n&&O.fixed!=="right")n=!1;else if(!n&&O.fixed==="right"){Object(H.a)(!1,"Index ".concat(h+1," of `columns` missing `fixed='right'` prop."));break}}}function u(s){return s.map(function(l){var r=l.fixed,a=Object(z.a)(l,["fixed"]),n=r;return r==="left"?n="right":r==="right"&&(n="left"),Object(M.a)({fixed:n},a)})}function d(s,l){var r=s.prefixCls,a=s.columns,n=s.children,h=s.expandable,O=s.expandedKeys,S=s.getRowKey,x=s.onTriggerExpand,A=s.expandIcon,C=s.rowExpandable,b=s.expandIconColumnIndex,v=s.direction,p=s.expandRowByClick,c=U.useMemo(function(){return a||I(n)},[a,n]),E=U.useMemo(function(){if(h){var P,N=b||0,K=c[N],$=(P={},Object(q.a)(P,D.a,{className:"".concat(r,"-expand-icon-col")}),Object(q.a)(P,"title",""),Object(q.a)(P,"fixed",K?K.fixed:null),Object(q.a)(P,"className","".concat(r,"-row-expand-icon-cell")),Object(q.a)(P,"render",function(G,Q,ne){var le=S(Q,ne),_e=O.has(le),pe=C?C(Q):!0,Ee=A({prefixCls:r,expanded:_e,expandable:pe,record:Q,onExpand:x});return p?U.createElement("span",{onClick:function(we){return we.stopPropagation()}},Ee):Ee}),P),B=c.slice();return N>=0&&B.splice(N,0,$),B}return c},[h,c,S,O,A,v]),y=U.useMemo(function(){var P=E;return l&&(P=l(P)),P.length||(P=[{render:function(){return null}}]),P},[l,E,v]),_=U.useMemo(function(){return v==="rtl"?u(g(y)):g(y)},[y,v]);return[y,_]}Se.b=d},"y0+3":function(Fe,Se,W){"use strict";W.d(Se,"a",function(){return g}),W.d(Se,"b",function(){return u});var q=/margin|padding|width|height|max|min|offset/,V={left:!0,top:!0},M={cssFloat:1,styleFloat:1,float:1};function z(d){return d.nodeType===1?d.ownerDocument.defaultView.getComputedStyle(d,null):{}}function U(d,s,l){if(s=s.toLowerCase(),l==="auto"){if(s==="height")return d.offsetHeight;if(s==="width")return d.offsetWidth}return s in V||(V[s]=q.test(s)),V[s]?parseFloat(l)||0:l}function L(d,s){var l=arguments.length,r=z(d);return s=M[s]?"cssFloat"in d.style?"cssFloat":"styleFloat":s,l===1?r:U(d,s,r[s]||d.style[s])}function H(d,s,l){var r=arguments.length;if(s=M[s]?"cssFloat"in d.style?"cssFloat":"styleFloat":s,r===3)return typeof l=="number"&&q.test(s)&&(l="".concat(l,"px")),d.style[s]=l,l;for(var a in s)s.hasOwnProperty(a)&&H(d,a,s[a]);return z(d)}function F(d){return d===document.body?document.documentElement.clientWidth:d.offsetWidth}function D(d){return d===document.body?window.innerHeight||document.documentElement.clientHeight:d.offsetHeight}function I(){var d=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),s=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:d,height:s}}function g(){var d=document.documentElement.clientWidth,s=window.innerHeight||document.documentElement.clientHeight;return{width:d,height:s}}function f(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function u(d){var s=d.getBoundingClientRect(),l=document.documentElement;return{left:s.left+(window.pageXOffset||l.scrollLeft)-(l.clientLeft||document.body.clientLeft||0),top:s.top+(window.pageYOffset||l.scrollTop)-(l.clientTop||document.body.clientTop||0)}}},ynwM:function(Fe,Se,W){var q=W("MFOe"),V=q.Global;Fe.exports={name:"oldFF-globalStorage",read:z,write:U,each:L,remove:H,clearAll:F};var M=V.globalStorage;function z(D){return M[D]}function U(D,I){M[D]=I}function L(D){for(var I=M.length-1;I>=0;I--){var g=M.key(I);D(M[g],g)}}function H(D){return M.removeItem(D)}function F(){L(function(D,I){delete M[D]})}}}]);