You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__MyProblem__index.3a512e9...

446 lines
1.3 MiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[211,3,5,7,8,9],{"+NIl":function(Ue,de,M){(function(J){J(M("VrN/"))})(function(J){"use strict";J.defineMode("stex",function(z,D){"use strict";function V(c,s){c.cmdState.push(s)}function N(c){return c.cmdState.length>0?c.cmdState[c.cmdState.length-1]:null}function O(c){var s=c.cmdState.pop();s&&s.closeBracket()}function K(c){for(var s=c.cmdState,d=s.length-1;d>=0;d--){var i=s[d];if(i.name=="DEFAULT")continue;return i}return{styleIdentifier:function(){return null}}}function W(c,s,d){return function(){this.name=c,this.bracketNo=0,this.style=s,this.styles=d,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var n={};n.importmodule=W("importmodule","tag",["string","builtin"]),n.documentclass=W("documentclass","tag",["","atom"]),n.usepackage=W("usepackage","tag",["atom"]),n.begin=W("begin","tag",["atom"]),n.end=W("end","tag",["atom"]),n.label=W("label","tag",["atom"]),n.ref=W("ref","tag",["atom"]),n.eqref=W("eqref","tag",["atom"]),n.cite=W("cite","tag",["atom"]),n.bibitem=W("bibitem","tag",["atom"]),n.Bibitem=W("Bibitem","tag",["atom"]),n.RBibitem=W("RBibitem","tag",["atom"]),n.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function I(c,s){c.f=s}function g(c,s){var d;if(c.match(/^\\[a-zA-Z@]+/)){var i=c.current().slice(1);return d=n.hasOwnProperty(i)?n[i]:n.DEFAULT,d=new d,V(s,d),I(s,h),d.style}if(c.match(/^\\[$&%#{}_]/))return"tag";if(c.match(/^\\[,;!\/\\]/))return"tag";if(c.match("\\["))return I(s,function(r,o){return f(r,o,"\\]")}),"keyword";if(c.match("\\("))return I(s,function(r,o){return f(r,o,"\\)")}),"keyword";if(c.match("$$"))return I(s,function(r,o){return f(r,o,"$$")}),"keyword";if(c.match("$"))return I(s,function(r,o){return f(r,o,"$")}),"keyword";var a=c.next();if(a=="%")return c.skipToEnd(),"comment";if(a=="}"||a=="]"){if(d=N(s),d)d.closeBracket(a),I(s,h);else return"error";return"bracket"}else return a=="{"||a=="["?(d=n.DEFAULT,d=new d,V(s,d),"bracket"):/\d/.test(a)?(c.eatWhile(/[\w.%]/),"atom"):(c.eatWhile(/[\w\-_]/),d=K(s),d.name=="begin"&&(d.argument=c.current()),d.styleIdentifier())}function f(c,s,d){if(c.eatSpace())return null;if(d&&c.match(d))return I(s,g),"keyword";if(c.match(/^\\[a-zA-Z@]+/))return"tag";if(c.match(/^[a-zA-Z]+/))return"variable-2";if(c.match(/^\\[$&%#{}_]/))return"tag";if(c.match(/^\\[,;!\/]/))return"tag";if(c.match(/^[\^_&]/))return"tag";if(c.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(c.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var i=c.next();return i=="{"||i=="}"||i=="["||i=="]"||i=="("||i==")"?"bracket":i=="%"?(c.skipToEnd(),"comment"):"error"}function h(c,s){var d=c.peek(),i;return d=="{"||d=="["?(i=N(s),i.openBracket(d),c.eat(d),I(s,g),"bracket"):/[ \t\r]/.test(d)?(c.eat(d),null):(I(s,g),O(s),g(c,s))}return{startState:function(){var c=D.inMathMode?function(s,d){return f(s,d)}:g;return{cmdState:[],f:c}},copyState:function(c){return{cmdState:c.cmdState.slice(),f:c.f}},token:function(c,s){return s.f(c,s)},blankLine:function(c){c.f=g,c.cmdState.length=0},lineComment:"%"}}),J.defineMIME("text/x-stex","stex"),J.defineMIME("text/x-latex","stex")})},"+aKw":function(Ue,de,M){"use strict";var J=M("tJVT"),z=M("q1tI"),D=M.n(z),V=function(K){return String(K).length===1?"0".concat(K):K},N=function(K){var W=K.className,n=W===void 0?"":W,I=K.onChange,g=K.defaultValue,f=g===void 0?0:g,h=Object(z.useState)(f),c=Object(J.a)(h,2),s=c[0],d=c[1];Object(z.useEffect)(function(){var o=setTimeout(function(){d(s+1e3)},1e3);return I(s+1e3),function(){clearInterval(o)}},[s]);var i=parseInt(s/(60*6e4))||"00",a=parseInt(s%(60*6e4)/6e4)||"00",r=parseInt(s%6e4/1e3)||"00";return D.a.createElement("div",{className:n},V(i),":",V(a),":",V(r))};de.a=N},"+k/U":function(Ue,de,M){Ue.exports={pagination:"pagination___2XcQw",info:"info___12Y4R"}},"+ua5":function(Ue,de,M){},"/cxE":function(Ue,de,M){"use strict";M.d(de,"f",function(){return D}),M.d(de,"g",function(){return V}),M.d(de,"h",function(){return N}),M.d(de,"e",function(){return K}),M.d(de,"b",function(){return W}),M.d(de,"c",function(){return n}),M.d(de,"d",function(){return I}),M.d(de,"a",function(){return g});class J{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(f){setTimeout(()=>{throw f.stack?new Error(f.message+`
`+f.stack):f},0)}}emit(f){this.listeners.forEach(h=>{h(f)})}onUnexpectedError(f){this.unexpectedErrorHandler(f),this.emit(f)}onUnexpectedExternalError(f){this.unexpectedErrorHandler(f)}}const z=new J;function D(f){K(f)||z.onUnexpectedError(f);return}function V(f){K(f)||z.onUnexpectedExternalError(f);return}function N(f){if(f instanceof Error){let{name:h,message:c}=f;const s=f.stacktrace||f.stack;return{$isError:!0,name:h,message:c,stack:s}}return f}const O="Canceled";function K(f){return f instanceof Error&&f.name===O&&f.message===O}function W(){const f=new Error(O);return f.name=f.message,f}function n(f){return f?new Error(`Illegal argument: ${f}`):new Error("Illegal argument")}function I(f){return f?new Error(`Illegal state: ${f}`):new Error("Illegal state")}class g extends Error{constructor(f){super("NotSupported");f&&(this.message=f)}}},"07cG":function(Ue,de,M){Ue.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},"19Vz":function(Ue,de,M){(function(J){J(M("VrN/"))})(function(J){J.defineOption("placeholder","",function(W,n,I){var g=I&&I!=J.Init;if(n&&!g)W.on("blur",N),W.on("change",O),W.on("swapDoc",O),J.on(W.getInputField(),"compositionupdate",W.state.placeholderCompose=function(){V(W)}),O(W);else if(!n&&g){W.off("blur",N),W.off("change",O),W.off("swapDoc",O),J.off(W.getInputField(),"compositionupdate",W.state.placeholderCompose),z(W);var f=W.getWrapperElement();f.className=f.className.replace(" CodeMirror-empty","")}n&&!W.hasFocus()&&N(W)});function z(W){W.state.placeholder&&(W.state.placeholder.parentNode.removeChild(W.state.placeholder),W.state.placeholder=null)}function D(W){z(W);var n=W.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.style.direction=W.getOption("direction"),n.className="CodeMirror-placeholder CodeMirror-line-like";var I=W.getOption("placeholder");typeof I=="string"&&(I=document.createTextNode(I)),n.appendChild(I),W.display.lineSpace.insertBefore(n,W.display.lineSpace.firstChild)}function V(W){setTimeout(function(){var n=!1,I=W.getInputField();I.nodeName=="TEXTAREA"?n=!I.value:W.lineCount()==1&&(n=!/[^\u200b]/.test(I.querySelector(".CodeMirror-line").textContent)),n?D(W):z(W)},20)}function N(W){K(W)&&D(W)}function O(W){var n=W.getWrapperElement(),I=K(W);n.className=n.className.replace(" CodeMirror-empty","")+(I?" CodeMirror-empty":""),I?D(W):z(W)}function K(W){return W.lineCount()===1&&W.getLine(0)===""}})},"1eCo":function(Ue,de,M){(function(J){J(M("VrN/"))})(function(J){"use strict";var z={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},D={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};J.defineMode("xml",function(V,N){var O=V.indentUnit,K={},W=N.htmlMode?z:D;for(var n in W)K[n]=W[n];for(var n in N)K[n]=N[n];var I,g;function f(p,C){function E(F){return C.tokenize=F,F(p,C)}var v=p.next();if(v=="<")return p.eat("!")?p.eat("[")?p.match("CDATA[")?E(s("atom","]]>")):null:p.match("--")?E(s("comment","-->")):p.match("DOCTYPE",!0,!0)?(p.eatWhile(/[\w\._\-]/),E(d(1))):null:p.eat("?")?(p.eatWhile(/[\w\._\-]/),C.tokenize=s("meta","?>"),"meta"):(I=p.eat("/")?"closeTag":"openTag",C.tokenize=h,"tag bracket");if(v=="&"){var P;return p.eat("#")?p.eat("x")?P=p.eatWhile(/[a-fA-F\d]/)&&p.eat(";"):P=p.eatWhile(/[\d]/)&&p.eat(";"):P=p.eatWhile(/[\w\.\-:]/)&&p.eat(";"),P?"atom":"error"}else return p.eatWhile(/[^&<]/),null}f.isInText=!0;function h(p,C){var E=p.next();if(E==">"||E=="/"&&p.eat(">"))return C.tokenize=f,I=E==">"?"endTag":"selfcloseTag","tag bracket";if(E=="=")return I="equals",null;if(E=="<"){C.tokenize=f,C.state=o,C.tagName=C.tagStart=null;var v=C.tokenize(p,C);return v?v+" tag error":"tag error"}else return/[\'\"]/.test(E)?(C.tokenize=c(E),C.stringStartCol=p.column(),C.tokenize(p,C)):(p.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function c(p){var C=function(E,v){for(;!E.eol();)if(E.next()==p){v.tokenize=h;break}return"string"};return C.isInAttribute=!0,C}function s(p,C){return function(E,v){for(;!E.eol();){if(E.match(C)){v.tokenize=f;break}E.next()}return p}}function d(p){return function(C,E){for(var v;(v=C.next())!=null;){if(v=="<")return E.tokenize=d(p+1),E.tokenize(C,E);if(v==">")if(p==1){E.tokenize=f;break}else return E.tokenize=d(p-1),E.tokenize(C,E)}return"meta"}}function i(p,C,E){this.prev=p.context,this.tagName=C,this.indent=p.indented,this.startOfLine=E,(K.doNotIndent.hasOwnProperty(C)||p.context&&p.context.noIndent)&&(this.noIndent=!0)}function a(p){p.context&&(p.context=p.context.prev)}function r(p,C){for(var E;;){if(!p.context)return;if(E=p.context.tagName,!K.contextGrabbers.hasOwnProperty(E)||!K.contextGrabbers[E].hasOwnProperty(C))return;a(p)}}function o(p,C,E){return p=="openTag"?(E.tagStart=C.column(),T):p=="closeTag"?w:o}function T(p,C,E){return p=="word"?(E.tagName=C.current(),g="tag",A):K.allowMissingTagName&&p=="endTag"?(g="tag bracket",A(p,C,E)):(g="error",T)}function w(p,C,E){if(p=="word"){var v=C.current();return E.context&&E.context.tagName!=v&&K.implicitlyClosed.hasOwnProperty(E.context.tagName)&&a(E),E.context&&E.context.tagName==v||K.matchClosing===!1?(g="tag",x):(g="tag error",L)}else return K.allowMissingTagName&&p=="endTag"?(g="tag bracket",x(p,C,E)):(g="error",L)}function x(p,C,E){return p!="endTag"?(g="error",x):(a(E),o)}function L(p,C,E){return g="error",x(p,C,E)}function A(p,C,E){if(p=="word")return g="attribute",_;if(p=="endTag"||p=="selfcloseTag"){var v=E.tagName,P=E.tagStart;return E.tagName=E.tagStart=null,p=="selfcloseTag"||K.autoSelfClosers.hasOwnProperty(v)?r(E,v):(r(E,v),E.context=new i(E,v,P==E.indented)),o}return g="error",A}function _(p,C,E){return p=="equals"?b:(K.allowMissing||(g="error"),A(p,C,E))}function b(p,C,E){return p=="string"?m:p=="word"&&K.allowUnquoted?(g="string",A):(g="error",A(p,C,E))}function m(p,C,E){return p=="string"?m:A(p,C,E)}return{startState:function(p){var C={tokenize:f,state:o,indented:p||0,tagName:null,tagStart:null,context:null};return p!=null&&(C.baseIndent=p),C},token:function(p,C){if(!C.tagName&&p.sol()&&(C.indented=p.indentation()),p.eatSpace())return null;I=null;var E=C.tokenize(p,C);return(E||I)&&E!="comment"&&(g=null,C.state=C.state(I||E,p,C),g&&(E=g=="error"?E+" error":g)),E},indent:function(p,C,E){var v=p.context;if(p.tokenize.isInAttribute)return p.tagStart==p.indented?p.stringStartCol+1:p.indented+O;if(v&&v.noIndent)return J.Pass;if(p.tokenize!=h&&p.tokenize!=f)return E?E.match(/^(\s*)/)[0].length:0;if(p.tagName)return K.multilineTagIndentPastTag!==!1?p.tagStart+p.tagName.length+2:p.tagStart+O*(K.multilineTagIndentFactor||1);if(K.alignCDATA&&/<!\[CDATA\[/.test(C))return 0;var P=C&&/^<(\/)?([\w_:\.-]*)/.exec(C);if(P&&P[1])for(;v;)if(v.tagName==P[2]){v=v.prev;break}else if(K.implicitlyClosed.hasOwnProperty(v.tagName))v=v.prev;else break;else if(P)for(;v;){var F=K.contextGrabbers[v.tagName];if(F&&F.hasOwnProperty(P[2]))v=v.prev;else break}for(;v&&v.prev&&!v.startOfLine;)v=v.prev;return v?v.indent+O:p.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:K.htmlMode?"html":"xml",helperType:K.htmlMode?"html":"xml",skipAttribute:function(p){p.state==b&&(p.state=A)},xmlCurrentTag:function(p){return p.tagName?{name:p.tagName,close:p.type=="closeTag"}:null},xmlCurrentContext:function(p){for(var C=[],E=p.context;E;E=E.prev)E.tagName&&C.push(E.tagName);return C.reverse()}}}),J.defineMIME("text/xml","xml"),J.defineMIME("application/xml","xml"),J.mimeModes.hasOwnProperty("text/html")||J.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1j5w":function(Ue,de,M){"use strict";M.d(de,"d",function(){return Ye}),M.d(de,"b",function(){return _e}),M.d(de,"c",function(){return Ge}),M.d(de,"a",function(){return ct});var J=M("VTBJ"),z=M("1OyB"),D=M("vuIU"),V=M("JX7q"),N=M("Ji7U"),O=M("LK+K"),K=M("q1tI"),W=M("I8Z2"),n=M("BGR+"),I=M("wx14"),g=M("rePB"),f=M("4IlW"),h=M("2GS6"),c=M("Gytx"),s=M.n(c),d=M("TSYQ"),i=M.n(d),a=M("U8pU"),r=M("ODXe"),o=/iPhone/i,T=/iPod/i,w=/iPad/i,x=/\bAndroid(?:.+)Mobile\b/i,L=/Android/i,A=/\bAndroid(?:.+)SD4930UR\b/i,_=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,b=/Windows Phone/i,m=/\bWindows(?:.+)ARM\b/i,p=/BlackBerry/i,C=/BB10/i,E=/Opera Mini/i,v=/\b(CriOS|Chrome)(?:.+)Mobile/i,P=/Mobile(?:.+)Firefox\b/i;function F(nt,We){return nt.test(We)}function R(nt){var We=nt||(typeof navigator!="undefined"?navigator.userAgent:""),Ve=We.split("[FBAN");if(typeof Ve[1]!="undefined"){var Ne=Ve,pe=Object(r.a)(Ne,1);We=pe[0]}if(Ve=We.split("Twitter"),typeof Ve[1]!="undefined"){var xe=Ve,Xe=Object(r.a)(xe,1);We=Xe[0]}var je={apple:{phone:F(o,We)&&!F(b,We),ipod:F(T,We),tablet:!F(o,We)&&F(w,We)&&!F(b,We),device:(F(o,We)||F(T,We)||F(w,We))&&!F(b,We)},amazon:{phone:F(A,We),tablet:!F(A,We)&&F(_,We),device:F(A,We)||F(_,We)},android:{phone:!F(b,We)&&F(A,We)||!F(b,We)&&F(x,We),tablet:!F(b,We)&&!F(A,We)&&!F(x,We)&&(F(_,We)||F(L,We)),device:!F(b,We)&&(F(A,We)||F(_,We)||F(x,We)||F(L,We))||F(/\bokhttp\b/i,We)},windows:{phone:F(b,We),tablet:F(m,We),device:F(b,We)||F(m,We)},other:{blackberry:F(p,We),blackberry10:F(C,We),opera:F(E,We),firefox:F(P,We),chrome:F(v,We),device:F(p,We)||F(C,We)||F(E,We)||F(P,We)||F(v,We)},any:null,phone:null,tablet:null};return je.any=je.apple.device||je.android.device||je.windows.device||je.other.device,je.phone=je.apple.phone||je.android.phone||je.windows.phone,je.tablet=je.apple.tablet||je.android.tablet||je.windows.tablet,je}var H=Object(J.a)(Object(J.a)({},R()),{},{isMobile:R}),U=H;function S(){}function G(nt,We,Ve){var Ne=We||"";return nt.key||"".concat(Ne,"item_").concat(Ve)}function Q(nt){return"".concat(nt,"-menu-")}function se(nt,We){var Ve=-1;K.Children.forEach(nt,function(Ne){Ve+=1,Ne&&Ne.type&&Ne.type.isMenuItemGroup?K.Children.forEach(Ne.props.children,function(pe){Ve+=1,We(pe,Ve)}):We(Ne,Ve)})}function fe(nt,We,Ve){if(!nt||Ve.find)return;K.Children.forEach(nt,function(Ne){if(Ne){var pe=Ne.type;if(!pe||!(pe.isSubMenu||pe.isMenuItem||pe.isMenuItemGroup))return;We.indexOf(Ne.key)!==-1?Ve.find=!0:Ne.props.children&&fe(Ne.props.children,We,Ve)}})}var we=["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"],be=function(We){var Ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ne=We&&typeof We.getBoundingClientRect=="function"&&We.getBoundingClientRect().width;if(Ne){if(Ve){var pe=getComputedStyle(We),xe=pe.marginLeft,Xe=pe.marginRight;Ne+=+xe.replace("px","")+ +Xe.replace("px","")}Ne=+Ne.toFixed(6)}return Ne||0},Se=function(We,Ve,Ne){We&&Object(a.a)(We.style)==="object"&&(We.style[Ve]=Ne)},Ae=function(){return U.any},De=M("KQm4"),ve=M("Ff2n"),Y=M("i8i4"),k=M("bdgK"),B=M("uciX"),Z=M("8XRh"),re={adjustX:1,adjustY:1},X={topLeft:{points:["bl","tl"],overflow:re,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:re,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:re,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:re,offset:[4,0]}},ye={topLeft:{points:["bl","tl"],overflow:re,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:re,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:re,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:re,offset:[4,0]}},Me=X,He=0,me={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Ee=function(We,Ve,Ne){var pe=Q(Ve),xe=We.getState();We.setState({defaultActiveFirst:Object(J.a)(Object(J.a)({},xe.defaultActiveFirst),{},Object(g.a)({},pe,Ne))})},Le=function(nt){Object(N.a)(Ve,nt);var We=Object(O.a)(Ve);function Ve(Ne){var pe;Object(z.a)(this,Ve),pe=We.call(this,Ne),pe.onDestroy=function(Ke){pe.props.onDestroy(Ke)},pe.onKeyDown=function(Ke){var Je=Ke.keyCode,Qe=pe.menuInstance,pt=pe.props,dt=pt.isOpen,Vt=pt.store;if(Je===f.a.ENTER)return pe.onTitleClick(Ke),Ee(Vt,pe.props.eventKey,!0),!0;if(Je===f.a.RIGHT)return dt?Qe.onKeyDown(Ke):(pe.triggerOpenChange(!0),Ee(Vt,pe.props.eventKey,!0)),!0;if(Je===f.a.LEFT){var rn;if(dt)rn=Qe.onKeyDown(Ke);else return;return rn||(pe.triggerOpenChange(!1),rn=!0),rn}return dt&&(Je===f.a.UP||Je===f.a.DOWN)?Qe.onKeyDown(Ke):void 0},pe.onOpenChange=function(Ke){pe.props.onOpenChange(Ke)},pe.onPopupVisibleChange=function(Ke){pe.triggerOpenChange(Ke,Ke?"mouseenter":"mouseleave")},pe.onMouseEnter=function(Ke){var Je=pe.props,Qe=Je.eventKey,pt=Je.onMouseEnter,dt=Je.store;Ee(dt,pe.props.eventKey,!1),pt({key:Qe,domEvent:Ke})},pe.onMouseLeave=function(Ke){var Je=pe.props,Qe=Je.parentMenu,pt=Je.eventKey,dt=Je.onMouseLeave;Qe.subMenuInstance=Object(V.a)(pe),dt({key:pt,domEvent:Ke})},pe.onTitleMouseEnter=function(Ke){var Je=pe.props,Qe=Je.eventKey,pt=Je.onItemHover,dt=Je.onTitleMouseEnter;pt({key:Qe,hover:!0}),dt({key:Qe,domEvent:Ke})},pe.onTitleMouseLeave=function(Ke){var Je=pe.props,Qe=Je.parentMenu,pt=Je.eventKey,dt=Je.onItemHover,Vt=Je.onTitleMouseLeave;Qe.subMenuInstance=Object(V.a)(pe),dt({key:pt,hover:!1}),Vt({key:pt,domEvent:Ke})},pe.onTitleClick=function(Ke){var Je=Object(V.a)(pe),Qe=Je.props;if(Qe.onTitleClick({key:Qe.eventKey,domEvent:Ke}),Qe.triggerSubMenuAction==="hover")return;pe.triggerOpenChange(!Qe.isOpen,"click"),Ee(Qe.store,pe.props.eventKey,!1)},pe.onSubMenuClick=function(Ke){typeof pe.props.onClick=="function"&&pe.props.onClick(pe.addKeyPath(Ke))},pe.onSelect=function(Ke){pe.props.onSelect(Ke)},pe.onDeselect=function(Ke){pe.props.onDeselect(Ke)},pe.getPrefixCls=function(){return"".concat(pe.props.rootPrefixCls,"-submenu")},pe.getActiveClassName=function(){return"".concat(pe.getPrefixCls(),"-active")},pe.getDisabledClassName=function(){return"".concat(pe.getPrefixCls(),"-disabled")},pe.getSelectedClassName=function(){return"".concat(pe.getPrefixCls(),"-selected")},pe.getOpenClassName=function(){return"".concat(pe.props.rootPrefixCls,"-submenu-open")},pe.saveMenuInstance=function(Ke){pe.menuInstance=Ke},pe.addKeyPath=function(Ke){return Object(J.a)(Object(J.a)({},Ke),{},{keyPath:(Ke.keyPath||[]).concat(pe.props.eventKey)})},pe.triggerOpenChange=function(Ke,Je){var Qe=pe.props.eventKey,pt=function(){pe.onOpenChange({key:Qe,item:Object(V.a)(pe),trigger:Je,open:Ke})};Je==="mouseenter"?pe.mouseenterTimeout=setTimeout(function(){pt()},0):pt()},pe.isChildrenSelected=function(){var Ke={find:!1};return fe(pe.props.children,pe.props.selectedKeys,Ke),Ke.find},pe.isOpen=function(){return pe.props.openKeys.indexOf(pe.props.eventKey)!==-1},pe.adjustWidth=function(){if(!pe.subMenuTitle||!pe.menuInstance)return;var Ke=Y.findDOMNode(pe.menuInstance);if(Ke.offsetWidth>=pe.subMenuTitle.offsetWidth)return;Ke.style.minWidth="".concat(pe.subMenuTitle.offsetWidth,"px")},pe.saveSubMenuTitle=function(Ke){pe.subMenuTitle=Ke},pe.getBaseProps=function(){var Ke=Object(V.a)(pe),Je=Ke.props;return{mode:Je.mode==="horizontal"?"vertical":Je.mode,visible:pe.props.isOpen,level:Je.level+1,inlineIndent:Je.inlineIndent,focusable:!1,onClick:pe.onSubMenuClick,onSelect:pe.onSelect,onDeselect:pe.onDeselect,onDestroy:pe.onDestroy,selectedKeys:Je.selectedKeys,eventKey:"".concat(Je.eventKey,"-menu-"),openKeys:Je.openKeys,motion:Je.motion,onOpenChange:pe.onOpenChange,subMenuOpenDelay:Je.subMenuOpenDelay,parentMenu:Object(V.a)(pe),subMenuCloseDelay:Je.subMenuCloseDelay,forceSubMenuRender:Je.forceSubMenuRender,triggerSubMenuAction:Je.triggerSubMenuAction,builtinPlacements:Je.builtinPlacements,defaultActiveFirst:Je.store.getState().defaultActiveFirst[Q(Je.eventKey)],multiple:Je.multiple,prefixCls:Je.rootPrefixCls,id:pe.internalMenuId,manualRef:pe.saveMenuInstance,itemIcon:Je.itemIcon,expandIcon:Je.expandIcon,direction:Je.direction}},pe.getMotion=function(Ke,Je){var Qe=Object(V.a)(pe),pt=Qe.haveRendered,dt=pe.props,Vt=dt.motion,rn=dt.rootPrefixCls,an=Object(J.a)(Object(J.a)({},Vt),{},{leavedClassName:"".concat(rn,"-hidden"),removeOnLeave:!1,motionAppear:pt||!Je||Ke!=="inline"});return an};var xe=Ne.store,Xe=Ne.eventKey,je=xe.getState(),it=je.defaultActiveFirst;pe.isRootMenu=!1;var ot=!1;return it&&(ot=it[Xe]),Ee(xe,Xe,ot),pe}return Object(D.a)(Ve,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var pe=this,xe=this.props,Xe=xe.mode,je=xe.parentMenu,it=xe.manualRef;if(it&&it(this),Xe!=="horizontal"||!je.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return pe.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var pe=this.props,xe=pe.onDestroy,Xe=pe.eventKey;xe&&xe(Xe),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(pe){var xe=this,Xe=this.getBaseProps(),je=this.getMotion(Xe.mode,Xe.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||Xe.visible||Xe.forceSubMenuRender,!this.haveOpened)return K.createElement("div",null);var it=Xe.direction;return K.createElement(Z.default,Object.assign({visible:Xe.visible},je),function(ot){var Ke=ot.className,Je=ot.style,Qe=i()("".concat(Xe.prefixCls,"-sub"),Ke,Object(g.a)({},"".concat(Xe.prefixCls,"-rtl"),it==="rtl"));return K.createElement(te,Object.assign({},Xe,{id:xe.internalMenuId,className:Qe,style:Je}),pe)})}},{key:"render",value:function(){var pe,xe=Object(J.a)({},this.props),Xe=xe.isOpen,je=this.getPrefixCls(),it=xe.mode==="inline",ot=i()(je,"".concat(je,"-").concat(xe.mode),(pe={},Object(g.a)(pe,xe.className,!!xe.className),Object(g.a)(pe,this.getOpenClassName(),Xe),Object(g.a)(pe,this.getActiveClassName(),xe.active||Xe&&!it),Object(g.a)(pe,this.getDisabledClassName(),xe.disabled),Object(g.a)(pe,this.getSelectedClassName(),this.isChildrenSelected()),pe));this.internalMenuId||(xe.eventKey?this.internalMenuId="".concat(xe.eventKey,"$Menu"):(He+=1,this.internalMenuId="$__$".concat(He,"$Menu")));var Ke={},Je={},Qe={};xe.disabled||(Ke={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},Je={onClick:this.onTitleClick},Qe={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var pt={},dt=xe.direction;it&&(dt==="rtl"?pt.paddingRight=xe.inlineIndent*xe.level:pt.paddingLeft=xe.inlineIndent*xe.level);var Vt={};this.props.isOpen&&(Vt={"aria-owns":this.internalMenuId});var rn=null;xe.mode!=="horizontal"&&(rn=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(rn=K.createElement(this.props.expandIcon,Object(J.a)({},this.props))));var an=K.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:pt,className:"".concat(je,"-title"),role:"button"},Qe,Je,{"aria-expanded":Xe},Vt,{"aria-haspopup":"true",title:typeof xe.title=="string"?xe.title:void 0}),xe.title,rn||K.createElement("i",{className:"".concat(je,"-arrow")})),ft=this.renderChildren(xe.children),Wt=xe.parentMenu.isRootMenu?xe.parentMenu.props.getPopupContainer:function(vr){return vr.parentNode},Xt=me[xe.mode],Ot=xe.popupOffset?{offset:xe.popupOffset}:{},Mt=xe.mode==="inline"?"":xe.popupClassName;Mt+=dt==="rtl"?" ".concat(je,"-rtl"):"";var Ft=xe.disabled,On=xe.triggerSubMenuAction,vn=xe.subMenuOpenDelay,rt=xe.forceSubMenuRender,vt=xe.subMenuCloseDelay,zn=xe.builtinPlacements;we.forEach(function(vr){return delete xe[vr]}),delete xe.onClick;var Tr=dt==="rtl"?Object.assign({},ye,zn):Object.assign({},X,zn);return delete xe.direction,K.createElement("li",Object.assign({},xe,Ke,{className:ot,role:"menuitem"}),it&&an,it&&ft,!it&&K.createElement(B.a,{prefixCls:je,popupClassName:i()("".concat(je,"-popup"),Mt),getPopupContainer:Wt,builtinPlacements:Tr,popupPlacement:Xt,popupVisible:Xe,popupAlign:Ot,popup:ft,action:Ft?[]:[On],mouseEnterDelay:vn,mouseLeaveDelay:vt,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:rt},an))}}]),Ve}(K.Component);Le.defaultProps={onMouseEnter:S,onMouseLeave:S,onTitleMouseEnter:S,onTitleMouseLeave:S,onTitleClick:S,manualRef:S,mode:"vertical",title:""};var Pe=Object(W.b)(function(nt,We){var Ve=nt.openKeys,Ne=nt.activeKey,pe=nt.selectedKeys,xe=We.eventKey,Xe=We.subMenuKey;return{isOpen:Ve.indexOf(xe)>-1,active:Ne[Xe]===xe,selectedKeys:pe}})(Le);Pe.isSubMenu=!0;var Ye=Pe,tt="menuitem-overflowed",ut=.5,lt=function(nt){Object(N.a)(Ve,nt);var We=Object(O.a)(Ve);function Ve(){var Ne;return Object(z.a)(this,Ve),Ne=We.apply(this,arguments),Ne.resizeObserver=null,Ne.mutationObserver=null,Ne.originalTotalWidth=0,Ne.overflowedItems=[],Ne.menuItemSizes=[],Ne.cancelFrameId=null,Ne.state={lastVisibleIndex:void 0},Ne.getMenuItemNodes=function(){var pe=Ne.props.prefixCls,xe=Y.findDOMNode(Object(V.a)(Ne));return xe?[].slice.call(xe.children).filter(function(Xe){return Xe.className.split(" ").indexOf("".concat(pe,"-overflowed-submenu"))<0}):[]},Ne.getOverflowedSubMenuItem=function(pe,xe,Xe){var je=Ne.props,it=je.overflowedIndicator,ot=je.level,Ke=je.mode,Je=je.prefixCls,Qe=je.theme;if(ot!==1||Ke!=="horizontal")return null;var pt=Ne.props.children[0],dt=pt.props,Vt=dt.children,rn=dt.title,an=dt.style,ft=Object(ve.a)(dt,["children","title","style"]),Wt=Object(J.a)({},an),Xt="".concat(pe,"-overflowed-indicator"),Ot="".concat(pe,"-overflowed-indicator");xe.length===0&&Xe!==!0?Wt=Object(J.a)(Object(J.a)({},Wt),{},{display:"none"}):Xe&&(Wt=Object(J.a)(Object(J.a)({},Wt),{},{visibility:"hidden",position:"absolute"}),Xt="".concat(Xt,"-placeholder"),Ot="".concat(Ot,"-placeholder"));var Mt=Qe?"".concat(Je,"-").concat(Qe):"",Ft={};return we.forEach(function(On){ft[On]!==void 0&&(Ft[On]=ft[On])}),K.createElement(Ye,Object.assign({title:it,className:"".concat(Je,"-overflowed-submenu"),popupClassName:Mt},Ft,{key:Xt,eventKey:Ot,disabled:!1,style:Wt}),xe)},Ne.setChildrenWidthAndResize=function(){if(Ne.props.mode!=="horizontal")return;var pe=Y.findDOMNode(Object(V.a)(Ne));if(!pe)return;var xe=pe.children;if(!xe||xe.length===0)return;var Xe=pe.children[xe.length-1];Se(Xe,"display","inline-block");var je=Ne.getMenuItemNodes(),it=je.filter(function(ot){return ot.className.split(" ").indexOf(tt)>=0});it.forEach(function(ot){Se(ot,"display","inline-block")}),Ne.menuItemSizes=je.map(function(ot){return be(ot,!0)}),it.forEach(function(ot){Se(ot,"display","none")}),Ne.overflowedIndicatorWidth=be(pe.children[pe.children.length-1],!0),Ne.originalTotalWidth=Ne.menuItemSizes.reduce(function(ot,Ke){return ot+Ke},0),Ne.handleResize(),Se(Xe,"display","none")},Ne.handleResize=function(){if(Ne.props.mode!=="horizontal")return;var pe=Y.findDOMNode(Object(V.a)(Ne));if(!pe)return;var xe=be(pe);Ne.overflowedItems=[];var Xe=0,je;Ne.originalTotalWidth>xe+ut&&(je=-1,Ne.menuItemSizes.forEach(function(it){Xe+=it,Xe+Ne.overflowedIndicatorWidth<=xe&&(je+=1)})),Ne.setState({lastVisibleIndex:je})},Ne}return Object(D.a)(Ve,[{key:"componentDidMount",value:function(){var pe=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var xe=Y.findDOMNode(this);if(!xe)return;this.resizeObserver=new k.default(function(Xe){Xe.forEach(function(){var je=pe.cancelFrameId;cancelAnimationFrame(je),pe.cancelFrameId=requestAnimationFrame(pe.setChildrenWidthAndResize)})}),[].slice.call(xe.children).concat(xe).forEach(function(Xe){pe.resizeObserver.observe(Xe)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){pe.resizeObserver.disconnect(),[].slice.call(xe.children).concat(xe).forEach(function(Xe){pe.resizeObserver.observe(Xe)}),pe.setChildrenWidthAndResize()}),this.mutationObserver.observe(xe,{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(pe){var xe=this,Xe=this.state.lastVisibleIndex;return(pe||[]).reduce(function(je,it,ot){var Ke=it;if(xe.props.mode==="horizontal"){var Je=xe.getOverflowedSubMenuItem(it.props.eventKey,[]);Xe!==void 0&&xe.props.className.indexOf("".concat(xe.props.prefixCls,"-root"))!==-1&&(ot>Xe&&(Ke=K.cloneElement(it,{style:{display:"none"},eventKey:"".concat(it.props.eventKey,"-hidden"),className:"".concat(tt)})),ot===Xe+1&&(xe.overflowedItems=pe.slice(Xe+1).map(function(pt){return K.cloneElement(pt,{key:pt.props.eventKey,mode:"vertical-left"})}),Je=xe.getOverflowedSubMenuItem(it.props.eventKey,xe.overflowedItems)));var Qe=[].concat(Object(De.a)(je),[Je,Ke]);return ot===pe.length-1&&Qe.push(xe.getOverflowedSubMenuItem(it.props.eventKey,[],!0)),Qe}return[].concat(Object(De.a)(je),[Ke])},[])}},{key:"render",value:function(){var pe=this.props,xe=pe.visible,Xe=pe.prefixCls,je=pe.overflowedIndicator,it=pe.mode,ot=pe.level,Ke=pe.tag,Je=pe.children,Qe=pe.theme,pt=Object(ve.a)(pe,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),dt=Ke;return K.createElement(dt,Object.assign({},pt),this.renderChildren(Je))}}]),Ve}(K.Component);lt.defaultProps={tag:"div",className:""};var gt=lt;function ht(nt){return nt.length?nt.every(function(We){return!!We.props.disabled}):!0}function Ie(nt,We,Ve){var Ne=nt.getState();nt.setState({activeKey:Object(J.a)(Object(J.a)({},Ne.activeKey),{},Object(g.a)({},We,Ve))})}function Re(nt){return nt.eventKey||"0-menu-"}function $e(nt,We){var Ve=We,Ne=nt.children,pe=nt.eventKey;if(Ve){var xe;if(se(Ne,function(Xe,je){Xe&&Xe.props&&!Xe.props.disabled&&Ve===G(Xe,pe,je)&&(xe=!0)}),xe)return Ve}return Ve=null,nt.defaultActiveFirst&&se(Ne,function(Xe,je){!Ve&&Xe&&!Xe.props.disabled&&(Ve=G(Xe,pe,je))}),Ve}function Ze(nt){if(nt){var We=this.instanceArray.indexOf(nt);We!==-1?this.instanceArray[We]=nt:this.instanceArray.push(nt)}}var ue=function(nt){Object(N.a)(Ve,nt);var We=Object(O.a)(Ve);function Ve(Ne){var pe;return Object(z.a)(this,Ve),pe=We.call(this,Ne),pe.onKeyDown=function(xe,Xe){var je=xe.keyCode,it;if(pe.getFlatInstanceArray().forEach(function(Ke){Ke&&Ke.props.active&&Ke.onKeyDown&&(it=Ke.onKeyDown(xe))}),it)return 1;var ot=null;return(je===f.a.UP||je===f.a.DOWN)&&(ot=pe.step(je===f.a.UP?-1:1)),ot?(xe.preventDefault(),Ie(pe.props.store,Re(pe.props),ot.props.eventKey),typeof Xe=="function"&&Xe(ot),1):void 0},pe.onItemHover=function(xe){var Xe=xe.key,je=xe.hover;Ie(pe.props.store,Re(pe.props),je?Xe:null)},pe.onDeselect=function(xe){pe.props.onDeselect(xe)},pe.onSelect=function(xe){pe.props.onSelect(xe)},pe.onClick=function(xe){pe.props.onClick(xe)},pe.onOpenChange=function(xe){pe.props.onOpenChange(xe)},pe.onDestroy=function(xe){pe.props.onDestroy(xe)},pe.getFlatInstanceArray=function(){return pe.instanceArray},pe.step=function(xe){var Xe=pe.getFlatInstanceArray(),je=pe.props.store.getState().activeKey[Re(pe.props)],it=Xe.length;if(!it)return null;xe<0&&(Xe=Xe.concat().reverse());var ot=-1;if(Xe.every(function(pt,dt){return pt&&pt.props.eventKey===je?(ot=dt,!1):!0}),!pe.props.defaultActiveFirst&&ot!==-1&&ht(Xe.slice(ot,it-1)))return;var Ke=(ot+1)%it,Je=Ke;do{var Qe=Xe[Je];if(!Qe||Qe.props.disabled)Je=(Je+1)%it;else return Qe}while(Je!==Ke);return null},pe.renderCommonMenuItem=function(xe,Xe,je){var it=pe.props.store.getState(),ot=Object(V.a)(pe),Ke=ot.props,Je=G(xe,Ke.eventKey,Xe),Qe=xe.props;if(!Qe||typeof xe.type=="string")return xe;var pt=Je===it.activeKey,dt=Object(J.a)(Object(J.a)({mode:Qe.mode||Ke.mode,level:Ke.level,inlineIndent:Ke.inlineIndent,renderMenuItem:pe.renderMenuItem,rootPrefixCls:Ke.prefixCls,index:Xe,parentMenu:Ke.parentMenu,manualRef:Qe.disabled?void 0:Object(h.a)(xe.ref,Ze.bind(Object(V.a)(pe))),eventKey:Je,active:!Qe.disabled&&pt,multiple:Ke.multiple,onClick:function(rn){(Qe.onClick||S)(rn),pe.onClick(rn)},onItemHover:pe.onItemHover,motion:Ke.motion,subMenuOpenDelay:Ke.subMenuOpenDelay,subMenuCloseDelay:Ke.subMenuCloseDelay,forceSubMenuRender:Ke.forceSubMenuRender,onOpenChange:pe.onOpenChange,onDeselect:pe.onDeselect,onSelect:pe.onSelect,builtinPlacements:Ke.builtinPlacements,itemIcon:Qe.itemIcon||pe.props.itemIcon,expandIcon:Qe.expandIcon||pe.props.expandIcon},je),{},{direction:Ke.direction});return(Ke.mode==="inline"||Ae())&&(dt.triggerSubMenuAction="click"),K.cloneElement(xe,dt)},pe.renderMenuItem=function(xe,Xe,je){if(!xe)return null;var it=pe.props.store.getState(),ot={openKeys:it.openKeys,selectedKeys:it.selectedKeys,triggerSubMenuAction:pe.props.triggerSubMenuAction,subMenuKey:je};return pe.renderCommonMenuItem(xe,Xe,ot)},Ne.store.setState({activeKey:Object(J.a)(Object(J.a)({},Ne.store.getState().activeKey),{},Object(g.a)({},Ne.eventKey,$e(Ne,Ne.activeKey)))}),pe.instanceArray=[],pe}return Object(D.a)(Ve,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(pe){return this.props.visible||pe.visible||this.props.className!==pe.className||!s()(this.props.style,pe.style)}},{key:"componentDidUpdate",value:function(pe){var xe=this.props,Xe="activeKey"in xe?xe.activeKey:xe.store.getState().activeKey[Re(xe)],je=$e(xe,Xe);if(je!==Xe)Ie(xe.store,Re(xe),je);else if("activeKey"in pe){var it=$e(pe,pe.activeKey);je!==it&&Ie(xe.store,Re(xe),je)}}},{key:"render",value:function(){var pe=this,xe=Object(I.a)({},this.props);this.instanceArray=[];var Xe=i()(xe.prefixCls,xe.className,"".concat(xe.prefixCls,"-").concat(xe.mode)),je={className:Xe,role:xe.role||"menu"};xe.id&&(je.id=xe.id),xe.focusable&&(je.tabIndex=0,je.onKeyDown=this.onKeyDown);var it=xe.prefixCls,ot=xe.eventKey,Ke=xe.visible,Je=xe.level,Qe=xe.mode,pt=xe.overflowedIndicator,dt=xe.theme;return we.forEach(function(Vt){return delete xe[Vt]}),delete xe.onClick,K.createElement(gt,Object.assign({},xe,{prefixCls:it,mode:Qe,tag:"ul",level:Je,theme:dt,visible:Ke,overflowedIndicator:pt},je),K.Children.map(xe.children,function(Vt,rn){return pe.renderMenuItem(Vt,rn,ot||"0-menu-")}))}}]),Ve}(K.Component);ue.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:S};var q=Object(W.b)()(ue),te=q,ae=M("Kwbf");function ce(nt,We,Ve){var Ne=nt.prefixCls,pe=nt.motion,xe=nt.defaultMotions,Xe=xe===void 0?{}:xe,je=nt.openAnimation,it=nt.openTransitionName,ot=We.switchingModeFromInline;if(pe)return pe;if(Object(a.a)(je)==="object"&&je)Object(ae.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof je=="string")return{motionName:"".concat(Ne,"-open-").concat(je)};if(it)return{motionName:it};var Ke=Xe[Ve];return Ke||(ot?null:Xe.other)}var ie=function(nt){Object(N.a)(Ve,nt);var We=Object(O.a)(Ve);function Ve(Ne){var pe;Object(z.a)(this,Ve),pe=We.call(this,Ne),pe.inlineOpenKeys=[],pe.onSelect=function(je){var it=Object(V.a)(pe),ot=it.props;if(ot.selectable){var Ke=pe.store.getState(),Je=Ke.selectedKeys,Qe=je.key;ot.multiple?Je=Je.concat([Qe]):Je=[Qe],"selectedKeys"in ot||pe.store.setState({selectedKeys:Je}),ot.onSelect(Object(J.a)(Object(J.a)({},je),{},{selectedKeys:Je}))}},pe.onClick=function(je){var it=pe.getRealMenuMode(),ot=Object(V.a)(pe),Ke=ot.store,Je=ot.props.onOpenChange;it!=="inline"&&!("openKeys"in pe.props)&&(Ke.setState({openKeys:[]}),Je([])),pe.props.onClick(je)},pe.onKeyDown=function(je,it){pe.innerMenu.getWrappedInstance().onKeyDown(je,it)},pe.onOpenChange=function(je){var it=Object(V.a)(pe),ot=it.props,Ke=pe.store.getState().openKeys.concat(),Je=!1,Qe=function(dt){var Vt=!1;if(dt.open)Vt=Ke.indexOf(dt.key)===-1,Vt&&Ke.push(dt.key);else{var rn=Ke.indexOf(dt.key);Vt=rn!==-1,Vt&&Ke.splice(rn,1)}Je=Je||Vt};Array.isArray(je)?je.forEach(Qe):Qe(je),Je&&("openKeys"in pe.props||pe.store.setState({openKeys:Ke}),ot.onOpenChange(Ke))},pe.onDeselect=function(je){var it=Object(V.a)(pe),ot=it.props;if(ot.selectable){var Ke=pe.store.getState().selectedKeys.concat(),Je=je.key,Qe=Ke.indexOf(Je);Qe!==-1&&Ke.splice(Qe,1),"selectedKeys"in ot||pe.store.setState({selectedKeys:Ke}),ot.onDeselect(Object(J.a)(Object(J.a)({},je),{},{selectedKeys:Ke}))}},pe.onMouseEnter=function(je){pe.restoreModeVerticalFromInline();var it=pe.props.onMouseEnter;it&&it(je)},pe.onTransitionEnd=function(je){var it=je.propertyName==="width"&&je.target===je.currentTarget,ot=je.target.className,Ke=Object.prototype.toString.call(ot)==="[object SVGAnimatedString]"?ot.animVal:ot,Je=je.propertyName==="font-size"&&Ke.indexOf("anticon")>=0;(it||Je)&&pe.restoreModeVerticalFromInline()},pe.setInnerMenu=function(je){pe.innerMenu=je},pe.isRootMenu=!0;var xe=Ne.defaultSelectedKeys,Xe=Ne.defaultOpenKeys;return"selectedKeys"in Ne&&(xe=Ne.selectedKeys||[]),"openKeys"in Ne&&(Xe=Ne.openKeys||[]),pe.store=Object(W.c)({selectedKeys:xe,openKeys:Xe,activeKey:{"0-menu-":$e(Ne,Ne.activeKey)}}),pe.state={switchingModeFromInline:!1},pe}return Object(D.a)(Ve,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(pe){this.updateOpentKeysWhenSwitchMode(pe),this.updateMiniStore();var xe=this.props,Xe=xe.siderCollapsed,je=xe.inlineCollapsed,it=xe.onOpenChange;(!pe.inlineCollapsed&&je||!pe.siderCollapsed&&Xe)&&it([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(pe){var xe=this.props,Xe=this.store,je=this.inlineOpenKeys,it=Xe.getState(),ot={};pe.mode==="inline"&&xe.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in xe||((xe.inlineCollapsed&&!pe.inlineCollapsed||xe.siderCollapsed&&!pe.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=it.openKeys.concat(),ot.openKeys=[]),(!xe.inlineCollapsed&&pe.inlineCollapsed||!xe.siderCollapsed&&pe.siderCollapsed)&&(ot.openKeys=je,this.inlineOpenKeys=[])),Object.keys(ot).length&&Xe.setState(ot)}},{key:"updateMenuDisplay",value:function(){var pe=this.props.collapsedWidth,xe=this.store,Xe=this.prevOpenKeys,je=this.getInlineCollapsed()&&(pe===0||pe==="0"||pe==="0px");je?(this.prevOpenKeys=xe.getState().openKeys.concat(),this.store.setState({openKeys:[]})):Xe&&(this.store.setState({openKeys:Xe}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var pe=this.props.mode,xe=this.state.switchingModeFromInline,Xe=this.getInlineCollapsed();return xe&&Xe?"inline":Xe?"vertical":pe}},{key:"getInlineCollapsed",value:function(){var pe=this.props,xe=pe.inlineCollapsed,Xe=pe.siderCollapsed;return Xe!==void 0?Xe:xe}},{key:"restoreModeVerticalFromInline",value:function(){var pe=this.state.switchingModeFromInline;pe&&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 pe=Object(J.a)({},Object(n.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),xe=this.getRealMenuMode();return pe.className+=" ".concat(pe.prefixCls,"-root"),pe.direction==="rtl"&&(pe.className+=" ".concat(pe.prefixCls,"-rtl")),pe=Object(J.a)(Object(J.a)({},pe),{},{mode:xe,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,xe)}),delete pe.openAnimation,delete pe.openTransitionName,K.createElement(W.a,{store:this.store},K.createElement(te,Object.assign({},pe,{ref:this.setInnerMenu}),this.props.children))}}]),Ve}(K.Component);ie.defaultProps={selectable:!0,onClick:S,onSelect:S,onOpenChange:S,onDeselect:S,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:K.createElement("span",null,"\xB7\xB7\xB7")};var oe=ie,he=function(nt){Object(N.a)(Ve,nt);var We=Object(O.a)(Ve);function Ve(){var Ne;return Object(z.a)(this,Ve),Ne=We.apply(this,arguments),Ne.onKeyDown=function(pe){var xe=pe.keyCode;return xe===f.a.ENTER?(Ne.onClick(pe),!0):void 0},Ne.onMouseLeave=function(pe){var xe=Ne.props,Xe=xe.eventKey,je=xe.onItemHover,it=xe.onMouseLeave;je({key:Xe,hover:!1}),it({key:Xe,domEvent:pe})},Ne.onMouseEnter=function(pe){var xe=Ne.props,Xe=xe.eventKey,je=xe.onItemHover,it=xe.onMouseEnter;je({key:Xe,hover:!0}),it({key:Xe,domEvent:pe})},Ne.onClick=function(pe){var xe=Ne.props,Xe=xe.eventKey,je=xe.multiple,it=xe.onClick,ot=xe.onSelect,Ke=xe.onDeselect,Je=xe.isSelected,Qe={key:Xe,keyPath:[Xe],item:Object(V.a)(Ne),domEvent:pe};it(Qe),je?Je?Ke(Qe):ot(Qe):Je||ot(Qe)},Ne.saveNode=function(pe){Ne.node=pe},Ne}return Object(D.a)(Ve,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var pe=this.props;pe.onDestroy&&pe.onDestroy(pe.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 pe,xe=Object(J.a)({},this.props),Xe=i()(this.getPrefixCls(),xe.className,(pe={},Object(g.a)(pe,this.getActiveClassName(),!xe.disabled&&xe.active),Object(g.a)(pe,this.getSelectedClassName(),xe.isSelected),Object(g.a)(pe,this.getDisabledClassName(),xe.disabled),pe)),je=Object(J.a)(Object(J.a)({},xe.attribute),{},{title:typeof xe.title=="string"?xe.title:void 0,className:Xe,role:xe.role||"menuitem","aria-disabled":xe.disabled});xe.role==="option"?je=Object(J.a)(Object(J.a)({},je),{},{role:"option","aria-selected":xe.isSelected}):(xe.role===null||xe.role==="none")&&(je.role="none");var it={onClick:xe.disabled?null:this.onClick,onMouseLeave:xe.disabled?null:this.onMouseLeave,onMouseEnter:xe.disabled?null:this.onMouseEnter},ot=Object(J.a)({},xe.style);xe.mode==="inline"&&(xe.direction==="rtl"?ot.paddingRight=xe.inlineIndent*xe.level:ot.paddingLeft=xe.inlineIndent*xe.level),we.forEach(function(Je){return delete xe[Je]}),delete xe.direction;var Ke=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Ke=K.createElement(this.props.itemIcon,this.props)),K.createElement("li",Object.assign({},Object(n.default)(xe,["onClick","onMouseEnter","onMouseLeave","onSelect"]),je,it,{style:ot,ref:this.saveNode}),xe.children,Ke)}}]),Ve}(K.Component);he.isMenuItem=!0,he.defaultProps={onSelect:S,onMouseEnter:S,onMouseLeave:S,manualRef:S};var ge=Object(W.b)(function(nt,We){var Ve=nt.activeKey,Ne=nt.selectedKeys,pe=We.eventKey,xe=We.subMenuKey;return{active:Ve[xe]===pe,isSelected:Ne.indexOf(pe)!==-1}})(he),_e=ge,Oe=function(nt){Object(N.a)(Ve,nt);var We=Object(O.a)(Ve);function Ve(){var Ne;return Object(z.a)(this,Ve),Ne=We.apply(this,arguments),Ne.renderInnerMenuItem=function(pe){var xe=Ne.props,Xe=xe.renderMenuItem,je=xe.index;return Xe(pe,je,Ne.props.subMenuKey)},Ne}return Object(D.a)(Ve,[{key:"render",value:function(){var pe=Object(I.a)({},this.props),xe=pe.className,Xe=xe===void 0?"":xe,je=pe.rootPrefixCls,it="".concat(je,"-item-group-title"),ot="".concat(je,"-item-group-list"),Ke=pe.title,Je=pe.children;return we.forEach(function(Qe){return delete pe[Qe]}),delete pe.onClick,delete pe.direction,K.createElement("li",Object.assign({},pe,{className:"".concat(Xe," ").concat(je,"-item-group")}),K.createElement("div",{className:it,title:typeof Ke=="string"?Ke:void 0},Ke),K.createElement("ul",{className:ot},K.Children.map(Je,this.renderInnerMenuItem)))}}]),Ve}(K.Component);Oe.isMenuItemGroup=!0,Oe.defaultProps={disabled:!0};var Ge=Oe,et=function(We){var Ve=We.className,Ne=We.rootPrefixCls,pe=We.style;return K.createElement("li",{className:"".concat(Ve," ").concat(Ne,"-item-divider"),style:pe})};et.defaultProps={disabled:!0,className:"",style:{}};var ct=et,st=de.e=oe},"24hK":function(Ue,de,M){"use strict";M.d(de,"a",function(){return z});class J{constructor(D){this.element=D,this.next=J.Undefined,this.prev=J.Undefined}}J.Undefined=new J(void 0);class z{constructor(){this._first=J.Undefined,this._last=J.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===J.Undefined}clear(){let D=this._first;for(;D!==J.Undefined;){const V=D.next;D.prev=J.Undefined,D.next=J.Undefined,D=V}this._first=J.Undefined,this._last=J.Undefined,this._size=0}unshift(D){return this._insert(D,!1)}push(D){return this._insert(D,!0)}_insert(D,V){const N=new J(D);if(this._first===J.Undefined)this._first=N,this._last=N;else if(V){const K=this._last;this._last=N,N.prev=K,K.next=N}else{const K=this._first;this._first=N,N.next=K,K.prev=N}this._size+=1;let O=!1;return()=>{O||(O=!0,this._remove(N))}}shift(){if(this._first===J.Undefined)return;{const D=this._first.element;return this._remove(this._first),D}}pop(){if(this._last===J.Undefined)return;{const D=this._last.element;return this._remove(this._last),D}}_remove(D){if(D.prev!==J.Undefined&&D.next!==J.Undefined){const V=D.prev;V.next=D.next,D.next.prev=V}else D.prev===J.Undefined&&D.next===J.Undefined?(this._first=J.Undefined,this._last=J.Undefined):D.next===J.Undefined?(this._last=this._last.prev,this._last.next=J.Undefined):D.prev===J.Undefined&&(this._first=this._first.next,this._first.prev=J.Undefined);this._size-=1}*[Symbol.iterator](){let D=this._first;for(;D!==J.Undefined;)yield D.element,D=D.next}}},"3/fG":function(Ue,de,M){"use strict";M.d(de,"a",function(){return z});function J(D,V){let N;return V.length===0?N=D:N=D.replace(/\{(\d+)\}/g,function(O,K){const W=K[0];return typeof V[W]!="undefined"?V[W]:O}),N}function z(D,V,...N){return J(V,N)}},"55Ip":function(Ue,de,M){"use strict";M.d(de,"a",function(){return r});var J=M("Ty5D"),z=M("dI71"),D=M("q1tI"),V=M.n(D),N=M("YS25"),O=M("17x9"),K=M.n(O),W=M("wx14"),n=M("zLVn"),I=M("9R94"),g=function(b){Object(z.a)(m,b);function m(){for(var C,E=arguments.length,v=new Array(E),P=0;P<E;P++)v[P]=arguments[P];return C=b.call.apply(b,[this].concat(v))||this,C.history=Object(N.a)(C.props),C}var p=m.prototype;return p.render=function(){return V.a.createElement(J.c,{history:this.history,children:this.props.children})},m}(V.a.Component),f=function(b){Object(z.a)(m,b);function m(){for(var C,E=arguments.length,v=new Array(E),P=0;P<E;P++)v[P]=arguments[P];return C=b.call.apply(b,[this].concat(v))||this,C.history=Object(N.b)(C.props),C}var p=m.prototype;return p.render=function(){return V.a.createElement(J.c,{history:this.history,children:this.props.children})},m}(V.a.Component),h=function(m,p){return typeof m=="function"?m(p):m},c=function(m,p){return typeof m=="string"?Object(N.c)(m,null,null,p):m},s=function(m){return m},d=V.a.forwardRef;typeof d=="undefined"&&(d=s);function i(b){return!!(b.metaKey||b.altKey||b.ctrlKey||b.shiftKey)}var a=d(function(b,m){var p=b.innerRef,C=b.navigate,E=b.onClick,v=Object(n.a)(b,["innerRef","navigate","onClick"]),P=v.target,F=Object(W.a)({},v,{onClick:function(H){try{E&&E(H)}catch(U){throw H.preventDefault(),U}!H.defaultPrevented&&H.button===0&&(!P||P==="_self")&&!i(H)&&(H.preventDefault(),C())}});return s!==d?F.ref=m||p:F.ref=p,V.a.createElement("a",F)}),r=d(function(b,m){var p=b.component,C=p===void 0?a:p,E=b.replace,v=b.to,P=b.innerRef,F=Object(n.a)(b,["component","replace","to","innerRef"]);return V.a.createElement(J.e.Consumer,null,function(R){R||Object(I.a)(!1);var H=R.history,U=c(h(v,R.location),R.location),S=U?H.createHref(U):"",G=Object(W.a)({},F,{href:S,navigate:function(){var se=h(v,R.location),fe=E?H.replace:H.push;fe(se)}});return s!==d?G.ref=m||P:G.innerRef=P,V.a.createElement(C,G)})});if(!1)var o,T;var w=function(m){return m},x=V.a.forwardRef;typeof x=="undefined"&&(x=w);function L(){for(var b=arguments.length,m=new Array(b),p=0;p<b;p++)m[p]=arguments[p];return m.filter(function(C){return C}).join(" ")}var A=x(function(b,m){var p=b["aria-current"],C=p===void 0?"page":p,E=b.activeClassName,v=E===void 0?"active":E,P=b.activeStyle,F=b.className,R=b.exact,H=b.isActive,U=b.location,S=b.sensitive,G=b.strict,Q=b.style,se=b.to,fe=b.innerRef,we=Object(n.a)(b,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return V.a.createElement(J.e.Consumer,null,function(be){be||Object(I.a)(!1);var Se=U||be.location,Ae=c(h(se,Se),Se),De=Ae.pathname,ve=De&&De.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),Y=ve?Object(J.f)(Se.pathname,{path:ve,exact:R,sensitive:S,strict:G}):null,k=!!(H?H(Y,Se):Y),B=k?L(F,v):F,Z=k?Object(W.a)({},Q,{},P):Q,re=Object(W.a)({"aria-current":k&&C||null,className:B,style:Z,to:Ae},we);return w!==x?re.ref=m||fe:re.innerRef=fe,V.a.createElement(r,re)})});if(!1)var _},"5VLF":function(Ue,de,M){"use strict";var J,z;function D(V,N,O){var K=function(W,n){return V.js_beautify(W,n)};return K.js=V.js_beautify,K.css=N.css_beautify,K.html=O.html_beautify,K.js_beautify=V.js_beautify,K.css_beautify=N.css_beautify,K.html_beautify=O.html_beautify,K}!(J=[M("6UM0"),M("TXwP"),M("psGv")],z=function(V,N,O){return D(V,N,O)}.apply(de,J),z!==void 0&&(Ue.exports=z))},"5Y4S":function(Ue,de,M){"use strict";M.d(de,"a",function(){return D});var J=M("MNsG");const z=J.b.performance&&typeof J.b.performance.now=="function";class D{constructor(V){this._highResolution=z&&V,this._startTime=this._now(),this._stopTime=-1}static create(V=!0){return new D(V)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?J.b.performance.now():Date.now()}}},"5nXd":function(Ue,de,M){var J=M("MFOe"),z=J.slice,D=J.pluck,V=J.each,N=J.bind,O=J.create,K=J.isList,W=J.isFunction,n=J.isObject;Ue.exports={createStore:f};var I={version:"2.0.12",enabled:!1,get:function(h,c){var s=this.storage.read(this._namespacePrefix+h);return this._deserialize(s,c)},set:function(h,c){return c===void 0?this.remove(h):(this.storage.write(this._namespacePrefix+h,this._serialize(c)),c)},remove:function(h){this.storage.remove(this._namespacePrefix+h)},each:function(h){var c=this;this.storage.each(function(s,d){h.call(c,c._deserialize(s),(d||"").replace(c._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(h){return this._namespacePrefix=="__storejs_"+h+"_"},createStore:function(){return f.apply(this,arguments)},addPlugin:function(h){this._addPlugin(h)},namespace:function(h){return f(this.storage,this.plugins,h)}};function g(){var h=typeof console=="undefined"?null:console;if(!h)return;var c=h.warn?h.warn:h.log;c.apply(h,arguments)}function f(h,c,s){s||(s=""),h&&!K(h)&&(h=[h]),c&&!K(c)&&(c=[c]);var d=s?"__storejs_"+s+"_":"",i=s?new RegExp("^"+d):null,a=/^[a-zA-Z0-9_\-]*$/;if(!a.test(s))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var r={_namespacePrefix:d,_namespaceRegexp:i,_testStorage:function(T){try{var w="__storejs__test__";T.write(w,w);var x=T.read(w)===w;return T.remove(w),x}catch(L){return!1}},_assignPluginFnProp:function(T,w){var x=this[w];this[w]=function(){var A=z(arguments,0),_=this;function b(){return x?(V(arguments,function(p,C){A[C]=p}),x.apply(_,A)):void 0}var m=[b].concat(A);return T.apply(_,m)}},_serialize:function(T){return JSON.stringify(T)},_deserialize:function(T,w){if(!T)return w;var x="";try{x=JSON.parse(T)}catch(L){x=T}return x!==void 0?x:w},_addStorage:function(T){if(this.enabled)return;this._testStorage(T)&&(this.storage=T,this.enabled=!0)},_addPlugin:function(T){var w=this;if(K(T)){V(T,function(A){w._addPlugin(A)});return}var x=D(this.plugins,function(A){return T===A});if(x)return;if(this.plugins.push(T),!W(T))throw new Error("Plugins must be function values that return objects");var L=T.call(this);if(!n(L))throw new Error("Plugins must return an object of function properties");V(L,function(A,_){if(!W(A))throw new Error("Bad plugin property: "+_+" from plugin "+T.name+". Plugins should only return functions.");w._assignPluginFnProp(A,_)})},addStorage:function(T){g("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(T)}},o=O(r,I,{plugins:[]});return o.raw={},V(o,function(T,w){W(T)&&(o.raw[w]=N(o,T))}),V(h,function(T){o._addStorage(T)}),V(c,function(T){o._addPlugin(T)}),o}},"6+eU":function(Ue,de,M){"use strict";M.d(de,"a",function(){return x});var J=M("wx14"),z=M("rePB"),D=M("VTBJ"),V=M("1OyB"),N=M("vuIU"),O=M("Ji7U"),K=M("LK+K"),W=M("q1tI"),n=M.n(W),I=M("TSYQ"),g=M.n(I),f=function(A){var _,b="".concat(A.rootPrefixCls,"-item"),m=g()(b,"".concat(b,"-").concat(A.page),(_={},Object(z.a)(_,"".concat(b,"-active"),A.active),Object(z.a)(_,A.className,!!A.className),Object(z.a)(_,"".concat(b,"-disabled"),!A.page),_)),p=function(){A.onClick(A.page)},C=function(v){A.onKeyPress(v,A.onClick,A.page)};return n.a.createElement("li",{title:A.showTitle?A.page:null,className:m,onClick:p,onKeyPress:C,tabIndex:"0"},A.itemRender(A.page,"page",n.a.createElement("a",{rel:"nofollow"},A.page)))},h=f,c={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},s=function(L){Object(O.a)(_,L);var A=Object(K.a)(_);function _(){var b;Object(V.a)(this,_);for(var m=arguments.length,p=new Array(m),C=0;C<m;C++)p[C]=arguments[C];return b=A.call.apply(A,[this].concat(p)),b.state={goInputText:""},b.buildOptionText=function(E){return"".concat(E," ").concat(b.props.locale.items_per_page)},b.changeSize=function(E){b.props.changeSize(Number(E))},b.handleChange=function(E){b.setState({goInputText:E.target.value})},b.handleBlur=function(E){var v=b.props,P=v.goButton,F=v.quickGo,R=v.rootPrefixCls,H=b.state.goInputText;if(P||H==="")return;if(E.relatedTarget&&(E.relatedTarget.className.indexOf("".concat(R,"-prev"))>=0||E.relatedTarget.className.indexOf("".concat(R,"-next"))>=0))return;b.setState({goInputText:""}),F(b.getValidValue())},b.go=function(E){var v=b.state.goInputText;if(v==="")return;(E.keyCode===c.ENTER||E.type==="click")&&(b.setState({goInputText:""}),b.props.quickGo(b.getValidValue()))},b}return Object(N.a)(_,[{key:"getValidValue",value:function(){var m=this.state,p=m.goInputText,C=m.current;return!p||isNaN(p)?C:Number(p)}},{key:"getPageSizeOptions",value:function(){var m=this.props,p=m.pageSize,C=m.pageSizeOptions;return C.some(function(E){return E.toString()===p.toString()})?C:C.concat([p.toString()]).sort(function(E,v){var P=isNaN(Number(E))?0:Number(E),F=isNaN(Number(v))?0:Number(v);return P-F})}},{key:"render",value:function(){var m=this,p=this.props,C=p.pageSize,E=p.locale,v=p.rootPrefixCls,P=p.changeSize,F=p.quickGo,R=p.goButton,H=p.selectComponentClass,U=p.buildOptionText,S=p.selectPrefixCls,G=p.disabled,Q=this.state.goInputText,se="".concat(v,"-options"),fe=H,we=null,be=null,Se=null;if(!P&&!F)return null;var Ae=this.getPageSizeOptions();if(P&&fe){var De=Ae.map(function(ve,Y){return n.a.createElement(fe.Option,{key:Y,value:ve.toString()},(U||m.buildOptionText)(ve))});we=n.a.createElement(fe,{disabled:G,prefixCls:S,showSearch:!1,className:"".concat(se,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(C||Ae[0]).toString(),onChange:this.changeSize,getPopupContainer:function(Y){return Y.parentNode}},De)}return F&&(R&&(Se=typeof R=="boolean"?n.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:G,className:"".concat(se,"-quick-jumper-button")},E.jump_to_confirm):n.a.createElement("span",{onClick:this.go,onKeyUp:this.go},R)),be=n.a.createElement("div",{className:"".concat(se,"-quick-jumper")},E.jump_to,n.a.createElement("input",{disabled:G,type:"text",value:Q,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),E.page,Se)),n.a.createElement("li",{className:"".concat(se)},we,be)}}]),_}(n.a.Component);s.defaultProps={pageSizeOptions:["10","20","50","100"]};var d=s,i=M("N2Kk");function a(){}function r(L){return typeof L=="number"&&isFinite(L)&&Math.floor(L)===L}function o(L,A,_){return _}function T(L,A,_){var b=typeof L=="undefined"?A.pageSize:L;return Math.floor((_.total-1)/b)+1}var w=function(L){Object(O.a)(_,L);var A=Object(K.a)(_);function _(b){var m;Object(V.a)(this,_),m=A.call(this,b),m.getJumpPrevPage=function(){return Math.max(1,m.state.current-(m.props.showLessItems?3:5))},m.getJumpNextPage=function(){return Math.min(T(void 0,m.state,m.props),m.state.current+(m.props.showLessItems?3:5))},m.getItemIcon=function(P,F){var R=m.props.prefixCls,H=P||n.a.createElement("button",{type:"button","aria-label":F,className:"".concat(R,"-item-link")});return typeof P=="function"&&(H=n.a.createElement(P,Object(D.a)({},m.props))),H},m.savePaginationNode=function(P){m.paginationNode=P},m.isValid=function(P){return r(P)&&P!==m.state.current},m.shouldDisplayQuickJumper=function(){var P=m.props,F=P.showQuickJumper,R=P.pageSize,H=P.total;return H<=R?!1:F},m.handleKeyDown=function(P){(P.keyCode===c.ARROW_UP||P.keyCode===c.ARROW_DOWN)&&P.preventDefault()},m.handleKeyUp=function(P){var F=m.getValidValue(P),R=m.state.currentInputValue;F!==R&&m.setState({currentInputValue:F}),P.keyCode===c.ENTER?m.handleChange(F):P.keyCode===c.ARROW_UP?m.handleChange(F-1):P.keyCode===c.ARROW_DOWN&&m.handleChange(F+1)},m.changePageSize=function(P){var F=m.state.current,R=T(P,m.state,m.props);F=F>R?R:F,R===0&&(F=m.state.current),typeof P=="number"&&("pageSize"in m.props||m.setState({pageSize:P}),"current"in m.props||m.setState({current:F,currentInputValue:F})),m.props.onShowSizeChange(F,P),"onChange"in m.props&&m.props.onChange&&m.props.onChange(F,P)},m.handleChange=function(P){var F=m.props.disabled,R=P;if(m.isValid(R)&&!F){var H=T(void 0,m.state,m.props);R>H?R=H:R<1&&(R=1),"current"in m.props||m.setState({current:R,currentInputValue:R});var U=m.state.pageSize;return m.props.onChange(R,U),R}return m.state.current},m.prev=function(){m.hasPrev()&&m.handleChange(m.state.current-1)},m.next=function(){m.hasNext()&&m.handleChange(m.state.current+1)},m.jumpPrev=function(){m.handleChange(m.getJumpPrevPage())},m.jumpNext=function(){m.handleChange(m.getJumpNextPage())},m.hasPrev=function(){return m.state.current>1},m.hasNext=function(){return m.state.current<T(void 0,m.state,m.props)},m.runIfEnter=function(P,F){if(P.key==="Enter"||P.charCode===13){for(var R=arguments.length,H=new Array(R>2?R-2:0),U=2;U<R;U++)H[U-2]=arguments[U];F.apply(void 0,H)}},m.runIfEnterPrev=function(P){m.runIfEnter(P,m.prev)},m.runIfEnterNext=function(P){m.runIfEnter(P,m.next)},m.runIfEnterJumpPrev=function(P){m.runIfEnter(P,m.jumpPrev)},m.runIfEnterJumpNext=function(P){m.runIfEnter(P,m.jumpNext)},m.handleGoTO=function(P){(P.keyCode===c.ENTER||P.type==="click")&&m.handleChange(m.state.currentInputValue)};var p=b.onChange!==a,C="current"in b;C&&!p&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var E=b.defaultCurrent;"current"in b&&(E=b.current);var v=b.defaultPageSize;return"pageSize"in b&&(v=b.pageSize),E=Math.min(E,T(v,void 0,b)),m.state={current:E,currentInputValue:E,pageSize:v},m}return Object(N.a)(_,[{key:"componentDidUpdate",value:function(m,p){var C=this.props.prefixCls;if(p.current!==this.state.current&&this.paginationNode){var E=this.paginationNode.querySelector(".".concat(C,"-item-").concat(p.current));E&&document.activeElement===E&&E.blur()}}},{key:"getValidValue",value:function(m){var p=m.target.value,C=T(void 0,this.state,this.props),E=this.state.currentInputValue,v;return p===""?v=p:isNaN(Number(p))?v=E:p>=C?v=C:v=Number(p),v}},{key:"getShowSizeChanger",value:function(){var m=this.props,p=m.showSizeChanger,C=m.total,E=m.totalBoundaryShowSizeChanger;return typeof p!="undefined"?p:C>E}},{key:"renderPrev",value:function(m){var p=this.props,C=p.prevIcon,E=p.itemRender,v=E(m,"prev",this.getItemIcon(C,"prev page")),P=!this.hasPrev();return Object(W.isValidElement)(v)?Object(W.cloneElement)(v,{disabled:P}):v}},{key:"renderNext",value:function(m){var p=this.props,C=p.nextIcon,E=p.itemRender,v=E(m,"next",this.getItemIcon(C,"next page")),P=!this.hasNext();return Object(W.isValidElement)(v)?Object(W.cloneElement)(v,{disabled:P}):v}},{key:"render",value:function(){var m=this,p=this.props,C=p.prefixCls,E=p.className,v=p.style,P=p.disabled,F=p.hideOnSinglePage,R=p.total,H=p.locale,U=p.showQuickJumper,S=p.showLessItems,G=p.showTitle,Q=p.showTotal,se=p.simple,fe=p.itemRender,we=p.showPrevNextJumpers,be=p.jumpPrevIcon,Se=p.jumpNextIcon,Ae=p.selectComponentClass,De=p.selectPrefixCls,ve=p.pageSizeOptions,Y=this.state,k=Y.current,B=Y.pageSize,Z=Y.currentInputValue;if(F===!0&&R<=B)return null;var re=T(void 0,this.state,this.props),X=[],ye=null,Me=null,He=null,me=null,Ee=null,Le=U&&U.goButton,Pe=S?1:2,Ye=k-1>0?k-1:0,tt=k+1<re?k+1:re,ut=Object.keys(this.props).reduce(function(ie,oe){return(oe.substr(0,5)==="data-"||oe.substr(0,5)==="aria-"||oe==="role")&&(ie[oe]=m.props[oe]),ie},{});if(se)return Le&&(typeof Le=="boolean"?Ee=n.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},H.jump_to_confirm):Ee=n.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Le),Ee=n.a.createElement("li",{title:G?"".concat(H.jump_to).concat(k,"/").concat(re):null,className:"".concat(C,"-simple-pager")},Ee)),n.a.createElement("ul",Object(J.a)({className:g()(C,"".concat(C,"-simple"),Object(z.a)({},"".concat(C,"-disabled"),P),E),style:v,ref:this.savePaginationNode},ut),n.a.createElement("li",{title:G?H.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:g()("".concat(C,"-prev"),Object(z.a)({},"".concat(C,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(Ye)),n.a.createElement("li",{title:G?"".concat(k,"/").concat(re):null,className:"".concat(C,"-simple-pager")},n.a.createElement("input",{type:"text",value:Z,disabled:P,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),n.a.createElement("span",{className:"".concat(C,"-slash")},"/"),re),n.a.createElement("li",{title:G?H.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:g()("".concat(C,"-next"),Object(z.a)({},"".concat(C,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(tt)),Ee);if(re<=3+Pe*2){var lt={locale:H,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:G,itemRender:fe};re||X.push(n.a.createElement(h,Object(J.a)({},lt,{key:"noPager",page:re,className:"".concat(C,"-disabled")})));for(var gt=1;gt<=re;gt+=1){var ht=k===gt;X.push(n.a.createElement(h,Object(J.a)({},lt,{key:gt,page:gt,active:ht})))}}else{var Ie=S?H.prev_3:H.prev_5,Re=S?H.next_3:H.next_5;we&&(ye=n.a.createElement("li",{title:G?Ie:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:g()("".concat(C,"-jump-prev"),Object(z.a)({},"".concat(C,"-jump-prev-custom-icon"),!!be))},fe(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(be,"prev page"))),Me=n.a.createElement("li",{title:G?Re:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:g()("".concat(C,"-jump-next"),Object(z.a)({},"".concat(C,"-jump-next-custom-icon"),!!Se))},fe(this.getJumpNextPage(),"jump-next",this.getItemIcon(Se,"next page")))),me=n.a.createElement(h,{locale:H,last:!0,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:re,page:re,active:!1,showTitle:G,itemRender:fe}),He=n.a.createElement(h,{locale:H,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:G,itemRender:fe});var $e=Math.max(1,k-Pe),Ze=Math.min(k+Pe,re);k-1<=Pe&&(Ze=1+Pe*2),re-k<=Pe&&($e=re-Pe*2);for(var ue=$e;ue<=Ze;ue+=1){var q=k===ue;X.push(n.a.createElement(h,{locale:H,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:ue,page:ue,active:q,showTitle:G,itemRender:fe}))}k-1>=Pe*2&&k!==1+2&&(X[0]=Object(W.cloneElement)(X[0],{className:"".concat(C,"-item-after-jump-prev")}),X.unshift(ye)),re-k>=Pe*2&&k!==re-2&&(X[X.length-1]=Object(W.cloneElement)(X[X.length-1],{className:"".concat(C,"-item-before-jump-next")}),X.push(Me)),$e!==1&&X.unshift(He),Ze!==re&&X.push(me)}var te=null;Q&&(te=n.a.createElement("li",{className:"".concat(C,"-total-text")},Q(R,[R===0?0:(k-1)*B+1,k*B>R?R:k*B])));var ae=!this.hasPrev()||!re,ce=!this.hasNext()||!re;return n.a.createElement("ul",Object(J.a)({className:g()(C,E,Object(z.a)({},"".concat(C,"-disabled"),P)),style:v,unselectable:"unselectable",ref:this.savePaginationNode},ut),te,n.a.createElement("li",{title:G?H.prev_page:null,onClick:this.prev,tabIndex:ae?null:0,onKeyPress:this.runIfEnterPrev,className:g()("".concat(C,"-prev"),Object(z.a)({},"".concat(C,"-disabled"),ae)),"aria-disabled":ae},this.renderPrev(Ye)),X,n.a.createElement("li",{title:G?H.next_page:null,onClick:this.next,tabIndex:ce?null:0,onKeyPress:this.runIfEnterNext,className:g()("".concat(C,"-next"),Object(z.a)({},"".concat(C,"-disabled"),ce)),"aria-disabled":ce},this.renderNext(tt)),n.a.createElement(d,{disabled:P,locale:H,rootPrefixCls:C,selectComponentClass:Ae,selectPrefixCls:De,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:k,pageSize:B,pageSizeOptions:ve,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Le}))}}],[{key:"getDerivedStateFromProps",value:function(m,p){var C={};if("current"in m&&(C.current=m.current,m.current!==p.current&&(C.currentInputValue=C.current)),"pageSize"in m&&m.pageSize!==p.pageSize){var E=p.current,v=T(m.pageSize,p,m);E=E>v?v:E,"current"in m||(C.current=E,C.currentInputValue=E),C.pageSize=m.pageSize}return C}}]),_}(n.a.Component);w.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:i.a,style:{},itemRender:o,totalBoundaryShowSizeChanger:50};var x=w},"6RRn":function(Ue,de,M){"use strict";var J=M("wCXF"),z=M("n6Qo");M.d(de,"b",function(){return z.a});var D=M("IBYe"),V=M("6eGT"),N=M("hW8S");M.d(de,"a",function(){return N.a}),de.c=J.b},"6UM0":function(Ue,de,M){var J,z;(function(){var D;(function(){"use strict";var N=[function(n,I,g){var f=g(1).Beautifier,h=g(5).Options;function c(s,d){var i=new f(s,d);return i.beautify()}n.exports=c,n.exports.defaultOptions=function(){return new h}},function(n,I,g){var f=g(2).Output,h=g(3).Token,c=g(4),s=g(5).Options,d=g(7).Tokenizer,i=g(7).line_starters,a=g(7).positionable_operators,r=g(7).TOKEN;function o(S,G){return G.indexOf(S)!==-1}function T(S){return S.replace(/^\s+/g,"")}function w(S){for(var G={},Q=0;Q<S.length;Q++)G[S[Q].replace(/-/g,"_")]=S[Q];return G}function x(S,G){return S&&S.type===r.RESERVED&&S.text===G}function L(S,G){return S&&S.type===r.RESERVED&&o(S.text,G)}var A=["case","return","do","if","throw","else","await","break","continue","async"],_=["before-newline","after-newline","preserve-newline"],b=w(_),m=[b.before_newline,b.preserve_newline],p={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function C(S,G){if(G.multiline_frame||G.mode===p.ForInitializer||G.mode===p.Conditional)return;S.remove_indent(G.start_line_index)}function E(S){S=S.replace(c.allLineBreaks,`
`);for(var G=[],Q=S.indexOf(`
`);Q!==-1;)G.push(S.substring(0,Q)),S=S.substring(Q+1),Q=S.indexOf(`
`);return S.length&&G.push(S),G}function v(S){return S===p.ArrayLiteral}function P(S){return o(S,[p.Expression,p.ForInitializer,p.Conditional])}function F(S,G){for(var Q=0;Q<S.length;Q++){var se=S[Q].trim();if(se.charAt(0)!==G)return!1}return!0}function R(S,G){for(var Q=0,se=S.length,fe;Q<se;Q++)if(fe=S[Q],fe&&fe.indexOf(G)!==0)return!1;return!0}function H(S,G){G=G||{},this._source_text=S||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new s(G)}H.prototype.create_flags=function(S,G){var Q=0;S&&(Q=S.indentation_level,!this._output.just_added_newline()&&S.line_indent_level>Q&&(Q=S.line_indent_level));var se={mode:G,parent:S,last_token:S?S.last_token:new h(r.START_BLOCK,""),last_word:S?S.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:S?S.line_indent_level:Q,start_line_index:this._output.get_line_number(),ternary_depth:0};return se},H.prototype._reset=function(S){var G=S.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(p.BlockStatement);var Q=new d(S,this._options);return this._tokens=Q.tokenize(),S},H.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var S,G=this._reset(this._source_text),Q=this._options.eol;this._options.eol==="auto"&&(Q=`
`,G&&c.lineBreak.test(G||"")&&(Q=G.match(c.lineBreak)[0]));for(var se=this._tokens.next();se;)this.handle_token(se),this._last_last_text=this._flags.last_token.text,this._flags.last_token=se,se=this._tokens.next();return S=this._output.get_code(Q),S},H.prototype.handle_token=function(S,G){S.type===r.START_EXPR?this.handle_start_expr(S):S.type===r.END_EXPR?this.handle_end_expr(S):S.type===r.START_BLOCK?this.handle_start_block(S):S.type===r.END_BLOCK?this.handle_end_block(S):S.type===r.WORD?this.handle_word(S):S.type===r.RESERVED?this.handle_word(S):S.type===r.SEMICOLON?this.handle_semicolon(S):S.type===r.STRING?this.handle_string(S):S.type===r.EQUALS?this.handle_equals(S):S.type===r.OPERATOR?this.handle_operator(S):S.type===r.COMMA?this.handle_comma(S):S.type===r.BLOCK_COMMENT?this.handle_block_comment(S,G):S.type===r.COMMENT?this.handle_comment(S,G):S.type===r.DOT?this.handle_dot(S):S.type===r.EOF?this.handle_eof(S):S.type===r.UNKNOWN?this.handle_unknown(S,G):this.handle_unknown(S,G)},H.prototype.handle_whitespace_and_comments=function(S,G){var Q=S.newlines,se=this._options.keep_array_indentation&&v(this._flags.mode);if(S.comments_before)for(var fe=S.comments_before.next();fe;)this.handle_whitespace_and_comments(fe,G),this.handle_token(fe,G),fe=S.comments_before.next();if(se)for(var we=0;we<Q;we+=1)this.print_newline(we>0,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 be=1;be<Q;be+=1)this.print_newline(!0,G)}};var U=["async","break","continue","return","throw","yield"];H.prototype.allow_wrap_or_preserved_newline=function(S,G){if(G=G===void 0?!1:G,this._output.just_added_newline())return;var Q=this._options.preserve_newlines&&S.newlines||G,se=o(this._flags.last_token.text,a)||o(S.text,a);if(se){var fe=o(this._flags.last_token.text,a)&&o(this._options.operator_position,m)||o(S.text,a);Q=Q&&fe}if(Q)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(L(this._flags.last_token,U))return;this._output.set_wrap_point()}},H.prototype.print_newline=function(S,G){if(!G&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==r.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var Q=this._tokens.peek();this._flags.mode===p.Statement&&!(this._flags.if_block&&x(Q,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(S)&&(this._flags.multiline_frame=!0)},H.prototype.print_token_line_indentation=function(S){this._output.just_added_newline()&&(this._options.keep_array_indentation&&S.newlines&&(S.text==="["||v(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(S.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},H.prototype.print_token=function(S){if(this._output.raw){this._output.add_raw_token(S);return}if(this._options.comma_first&&S.previous&&S.previous.type===r.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var G=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(G),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(S),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(S),this._output.non_breaking_space=!0,this._output.add_token(S.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},H.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},H.prototype.deindent=function(){this._flags.indentation_level>0&&(!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))},H.prototype.set_mode=function(S){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,S),this._flags=this.create_flags(this._previous_flags,S),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},H.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===p.Statement&&C(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},H.prototype.start_of_object_property=function(){return this._flags.parent.mode===p.ObjectLiteral&&this._flags.mode===p.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||L(this._flags.last_token,["get","set"]))},H.prototype.start_of_statement=function(S){var G=!1;return G=G||L(this._flags.last_token,["var","let","const"])&&S.type===r.WORD,G=G||x(this._flags.last_token,"do"),G=G||!(this._flags.parent.mode===p.ObjectLiteral&&this._flags.mode===p.Statement)&&L(this._flags.last_token,U)&&!S.newlines,G=G||x(this._flags.last_token,"else")&&!(x(S,"if")&&!S.comments_before),G=G||this._flags.last_token.type===r.END_EXPR&&(this._previous_flags.mode===p.ForInitializer||this._previous_flags.mode===p.Conditional),G=G||this._flags.last_token.type===r.WORD&&this._flags.mode===p.BlockStatement&&!this._flags.in_case&&!(S.text==="--"||S.text==="++")&&this._last_last_text!=="function"&&S.type!==r.WORD&&S.type!==r.RESERVED,G=G||this._flags.mode===p.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||L(this._flags.last_token,["get","set"])),G?(this.set_mode(p.Statement),this.indent(),this.handle_whitespace_and_comments(S,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(S,L(S,["do","for","if","while"])),!0):!1},H.prototype.handle_start_expr=function(S){this.start_of_statement(S)||this.handle_whitespace_and_comments(S);var G=p.Expression;if(S.text==="["){if(this._flags.last_token.type===r.WORD||this._flags.last_token.text===")"){L(this._flags.last_token,i)&&(this._output.space_before_token=!0),this.print_token(S),this.set_mode(G),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}G=p.ArrayLiteral,v(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())),o(this._flags.last_token.type,[r.START_EXPR,r.END_EXPR,r.WORD,r.OPERATOR,r.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===r.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,G=p.ForInitializer):o(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,G=p.Conditional):o(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&S.whitespace_before===""?this._output.space_before_token=!1:(o(this._flags.last_token.text,i)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===r.EQUALS||this._flags.last_token.type===r.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(S);else if(this._flags.last_token.type===r.WORD){this._output.space_before_token=!1;var Q=this._tokens.peek(-3);if(this._options.space_after_named_function&&Q){var se=this._tokens.peek(-4);L(Q,["async","function"])||Q.text==="*"&&L(se,["async","function"])?this._output.space_before_token=!0:this._flags.mode===p.ObjectLiteral?(Q.text==="{"||Q.text===","||Q.text==="*"&&(se.text==="{"||se.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(S);(this._flags.last_token.type===r.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(o(this._last_last_text,["function","yield"])||this._flags.mode===p.ObjectLiteral&&o(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===r.START_BLOCK?this.print_newline():(this._flags.last_token.type===r.END_EXPR||this._flags.last_token.type===r.START_EXPR||this._flags.last_token.type===r.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===r.COMMA)&&this.allow_wrap_or_preserved_newline(S,S.newlines),this.print_token(S),this.set_mode(G),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},H.prototype.handle_end_expr=function(S){for(;this._flags.mode===p.Statement;)this.restore_mode();this.handle_whitespace_and_comments(S),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(S,S.text==="]"&&v(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===r.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(S),this.restore_mode(),C(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===p.Conditional&&(this._previous_flags.mode=p.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},H.prototype.handle_start_block=function(S){this.handle_whitespace_and_comments(S);var G=this._tokens.peek(),Q=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===r.END_EXPR?(this.set_mode(p.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(p.BlockStatement):Q&&(o(Q.text,[":",","])&&o(G.type,[r.STRING,r.WORD,r.RESERVED])||o(G.text,["get","set","..."])&&o(Q.type,[r.WORD,r.RESERVED]))?o(this._last_last_text,["class","interface"])&&!o(Q.text,[":",","])?this.set_mode(p.BlockStatement):this.set_mode(p.ObjectLiteral):this._flags.last_token.type===r.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(p.BlockStatement):o(this._flags.last_token.type,[r.EQUALS,r.START_EXPR,r.COMMA,r.OPERATOR])||L(this._flags.last_token,["return","throw","import","default"])?this.set_mode(p.ObjectLiteral):this.set_mode(p.BlockStatement),this._flags.last_token&&(L(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var se=!G.comments_before&&G.text==="}",fe=se&&this._flags.last_word==="function"&&this._flags.last_token.type===r.END_EXPR;if(this._options.brace_preserve_inline){var we=0,be=null;this._flags.inline_frame=!0;do if(we+=1,be=this._tokens.peek(we-1),be.newlines){this._flags.inline_frame=!1;break}while(be.type!==r.EOF&&!(be.type===r.END_BLOCK&&be.opened===S))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&S.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==r.OPERATOR&&(fe||this._flags.last_token.type===r.EQUALS||L(this._flags.last_token,A)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(v(this._previous_flags.mode)&&(this._flags.last_token.type===r.START_EXPR||this._flags.last_token.type===r.COMMA)&&((this._flags.last_token.type===r.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(S),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==r.OPERATOR&&this._flags.last_token.type!==r.START_EXPR&&(this._flags.last_token.type===r.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(S),this.indent(),!se&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},H.prototype.handle_end_block=function(S){for(this.handle_whitespace_and_comments(S);this._flags.mode===p.Statement;)this.restore_mode();var G=this._flags.last_token.type===r.START_BLOCK;this._flags.inline_frame&&!G?this._output.space_before_token=!0:this._options.brace_style==="expand"?G||this.print_newline():G||(v(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(S)},H.prototype.handle_word=function(S){if(S.type===r.RESERVED){if(o(S.text,["set","get"])&&this._flags.mode!==p.ObjectLiteral)S.type=r.WORD;else if(S.text==="import"&&o(this._tokens.peek().text,["(","."]))S.type=r.WORD;else if(o(S.text,["as","from"])&&!this._flags.import_block)S.type=r.WORD;else if(this._flags.mode===p.ObjectLiteral){var G=this._tokens.peek();G.text===":"&&(S.type=r.WORD)}}if(this.start_of_statement(S)?L(this._flags.last_token,["var","let","const"])&&S.type===r.WORD&&(this._flags.declaration_statement=!0):S.newlines&&!P(this._flags.mode)&&(this._flags.last_token.type!==r.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==r.EQUALS&&(this._options.preserve_newlines||!L(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(S),this.print_newline()):this.handle_whitespace_and_comments(S),this._flags.do_block&&!this._flags.do_while)if(x(S,"while")){this._output.space_before_token=!0,this.print_token(S),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(S,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===p.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&L(S,["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(S),this._flags.in_case=!0;return}if((this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.START_EXPR||this._flags.last_token.type===r.EQUALS||this._flags.last_token.type===r.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(S)),x(S,"function")){(o(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(o(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===r.OPERATOR))&&(!this._output.just_added_blankline()&&!S.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===r.RESERVED||this._flags.last_token.type===r.WORD?L(this._flags.last_token,["get","set","new","export"])||L(this._flags.last_token,U)?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===r.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(P(this._flags.mode)||v(this._flags.mode))||this.print_newline(),this.print_token(S),this._flags.last_word=S.text;return}var Q="NONE";if(this._flags.last_token.type===r.END_BLOCK?this._previous_flags.inline_frame?Q="SPACE":L(S,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&S.newlines?Q="NEWLINE":(Q="SPACE",this._output.space_before_token=!0):Q="NEWLINE":this._flags.last_token.type===r.SEMICOLON&&this._flags.mode===p.BlockStatement?Q="NEWLINE":this._flags.last_token.type===r.SEMICOLON&&P(this._flags.mode)?Q="SPACE":this._flags.last_token.type===r.STRING?Q="NEWLINE":this._flags.last_token.type===r.RESERVED||this._flags.last_token.type===r.WORD||this._flags.last_token.text==="*"&&(o(this._last_last_text,["function","yield"])||this._flags.mode===p.ObjectLiteral&&o(this._last_last_text,["{",","]))?Q="SPACE":this._flags.last_token.type===r.START_BLOCK?this._flags.inline_frame?Q="SPACE":Q="NEWLINE":this._flags.last_token.type===r.END_EXPR&&(this._output.space_before_token=!0,Q="NEWLINE"),L(S,i)&&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"),L(S,["else","catch","finally"]))if((!(this._flags.last_token.type===r.END_BLOCK&&this._previous_flags.mode===p.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&S.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var se=this._output.current_line;se.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else Q==="NEWLINE"?L(this._flags.last_token,A)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&L(S,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==r.END_EXPR?(this._flags.last_token.type!==r.START_EXPR||!L(S,["var","let","const"]))&&this._flags.last_token.text!==":"&&(x(S,"if")&&x(S.previous,"else")?this._output.space_before_token=!0:this.print_newline()):L(S,i)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&v(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():Q==="SPACE"&&(this._output.space_before_token=!0);S.previous&&(S.previous.type===r.WORD||S.previous.type===r.RESERVED)&&(this._output.space_before_token=!0),this.print_token(S),this._flags.last_word=S.text,S.type===r.RESERVED&&(S.text==="do"?this._flags.do_block=!0:S.text==="if"?this._flags.if_block=!0:S.text==="import"?this._flags.import_block=!0:this._flags.import_block&&x(S,"from")&&(this._flags.import_block=!1))},H.prototype.handle_semicolon=function(S){this.start_of_statement(S)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(S);for(var G=this._tokens.peek();this._flags.mode===p.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(S)},H.prototype.handle_string=function(S){S.text.startsWith("`")&&S.newlines===0&&S.whitespace_before===""&&(S.previous.text===")"||this._flags.last_token.type===r.WORD)||(this.start_of_statement(S)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(S),this._flags.last_token.type===r.RESERVED||this._flags.last_token.type===r.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.START_EXPR||this._flags.last_token.type===r.EQUALS||this._flags.last_token.type===r.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(S):S.text.startsWith("`")&&this._flags.last_token.type===r.END_EXPR&&(S.previous.text==="]"||S.previous.text===")")&&S.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(S)},H.prototype.handle_equals=function(S){this.start_of_statement(S)||this.handle_whitespace_and_comments(S),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(S),this._output.space_before_token=!0},H.prototype.handle_comma=function(S){this.handle_whitespace_and_comments(S,!0),this.print_token(S),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(S)):this._flags.mode===p.ObjectLiteral||this._flags.mode===p.Statement&&this._flags.parent.mode===p.ObjectLiteral?(this._flags.mode===p.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(S)},H.prototype.handle_operator=function(S){var G=S.text==="*"&&(L(this._flags.last_token,["function","yield"])||o(this._flags.last_token.type,[r.START_BLOCK,r.COMMA,r.END_BLOCK,r.SEMICOLON])),Q=o(S.text,["-","+"])&&(o(this._flags.last_token.type,[r.START_BLOCK,r.START_EXPR,r.EQUALS,r.OPERATOR])||o(this._flags.last_token.text,i)||this._flags.last_token.text===",");if(!this.start_of_statement(S)){var se=!G;this.handle_whitespace_and_comments(S,se)}if(S.text==="*"&&this._flags.last_token.type===r.DOT){this.print_token(S);return}if(S.text==="::"){this.print_token(S);return}if(this._flags.last_token.type===r.OPERATOR&&o(this._options.operator_position,m)&&this.allow_wrap_or_preserved_newline(S),S.text===":"&&this._flags.in_case){this.print_token(S),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==r.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 fe=!0,we=!0,be=!1;if(S.text===":"?this._flags.ternary_depth===0?fe=!1:(this._flags.ternary_depth-=1,be=!0):S.text==="?"&&(this._flags.ternary_depth+=1),!Q&&!G&&this._options.preserve_newlines&&o(S.text,a)){var Se=S.text===":",Ae=Se&&be,De=Se&&!be;switch(this._options.operator_position){case b.before_newline:this._output.space_before_token=!De,this.print_token(S),(!Se||Ae)&&this.allow_wrap_or_preserved_newline(S),this._output.space_before_token=!0;return;case b.after_newline:this._output.space_before_token=!0,!Se||Ae?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(S):this._output.space_before_token=!1,this.print_token(S),this._output.space_before_token=!0;return;case b.preserve_newline:De||this.allow_wrap_or_preserved_newline(S),fe=!(this._output.just_added_newline()||De),this._output.space_before_token=fe,this.print_token(S),this._output.space_before_token=!0;return}}if(G){this.allow_wrap_or_preserved_newline(S),fe=!1;var ve=this._tokens.peek();we=ve&&o(ve.type,[r.WORD,r.RESERVED])}else if(S.text==="...")this.allow_wrap_or_preserved_newline(S),fe=this._flags.last_token.type===r.START_BLOCK,we=!1;else if(o(S.text,["--","++","!","~"])||Q){if((this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.START_EXPR)&&this.allow_wrap_or_preserved_newline(S),fe=!1,we=!1,S.newlines&&(S.text==="--"||S.text==="++"||S.text==="~")){var Y=L(this._flags.last_token,A)&&S.newlines;Y&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(Y,!0)}this._flags.last_token.text===";"&&P(this._flags.mode)&&(fe=!0),this._flags.last_token.type===r.RESERVED?fe=!0:this._flags.last_token.type===r.END_EXPR?fe=!(this._flags.last_token.text==="]"&&(S.text==="--"||S.text==="++")):this._flags.last_token.type===r.OPERATOR&&(fe=o(S.text,["--","-","++","+"])&&o(this._flags.last_token.text,["--","-","++","+"]),o(S.text,["+","-"])&&o(this._flags.last_token.text,["--","++"])&&(we=!0)),(this._flags.mode===p.BlockStatement&&!this._flags.inline_frame||this._flags.mode===p.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||fe,this.print_token(S),this._output.space_before_token=we},H.prototype.handle_block_comment=function(S,G){if(this._output.raw){this._output.add_raw_token(S),S.directives&&S.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(S.directives){this.print_newline(!1,G),this.print_token(S),S.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!c.newline.test(S.text)&&!S.newlines){this._output.space_before_token=!0,this.print_token(S),this._output.space_before_token=!0;return}else this.print_block_commment(S,G)},H.prototype.print_block_commment=function(S,G){var Q=E(S.text),se,fe=!1,we=!1,be=S.whitespace_before,Se=be.length;if(this.print_newline(!1,G),this.print_token_line_indentation(S),this._output.add_token(Q[0]),this.print_newline(!1,G),Q.length>1){for(Q=Q.slice(1),fe=F(Q,"*"),we=R(Q,be),fe&&(this._flags.alignment=1),se=0;se<Q.length;se++)fe?(this.print_token_line_indentation(S),this._output.add_token(T(Q[se]))):we&&Q[se]?(this.print_token_line_indentation(S),this._output.add_token(Q[se].substring(Se))):(this._output.current_line.set_indent(-1),this._output.add_token(Q[se])),this.print_newline(!1,G);this._flags.alignment=0}},H.prototype.handle_comment=function(S,G){S.newlines?this.print_newline(!1,G):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(S),this.print_newline(!1,G)},H.prototype.handle_dot=function(S){this.start_of_statement(S)||this.handle_whitespace_and_comments(S,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),L(this._flags.last_token,A)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(S,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(S)},H.prototype.handle_unknown=function(S,G){this.print_token(S),S.text[S.text.length-1]===`
`&&this.print_newline(!1,G)},H.prototype.handle_eof=function(S){for(;this._flags.mode===p.Statement;)this.restore_mode();this.handle_whitespace_and_comments(S)},n.exports.Beautifier=H},function(n){function I(h){this.__parent=h,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=[]}I.prototype.clone_empty=function(){var h=new I(this.__parent);return h.set_indent(this.__indent_count,this.__alignment_count),h},I.prototype.item=function(h){return h<0?this.__items[this.__items.length+h]:this.__items[h]},I.prototype.has_match=function(h){for(var c=this.__items.length-1;c>=0;c--)if(this.__items[c].match(h))return!0;return!1},I.prototype.set_indent=function(h,c){this.is_empty()&&(this.__indent_count=h||0,this.__alignment_count=c||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 h=this.__parent.current_line;return h.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),h.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),h.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,h.__items[0]===" "&&(h.__items.splice(0,1),h.__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(h){this.__items.push(h);var c=h.lastIndexOf(`
`);c!==-1?this.__character_count=h.length-c:this.__character_count+=h.length},I.prototype.pop=function(){var h=null;return this.is_empty()||(h=this.__items.pop(),this.__character_count-=h.length),h},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 h="";return this.is_empty()?this.__parent.indent_empty_lines&&(h=this.__parent.get_indent_string(this.__indent_count)):(h=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),h+=this.__items.join("")),h};function g(h,c){this.__cache=[""],this.__indent_size=h.indent_size,this.__indent_string=h.indent_char,h.indent_with_tabs||(this.__indent_string=new Array(h.indent_size+1).join(h.indent_char)),c=c||"",h.indent_level>0&&(c=new Array(h.indent_level+1).join(this.__indent_string)),this.__base_string=c,this.__base_string_length=c.length}g.prototype.get_indent_size=function(h,c){var s=this.__base_string_length;return c=c||0,h<0&&(s=0),s+=h*this.__indent_size,s+=c,s},g.prototype.get_indent_string=function(h,c){var s=this.__base_string;return c=c||0,h<0&&(h=0,s=""),c+=h*this.__indent_size,this.__ensure_cache(c),s+=this.__cache[c],s},g.prototype.__ensure_cache=function(h){for(;h>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var h=this.__cache.length,c=0,s="";this.__indent_size&&h>=this.__indent_size&&(c=Math.floor(h/this.__indent_size),h-=c*this.__indent_size,s=new Array(c+1).join(this.__indent_string)),h&&(s+=new Array(h+1).join(" ")),this.__cache.push(s)};function f(h,c){this.__indent_cache=new g(h,c),this.raw=!1,this._end_with_newline=h.end_with_newline,this.indent_size=h.indent_size,this.wrap_line_length=h.wrap_line_length,this.indent_empty_lines=h.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(h,c){return this.__indent_cache.get_indent_string(h,c)},f.prototype.get_indent_size=function(h,c){return this.__indent_cache.get_indent_size(h,c)},f.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},f.prototype.add_new_line=function(h){return this.is_empty()||!h&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},f.prototype.get_code=function(h){this.trim(!0);var c=this.current_line.pop();c&&(c[c.length-1]===`
`&&(c=c.replace(/\n+$/g,"")),this.current_line.push(c)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(`
`);return h!==`
`&&(s=s.replace(/[\n]/g,h)),s},f.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},f.prototype.set_indent=function(h,c){return h=h||0,c=c||0,this.next_line.set_indent(h,c),this.__lines.length>1?(this.current_line.set_indent(h,c),!0):(this.current_line.set_indent(),!1)},f.prototype.add_raw_token=function(h){for(var c=0;c<h.newlines;c++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(h.whitespace_before),this.current_line.push(h.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},f.prototype.add_token=function(h){this.__add_space_before_token(),this.current_line.push(h),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},f.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},f.prototype.remove_indent=function(h){for(var c=this.__lines.length;h<c;)this.__lines[h]._remove_indent(),h++;this.current_line._remove_wrap_indent()},f.prototype.trim=function(h){for(h=h===void 0?!1:h,this.current_line.trim();h&&this.__lines.length>1&&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(h,c){for(var s=this.__lines.length-2;s>=0;){var d=this.__lines[s];if(d.is_empty())break;if(d.item(0).indexOf(h)!==0&&d.item(-1)!==c){this.__lines.splice(s+1,0,new I(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},n.exports.Output=f},function(n){function I(g,f,h,c){this.type=g,this.text=f,this.comments_before=null,this.newlines=h||0,this.whitespace_before=c||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}n.exports.Token=I},function(n,I){var g="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",f="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",h="\\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",c="\\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+h+"])",d="(?:\\\\u[0-9a-fA-F]{4}|["+f+h+c+"])*";I.identifier=new RegExp(s+d,"g"),I.identifierStart=new RegExp(s),I.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+f+h+c+"])+");var i=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;I.newline=/[\n\r\u2028\u2029]/,I.lineBreak=new RegExp(`\r
|`+I.newline.source),I.allLineBreaks=new RegExp(I.lineBreak.source,"g")},function(n,I,g){var f=g(6).Options,h=["before-newline","after-newline","preserve-newline"];function c(s){f.call(this,s,"js");var d=this.raw_options.brace_style||null;d==="expand-strict"?this.raw_options.brace_style="expand":d==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var a=0;a<i.length;a++)i[a]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=i[a];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",h),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}c.prototype=new f,n.exports.Options=c},function(n){function I(h,c){this.raw_options=g(h,c),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(h,c){var s=this.raw_options[h],d=c||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(d=s.concat()):typeof s=="string"&&(d=s.split(/[^a-zA-Z0-9_\/\-]+/)),d},I.prototype._get_boolean=function(h,c){var s=this.raw_options[h],d=s===void 0?!!c:!!s;return d},I.prototype._get_characters=function(h,c){var s=this.raw_options[h],d=c||"";return typeof s=="string"&&(d=s.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),d},I.prototype._get_number=function(h,c){var s=this.raw_options[h];c=parseInt(c,10),isNaN(c)&&(c=0);var d=parseInt(s,10);return isNaN(d)&&(d=c),d},I.prototype._get_selection=function(h,c,s){var d=this._get_selection_list(h,c,s);if(d.length!==1)throw new Error("Invalid Option Value: The option '"+h+`' can only be one of the following values:
`+c+`
You passed in: '`+this.raw_options[h]+"'");return d[0]},I.prototype._get_selection_list=function(h,c,s){if(!c||c.length===0)throw new Error("Selection list cannot be empty.");if(s=s||[c[0]],!this._is_valid_selection(s,c))throw new Error("Invalid Default Value!");var d=this._get_array(h,s);if(!this._is_valid_selection(d,c))throw new Error("Invalid Option Value: The option '"+h+`' can contain only the following values:
`+c+`
You passed in: '`+this.raw_options[h]+"'");return d},I.prototype._is_valid_selection=function(h,c){return h.length&&c.length&&!h.some(function(s){return c.indexOf(s)===-1})};function g(h,c){var s={};h=f(h);var d;for(d in h)d!==c&&(s[d]=h[d]);if(c&&h[c])for(d in h[c])s[d]=h[c][d];return s}function f(h){var c={},s;for(s in h){var d=s.replace(/-/g,"_");c[d]=h[s]}return c}n.exports.Options=I,n.exports.normalizeOpts=f,n.exports.mergeOpts=g},function(n,I,g){var f=g(8).InputScanner,h=g(9).Tokenizer,c=g(9).TOKEN,s=g(13).Directives,d=g(4),i=g(12).Pattern,a=g(14).TemplatablePattern;function r(F,R){return R.indexOf(F)!==-1}var o={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:c.START,RAW:c.RAW,EOF:c.EOF},T=new s(/\/\*/,/\*\//),w=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,x=/[0-9]/,L=/[^\d\.]/,A=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),_=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";_=_.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),_="\\?\\.(?!\\d) "+_,_=_.replace(/ /g,"|");var b=new RegExp(_),m="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),p=m.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),C=new RegExp("^(?:"+p.join("|")+")$"),E,v=function(F,R){h.call(this,F,R),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var H=new i(this._input),U=new a(this._input).read_options(this._options);this.__patterns={template:U,identifier:U.starting_with(d.identifier).matching(d.identifierMatch),number:H.matching(w),punct:H.matching(b),comment:H.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:H.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:H.matching(/<!--/),html_comment_end:H.matching(/-->/),include:H.starting_with(/#include/).until_after(d.lineBreak),shebang:H.starting_with(/#!/).until_after(d.lineBreak),xml:H.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:U.until(/['\\\n\r\u2028\u2029]/),double_quote:U.until(/["\\\n\r\u2028\u2029]/),template_text:U.until(/[`\\$]/),template_expression:U.until(/[`}\\]/)}};v.prototype=new h,v.prototype._is_comment=function(F){return F.type===o.COMMENT||F.type===o.BLOCK_COMMENT||F.type===o.UNKNOWN},v.prototype._is_opening=function(F){return F.type===o.START_BLOCK||F.type===o.START_EXPR},v.prototype._is_closing=function(F,R){return(F.type===o.END_BLOCK||F.type===o.END_EXPR)&&R&&(F.text==="]"&&R.text==="["||F.text===")"&&R.text==="("||F.text==="}"&&R.text==="{")},v.prototype._reset=function(){E=!1},v.prototype._get_next_token=function(F,R){var H=null;this._readWhitespace();var U=this._input.peek();return U===null?this._create_token(o.EOF,""):(H=H||this._read_non_javascript(U),H=H||this._read_string(U),H=H||this._read_word(F),H=H||this._read_singles(U),H=H||this._read_comment(U),H=H||this._read_regexp(U,F),H=H||this._read_xml(U,F),H=H||this._read_punctuation(),H=H||this._create_token(o.UNKNOWN,this._input.next()),H)},v.prototype._read_word=function(F){var R;if(R=this.__patterns.identifier.read(),R!=="")return R=R.replace(d.allLineBreaks,`
`),!(F.type===o.DOT||F.type===o.RESERVED&&(F.text==="set"||F.text==="get"))&&C.test(R)?(R==="in"||R==="of")&&(F.type===o.WORD||F.type===o.STRING)?this._create_token(o.OPERATOR,R):this._create_token(o.RESERVED,R):this._create_token(o.WORD,R);if(R=this.__patterns.number.read(),R!=="")return this._create_token(o.WORD,R)},v.prototype._read_singles=function(F){var R=null;return F==="("||F==="["?R=this._create_token(o.START_EXPR,F):F===")"||F==="]"?R=this._create_token(o.END_EXPR,F):F==="{"?R=this._create_token(o.START_BLOCK,F):F==="}"?R=this._create_token(o.END_BLOCK,F):F===";"?R=this._create_token(o.SEMICOLON,F):F==="."&&L.test(this._input.peek(1))?R=this._create_token(o.DOT,F):F===","&&(R=this._create_token(o.COMMA,F)),R&&this._input.next(),R},v.prototype._read_punctuation=function(){var F=this.__patterns.punct.read();if(F!=="")return F==="="?this._create_token(o.EQUALS,F):F==="?."?this._create_token(o.DOT,F):this._create_token(o.OPERATOR,F)},v.prototype._read_non_javascript=function(F){var R="";if(F==="#"){if(this._is_first_token()&&(R=this.__patterns.shebang.read(),R))return this._create_token(o.UNKNOWN,R.trim()+`
`);if(R=this.__patterns.include.read(),R)return this._create_token(o.UNKNOWN,R.trim()+`
`);F=this._input.next();var H="#";if(this._input.hasNext()&&this._input.testChar(x)){do F=this._input.next(),H+=F;while(this._input.hasNext()&&F!=="#"&&F!=="=");return F==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(H+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(H+="{}",this._input.next(),this._input.next())),this._create_token(o.WORD,H)}this._input.back()}else if(F==="<"&&this._is_first_token()){if(R=this.__patterns.html_comment_start.read(),R){for(;this._input.hasNext()&&!this._input.testChar(d.newline);)R+=this._input.next();return E=!0,this._create_token(o.COMMENT,R)}}else if(E&&F==="-"&&(R=this.__patterns.html_comment_end.read(),R))return E=!1,this._create_token(o.COMMENT,R);return null},v.prototype._read_comment=function(F){var R=null;if(F==="/"){var H="";if(this._input.peek(1)==="*"){H=this.__patterns.block_comment.read();var U=T.get_directives(H);U&&U.ignore==="start"&&(H+=T.readIgnored(this._input)),H=H.replace(d.allLineBreaks,`
`),R=this._create_token(o.BLOCK_COMMENT,H),R.directives=U}else this._input.peek(1)==="/"&&(H=this.__patterns.comment.read(),R=this._create_token(o.COMMENT,H))}return R},v.prototype._read_string=function(F){if(F==="`"||F==="'"||F==='"'){var R=this._input.next();return this.has_char_escapes=!1,F==="`"?R+=this._read_string_recursive("`",!0,"${"):R+=this._read_string_recursive(F),this.has_char_escapes&&this._options.unescape_strings&&(R=P(R)),this._input.peek()===F&&(R+=this._input.next()),R=R.replace(d.allLineBreaks,`
`),this._create_token(o.STRING,R)}return null},v.prototype._allow_regexp_or_xml=function(F){return F.type===o.RESERVED&&r(F.text,["return","case","throw","else","do","typeof","yield"])||F.type===o.END_EXPR&&F.text===")"&&F.opened.previous.type===o.RESERVED&&r(F.opened.previous.text,["if","while","for"])||r(F.type,[o.COMMENT,o.START_EXPR,o.START_BLOCK,o.START,o.END_BLOCK,o.OPERATOR,o.EQUALS,o.EOF,o.SEMICOLON,o.COMMA])},v.prototype._read_regexp=function(F,R){if(F==="/"&&this._allow_regexp_or_xml(R)){for(var H=this._input.next(),U=!1,S=!1;this._input.hasNext()&&(U||S||this._input.peek()!==F)&&!this._input.testChar(d.newline);)H+=this._input.peek(),U?U=!1:(U=this._input.peek()==="\\",this._input.peek()==="["?S=!0:this._input.peek()==="]"&&(S=!1)),this._input.next();return this._input.peek()===F&&(H+=this._input.next(),H+=this._input.read(d.identifier)),this._create_token(o.STRING,H)}return null},v.prototype._read_xml=function(F,R){if(this._options.e4x&&F==="<"&&this._allow_regexp_or_xml(R)){var H="",U=this.__patterns.xml.read_match();if(U){for(var S=U[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),G=S.indexOf("{")===0,Q=0;U;){var se=!!U[1],fe=U[2],we=!!U[U.length-1]||fe.slice(0,8)==="![CDATA[";if(!we&&(fe===S||G&&fe.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(se?--Q:++Q),H+=U[0],Q<=0)break;U=this.__patterns.xml.read_match()}return U||(H+=this._input.match(/[\s\S]*/g)[0]),H=H.replace(d.allLineBreaks,`
`),this._create_token(o.STRING,H)}}return null};function P(F){for(var R="",H=0,U=new f(F),S=null;U.hasNext();)if(S=U.match(/([\s]|[^\\]|\\\\)+/g),S&&(R+=S[0]),U.peek()==="\\"){if(U.next(),U.peek()==="x")S=U.match(/x([0-9A-Fa-f]{2})/g);else if(U.peek()==="u")S=U.match(/u([0-9A-Fa-f]{4})/g);else{R+="\\",U.hasNext()&&(R+=U.next());continue}if(!S)return F;if(H=parseInt(S[1],16),H>126&&H<=255&&S[0].indexOf("x")===0)return F;if(H>=0&&H<32){R+="\\"+S[0];continue}else H===34||H===39||H===92?R+="\\"+String.fromCharCode(H):R+=String.fromCharCode(H)}return R}v.prototype._read_string_recursive=function(F,R,H){var U,S;F==="'"?S=this.__patterns.single_quote:F==='"'?S=this.__patterns.double_quote:F==="`"?S=this.__patterns.template_text:F==="}"&&(S=this.__patterns.template_expression);for(var G=S.read(),Q="";this._input.hasNext();){if(Q=this._input.next(),Q===F||!R&&d.newline.test(Q)){this._input.back();break}else Q==="\\"&&this._input.hasNext()?(U=this._input.peek(),U==="x"||U==="u"?this.has_char_escapes=!0:U==="\r"&&this._input.peek(1)===`
`&&this._input.next(),Q+=this._input.next()):H&&(H==="${"&&Q==="$"&&this._input.peek()==="{"&&(Q+=this._input.next()),H===Q&&(F==="`"?Q+=this._read_string_recursive("}",R,"`"):Q+=this._read_string_recursive("`",R,"${"),this._input.hasNext()&&(Q+=this._input.next())));Q+=S.read(),G+=Q}return G},n.exports.Tokenizer=v,n.exports.TOKEN=o,n.exports.positionable_operators=A.slice(),n.exports.line_starters=m.slice()},function(n){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<this.__input_length},g.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__input.charAt(this.__position),this.__position+=1),f},g.prototype.peek=function(f){var h=null;return f=f||0,f+=this.__position,f>=0&&f<this.__input_length&&(h=this.__input.charAt(f)),h},g.prototype.__match=function(f,h){f.lastIndex=h;var c=f.exec(this.__input);return c&&!(I&&f.sticky)&&(c.index!==h&&(c=null)),c},g.prototype.test=function(f,h){return h=h||0,h+=this.__position,h>=0&&h<this.__input_length?!!this.__match(f,h):!1},g.prototype.testChar=function(f,h){var c=this.peek(h);return f.lastIndex=0,c!==null&&f.test(c)},g.prototype.match=function(f){var h=this.__match(f,this.__position);return h?this.__position+=h[0].length:h=null,h},g.prototype.read=function(f,h,c){var s="",d;return f&&(d=this.match(f),d&&(s+=d[0])),h&&(d||!f)&&(s+=this.readUntil(h,c)),s},g.prototype.readUntil=function(f,h){var c="",s=this.__position;f.lastIndex=this.__position;var d=f.exec(this.__input);return d?(s=d.index,h&&(s+=d[0].length)):s=this.__input_length,c=this.__input.substring(this.__position,s),this.__position=s,c},g.prototype.readUntilAfter=function(f){return this.readUntil(f,!0)},g.prototype.get_regexp=function(f,h){var c=null,s="g";return h&&I&&(s="y"),typeof f=="string"&&f!==""?c=new RegExp(f,s):f&&(c=new RegExp(f.source,s)),c},g.prototype.get_literal_regexp=function(f){return RegExp(f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(f){var h=this.__position,c=this.readUntilAfter(f);return this.__position=h,c},g.prototype.lookBack=function(f){var h=this.__position-1;return h>=f.length&&this.__input.substring(h-f.length,h).toLowerCase()===f},n.exports.InputScanner=g},function(n,I,g){var f=g(8).InputScanner,h=g(3).Token,c=g(10).TokenStream,s=g(11).WhitespacePattern,d={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},i=function(a,r){this._input=new f(a),this._options=r||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};i.prototype.tokenize=function(){this._input.restart(),this.__tokens=new c,this._reset();for(var a,r=new h(d.START,""),o=null,T=[],w=new c;r.type!==d.EOF;){for(a=this._get_next_token(r,o);this._is_comment(a);)w.add(a),a=this._get_next_token(r,o);w.isEmpty()||(a.comments_before=w,w=new c),a.parent=o,this._is_opening(a)?(T.push(o),o=a):o&&this._is_closing(a,o)&&(a.opened=o,o.closed=a,o=T.pop(),a.parent=o),a.previous=r,r.next=a,this.__tokens.add(a),r=a}return this.__tokens},i.prototype._is_first_token=function(){return this.__tokens.isEmpty()},i.prototype._reset=function(){},i.prototype._get_next_token=function(a,r){this._readWhitespace();var o=this._input.read(/.+/g);return o?this._create_token(d.RAW,o):this._create_token(d.EOF,"")},i.prototype._is_comment=function(a){return!1},i.prototype._is_opening=function(a){return!1},i.prototype._is_closing=function(a,r){return!1},i.prototype._create_token=function(a,r){var o=new h(a,r,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return o},i.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},n.exports.Tokenizer=i,n.exports.TOKEN=d},function(n){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<this.__tokens_length},I.prototype.next=function(){var g=null;return this.hasNext()&&(g=this.__tokens[this.__position],this.__position+=1),g},I.prototype.peek=function(g){var f=null;return g=g||0,g+=this.__position,g>=0&&g<this.__tokens_length&&(f=this.__tokens[g]),f},I.prototype.add=function(g){this.__parent_token&&(g.parent=this.__parent_token),this.__tokens.push(g),this.__tokens_length+=1},n.exports.TokenStream=I},function(n,I,g){var f=g(12).Pattern;function h(c,s){f.call(this,c,s),s?this._line_regexp=this._input.get_regexp(s._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}h.prototype=new f,h.prototype.__set_whitespace_patterns=function(c,s){c+="\\t ",s+="\\n\\r",this._match_pattern=this._input.get_regexp("["+c+s+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+s+"]")},h.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var c=this._input.read(this._match_pattern);if(c===" ")this.whitespace_before_token=" ";else if(c){var s=this.__split(this._newline_regexp,c);this.newline_count=s.length-1,this.whitespace_before_token=s[this.newline_count]}return c},h.prototype.matching=function(c,s){var d=this._create();return d.__set_whitespace_patterns(c,s),d._update(),d},h.prototype._create=function(){return new h(this._input,this)},h.prototype.__split=function(c,s){c.lastIndex=0;for(var d=0,i=[],a=c.exec(s);a;)i.push(s.substring(d,a.index)),d=a.index+a[0].length,a=c.exec(s);return d<s.length?i.push(s.substring(d,s.length)):i.push(""),i},n.exports.WhitespacePattern=h},function(n){function I(g,f){this._input=g,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,f&&(this._starting_pattern=this._input.get_regexp(f._starting_pattern,!0),this._match_pattern=this._input.get_regexp(f._match_pattern,!0),this._until_pattern=this._input.get_regexp(f._until_pattern),this._until_after=f._until_after)}I.prototype.read=function(){var g=this._input.read(this._starting_pattern);return(!this._starting_pattern||g)&&(g+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),g},I.prototype.read_match=function(){return this._input.match(this._match_pattern)},I.prototype.until_after=function(g){var f=this._create();return f._until_after=!0,f._until_pattern=this._input.get_regexp(g),f._update(),f},I.prototype.until=function(g){var f=this._create();return f._until_after=!1,f._until_pattern=this._input.get_regexp(g),f._update(),f},I.prototype.starting_with=function(g){var f=this._create();return f._starting_pattern=this._input.get_regexp(g,!0),f._update(),f},I.prototype.matching=function(g){var f=this._create();return f._match_pattern=this._input.get_regexp(g,!0),f._update(),f},I.prototype._create=function(){return new I(this._input,this)},I.prototype._update=function(){},n.exports.Pattern=I},function(n){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 h=this.__directive_pattern.exec(g);h;)f[h[1]]=h[2],h=this.__directive_pattern.exec(g);return f},I.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=I},function(n,I,g){var f=g(12).Pattern,h={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function c(s,d){f.call(this,s,d),this.__template_pattern=null,this._disabled=Object.assign({},h),this._excluded=Object.assign({},h),d&&(this.__template_pattern=this._input.get_regexp(d.__template_pattern),this._excluded=Object.assign(this._excluded,d._excluded),this._disabled=Object.assign(this._disabled,d._disabled));var i=new f(s);this.__patterns={handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:i.starting_with(/{{{/).until_after(/}}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),php:i.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}c.prototype=new f,c.prototype._create=function(){return new c(this._input,this)},c.prototype._update=function(){this.__set_templated_pattern()},c.prototype.disable=function(s){var d=this._create();return d._disabled[s]=!0,d._update(),d},c.prototype.read_options=function(s){var d=this._create();for(var i in h)d._disabled[i]=s.templating.indexOf(i)===-1;return d._update(),d},c.prototype.exclude=function(s){var d=this._create();return d._excluded[s]=!0,d._update(),d},c.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 d=this._read_template();d;)this._match_pattern?d+=this._input.read(this._match_pattern):d+=this._input.readUntil(this.__template_pattern),s+=d,d=this._read_template();return this._until_after&&(s+=this._input.readUntilAfter(this._until_pattern)),s},c.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("|")+")")},c.prototype._read_template=function(){var s="",d=this._input.peek();if(d==="<"){var i=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&i==="?"&&(s=s||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&i==="%"&&(s=s||this.__patterns.erb.read())}else d==="{"&&(!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},n.exports.TemplatablePattern=c}],O={};function K(n){var I=O[n];if(I!==void 0)return I.exports;var g=O[n]={exports:{}};return N[n](g,g.exports,K),g.exports}var W=K(0);D=W})();var V=D;!(J=[],z=function(){return{js_beautify:V}}.apply(de,J),z!==void 0&&(Ue.exports=z))})()},"6eGT":function(Ue,de,M){"use strict";function J(z){return null}de.a=J},"746U":function(Ue,de,M){"use strict";M.d(de,"f",function(){return J}),M.d(de,"l",function(){return z}),M.d(de,"k",function(){return D}),M.d(de,"j",function(){return V}),M.d(de,"g",function(){return N}),M.d(de,"m",function(){return O}),M.d(de,"h",function(){return K}),M.d(de,"n",function(){return W}),M.d(de,"c",function(){return n}),M.d(de,"a",function(){return I}),M.d(de,"i",function(){return g}),M.d(de,"o",function(){return f}),M.d(de,"e",function(){return s}),M.d(de,"d",function(){return d}),M.d(de,"p",function(){return i}),M.d(de,"b",function(){return a});function J(r){return Array.isArray(r)}function z(r){return typeof r=="string"}function D(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)&&!(r instanceof RegExp)&&!(r instanceof Date)}function V(r){return typeof r=="number"&&!isNaN(r)}function N(r){return r===!0||r===!1}function O(r){return typeof r=="undefined"}function K(r){return!W(r)}function W(r){return O(r)||r===null}function n(r,o){if(!r)throw new Error(o?`Unexpected type, expected '${o}'`:"Unexpected type")}function I(r){if(W(r))throw new Error("Assertion Failed: argument is undefined or null");return r}function g(r){return typeof r=="function"}function f(r,o){const T=Math.min(r.length,o.length);for(let w=0;w<T;w++)h(r[w],o[w])}function h(r,o){if(z(o)){if(typeof r!==o)throw new Error(`argument does not match constraint: typeof ${o}`)}else if(g(o)){try{if(r instanceof o)return}catch(T){}if(!W(r)&&r.constructor===o)return;if(o.length===1&&o.call(void 0,r)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function c(r){let o=[],T=Object.getPrototypeOf(r);for(;Object.prototype!==T;)o=o.concat(Object.getOwnPropertyNames(T)),T=Object.getPrototypeOf(T);return o}function s(r){const o=[];for(const T of c(r))typeof r[T]=="function"&&o.push(T);return o}function d(r,o){const T=x=>function(){const L=Array.prototype.slice.call(arguments,0);return o(x,L)};let w={};for(const x of r)w[x]=T(x);return w}function i(r){return r===null?void 0:r}function a(r,o="Unreachable"){throw new Error(o)}},"7Cbv":function(Ue,de,M){"use strict";var J=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),z=new Uint8Array(16);function D(){if(!J)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return J(z)}var V=/^(?:[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 N(h){return typeof h=="string"&&V.test(h)}for(var O=N,K=[],W=0;W<256;++W)K.push((W+256).toString(16).substr(1));function n(h){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=(K[h[c+0]]+K[h[c+1]]+K[h[c+2]]+K[h[c+3]]+"-"+K[h[c+4]]+K[h[c+5]]+"-"+K[h[c+6]]+K[h[c+7]]+"-"+K[h[c+8]]+K[h[c+9]]+"-"+K[h[c+10]]+K[h[c+11]]+K[h[c+12]]+K[h[c+13]]+K[h[c+14]]+K[h[c+15]]).toLowerCase();if(!O(s))throw TypeError("Stringified UUID is invalid");return s}var I=n;function g(h,c,s){h=h||{};var d=h.random||(h.rng||D)();if(d[6]=d[6]&15|64,d[8]=d[8]&63|128,c){s=s||0;for(var i=0;i<16;++i)c[s+i]=d[i];return c}return I(d)}var f=de.a=g},"7ahc":function(Ue,de,M){"use strict";M.d(de,"a",function(){return T});var J=M("k1fw"),z=M("0Owb"),D=M("+L6B"),V=M("2/Rp"),N=M("y8nQ"),O=M("Vl3Y"),K=M("tJVT"),W=M("OaEy"),n=M("2fM7"),I=M("q1tI"),g=M.n(I),f=M("VrN/"),h=M.n(f),c=M("p77/"),s=M.n(c),d=M("c5Ni"),i=M.n(d),a=n.a.Option,r={labelCol:{span:4},wrapperCol:{span:20}},o={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"]};de.b=function(w){var x=w.callback,L=w.onCancel,A=Object(I.useState)("python"),_=Object(K.a)(A,2),b=_[0],m=_[1];function p(E){m(o[E][1])}function C(E){x(E)}return g.a.createElement(O.a,Object(z.a)({},r,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:C}),g.a.createElement(O.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},g.a.createElement(n.a,{onChange:p},Object.keys(o).map(function(E){return g.a.createElement(a,{key:E,value:E},o[E][0])}))),g.a.createElement(O.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},g.a.createElement(T,{mode:b})),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(V.a,{type:"ghost",onClick:L},"\u53D6\u6D88")))};function T(w){var x=w.value,L=w.onChange,A=w.mode,_=w.options,b=_===void 0?{}:_,m=Object(I.useRef)(),p=Object(I.useState)(),C=Object(K.a)(p,2),E=C[0],v=C[1];return Object(I.useEffect)(function(){if(E){function P(F){var R=F.getValue();L&&L(R)}return E.on("change",P),function(){E.off("change",P)}}},[E,L]),Object(I.useEffect)(function(){E&&E.setOption("mode",A)},[E,A]),Object(I.useEffect)(function(){E&&((x!==E.getValue()||x==="")&&setTimeout(function(){E.setValue(x||" ")},300))},[E,x]),Object(I.useEffect)(function(){if(m.current&&!E){var P=h.a.fromTextArea(m.current,Object(J.a)({mode:A,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},b));v(P)}},[m.current,E]),g.a.createElement("div",{className:"my-codemirror-container"},g.a.createElement("textarea",{ref:m}))}},"7ixt":function(Ue,de,M){"use strict";M.d(de,"a",function(){return D});var J={adjustX:1,adjustY:1},z=[0,0],D={left:{points:["cr","cl"],overflow:J,offset:[-4,0],targetOffset:z},right:{points:["cl","cr"],overflow:J,offset:[4,0],targetOffset:z},top:{points:["bc","tc"],overflow:J,offset:[0,-4],targetOffset:z},bottom:{points:["tc","bc"],overflow:J,offset:[0,4],targetOffset:z},topLeft:{points:["bl","tl"],overflow:J,offset:[0,-4],targetOffset:z},leftTop:{points:["tr","tl"],overflow:J,offset:[-4,0],targetOffset:z},topRight:{points:["br","tr"],overflow:J,offset:[0,-4],targetOffset:z},rightTop:{points:["tl","tr"],overflow:J,offset:[4,0],targetOffset:z},bottomRight:{points:["tr","br"],overflow:J,offset:[0,4],targetOffset:z},rightBottom:{points:["bl","br"],overflow:J,offset:[4,0],targetOffset:z},bottomLeft:{points:["tl","bl"],overflow:J,offset:[0,4],targetOffset:z},leftBottom:{points:["br","bl"],overflow:J,offset:[-4,0],targetOffset:z}},V=D},"815F":function(Ue,de,M){"use strict";M.d(de,"e",function(){return K}),M.d(de,"c",function(){return n}),M.d(de,"d",function(){return I}),M.d(de,"a",function(){return f}),M.d(de,"f",function(){return h}),M.d(de,"b",function(){return c});var J=M("KQm4"),z=M("VTBJ"),D=M("Ff2n"),V=M("Zm9Q"),N=M("Kwbf"),O=M("OZM5");function K(s,d){return s!=null?s:d}function W(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],d=new Map;function i(a){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(a||[]).forEach(function(o){var T=o.key,w=o.children;Object(N.a)(T!=null,"Tree node must have a certain key: [".concat(r).concat(T,"]"));var x=String(T);Object(N.a)(!d.has(x)||T===null||T===void 0,"Same 'key' exist in the Tree: ".concat(x)),d.set(x,!0),i(w,"".concat(r).concat(x," > "))})}i(s)}function n(s){function d(i){var a=Object(V.a)(i);return a.map(function(r){if(!Object(O.i)(r))return Object(N.a)(!r,"Tree/TreeNode can only accept TreeNode as children."),null;var o=r.key,T=r.props,w=T.children,x=Object(D.a)(T,["children"]),L=Object(z.a)({key:o},x),A=d(w);return A.length&&(L.children=A),L}).filter(function(r){return r})}return d(s)}function I(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=new Set(d===!0?[]:d),a=[];function r(o){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return o.map(function(w,x){var L=Object(O.h)(T?T.pos:"0",x),A=K(w.key,L),_=Object(z.a)(Object(z.a)({},w),{},{parent:T,pos:L,children:null,data:w,isStart:[].concat(Object(J.a)(T?T.isStart:[]),[x===0]),isEnd:[].concat(Object(J.a)(T?T.isEnd:[]),[x===o.length-1])});return a.push(_),d===!0||i.has(A)?_.children=r(w.children||[],_):_.children=[],_})}return r(s),a}function g(s,d,i){var a;i?typeof i=="string"?a=function(T){return T[i]}:typeof i=="function"&&(a=function(T){return i(T)}):a=function(T,w){return K(T.key,w)};function r(o,T,w){var x=o?o.children:s,L=o?Object(O.h)(w.pos,T):"0";if(o){var A=a(o,L),_={node:o,index:T,pos:L,key:A,parentPos:w.node?w.pos:null,level:w.level+1};d(_)}x&&x.forEach(function(b,m){r(b,m,{node:o,pos:L,level:w?w.level+1:-1})})}r(null)}function f(s){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=d.initWrapper,a=d.processEntity,r=d.onProcessFinished,o=arguments.length>2?arguments[2]:void 0,T={},w={},x={posEntities:T,keyEntities:w};return i&&(x=i(x)||x),g(s,function(L){var A=L.node,_=L.index,b=L.pos,m=L.key,p=L.parentPos,C=L.level,E={node:A,index:_,key:m,pos:b,level:C},v=K(m,b);T[b]=E,w[v]=E,E.parent=T[p],E.parent&&(E.parent.children=E.parent.children||[],E.parent.children.push(E)),a&&a(E,x)},o),r&&r(x),x}function h(s,d){var i=d.expandedKeys,a=d.selectedKeys,r=d.loadedKeys,o=d.loadingKeys,T=d.checkedKeys,w=d.halfCheckedKeys,x=d.dragOverNodeKey,L=d.dropPosition,A=d.keyEntities,_=A[s],b={eventKey:s,expanded:i.indexOf(s)!==-1,selected:a.indexOf(s)!==-1,loaded:r.indexOf(s)!==-1,loading:o.indexOf(s)!==-1,checked:T.indexOf(s)!==-1,halfChecked:w.indexOf(s)!==-1,pos:String(_?_.pos:""),dragOver:x===s&&L===0,dragOverGapTop:x===s&&L===-1,dragOverGapBottom:x===s&&L===1};return b}function c(s){var d=s.data,i=s.expanded,a=s.selected,r=s.checked,o=s.loaded,T=s.loading,w=s.halfChecked,x=s.dragOver,L=s.dragOverGapTop,A=s.dragOverGapBottom,_=s.pos,b=s.active,m=Object(z.a)(Object(z.a)({},d),{},{expanded:i,selected:a,checked:r,loaded:o,loading:T,halfChecked:w,dragOver:x,dragOverGapTop:L,dragOverGapBottom:A,pos:_,active:b});return"props"in m||Object.defineProperty(m,"props",{get:function(){return Object(N.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),s}}),m}},"8EBN":function(Ue,de,M){(function(J){J(M("VrN/"))})(function(J){"use strict";J.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 z=0;z<J.modeInfo.length;z++){var D=J.modeInfo[z];D.mimes&&(D.mime=D.mimes[0])}J.findModeByMIME=function(V){V=V.toLowerCase();for(var N=0;N<J.modeInfo.length;N++){var O=J.modeInfo[N];if(O.mime==V)return O;if(O.mimes){for(var K=0;K<O.mimes.length;K++)if(O.mimes[K]==V)return O}}if(/\+xml$/.test(V))return J.findModeByMIME("application/xml");if(/\+json$/.test(V))return J.findModeByMIME("application/json")},J.findModeByExtension=function(V){V=V.toLowerCase();for(var N=0;N<J.modeInfo.length;N++){var O=J.modeInfo[N];if(O.ext){for(var K=0;K<O.ext.length;K++)if(O.ext[K]==V)return O}}},J.findModeByFileName=function(V){for(var N=0;N<J.modeInfo.length;N++){var O=J.modeInfo[N];if(O.file&&O.file.test(V))return O}var K=V.lastIndexOf("."),W=K>-1&&V.substring(K+1,V.length);if(W)return J.findModeByExtension(W)},J.findModeByName=function(V){V=V.toLowerCase();for(var N=0;N<J.modeInfo.length;N++){var O=J.modeInfo[N];if(O.name.toLowerCase()==V)return O;if(O.alias){for(var K=0;K<O.alias.length;K++)if(O.alias[K].toLowerCase()==V)return O}}}})},"8HAY":function(Ue,de,M){"use strict";M.d(de,"a",function(){return N}),M.d(de,"b",function(){return O}),M.d(de,"d",function(){return K}),M.d(de,"e",function(){return W}),M.d(de,"c",function(){return n});var J=M("MI8n"),z=M("pmY6"),D=M("3/fG"),V=function(I,g,f,h){function c(s){return s instanceof f?s:new f(function(d){d(s)})}return new(f||(f=Promise))(function(s,d){function i(o){try{r(h.next(o))}catch(T){d(T)}}function a(o){try{r(h.throw(o))}catch(T){d(T)}}function r(o){o.done?s(o.value):c(o.value).then(i,a)}r((h=h.apply(I,g||[])).next())})};class N extends z.a{constructor(I,g="",f="",h=!0,c){super();this._onDidChange=this._register(new J.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=I,this._label=g,this._cssClass=f,this._enabled=h,this._actionCallback=c}get id(){return this._id}get label(){return this._label}set label(I){this._setLabel(I)}_setLabel(I){this._label!==I&&(this._label=I,this._onDidChange.fire({label:I}))}get tooltip(){return this._tooltip||""}set tooltip(I){this._setTooltip(I)}_setTooltip(I){this._tooltip!==I&&(this._tooltip=I,this._onDidChange.fire({tooltip:I}))}get class(){return this._cssClass}set class(I){this._setClass(I)}_setClass(I){this._cssClass!==I&&(this._cssClass=I,this._onDidChange.fire({class:I}))}get enabled(){return this._enabled}set enabled(I){this._setEnabled(I)}_setEnabled(I){this._enabled!==I&&(this._enabled=I,this._onDidChange.fire({enabled:I}))}get checked(){return this._checked}set checked(I){this._setChecked(I)}_setChecked(I){this._checked!==I&&(this._checked=I,this._onDidChange.fire({checked:I}))}run(I,g){return V(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(I))})}}class O extends z.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new J.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new J.b),this.onDidRun=this._onDidRun.event}run(I,g){return V(this,void 0,void 0,function*(){if(!I.enabled)return;this._onBeforeRun.fire({action:I});let f;try{yield this.runAction(I,g)}catch(h){f=h}this._onDidRun.fire({action:I,error:f})})}runAction(I,g){return V(this,void 0,void 0,function*(){yield I.run(g)})}}class K extends N{constructor(I){super(K.ID,I,I?"separator text":"separator");this.checked=!1,this.enabled=!1}}K.ID="vs.actions.separator";class W{constructor(I,g,f,h){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=I,this.label=g,this.class=h,this._actions=f}get actions(){return this._actions}dispose(){}run(){return V(this,void 0,void 0,function*(){})}}class n extends N{constructor(){super(n.ID,D.a("submenu.empty","(empty)"),void 0,!1)}}n.ID="vs.actions.empty"},"8hTe":function(Ue,de,M){Ue.exports={button:"button___1wy9m"}},"9Bee":function(Ue,de,M){"use strict";var J=M("DYRE"),z=M("zeV3"),D=M("+L6B"),V=M("2/Rp"),N=M("k1fw"),O=M("9og8"),K=M("tJVT"),W=M("WmNS"),n=M.n(W),I=M("q1tI"),g=M.n(I),f=M("vg9a"),h=M("DlQD"),c=M.n(h),s=M("rUJ1");function d(ue,q){var te=ue.match(/^(\s+)(?:```)/);if(te===null)return q;var ae=te[1];return q.split(`
`).map(function(ce){var ie=ce.match(/^\s+/);if(ie===null)return ce;var oe=Object(K.a)(ie,1),he=oe[0];return he.length>=ae.length?ce.slice(ae.length):ce}).join(`
`)}var i=[],a=["<ul>"],r=new c.a.Renderer,o=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function T(){i.length=0,a=["<ul>"]}var w={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function x(ue,q,te,ae){if(q>=ue.length||ue[q].level<=te)return q;var ce=ue[q];ae.push("<li><a href='#"+ce.anchor+"'>"+ce.text+"</a>"),q++;var ie=[];return q=x(ue,q,ce.level,ie),ie.length>0&&(ae.push("<ul>"),ie.forEach(function(oe){ae.push(oe)}),ae.push("</ul>")),ae.push("</li>"),q=x(ue,q,te,ae),q}function L(){return x(i,0,0,a),a.push("</ul>"),a.join("")}var A={heading:function(q){var te=o.exec(q);if(te)return{type:"heading",raw:te[0],depth:te[1].length,text:te[2]}},fences:function(q){var te=this.rules.block.fences.exec(q);if(te){var ae=te[0],ce=d(ae,te[3]||""),ie=te[2]?te[2].trim():te[2];if(["latex","katex","math"].indexOf(ie)>=0){var oe=m(),he=ce;ce=oe,p[oe]={type:"block",expression:he}}return{type:"code",raw:ae,lang:ie,text:ce}}}},_=/(?:\${2})([^\n`]+?)(?:\${2})/gi,b=0,m=function(){return"__special_katext_id_".concat(b++,"__")},p={};function C(){return p}function E(){b=0,p={}}function v(ue){return ue=ue.replace(_,function(q,te){var ae=m();return p[ae]={type:"inline",expression:te},ae}),ue}var P=r.listitem;r.listitem=function(ue){return P(v(ue))};var F=r.paragraph;r.paragraph=function(ue){return F(v(ue))};var R=r.tablecell;r.tablecell=function(ue,q){return R(v(ue),q)},r.code=function(ue,q,te){var ae=(q||"").match(/\S*/)[0];return ae?["latex","katex","math"].indexOf(ae)>=0?"<p class='editormd-tex'>".concat(ue,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(q,'">').concat(te?ue:Object(s.escape)(ue,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(te?ue:Object(s.escape)(ue,!0))+"</code></pre>"},r.heading=function(ue,q,te){var ae=this.options.headerPrefix+te.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return i.push({anchor:ae,level:q,text:ue}),"<h"+q+' id="'+ae+'">'+ue+"</h"+q+">"},c.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),c.a.use({tokenizer:A,renderer:r});var H=c.a,U=M("SJMd"),S=M("ulZh"),G=M.n(S),Q=M("m3rI"),se=M("Oy/b"),fe=M("p5ED"),we=M("ErOA"),be=M("STEk");/* **********************************
cropro version 1.2.0
@license SEE LICENSE IN LICENSE
copyright Alan Mendelevich
see README and LICENSE for details
********************************** *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Se=function(ue,q){return(Se=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(te,ae){te.__proto__=ae}||function(te,ae){for(var ce in ae)Object.prototype.hasOwnProperty.call(ae,ce)&&(te[ce]=ae[ce])})(ue,q)};function Ae(ue,q){if(typeof q!="function"&&q!==null)throw new TypeError("Class extends value "+String(q)+" is not a constructor or null");function te(){this.constructor=ue}Se(ue,q),ue.prototype=q===null?Object.create(q):(te.prototype=q.prototype,new te)}function De(ue,q,te,ae){return new(te||(te=Promise))(function(ce,ie){function oe(_e){try{ge(ae.next(_e))}catch(Oe){ie(Oe)}}function he(_e){try{ge(ae.throw(_e))}catch(Oe){ie(Oe)}}function ge(_e){var Oe;_e.done?ce(_e.value):(Oe=_e.value,Oe instanceof te?Oe:new te(function(Ge){Ge(Oe)})).then(oe,he)}ge((ae=ae.apply(ue,q||[])).next())})}function ve(ue,q){var te,ae,ce,ie,oe={label:0,sent:function(){if(1&ce[0])throw ce[1];return ce[1]},trys:[],ops:[]};return ie={next:he(0),throw:he(1),return:he(2)},typeof Symbol=="function"&&(ie[Symbol.iterator]=function(){return this}),ie;function he(ge){return function(_e){return function(Oe){if(te)throw new TypeError("Generator is already executing.");for(;oe;)try{if(te=1,ae&&(ce=2&Oe[0]?ae.return:Oe[0]?ae.throw||((ce=ae.return)&&ce.call(ae),0):ae.next)&&!(ce=ce.call(ae,Oe[1])).done)return ce;switch(ae=0,ce&&(Oe=[2&Oe[0],ce.value]),Oe[0]){case 0:case 1:ce=Oe;break;case 4:return oe.label++,{value:Oe[1],done:!1};case 5:oe.label++,ae=Oe[1],Oe=[0];continue;case 7:Oe=oe.ops.pop(),oe.trys.pop();continue;default:if(!(ce=oe.trys,(ce=ce.length>0&&ce[ce.length-1])||Oe[0]!==6&&Oe[0]!==2)){oe=0;continue}if(Oe[0]===3&&(!ce||Oe[1]>ce[0]&&Oe[1]<ce[3])){oe.label=Oe[1];break}if(Oe[0]===6&&oe.label<ce[1]){oe.label=ce[1],ce=Oe;break}if(ce&&oe.label<ce[2]){oe.label=ce[2],oe.ops.push(Oe);break}ce[2]&&oe.ops.pop(),oe.trys.pop();continue}Oe=q.call(ue,oe)}catch(Ge){Oe=[6,Ge],ae=0}finally{te=ce=0}if(5&Oe[0])throw Oe[1];return{value:Oe[0]?Oe[1]:void 0,done:!0}}([ge,_e])}}}var Y=function(){function ue(){}return ue.addKey=function(q){ue.key=q},Object.defineProperty(ue,"isLicensed",{get:function(){return!!ue.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(ue.key)},enumerable:!1,configurable:!0}),ue}(),k=function(){function ue(){}return ue.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},ue.setAttributes=function(q,te){for(var ae=0,ce=te;ae<ce.length;ae++){var ie=ce[ae],oe=ie[0],he=ie[1];q.setAttribute(oe,he)}},ue.createRect=function(q,te,ae){var ce=document.createElementNS("http://www.w3.org/2000/svg","rect");return ce.setAttribute("width",q.toString()),ce.setAttribute("height",te.toString()),ae&&ue.setAttributes(ce,ae),ce},ue.createLine=function(q,te,ae,ce,ie){var oe=document.createElementNS("http://www.w3.org/2000/svg","line");return oe.setAttribute("x1",q.toString()),oe.setAttribute("y1",te.toString()),oe.setAttribute("x2",ae.toString()),oe.setAttribute("y2",ce.toString()),ie&&ue.setAttributes(oe,ie),oe},ue.createPolygon=function(q,te){var ae=document.createElementNS("http://www.w3.org/2000/svg","polygon");return ae.setAttribute("points",q),te&&ue.setAttributes(ae,te),ae},ue.createCircle=function(q,te){var ae=document.createElementNS("http://www.w3.org/2000/svg","circle");return ae.setAttribute("cx",(q/2).toString()),ae.setAttribute("cy",(q/2).toString()),ae.setAttribute("r",q.toString()),te&&ue.setAttributes(ae,te),ae},ue.createEllipse=function(q,te,ae){var ce=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ce.setAttribute("cx",(q/2).toString()),ce.setAttribute("cy",(te/2).toString()),ce.setAttribute("rx",(q/2).toString()),ce.setAttribute("ry",(te/2).toString()),ae&&ue.setAttributes(ce,ae),ce},ue.createGroup=function(q){var te=document.createElementNS("http://www.w3.org/2000/svg","g");return q&&ue.setAttributes(te,q),te},ue.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},ue.createMarker=function(q,te,ae,ce,ie,oe,he){var ge=document.createElementNS("http://www.w3.org/2000/svg","marker");return ue.setAttributes(ge,[["id",q],["orient",te],["markerWidth",ae.toString()],["markerHeight",ce.toString()],["refX",ie.toString()],["refY",oe.toString()]]),ge.appendChild(he),ge},ue.createText=function(q){var te=document.createElementNS("http://www.w3.org/2000/svg","text");return te.setAttribute("x","0"),te.setAttribute("y","0"),q&&ue.setAttributes(te,q),te},ue.createTSpan=function(q,te){var ae=document.createElementNS("http://www.w3.org/2000/svg","tspan");return ae.textContent=q,te&&ue.setAttributes(ae,te),ae},ue.createImage=function(q){var te=document.createElementNS("http://www.w3.org/2000/svg","image");return q&&ue.setAttributes(te,q),te},ue.createPoint=function(q,te){var ae=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return ae.x=q,ae.y=te,ae},ue.createPath=function(q,te){var ae=document.createElementNS("http://www.w3.org/2000/svg","path");return ae.setAttribute("d",q),te&&ue.setAttributes(ae,te),ae},ue.createElement=function(q,te){var ae=document.createElementNS("http://www.w3.org/2000/svg",q);return te&&ue.setAttributes(ae,te),ae},ue.getHollowRectanglePath=function(q,te,ae,ce,ie,oe,he,ge){return"M"+q+","+te+"V"+(te+ce)+"H"+(q+ae)+"V"+te+"H"+ie+"V"+oe+"H"+(ie+he)+"V"+(oe+ge)+"H"+ie+"V"+te+"Z"},ue}(),B=function(){function ue(q){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+q+"_"}return Object.defineProperty(ue.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(ue.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(ue.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(ue.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(ue.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),ue.prototype.addClass=function(q){return this.styleSheet===void 0&&this.addStyleSheet(),q.name=""+this.classNamePrefix+q.localName,this.classes.push(q),this.styleSheet.sheet.insertRule("."+q.name+" {"+q.style+"}",this.styleSheet.sheet.cssRules.length),q},ue.prototype.addRule=function(q){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(q),this.styleSheet.sheet.insertRule(q.selector+" {"+q.style+"}",this.styleSheet.sheet.cssRules.length)},ue.prototype.addStyleSheet=function(){var q;this.styleSheet=document.createElement("style"),((q=this.styleSheetRoot)!==null&&q!==void 0?q:document.head).appendChild(this.styleSheet),this.addRule(new Z("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Z("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Z("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new re("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new re("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},ue.prototype.removeStyleSheet=function(){var q;this.styleSheet&&(((q=this.styleSheetRoot)!==null&&q!==void 0?q:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},ue}(),Z=function(ue,q){this.selector=ue,this.style=q},re=function(ue,q){this.localName=ue,this.style=q},X=function(){function ue(){this.blocks=[],this.display=""}return ue.prototype.addButtonBlock=function(q){q.className=this.blockClassName,q.buttonClassName=this.buttonClassName,q.buttonColorsClassName=this.buttonColorsClassName,q.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(q)},ue.prototype.addElementBlock=function(q){q.className===void 0&&(q.className=this.blockClassName),this.blocks.push(q)},ue.prototype.getUI=function(){var q=document.createElement("div");return q.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,q.style.display=this.display,this.blocks.forEach(function(te){return q.appendChild(te.getUI())}),q},ue}(),ye=function(){function ue(){}return ue.prototype.getUI=function(){var q=document.createElement("div");if(q.className=this.className,this.minWidth!==void 0&&(q.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":q.style.justifyContent="flex-start";break;case"center":q.style.justifyContent="center";break;case"end":q.style.justifyContent="flex-end"}return q.style.whiteSpace="nowrap",q},ue}(),Me=function(ue){function q(){var te=ue!==null&&ue.apply(this,arguments)||this;return te.buttons=[],te}return Ae(q,ue),q.prototype.addButton=function(te){te.className=this.buttonClassName,te.colorsClassName=this.buttonColorsClassName,te.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(te)},q.prototype.getUI=function(){var te=ue.prototype.getUI.call(this);return this.buttons.forEach(function(ae){return te.appendChild(ae.getUI())}),te},q}(ye),He=function(){function ue(q,te){this._isActive=!1,this._isHidden=!1,this._icon=q,this.title=te,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(ue.prototype,"icon",{get:function(){return this._icon},set:function(q){this._icon=q,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(ue.prototype,"isActive",{get:function(){return this._isActive},set:function(q){this._isActive=q,this.adjustClassName()},enumerable:!1,configurable:!0}),ue.prototype.getUI=function(){var q=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return q.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},ue.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},ue.prototype.hide=function(){this._isHidden=!0},ue}(),me=function(ue){function q(){var te=ue!==null&&ue.apply(this,arguments)||this;return te.elements=[],te}return Ae(q,ue),q.prototype.addElement=function(te){this.elements.push(te)},q.prototype.getUI=function(){var te=ue.prototype.getUI.call(this);return this.elements.forEach(function(ae){return te.appendChild(ae)}),te},q}(ye),Ee=function(){function ue(q,te){this.horizontal=q,this.vertical=te}return Object.defineProperty(ue.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),ue.prototype.getVerticalLength=function(q){return q/this.ratio},ue.prototype.getHorizontalLength=function(q){return q*this.ratio},ue}(),Le=function(){function ue(){}return ue.getIcon=function(q,te){if(q>0&&te>0){var ae=new Ee(q,te),ce=ae.ratio>=1?20:ae.getHorizontalLength(20),ie=ae.ratio<1?20:ae.getVerticalLength(20),oe=document.createElementNS("http://www.w3.org/2000/svg","svg");oe.setAttribute("xmlns","http://www.w3.org/2000/svg"),oe.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(oe);var he=k.createDefs();oe.appendChild(he);var ge=k.createElement("clipPath",[["id","text-bg-clip"]]);he.appendChild(ge);var _e=k.createPath(k.getHollowRectanglePath((24-ce)/2,(24-ie)/2,ce,ie,(24-ce)/2+2,(24-ie)/2+2,ce-4,ie-4));oe.appendChild(_e);var Oe=k.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Oe.appendChild(k.createTSpan(q+":"+te)),oe.appendChild(Oe);var Ge=Oe.getBBox();k.setAttributes(Oe,[["x",((24-Ge.width)/2).toString()],["y",((24-Ge.height)/2-Ge.y).toString()]]);var et=k.createPath(k.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Ge.width))/2,(24-Math.ceil(Ge.height))/2,Math.ceil(Ge.width),Math.ceil(Ge.height)));return ge.appendChild(et),k.setAttributes(_e,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(oe),oe.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},ue}(),Pe=function(ue){function q(te,ae,ce){var ie=ue.call(this,te,ae)||this;return ie.isDropdownOpen=!1,ie.onClick=ie.dropdownButtonClicked,ie.dropdownButtons=ce,ie}return Ae(q,ue),q.prototype.setupDropdown=function(){var te=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(ae){ae.className=te.className,ae.colorsClassName=te.colorsClassName,te.dropdownBlock.appendChild(ae.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},q.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},q.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},q.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},q.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},q.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},q}(He),Ye=function(){function ue(q,te){this.GRIP_SIZE=10,this.color=q,this.fillColor=te,this.visual=k.createGroup(),this.visual.appendChild(k.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(k.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ue.prototype.ownsTarget=function(q){return q===this.visual||q===this.visual.childNodes[0]||q===this.visual.childNodes[1]},ue.prototype.setCenter=function(q,te){this.visual.childNodes.forEach(function(ae){return k.setAttributes(ae,[["cx",q.toString()],["cy",te.toString()]])})},ue}(),tt=function(){function ue(q,te,ae,ce){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=q,this.canvasHeight=te,this.margin=ae,this.container=ce,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(ue.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(q){this._aspectRatio=q,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(ue.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(q){this._isGridVisible=q,this.gridContainer&&k.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(ue.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(q){this._zoomFactor=q,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),ue.prototype.open=function(){var q=this;this.cropShadeElement=k.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=k.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var te=0;te<this.numberOfGridLines;te++)this.horizontalGridLines.push(k.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(k.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(ae){return q.gridContainer.appendChild(ae)}),this.verticalGridLines.forEach(function(ae){return q.gridContainer.appendChild(ae)}),this.cropRectElement=k.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Ye(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Ye(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Ye(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Ye(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},ue.prototype.setCropRectangle=function(q){this.cropRect=q;var te=Object.assign({},this.cropRect);this.zoomFactor!==1&&(te.width=this.cropRect.width*this.zoomFactor,te.height=this.cropRect.height*this.zoomFactor,te.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-te.width/2,te.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-te.height/2),k.setAttributes(this.cropRectElement,[["x",te.x.toString()],["y",te.y.toString()],["width",te.width.toString()],["height",te.height.toString()]]);var ae=te.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(ie,oe){var he=te.y+ae*(oe+1);k.setAttributes(ie,[["x1",""+te.x],["y1",""+he],["x2",""+(te.x+te.width)],["y2",""+he]])});var ce=te.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(ie,oe){var he=te.x+ce*(oe+1);k.setAttributes(ie,[["x1",""+he],["y1",""+te.y],["x2",""+he],["y2",""+(te.y+te.height)]])}),k.setAttributes(this.cropShadeElement,[["d",k.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,te.x,te.y,te.width,te.height)]]),this.topLeftGrip.setCenter(te.x,te.y),this.topRightGrip.setCenter(te.x+te.width,te.y),this.bottomLeftGrip.setCenter(te.x,te.y+te.height),this.bottomRightGrip.setCenter(te.x+te.width,te.y+te.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},ue.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)},ue.prototype.clientToLocalCoordinates=function(q,te){var ae=this.container.getBoundingClientRect();return{x:q-ae.left+this.margin,y:te-ae.top+this.margin}},ue.prototype.onPointerDown=function(q){this.container.setPointerCapture(q.pointerId),this.previousPoint=this.clientToLocalCoordinates(q.clientX,q.clientY),this.cropRectElement===q.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(q.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(q.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(q.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(q.target)&&(this.activeGrip=this.bottomRightGrip)},ue.prototype.onPointerMove=function(q){if(this.isMoving)this.move(this.clientToLocalCoordinates(q.clientX,q.clientY));else if(this.activeGrip){var te=this.clientToLocalCoordinates(q.clientX,q.clientY);this.resize(te)}q.preventDefault()},ue.prototype.onPointerUp=function(q){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(q.pointerId)},ue.prototype.move=function(q){var te=q.x-this.previousPoint.x,ae=q.y-this.previousPoint.y;this.zoomFactor!==1&&(te=-te/this.zoomFactor,ae=-ae/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+te),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+ae),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=q},ue.prototype.resize=function(q){var te=Object.assign({},this.cropRect),ae=q.x-this.previousPoint.x,ce=q.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:te.x+ae<this.margin&&(ae=this.margin-te.x),te.x+=ae,te.width=this.cropRect.x+this.cropRect.width-te.x;break;case this.bottomRightGrip:case this.topRightGrip:te.width+ae>this.canvasWidth*this.zoomFactor&&(ae=this.canvasWidth*this.zoomFactor-te.width),te.width+=ae}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(te.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(ae),te.height=this.aspectRatio.getVerticalLength(te.width)):(te.y+=ce,te.height=this.cropRect.y+this.cropRect.height-te.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?te.height=this.aspectRatio.getVerticalLength(te.width):te.height+=ce}te.width<10&&(te.x=this.cropRect.x,te.width=10),te.height<10&&(te.y=this.cropRect.y,te.height=10),this.previousPoint=q,te.x>=this.margin&&te.y>=this.margin&&te.x-this.margin+te.width<=this.canvasWidth&&te.y-this.margin+te.height<=this.canvasHeight&&(this.cropRect=te,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},ue.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var q=this.cropRect.x+this.cropRect.width/2,te=this.cropRect.y+this.cropRect.height/2,ae=this.aspectRatio.getHorizontalLength(this.cropRect.height),ce=this.aspectRatio.getVerticalLength(this.cropRect.width);ae/this.canvasWidth<ce/this.canvasHeight?this.cropRect.width=ae:this.cropRect.height=ce,this.cropRect.width>this.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=q-this.cropRect.width/2,this.cropRect.y=te-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)}},ue.prototype.getRescaledRect=function(q,te,ae,ce,ie,oe){var he=ae/q,ge=ce/te;return{x:(ie.x-oe)*he+oe,y:(ie.y-oe)*ge+oe,width:ie.width*he,height:ie.height*ge}},ue.prototype.scaleCanvas=function(q,te){var ae=this.getRescaledRect(this.canvasWidth,this.canvasHeight,q,te,this.cropRect,this.margin);this.canvasWidth=q,this.canvasHeight=te,this.onCropChange&&this.onCropChange(ae),this.setCropRectangle(ae)},ue}(),ut=function(){function ue(q){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=q,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(ue.prototype,"angle",{get:function(){return this._angle},set:function(q){this._angle=q,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),ue.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},ue.prototype.onPointerDown=function(q){this.controlContainer.setPointerCapture(q.pointerId),this.isDragging=!0,this.previousPoint={x:q.clientX,y:q.clientY}},ue.prototype.onPointerMove=function(q){this.isDragging&&(this.onAngleChange&&this.onAngleChange((q.clientX-this.previousPoint.x)/5),this.previousPoint.x=q.clientX)},ue.prototype.onPointerUp=function(q){this.isDragging&&this.onAngleChange&&this.onAngleChange((q.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(q.pointerId)},ue.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var q=this.angleLabelText.getBBox();k.setAttributes(this.angleLabelElement,[["x",((this.width-q.width)/2).toString()],["y",(this.height/2).toString()]])}},ue.prototype.positionScaleShape=function(){if(this.scaleShape){var q=this.scaleShape.transform.baseVal.getItem(0);q.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(q,0)}},ue.prototype.getVisual=function(){var q=document.createElementNS("http://www.w3.org/2000/svg","svg");q.setAttribute("xmlns","http://www.w3.org/2000/svg"),q.setAttribute("width",this.width+"px"),q.setAttribute("height",this.height+"px"),q.setAttribute("viewBox","0 0 "+this.width+" "+this.height),q.style.flexShrink="0",document.body.appendChild(q);for(var te="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,ae=1;ae<=this.width/5+10;ae++){var ce=ae%5==0?this.height/3:this.height/6;te+="h4v"+-ce+"h1v"+ce}te+="v1H0Z",this.scaleShape=k.createPath(te);var ie=k.createTransform();this.scaleShape.transform.baseVal.appendItem(ie),q.appendChild(this.scaleShape),this.angleLabelElement=k.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=k.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var oe=k.createTSpan("");return oe.innerHTML="&deg;",this.angleLabelElement.appendChild(oe),q.appendChild(this.angleLabelElement),document.body.removeChild(q),q},ue}(),lt=function(){function ue(){this.naturalSize=!1,this.imageType="image/png"}return ue.prototype.rasterize=function(q,te,ae,ce,ie,oe,he){var ge=this;return new Promise(function(_e){var Oe=document.createElement("canvas");Oe.width=q.width.baseVal.value-2*ce,Oe.height=q.height.baseVal.value-2*ce;var Ge=1,et=1;ge.naturalSize===!0?(Ge=te.naturalWidth/(q.width.baseVal.value-2*ce)/oe,et=te.naturalHeight/(q.height.baseVal.value-2*ce)/he,Oe.width=te.naturalWidth/oe,Oe.height=te.naturalHeight/he):ge.width!==void 0&&ge.height!==void 0&&(Ge=ge.width/ae.width,et=ge.height/ae.height,Oe.width*=Ge,Oe.height*=et);var ct=Oe.getContext("2d");ct.translate(Oe.width/2,Oe.height/2),ct.rotate(ie*Math.PI/180),ct.scale(oe,he),ct.translate(-Oe.width/2,-Oe.height/2),ct.drawImage(te,0,0,Oe.width,Oe.height);var st=document.createElement("canvas");st.width=ae.width*Ge,st.height=ae.height*et,st.getContext("2d").putImageData(ct.getImageData((ae.x-ce)*Ge,(ae.y-ce)*et,ae.width*Ge,ae.height*et),0,0),_e(st.toDataURL(ge.imageType,ge.imageQuality))})},ue}(),gt=function(){function ue(q){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=ue.instanceCounter++,this.styles=new B(this.instanceNo),this.target=q,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(ue.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(ue.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(q){this._zoomToCropEnabled=q,q?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(ue.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(q){this._isGridVisible=q,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(ue.prototype,"gridLines",{get:function(){return this._gridLines},set:function(q){this._gridLines=q,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(ue.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(q){this._rotationAngle=q,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(ue.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ue.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ue.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ue.prototype,"aspectRatio",{get:function(){var q;return(q=this._aspectRatio)!==null&&q!==void 0?q:this.aspectRatios[0]},set:function(q){this._aspectRatio=q},enumerable:!1,configurable:!0}),ue.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},ue.prototype.show=function(){this.showUI(),this.open()},ue.prototype.close=function(q){q===void 0&&(q=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),q||this.closeEventListeners.forEach(function(te){return te()}),this._isOpen=!1)},ue.prototype.addRenderEventListener=function(q){this.renderEventListeners.push(q)},ue.prototype.removeRenderEventListener=function(q){this.renderEventListeners.indexOf(q)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(q),1)},ue.prototype.addCloseEventListener=function(q){this.closeEventListeners.push(q)},ue.prototype.removeCloseEventListener=function(q){this.closeEventListeners.indexOf(q)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(q),1)},ue.prototype.setupResizeObserver=function(){var q=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){q.resize(q.target.clientWidth,q.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))},ue.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var q=1*this.target.clientWidth/this.target.clientHeight,te=this.contentDiv.clientWidth/q>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*q:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,ae=te+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/q;this.resize(te,ae)}},ue.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},ue.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",k.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},ue.prototype.resize=function(q,te){this.imageWidth=Math.round(q),this.imageHeight=Math.round(te),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},ue.prototype.setEditingTarget=function(){var q=document.createElement("canvas");q.width=this.target.naturalWidth,q.height=this.target.naturalHeight,q.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var te=q.toDataURL();k.setAttributes(this.editingTarget,[["href",te]]),this.setEditingTargetSize()},ue.prototype.setTopLeft=function(){var q=this.target.getBoundingClientRect(),te=this.editorCanvas.getBoundingClientRect();this.left=q.left-te.left-this.CANVAS_MARGIN,this.top=q.top-te.top-this.CANVAS_MARGIN},ue.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=k.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=k.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=k.createGroup(),this.editingTargetRotationScaleContainer=k.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var q=k.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(q);var te=k.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(te),this.editingTargetContainer=k.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},ue.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},ue.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=k.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new tt(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},ue.prototype.zoomToCrop=function(){if(this.cropRect){var q=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,te=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=q+"px "+te+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-q+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-te+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},ue.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},ue.prototype.cropRectChanged=function(q){this.cropRect=q,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},ue.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},ue.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"},ue.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ue.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var q=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,te=this.target.offsetTop>q+this.CANVAS_MARGIN?this.target.offsetTop-(q+this.CANVAS_MARGIN):0;this.coverDiv.style.top=te+"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},ue.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},ue.prototype.addTopToolbar=function(){var q=this;this.topToolbar=new X,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 te=new Me;te.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(te);var ae=[];this.aspectRatios.forEach(function(et){var ct=new He(Le.getIcon(et.horizontal,et.vertical),et.horizontal===0&&et.vertical===0?"FREE":et.horizontal+":"+et.vertical);ct.onClick=function(){return q.ratioButtonClicked(et)},ae.push(ct)}),this.aspectRatioButton=new Pe(Le.getIcon(0,0),"Aspect ratio",ae),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,te.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var ce=new He('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");ce.isActive=this.isGridVisible,ce.onClick=function(){q.isGridVisible=!q.isGridVisible,ce.isActive=q.isGridVisible},te.addButton(ce);var ie=new He('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(ie.isActive=this.zoomToCropEnabled,ie.onClick=function(){q.zoomToCropEnabled=!q.zoomToCropEnabled,ie.isActive=q.zoomToCropEnabled},te.addButton(ie),!Y.isLicensed){var oe=new me;this.topToolbar.addElementBlock(oe);var he=document.createElement("div");he.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var ge=document.createElement("a");ge.style.color="currentColor",ge.href="https://markerjs.com/products/cropro",ge.target="_blank",ge.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',he.appendChild(ge),oe.addElement(he)}var _e=new Me;_e.minWidth=3*this.toolbarHeight+"px",_e.contentAlign="end",this.topToolbar.addButtonBlock(_e);var Oe=new He('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");Oe.onClick=this.startRenderAndClose,_e.addButton(Oe),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Oe.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Ge=new He('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");Ge.onClick=this.close,_e.addButton(Ge),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Ge.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},ue.prototype.addBottomToolbar=function(){var q=this;this.bottomToolbar=new X,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 te=new Me;te.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(te);var ae=new He('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");ae.onClick=this.rotateLeftButtonClicked,te.addButton(ae);var ce=new He('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");ce.onClick=this.rotateRightButtonClicked,te.addButton(ce);var ie=new me;ie.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(ie),this.straightener=new ut("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(_e){q.rotateBy(_e),q.straightener.angle=q.rotationAngle},ie.addElement(this.straightener.getUI());var oe=new Me;oe.minWidth=2*this.toolbarHeight+"px",oe.contentAlign="end",this.bottomToolbar.addButtonBlock(oe);var he=new He('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");he.onClick=this.flipHorizontallyButtonClicked,oe.addButton(he);var ge=new He('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");ge.onClick=this.flipVerticallyButtonClicked,oe.addButton(ge)},ue.prototype.ratioButtonClicked=function(q){this.aspectRatio=q,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},ue.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Le.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},ue.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Ee(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},ue.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ue.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},ue.prototype.restoreState=function(q){if(q){var te=this.cropLayer.getRescaledRect(q.width,q.height,this.imageWidth,this.imageHeight,q.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(te),this.cropRectChanged(te),this.flippedHorizontally=q.flippedHorizontally,this.flippedVertically=q.flippedVertically,this.applyFlip(),this.rotationAngle=q.rotationAngle,this.applyRotation()}},ue.prototype.clientToLocalCoordinates=function(q,te){var ae=this.cropImage.getBoundingClientRect();return{x:q-ae.left,y:te-ae.top}},ue.prototype.onWindowResize=function(){this.positionUI()},ue.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var q=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=q+"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()},ue.prototype.rotateLeftButtonClicked=function(){var q=this.rotationAngle-90;this.rotationAngle%90!=0&&(q+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(q)},ue.prototype.rotateRightButtonClicked=function(){var q=this.rotationAngle+90;this.rotationAngle%90!=0&&(q-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(q)},ue.prototype.rotateTo=function(q){q=(q=q>180?q-360:q)<=-180?q+360:q,this.rotationAngle=q,this.applyRotation()},ue.prototype.rotateBy=function(q){this.rotateTo((this.rotationAngle+q)%360)},ue.prototype.applyRotation=function(){var q=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var te=this.editingTargetRotationContainer.transform.baseVal.getItem(0);te.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(te,0);var ae=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/ae.width,this.imageHeight/ae.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=q},ue.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},ue.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},ue.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},ue.prototype.startRenderAndClose=function(){return De(this,void 0,void 0,function(){var q,te;return ve(this,function(ae){switch(ae.label){case 0:return[4,this.render()];case 1:return q=ae.sent(),te=this.getState(),this.renderEventListeners.forEach(function(ce){return ce(q,te)}),this.close(!0),[2]}})})},ue.prototype.render=function(){return De(this,void 0,void 0,function(){var q;return ve(this,function(te){switch(te.label){case 0:return(q=new lt).naturalSize=this.renderAtNaturalSize,q.imageType=this.renderImageType,q.imageQuality=this.renderImageQuality,q.width=this.renderWidth,q.height=this.renderHeight,this.unzoomFromCrop(),k.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,q.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 te.sent(),[4,q.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,te.sent()]}})})},ue.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new re("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 re("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new re("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var q=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new re("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*q)+`px;
height: `+(this.toolbarHeight-2*q)+`px;
padding: `+q+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new re("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new re("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new Z("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new Z("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new re("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 re("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new re("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 re("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*q)+`px;
padding: `+q+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new re("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},ue.instanceCounter=0,ue}(),ht=M("8hTe"),Ie=M.n(ht),Re=/<pre[^>]*>/g;function $e(ue){var q=document.createElement("div");return q.innerHTML=ue,q.childNodes.length===0?"":q.childNodes[0].nodeValue}var Ze=de.a=function(ue){var q=ue.value,te=q===void 0?"":q,ae=ue.edit,ce=ae===void 0?!1:ae,ie=ue.className,oe=ue.showTextOnly,he=ue.showLines,ge=ue.replaces,_e=ue.zoomImg,Oe=ue.hasMask,Ge=ue.style,et=Ge===void 0?{}:Ge,ct=ue.stylesPrev,st=ct===void 0?{}:ct,nt=String(te),We=Object(I.useRef)(),Ve=Object(I.useRef)(),Ne=Object(I.useState)(""),pe=Object(K.a)(Ne,2),xe=pe[0],Xe=pe[1],je=Object(I.useState)("office"),it=Object(K.a)(je,2),ot=it[0],Ke=it[1],Je=function(){var Wt=new gt(Ve.current);Wt.displayMode="popup",Wt.addRenderEventListener(function(){var Xt=Object(O.a)(n.a.mark(function Ot(Mt){var Ft;return n.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:return We.current.style.display="none",vn.next=3,Object(we.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Mt}});case 3:Ft=vn.sent,Ft!=null&&Ft.id&&ge(Ve.current.getAttribute("src").replace(Q.a.API_SERVER,""),"/api/attachments/".concat(Ft==null?void 0:Ft.id,"?type=").concat(Ft.content_type));case 5:case"end":return vn.stop()}},Ot)}));return function(Ot){return Xt.apply(this,arguments)}}()),Wt.show()},Qe=function(){var Wt=new be.a(Ve.current);Wt.settings.displayMode="popup",Wt.addEventListener("render",function(){var Xt=Object(O.a)(n.a.mark(function Ot(Mt){var Ft;return n.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:if(We.current.style.display="none",!Ve.current){vn.next=6;break}return vn.next=4,Object(we.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Mt.dataUrl}});case 4:Ft=vn.sent,Ft!=null&&Ft.id&&ge(Ve.current.getAttribute("src").replace(Q.a.API_SERVER,""),"/api/attachments/".concat(Ft==null?void 0:Ft.id,"?type=").concat(Ft.content_type));case 6:case"end":return vn.stop()}},Ot)}));return function(Ot){return Xt.apply(this,arguments)}}()),Wt.show(),window.markerArea=Wt},pt=Object(I.useMemo)(function(){We.current&&(We.current.style.zIndex=-1);try{var ft=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Wt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Xt=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;nt=nt.replace(ft,"("+Q.a.API_SERVER+"/api/attachments/").replace(Wt,'"'+Q.a.API_SERVER+"/api/attachments/").replace(Xt,'"'+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(On){}var Ot=H(nt),Mt=C();if(nt.match(/\[TOC\]/)&&(Ot=Ot.replace("<p>[TOC]</p>",L()),T()),Ot=Ot.replace(/(__special_katext_id_\d+__)/g,function(On,vn){var rt=Mt[vn],vt=rt.type,zn=rt.expression;return Object(se.renderToString)($e(zn)||"",{displayMode:vt==="block",throwOnError:!1,output:"html"})}),Ot=Ot.replace(/▁/g,"\u2581\u2581\u2581"),E(),oe){var Ft=document.createElement("div");return Ft.innerHTML=Ot,Ft.innerText}return setTimeout(function(){return rn()},500),Ot},[nt]),dt=Object(I.useRef)();w.WebkitLineClamp=he,he&&(et=Object(N.a)(Object(N.a)({},et),w));function Vt(ft){var Wt=ft.target;if(Wt.tagName.toUpperCase()==="IMG"){if(_e){var Xt=Wt.getAttribute("src");Xe(Xt),Ke("image")}}else if(Wt.tagName.toUpperCase()==="A"){var Ot=Wt.getAttribute("href");if(Ot.indexOf("office")>-1)ft.preventDefault(),Xe(Ot),Ke("office");else if(Ot.indexOf("application/pdf")>-1)ft.preventDefault(),Xe(Ot),Ke("pdf");else if(Ot.indexOf("text/html")>-1)ft.preventDefault(),Xe(Ot),Ke("html");else if(Ot.startsWith("#")){ft.preventDefault();var Mt=document.getElementById(Ot.replace("#",""));Mt&&Mt.scrollIntoView(!0)}}}var rn=function(){var Wt,Xt=(Wt=dt.current)===null||Wt===void 0?void 0:Wt.querySelectorAll("video");Xt==null||Xt.forEach(function(Ot){if(Ot.oncontextmenu=function(){return!1},Ot.src.indexOf(".m3u8")>-1&&!Ot.canPlayType("application/vnd.apple.mpegurl")){if(G.a.isSupported()){var Mt=new G.a;Mt.loadSource(Ot.src),Mt.attachMedia(Ot)}}})};Object(I.useEffect)(function(){if(dt.current&&pt&&(pt.match(Re)&&window.PR.prettyPrint()),dt.current)return dt.current.addEventListener("click",Vt),function(){dt.current.removeEventListener("click",Vt),E(),T()}},[pt,dt.current,Vt]);var an=function(Wt){if(!ce)return;Wt.target.nodeName==="IMG"?(We.current.style.zIndex=1,We.current.style.display="flex",We.current.style.width=Wt.target.clientWidth+"px",We.current.style.height=Wt.target.clientHeight+"px",We.current.style.top=Wt.target.offsetTop+"px",We.current.style.left=Wt.target.offsetLeft+"px",Ve.current.src=Wt.target.getAttribute("src")):We.current.style.display="none"};return g.a.createElement("div",{style:{position:"relative"}},g.a.createElement("div",{ref:dt,style:Object(N.a)({},et),className:"".concat(ie||""," markdown-body ").concat(Ie.a.mdBody),onMouseOver:an,dangerouslySetInnerHTML:{__html:pt}}),g.a.createElement("div",{ref:We,className:Ie.a.button},g.a.createElement(z.a,null,g.a.createElement(V.a,{onClick:function(){return Je()}},"\u88C1\u526A"),g.a.createElement(V.a,{onClick:function(){return Qe()}},"\u7F16\u8F91"))),g.a.createElement("img",{ref:Ve,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),g.a.createElement(fe.a,{close:!0,data:xe,type:xe!=null&&xe.length?ot:"",style:Object(N.a)({},st),onClose:function(){return Xe("")}}))}},"9VGf":function(Ue,de,M){"use strict";M.d(de,"a",function(){return D});var J=M("q1tI"),z=M.n(J);function D(V,N){var O=Object(J.useRef)();Object(J.useEffect)(function(){O.current=V}),Object(J.useEffect)(function(){function K(){O.current()}if(N!==null){var W=setInterval(K,N);return function(){return clearInterval(W)}}},[N])}},AMnG:function(Ue,de,M){"use strict";var J=M("miYZ"),z=M("tsqr"),D=M("tJVT"),V=M("q1tI"),N=M.n(V),O=M("nWbc"),K=M.n(O),W=M("Ot1p");de.a=function(n){var I=n.id,g=n.activeDiscussIndex,f=n.onReplyDiscuss,h=Object(V.useState)(""),c=Object(D.a)(h,2),s=c[0],d=c[1];function i(r){d(r)}function a(){if(!s){z.b.info("\u56DE\u590D\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A!");return}f(I,s),d("")}return N.a.createElement("div",{key:I,className:"discuss-item-editor",style:{display:g===I?"block":"none",width:"100%"}},N.a.createElement(W.a,{miniToolbar:!0,startInit:g===I,defaultValue:s,id:I,noStorage:!0,watch:!1,height:155,placeholder:"\u6211\u8981\u56DE\u590D",showResizeBar:!0,onChange:i}),N.a.createElement("a",{onClick:a,className:"btn-send"},"\u53D1\u9001"))}},BU3w:function(Ue,de,M){"use strict";M.d(de,"a",function(){return O});var J=M("MNnm"),z="rc-util-key";function D(K){if(K.attachTo)return K.attachTo;var W=document.querySelector("head");return W||document.body}function V(K){var W,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(J.a)())return null;var I=document.createElement("style");if((W=n.csp)===null||W===void 0?void 0:W.nonce){var g;I.nonce=(g=n.csp)===null||g===void 0?void 0:g.nonce}I.innerHTML=K;var f=D(n),h=f.firstChild;return n.prepend&&f.prepend?f.prepend(I):n.prepend&&h?f.insertBefore(I,h):f.appendChild(I),I}var N=new Map;function O(K,W){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},I=D(n);if(!N.has(I)){var g=V("",n),f=g.parentNode;N.set(I,f),f.removeChild(g)}var h=Array.from(N.get(I).children).find(function(a){return a.tagName==="STYLE"&&a[z]===W});if(h){var c,s;if(((c=n.csp)===null||c===void 0?void 0:c.nonce)&&h.nonce!==((s=n.csp)===null||s===void 0?void 0:s.nonce)){var d;h.nonce=(d=n.csp)===null||d===void 0?void 0:d.nonce}return h.innerHTML!==K&&(h.innerHTML=K),h}var i=V(K,n);return i[z]=W,i}},Bd2K:function(Ue,de,M){(function(J){J(M("VrN/"),M("osHv"))})(function(J){J.defineOption("autoCloseTags",!1,function(n,I,g){if(g!=J.Init&&g&&n.removeKeyMap("autoCloseTags"),!I)return;var f={name:"autoCloseTags"};(typeof I!="object"||I.whenClosing!==!1)&&(f["'/'"]=function(h){return O(h)}),(typeof I!="object"||I.whenOpening!==!1)&&(f["'>'"]=function(h){return V(h)}),n.addKeyMap(f)});var z=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],D=["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 V(n){if(n.getOption("disableInput"))return J.Pass;for(var I=n.listSelections(),g=[],f=n.getOption("autoCloseTags"),h=0;h<I.length;h++){if(!I[h].empty())return J.Pass;var c=I[h].head,s=n.getTokenAt(c),d=J.innerMode(n.getMode(),s.state),i=d.state,a=d.mode.xmlCurrentTag&&d.mode.xmlCurrentTag(i),r=a&&a.name;if(!r)return J.Pass;var o=d.mode.configuration=="html",T=typeof f=="object"&&f.dontCloseTags||o&&z,w=typeof f=="object"&&f.indentTags||o&&D;s.end>c.ch&&(r=r.slice(0,r.length-s.end+c.ch));var x=r.toLowerCase();if(!r||s.type=="string"&&(s.end!=c.ch||!/[\"\']/.test(s.string.charAt(s.string.length-1))||s.string.length==1)||s.type=="tag"&&a.close||s.string.indexOf("/")==c.ch-s.start-1||T&&K(T,x)>-1||W(n,d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(i)||[],r,c,!0))return J.Pass;var L=typeof f=="object"&&f.emptyTags;if(L&&K(L,r)>-1){g[h]={text:"/>",newPos:J.Pos(c.line,c.ch+2)};continue}var A=w&&K(w,x)>-1;g[h]={indent:A,text:">"+(A?`
`:"")+"</"+r+">",newPos:A?J.Pos(c.line+1,0):J.Pos(c.line,c.ch+1)}}for(var _=typeof f=="object"&&f.dontIndentOnAutoClose,h=I.length-1;h>=0;h--){var b=g[h];n.replaceRange(b.text,I[h].head,I[h].anchor,"+insert");var m=n.listSelections().slice(0);m[h]={head:b.newPos,anchor:b.newPos},n.setSelections(m),!_&&b.indent&&(n.indentLine(b.newPos.line,null,!0),n.indentLine(b.newPos.line+1,null,!0))}}function N(n,I){for(var g=n.listSelections(),f=[],h=I?"/":"</",c=n.getOption("autoCloseTags"),s=typeof c=="object"&&c.dontIndentOnSlash,d=0;d<g.length;d++){if(!g[d].empty())return J.Pass;var i=g[d].head,a=n.getTokenAt(i),r=J.innerMode(n.getMode(),a.state),o=r.state;if(I&&(a.type=="string"||a.string.charAt(0)!="<"||a.start!=i.ch-1))return J.Pass;var T,w=r.mode.name!="xml"&&n.getMode().name=="htmlmixed";if(w&&r.mode.name=="javascript")T=h+"script";else if(w&&r.mode.name=="css")T=h+"style";else{var x=r.mode.xmlCurrentContext&&r.mode.xmlCurrentContext(o);if(!x||x.length&&W(n,x,x[x.length-1],i))return J.Pass;T=h+x[x.length-1]}n.getLine(i.line).charAt(a.end)!=">"&&(T+=">"),f[d]=T}if(n.replaceSelections(f),g=n.listSelections(),!s)for(var d=0;d<g.length;d++)(d==g.length-1||g[d].head.line<g[d+1].head.line)&&n.indentLine(g[d].head.line)}function O(n){return n.getOption("disableInput")?J.Pass:N(n,!0)}J.commands.closeTag=function(n){return N(n)};function K(n,I){if(n.indexOf)return n.indexOf(I);for(var g=0,f=n.length;g<f;++g)if(n[g]==I)return g;return-1}function W(n,I,g,f,h){if(!J.scanForClosingTag)return!1;var c=Math.min(n.lastLine()+1,f.line+500),s=J.scanForClosingTag(n,f,null,c);if(!s||s.tag!=g)return!1;for(var d=h?1:0,i=I.length-1;i>=0&&I[i]==g;i--)++d;f=s.to;for(var i=1;i<d;i++){var a=J.scanForClosingTag(n,f,null,c);if(!a||a.tag!=g)return!1;f=a.to}return!0}})},BdwD:function(Ue,de,M){"use strict";var J=M("+L6B"),z=M("2/Rp"),D=M("0Owb"),V=M("k1fw"),N=M("q1tI"),O=M.n(N),K=M("FOrL"),W=M.n(K),n=function(g){var f=g.buttonProps,h=f===void 0?{}:f,c=g.styles,s=c===void 0?{}:c,d=g.imgStyles,i=d===void 0?{}:d,a=g.customText,r=g.ButtonText,o=g.ButtonClick,T=g.Buttonclass,w=g.ButtonTwo;return O.a.createElement("section",{className:"tc animated fadeIn",style:Object(V.a)(Object(V.a)({},{color:"#999",margin:"0 auto",padding:"100px 0"}),s)},O.a.createElement("img",{src:W.a,style:Object(V.a)(Object(V.a)({},{width:"200px",height:"150px"}),i)}),O.a.createElement("p",{className:"mt10 font14"},a||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),r&&O.a.createElement(z.a,Object(D.a)({className:T,onClick:o},h),r),w&&w)};de.a=n},BjJ7:function(Ue,de,M){"use strict";M.d(de,"d",function(){return z}),M.d(de,"c",function(){return D}),M.d(de,"e",function(){return V}),M.d(de,"b",function(){return N}),M.d(de,"a",function(){return K});var J=M("m3rI");function z(W){var n=!0;if(W.length>0){for(var I=0;I<W.length;I++)if(W[I].compile_success==0||!W[I].compile_success){n=!1;break}}else n=!1;return n}function D(W){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",I=[],g=0;g<W.length;g++){var f=W[g],h=n?"".concat(n,"/").concat(f.name):"".concat(f.name);I.push({title:f.name,isLeaf:!(f.type==="tree"),key:h})}return I}function V(W,n,I){for(var g=0;g<W.length;g++){var f=W[g];if(f.key===n){f.children=I;break}f.children&&V(f.children,n,I)}return W}function N(W,n,I){var g;return function(){var f=this,h=arguments,c=function(){g=null,I||W.apply(f,h)},s=I&&!g;clearTimeout(g),g=setTimeout(c,n),s&&W.apply(f,h)}}var O=!0,K=J.a.API_SERVER},"C+DQ":function(Ue,de,M){},"C/vA":function(Ue,de,M){"use strict";M.d(de,"a",function(){return J});function J(z){const D=this;let V=!1,N;return function(){return V||(V=!0,N=z.apply(D,arguments)),N}}},"Cg/j":function(Ue,de,M){"use strict";M.d(de,"b",function(){return J}),M.d(de,"a",function(){return z}),M.d(de,"c",function(){return V}),M.d(de,"d",function(){return N});var J;(function(O){O.serviceIds=new Map,O.DI_TARGET="$di$target",O.DI_DEPENDENCIES="$di$dependencies";function K(W){return W[O.DI_DEPENDENCIES]||[]}O.getServiceDependencies=K})(J||(J={}));const z=V("instantiationService");function D(O,K,W,n){K[J.DI_TARGET]===K?K[J.DI_DEPENDENCIES].push({id:O,index:W,optional:n}):(K[J.DI_DEPENDENCIES]=[{id:O,index:W,optional:n}],K[J.DI_TARGET]=K)}function V(O){if(J.serviceIds.has(O))return J.serviceIds.get(O);const K=function(W,n,I){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");D(K,W,I,!1)};return K.toString=()=>O,J.serviceIds.set(O,K),K}function N(O){return function(K,W,n){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");D(O,K,n,!0)}}},CrYA:function(Ue,de,M){var J=M("MFOe"),z=J.Global;Ue.exports={name:"sessionStorage",read:V,write:N,each:O,remove:K,clearAll:W};function D(){return z.sessionStorage}function V(n){return D().getItem(n)}function N(n,I){return D().setItem(n,I)}function O(n){for(var I=D().length-1;I>=0;I--){var g=D().key(I);n(V(g),g)}}function K(n){return D().removeItem(n)}function W(){return D().clear()}},DlQD:function(Ue,de,M){(function(J,z){Ue.exports=z()})(this,function(){"use strict";function J(te,ae){for(var ce=0;ce<ae.length;ce++){var ie=ae[ce];ie.enumerable=ie.enumerable||!1,ie.configurable=!0,"value"in ie&&(ie.writable=!0),Object.defineProperty(te,ie.key,ie)}}function z(te,ae,ce){return ae&&J(te.prototype,ae),ce&&J(te,ce),te}function D(te,ae){if(!te)return;if(typeof te=="string")return V(te,ae);var ce=Object.prototype.toString.call(te).slice(8,-1);if(ce==="Object"&&te.constructor&&(ce=te.constructor.name),ce==="Map"||ce==="Set")return Array.from(te);if(ce==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ce))return V(te,ae)}function V(te,ae){(ae==null||ae>te.length)&&(ae=te.length);for(var ce=0,ie=new Array(ae);ce<ae;ce++)ie[ce]=te[ce];return ie}function N(te,ae){var ce;if(typeof Symbol=="undefined"||te[Symbol.iterator]==null){if(Array.isArray(te)||(ce=D(te))||ae&&te&&typeof te.length=="number"){ce&&(te=ce);var ie=0;return function(){return ie>=te.length?{done:!0}:{done:!1,value:te[ie++]}}}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=te[Symbol.iterator](),ce.next.bind(ce)}function O(te,ae){return ae={exports:{}},te(ae,ae.exports),ae.exports}var K=O(function(te){function ae(){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(ie){te.exports.defaults=ie}te.exports={defaults:ae(),getDefaults:ae,changeDefaults:ce}}),W=K.defaults,n=K.getDefaults,I=K.changeDefaults,g=/[&<>"']/,f=/[&<>"']/g,h=/[<>"']|&(?!#?\w+;)/,c=/[<>"']|&(?!#?\w+;)/g,s={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},d=function(ae){return s[ae]};function i(te,ae){if(ae){if(g.test(te))return te.replace(f,d)}else if(h.test(te))return te.replace(c,d);return te}var a=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function r(te){return te.replace(a,function(ae,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 o=/(^|[^\[])\^/g;function T(te,ae){te=te.source||te,ae=ae||"";var ce={replace:function(oe,he){return he=he.source||he,he=he.replace(o,"$1"),te=te.replace(oe,he),ce},getRegex:function(){return new RegExp(te,ae)}};return ce}var w=/[^\w:]/g,x=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function L(te,ae,ce){if(te){var ie;try{ie=decodeURIComponent(r(ce)).replace(w,"").toLowerCase()}catch(oe){return null}if(ie.indexOf("javascript:")===0||ie.indexOf("vbscript:")===0||ie.indexOf("data:")===0)return null}ae&&!x.test(ce)&&(ce=p(ae,ce));try{ce=encodeURI(ce).replace(/%25/g,"%")}catch(oe){return null}return ce}var A={},_=/^[^:]+:\/*[^/]*$/,b=/^([^:]+:)[\s\S]*$/,m=/^([^:]+:\/*[^/]*)[\s\S]*$/;function p(te,ae){A[" "+te]||(_.test(te)?A[" "+te]=te+"/":A[" "+te]=P(te,"/",!0)),te=A[" "+te];var ce=te.indexOf(":")===-1;return ae.substring(0,2)==="//"?ce?ae:te.replace(b,"$1")+ae:ae.charAt(0)==="/"?ce?ae:te.replace(m,"$1")+ae:te+ae}var C={exec:function(){}};function E(te){for(var ae=1,ce,ie;ae<arguments.length;ae++){ce=arguments[ae];for(ie in ce)Object.prototype.hasOwnProperty.call(ce,ie)&&(te[ie]=ce[ie])}return te}function v(te,ae){var ce=te.replace(/\|/g,function(he,ge,_e){for(var Oe=!1,Ge=ge;--Ge>=0&&_e[Ge]==="\\";)Oe=!Oe;return Oe?"|":" |"}),ie=ce.split(/ \|/),oe=0;if(ie.length>ae)ie.splice(ae);else for(;ie.length<ae;)ie.push("");for(;oe<ie.length;oe++)ie[oe]=ie[oe].trim().replace(/\\\|/g,"|");return ie}function P(te,ae,ce){var ie=te.length;if(ie===0)return"";for(var oe=0;oe<ie;){var he=te.charAt(ie-oe-1);if(he===ae&&!ce)oe++;else if(he!==ae&&ce)oe++;else break}return te.substr(0,ie-oe)}function F(te,ae){if(te.indexOf(ae[1])===-1)return-1;for(var ce=te.length,ie=0,oe=0;oe<ce;oe++)if(te[oe]==="\\")oe++;else if(te[oe]===ae[0])ie++;else if(te[oe]===ae[1]&&(ie--,ie<0))return oe;return-1}function R(te){te&&te.sanitize&&!te.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var H={escape:i,unescape:r,edit:T,cleanUrl:L,resolveUrl:p,noopTest:C,merge:E,splitCells:v,rtrim:P,findClosingBracket:F,checkSanitizeDeprecation:R},U=K.defaults,S=H.rtrim,G=H.splitCells,Q=H.escape,se=H.findClosingBracket;function fe(te,ae,ce){var ie=ae.href,oe=ae.title?Q(ae.title):null,he=te[1].replace(/\\([\[\]])/g,"$1");return te[0].charAt(0)!=="!"?{type:"link",raw:ce,href:ie,title:oe,text:he}:{type:"image",raw:ce,href:ie,title:oe,text:Q(he)}}function we(te,ae){var ce=te.match(/^(\s+)(?:```)/);if(ce===null)return ae;var ie=ce[1];return ae.split(`
`).map(function(oe){var he=oe.match(/^\s+/);if(he===null)return oe;var ge=he[0];return ge.length>=ie.length?oe.slice(ie.length):oe}).join(`
`)}var be=function(){function te(ce){this.options=ce||U}var ae=te.prototype;return ae.space=function(ie){var oe=this.rules.block.newline.exec(ie);if(oe)return oe[0].length>1?{type:"space",raw:oe[0]}:{raw:`
`}},ae.code=function(ie,oe){var he=this.rules.block.code.exec(ie);if(he){var ge=oe[oe.length-1];if(ge&&ge.type==="paragraph")return{raw:he[0],text:he[0].trimRight()};var _e=he[0].replace(/^ {4}/gm,"");return{type:"code",raw:he[0],codeBlockStyle:"indented",text:this.options.pedantic?_e:S(_e,`
`)}}},ae.fences=function(ie){var oe=this.rules.block.fences.exec(ie);if(oe){var he=oe[0],ge=we(he,oe[3]||"");return{type:"code",raw:he,lang:oe[2]?oe[2].trim():oe[2],text:ge}}},ae.heading=function(ie){var oe=this.rules.block.heading.exec(ie);if(oe)return{type:"heading",raw:oe[0],depth:oe[1].length,text:oe[2]}},ae.nptable=function(ie){var oe=this.rules.block.nptable.exec(ie);if(oe){var he={type:"table",header:G(oe[1].replace(/^ *| *\| *$/g,"")),align:oe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:oe[3]?oe[3].replace(/\n$/,"").split(`
`):[],raw:oe[0]};if(he.header.length===he.align.length){var ge=he.align.length,_e;for(_e=0;_e<ge;_e++)/^ *-+: *$/.test(he.align[_e])?he.align[_e]="right":/^ *:-+: *$/.test(he.align[_e])?he.align[_e]="center":/^ *:-+ *$/.test(he.align[_e])?he.align[_e]="left":he.align[_e]=null;for(ge=he.cells.length,_e=0;_e<ge;_e++)he.cells[_e]=G(he.cells[_e],he.header.length);return he}}},ae.hr=function(ie){var oe=this.rules.block.hr.exec(ie);if(oe)return{type:"hr",raw:oe[0]}},ae.blockquote=function(ie){var oe=this.rules.block.blockquote.exec(ie);if(oe){var he=oe[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:oe[0],text:he}}},ae.list=function(ie){var oe=this.rules.block.list.exec(ie);if(oe){for(var he=oe[0],ge=oe[2],_e=ge.length>1,Oe=ge[ge.length-1]===")",Ge={type:"list",raw:he,ordered:_e,start:_e?+ge.slice(0,-1):"",loose:!1,items:[]},et=oe[0].match(this.rules.block.item),ct=!1,st,nt,We,Ve,Ne,pe,xe,Xe=et.length,je=0;je<Xe;je++)st=et[je],he=st,nt=st.length,st=st.replace(/^ *([*+-]|\d+[.)]) */,""),~st.indexOf(`
`)&&(nt-=st.length,st=this.options.pedantic?st.replace(/^ {1,4}/gm,""):st.replace(new RegExp("^ {1,"+nt+"}","gm"),"")),je!==Xe-1&&(We=this.rules.block.bullet.exec(et[je+1])[0],(_e?We.length===1||!Oe&&We[We.length-1]===")":We.length>1||this.options.smartLists&&We!==ge)&&(Ve=et.slice(je+1).join(`
`),Ge.raw=Ge.raw.substring(0,Ge.raw.length-Ve.length),je=Xe-1)),Ne=ct||/\n\n(?!\s*$)/.test(st),je!==Xe-1&&(ct=st.charAt(st.length-1)===`
`,Ne||(Ne=ct)),Ne&&(Ge.loose=!0),pe=/^\[[ xX]\] /.test(st),xe=void 0,pe&&(xe=st[1]!==" ",st=st.replace(/^\[[ xX]\] +/,"")),Ge.items.push({type:"list_item",raw:he,task:pe,checked:xe,loose:Ne,text:st});return Ge}},ae.html=function(ie){var oe=this.rules.block.html.exec(ie);if(oe)return{type:this.options.sanitize?"paragraph":"html",raw:oe[0],pre:!this.options.sanitizer&&(oe[1]==="pre"||oe[1]==="script"||oe[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(oe[0]):Q(oe[0]):oe[0]}},ae.def=function(ie){var oe=this.rules.block.def.exec(ie);if(oe){oe[3]&&(oe[3]=oe[3].substring(1,oe[3].length-1));var he=oe[1].toLowerCase().replace(/\s+/g," ");return{tag:he,raw:oe[0],href:oe[2],title:oe[3]}}},ae.table=function(ie){var oe=this.rules.block.table.exec(ie);if(oe){var he={type:"table",header:G(oe[1].replace(/^ *| *\| *$/g,"")),align:oe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:oe[3]?oe[3].replace(/\n$/,"").split(`
`):[]};if(he.header.length===he.align.length){he.raw=oe[0];var ge=he.align.length,_e;for(_e=0;_e<ge;_e++)/^ *-+: *$/.test(he.align[_e])?he.align[_e]="right":/^ *:-+: *$/.test(he.align[_e])?he.align[_e]="center":/^ *:-+ *$/.test(he.align[_e])?he.align[_e]="left":he.align[_e]=null;for(ge=he.cells.length,_e=0;_e<ge;_e++)he.cells[_e]=G(he.cells[_e].replace(/^ *\| *| *\| *$/g,""),he.header.length);return he}}},ae.lheading=function(ie){var oe=this.rules.block.lheading.exec(ie);if(oe)return{type:"heading",raw:oe[0],depth:oe[2].charAt(0)==="="?1:2,text:oe[1]}},ae.paragraph=function(ie){var oe=this.rules.block.paragraph.exec(ie);if(oe)return{type:"paragraph",raw:oe[0],text:oe[1].charAt(oe[1].length-1)===`
`?oe[1].slice(0,-1):oe[1]}},ae.text=function(ie,oe){var he=this.rules.block.text.exec(ie);if(he){var ge=oe[oe.length-1];return ge&&ge.type==="text"?{raw:he[0],text:he[0]}:{type:"text",raw:he[0],text:he[0]}}},ae.escape=function(ie){var oe=this.rules.inline.escape.exec(ie);if(oe)return{type:"escape",raw:oe[0],text:Q(oe[1])}},ae.tag=function(ie,oe,he){var ge=this.rules.inline.tag.exec(ie);if(ge)return!oe&&/^<a /i.test(ge[0])?oe=!0:oe&&/^<\/a>/i.test(ge[0])&&(oe=!1),!he&&/^<(pre|code|kbd|script)(\s|>)/i.test(ge[0])?he=!0:he&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ge[0])&&(he=!1),{type:this.options.sanitize?"text":"html",raw:ge[0],inLink:oe,inRawBlock:he,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ge[0]):Q(ge[0]):ge[0]}},ae.link=function(ie){var oe=this.rules.inline.link.exec(ie);if(oe){var he=se(oe[2],"()");if(he>-1){var ge=oe[0].indexOf("!")===0?5:4,_e=ge+oe[1].length+he;oe[2]=oe[2].substring(0,he),oe[0]=oe[0].substring(0,_e).trim(),oe[3]=""}var Oe=oe[2],Ge="";if(this.options.pedantic){var et=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Oe);et?(Oe=et[1],Ge=et[3]):Ge=""}else Ge=oe[3]?oe[3].slice(1,-1):"";Oe=Oe.trim().replace(/^<([\s\S]*)>$/,"$1");var ct=fe(oe,{href:Oe&&Oe.replace(this.rules.inline._escapes,"$1"),title:Ge&&Ge.replace(this.rules.inline._escapes,"$1")},oe[0]);return ct}},ae.reflink=function(ie,oe){var he;if((he=this.rules.inline.reflink.exec(ie))||(he=this.rules.inline.nolink.exec(ie))){var ge=(he[2]||he[1]).replace(/\s+/g," ");if(ge=oe[ge.toLowerCase()],!ge||!ge.href){var _e=he[0].charAt(0);return{type:"text",raw:_e,text:_e}}var Oe=fe(he,ge,he[0]);return Oe}},ae.strong=function(ie,oe,he){he===void 0&&(he="");var ge=this.rules.inline.strong.start.exec(ie);if(ge&&(!ge[1]||ge[1]&&(he===""||this.rules.inline.punctuation.exec(he)))){oe=oe.slice(-1*ie.length);var _e=ge[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;_e.lastIndex=0;for(var Oe;(ge=_e.exec(oe))!=null;)if(Oe=this.rules.inline.strong.middle.exec(oe.slice(0,ge.index+3)),Oe)return{type:"strong",raw:ie.slice(0,Oe[0].length),text:ie.slice(2,Oe[0].length-2)}}},ae.em=function(ie,oe,he){he===void 0&&(he="");var ge=this.rules.inline.em.start.exec(ie);if(ge&&(!ge[1]||ge[1]&&(he===""||this.rules.inline.punctuation.exec(he)))){oe=oe.slice(-1*ie.length);var _e=ge[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;_e.lastIndex=0;for(var Oe;(ge=_e.exec(oe))!=null;)if(Oe=this.rules.inline.em.middle.exec(oe.slice(0,ge.index+2)),Oe)return{type:"em",raw:ie.slice(0,Oe[0].length),text:ie.slice(1,Oe[0].length-1)}}},ae.codespan=function(ie){var oe=this.rules.inline.code.exec(ie);if(oe){var he=oe[2].replace(/\n/g," "),ge=/[^ ]/.test(he),_e=he.startsWith(" ")&&he.endsWith(" ");return ge&&_e&&(he=he.substring(1,he.length-1)),he=Q(he,!0),{type:"codespan",raw:oe[0],text:he}}},ae.br=function(ie){var oe=this.rules.inline.br.exec(ie);if(oe)return{type:"br",raw:oe[0]}},ae.del=function(ie){var oe=this.rules.inline.del.exec(ie);if(oe)return{type:"del",raw:oe[0],text:oe[1]}},ae.autolink=function(ie,oe){var he=this.rules.inline.autolink.exec(ie);if(he){var ge,_e;return he[2]==="@"?(ge=Q(this.options.mangle?oe(he[1]):he[1]),_e="mailto:"+ge):(ge=Q(he[1]),_e=ge),{type:"link",raw:he[0],text:ge,href:_e,tokens:[{type:"text",raw:ge,text:ge}]}}},ae.url=function(ie,oe){var he;if(he=this.rules.inline.url.exec(ie)){var ge,_e;if(he[2]==="@")ge=Q(this.options.mangle?oe(he[0]):he[0]),_e="mailto:"+ge;else{var Oe;do Oe=he[0],he[0]=this.rules.inline._backpedal.exec(he[0])[0];while(Oe!==he[0]);ge=Q(he[0]),he[1]==="www."?_e="http://"+ge:_e=ge}return{type:"link",raw:he[0],text:ge,href:_e,tokens:[{type:"text",raw:ge,text:ge}]}}},ae.inlineText=function(ie,oe,he){var ge=this.rules.inline.text.exec(ie);if(ge){var _e;return oe?_e=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ge[0]):Q(ge[0]):ge[0]:_e=Q(this.options.smartypants?he(ge[0]):ge[0]),{type:"text",raw:ge[0],text:_e}}},te}(),Se=H.noopTest,Ae=H.edit,De=H.merge,ve={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Se,table:Se,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ve._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ve._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ve.def=Ae(ve.def).replace("label",ve._label).replace("title",ve._title).getRegex(),ve.bullet=/(?:[*+-]|\d{1,9}[.)])/,ve.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ve.item=Ae(ve.item,"gm").replace(/bull/g,ve.bullet).getRegex(),ve.list=Ae(ve.list).replace(/bull/g,ve.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ve.def.source+")").getRegex(),ve._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",ve._comment=/<!--(?!-?>)[\s\S]*?-->/,ve.html=Ae(ve.html,"i").replace("comment",ve._comment).replace("tag",ve._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ve.paragraph=Ae(ve._paragraph).replace("hr",ve.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ve._tag).getRegex(),ve.blockquote=Ae(ve.blockquote).replace("paragraph",ve.paragraph).getRegex(),ve.normal=De({},ve),ve.gfm=De({},ve.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*|$)"}),ve.gfm.nptable=Ae(ve.gfm.nptable).replace("hr",ve.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ve._tag).getRegex(),ve.gfm.table=Ae(ve.gfm.table).replace("hr",ve.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ve._tag).getRegex(),ve.pedantic=De({},ve.normal,{html:Ae(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ve._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Se,paragraph:Ae(ve.normal._paragraph).replace("hr",ve.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",ve.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Y={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Se,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\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:Se,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};Y._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Y.punctuation=Ae(Y.punctuation).replace(/punctuation/g,Y._punctuation).getRegex(),Y._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",Y._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",Y.em.start=Ae(Y.em.start).replace(/punctuation/g,Y._punctuation).getRegex(),Y.em.middle=Ae(Y.em.middle).replace(/punctuation/g,Y._punctuation).replace(/overlapSkip/g,Y._overlapSkip).getRegex(),Y.em.endAst=Ae(Y.em.endAst,"g").replace(/punctuation/g,Y._punctuation).getRegex(),Y.em.endUnd=Ae(Y.em.endUnd,"g").replace(/punctuation/g,Y._punctuation).getRegex(),Y.strong.start=Ae(Y.strong.start).replace(/punctuation/g,Y._punctuation).getRegex(),Y.strong.middle=Ae(Y.strong.middle).replace(/punctuation/g,Y._punctuation).replace(/blockSkip/g,Y._blockSkip).getRegex(),Y.strong.endAst=Ae(Y.strong.endAst,"g").replace(/punctuation/g,Y._punctuation).getRegex(),Y.strong.endUnd=Ae(Y.strong.endUnd,"g").replace(/punctuation/g,Y._punctuation).getRegex(),Y.blockSkip=Ae(Y._blockSkip,"g").getRegex(),Y.overlapSkip=Ae(Y._overlapSkip,"g").getRegex(),Y._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Y._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Y._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])?)+(?![-_])/,Y.autolink=Ae(Y.autolink).replace("scheme",Y._scheme).replace("email",Y._email).getRegex(),Y._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Y.tag=Ae(Y.tag).replace("comment",ve._comment).replace("attribute",Y._attribute).getRegex(),Y._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Y._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,Y._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Y.link=Ae(Y.link).replace("label",Y._label).replace("href",Y._href).replace("title",Y._title).getRegex(),Y.reflink=Ae(Y.reflink).replace("label",Y._label).getRegex(),Y.reflinkSearch=Ae(Y.reflinkSearch,"g").replace("reflink",Y.reflink).replace("nolink",Y.nolink).getRegex(),Y.normal=De({},Y),Y.pedantic=De({},Y.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:Ae(/^!?\[(label)\]\((.*?)\)/).replace("label",Y._label).getRegex(),reflink:Ae(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Y._label).getRegex()}),Y.gfm=De({},Y.normal,{escape:Ae(Y.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]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),Y.gfm.url=Ae(Y.gfm.url,"i").replace("email",Y.gfm._extended_email).getRegex(),Y.breaks=De({},Y.gfm,{br:Ae(Y.br).replace("{2,}","*").getRegex(),text:Ae(Y.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var k={block:ve,inline:Y},B=K.defaults,Z=k.block,re=k.inline;function X(te){return te.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function ye(te){var ae="",ce,ie,oe=te.length;for(ce=0;ce<oe;ce++)ie=te.charCodeAt(ce),Math.random()>.5&&(ie="x"+ie.toString(16)),ae+="&#"+ie+";";return ae}var Me=function(){function te(ce){this.tokens=[],this.tokens.links=Object.create(null),this.options=ce||B,this.options.tokenizer=this.options.tokenizer||new be,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ie={block:Z.normal,inline:re.normal};this.options.pedantic?(ie.block=Z.pedantic,ie.inline=re.pedantic):this.options.gfm&&(ie.block=Z.gfm,this.options.breaks?ie.inline=re.breaks:ie.inline=re.gfm),this.tokenizer.rules=ie}te.lex=function(ie,oe){var he=new te(oe);return he.lex(ie)};var ae=te.prototype;return ae.lex=function(ie){return ie=ie.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(ie,this.tokens,!0),this.inline(this.tokens),this.tokens},ae.blockTokens=function(ie,oe,he){oe===void 0&&(oe=[]),he===void 0&&(he=!0),ie=ie.replace(/^ +$/gm,"");for(var ge,_e,Oe,Ge;ie;){if(ge=this.tokenizer.space(ie)){ie=ie.substring(ge.raw.length),ge.type&&oe.push(ge);continue}if(ge=this.tokenizer.code(ie,oe)){ie=ie.substring(ge.raw.length),ge.type?oe.push(ge):(Ge=oe[oe.length-1],Ge.raw+=`
`+ge.raw,Ge.text+=`
`+ge.text);continue}if(ge=this.tokenizer.fences(ie)){ie=ie.substring(ge.raw.length),oe.push(ge);continue}if(ge=this.tokenizer.heading(ie)){ie=ie.substring(ge.raw.length),oe.push(ge);continue}if(ge=this.tokenizer.nptable(ie)){ie=ie.substring(ge.raw.length),oe.push(ge);continue}if(ge=this.tokenizer.hr(ie)){ie=ie.substring(ge.raw.length),oe.push(ge);continue}if(ge=this.tokenizer.blockquote(ie)){ie=ie.substring(ge.raw.length),ge.tokens=this.blockTokens(ge.text,[],he),oe.push(ge);continue}if(ge=this.tokenizer.list(ie)){for(ie=ie.substring(ge.raw.length),Oe=ge.items.length,_e=0;_e<Oe;_e++)ge.items[_e].tokens=this.blockTokens(ge.items[_e].text,[],!1);oe.push(ge);continue}if(ge=this.tokenizer.html(ie)){ie=ie.substring(ge.raw.length),oe.push(ge);continue}if(he&&(ge=this.tokenizer.def(ie))){ie=ie.substring(ge.raw.length),this.tokens.links[ge.tag]||(this.tokens.links[ge.tag]={href:ge.href,title:ge.title});continue}if(ge=this.tokenizer.table(ie)){ie=ie.substring(ge.raw.length),oe.push(ge);continue}if(ge=this.tokenizer.lheading(ie)){ie=ie.substring(ge.raw.length),oe.push(ge);continue}if(he&&(ge=this.tokenizer.paragraph(ie))){ie=ie.substring(ge.raw.length),oe.push(ge);continue}if(ge=this.tokenizer.text(ie,oe)){ie=ie.substring(ge.raw.length),ge.type?oe.push(ge):(Ge=oe[oe.length-1],Ge.raw+=`
`+ge.raw,Ge.text+=`
`+ge.text);continue}if(ie){var et="Infinite loop on byte: "+ie.charCodeAt(0);if(this.options.silent){console.error(et);break}else throw new Error(et)}}return oe},ae.inline=function(ie){var oe,he,ge,_e,Oe,Ge,et=ie.length;for(oe=0;oe<et;oe++){Ge=ie[oe];switch(Ge.type){case"paragraph":case"text":case"heading":{Ge.tokens=[],this.inlineTokens(Ge.text,Ge.tokens);break}case"table":{for(Ge.tokens={header:[],cells:[]},_e=Ge.header.length,he=0;he<_e;he++)Ge.tokens.header[he]=[],this.inlineTokens(Ge.header[he],Ge.tokens.header[he]);for(_e=Ge.cells.length,he=0;he<_e;he++)for(Oe=Ge.cells[he],Ge.tokens.cells[he]=[],ge=0;ge<Oe.length;ge++)Ge.tokens.cells[he][ge]=[],this.inlineTokens(Oe[ge],Ge.tokens.cells[he][ge]);break}case"blockquote":{this.inline(Ge.tokens);break}case"list":{for(_e=Ge.items.length,he=0;he<_e;he++)this.inline(Ge.items[he].tokens);break}}}return ie},ae.inlineTokens=function(ie,oe,he,ge,_e){oe===void 0&&(oe=[]),he===void 0&&(he=!1),ge===void 0&&(ge=!1),_e===void 0&&(_e="");var Oe,Ge=ie,et;if(this.tokens.links){var ct=Object.keys(this.tokens.links);if(ct.length>0)for(;(et=this.tokenizer.rules.inline.reflinkSearch.exec(Ge))!=null;)ct.includes(et[0].slice(et[0].lastIndexOf("[")+1,-1))&&(Ge=Ge.slice(0,et.index)+"["+"a".repeat(et[0].length-2)+"]"+Ge.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(et=this.tokenizer.rules.inline.blockSkip.exec(Ge))!=null;)Ge=Ge.slice(0,et.index)+"["+"a".repeat(et[0].length-2)+"]"+Ge.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ie;){if(Oe=this.tokenizer.escape(ie)){ie=ie.substring(Oe.raw.length),oe.push(Oe);continue}if(Oe=this.tokenizer.tag(ie,he,ge)){ie=ie.substring(Oe.raw.length),he=Oe.inLink,ge=Oe.inRawBlock,oe.push(Oe);continue}if(Oe=this.tokenizer.link(ie)){ie=ie.substring(Oe.raw.length),Oe.type==="link"&&(Oe.tokens=this.inlineTokens(Oe.text,[],!0,ge)),oe.push(Oe);continue}if(Oe=this.tokenizer.reflink(ie,this.tokens.links)){ie=ie.substring(Oe.raw.length),Oe.type==="link"&&(Oe.tokens=this.inlineTokens(Oe.text,[],!0,ge)),oe.push(Oe);continue}if(Oe=this.tokenizer.strong(ie,Ge,_e)){ie=ie.substring(Oe.raw.length),Oe.tokens=this.inlineTokens(Oe.text,[],he,ge),oe.push(Oe);continue}if(Oe=this.tokenizer.em(ie,Ge,_e)){ie=ie.substring(Oe.raw.length),Oe.tokens=this.inlineTokens(Oe.text,[],he,ge),oe.push(Oe);continue}if(Oe=this.tokenizer.codespan(ie)){ie=ie.substring(Oe.raw.length),oe.push(Oe);continue}if(Oe=this.tokenizer.br(ie)){ie=ie.substring(Oe.raw.length),oe.push(Oe);continue}if(Oe=this.tokenizer.del(ie)){ie=ie.substring(Oe.raw.length),Oe.tokens=this.inlineTokens(Oe.text,[],he,ge),oe.push(Oe);continue}if(Oe=this.tokenizer.autolink(ie,ye)){ie=ie.substring(Oe.raw.length),oe.push(Oe);continue}if(!he&&(Oe=this.tokenizer.url(ie,ye))){ie=ie.substring(Oe.raw.length),oe.push(Oe);continue}if(Oe=this.tokenizer.inlineText(ie,ge,X)){ie=ie.substring(Oe.raw.length),_e=Oe.raw.slice(-1),oe.push(Oe);continue}if(ie){var st="Infinite loop on byte: "+ie.charCodeAt(0);if(this.options.silent){console.error(st);break}else throw new Error(st)}}return oe},z(te,null,[{key:"rules",get:function(){return{block:Z,inline:re}}}]),te}(),He=K.defaults,me=H.cleanUrl,Ee=H.escape,Le=function(){function te(ce){this.options=ce||He}var ae=te.prototype;return ae.code=function(ie,oe,he){var ge=(oe||"").match(/\S*/)[0];if(this.options.highlight){var _e=this.options.highlight(ie,ge);_e!=null&&_e!==ie&&(he=!0,ie=_e)}return ge?'<pre><code class="'+this.options.langPrefix+Ee(ge,!0)+'">'+(he?ie:Ee(ie,!0))+`</code></pre>
`:"<pre><code>"+(he?ie:Ee(ie,!0))+`</code></pre>
`},ae.blockquote=function(ie){return`<blockquote>
`+ie+`</blockquote>
`},ae.html=function(ie){return ie},ae.heading=function(ie,oe,he,ge){return this.options.headerIds?"<h"+oe+' id="'+this.options.headerPrefix+ge.slug(he)+'">'+ie+"</h"+oe+`>
`:"<h"+oe+">"+ie+"</h"+oe+`>
`},ae.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},ae.list=function(ie,oe,he){var ge=oe?"ol":"ul",_e=oe&&he!==1?' start="'+he+'"':"";return"<"+ge+_e+`>
`+ie+"</"+ge+`>
`},ae.listitem=function(ie){return"<li>"+ie+`</li>
`},ae.checkbox=function(ie){return"<input "+(ie?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ae.paragraph=function(ie){return"<p>"+ie+`</p>
`},ae.table=function(ie,oe){return oe&&(oe="<tbody>"+oe+"</tbody>"),`<table>
<thead>
`+ie+`</thead>
`+oe+`</table>
`},ae.tablerow=function(ie){return`<tr>
`+ie+`</tr>
`},ae.tablecell=function(ie,oe){var he=oe.header?"th":"td",ge=oe.align?"<"+he+' align="'+oe.align+'">':"<"+he+">";return ge+ie+"</"+he+`>
`},ae.strong=function(ie){return"<strong>"+ie+"</strong>"},ae.em=function(ie){return"<em>"+ie+"</em>"},ae.codespan=function(ie){return"<code>"+ie+"</code>"},ae.br=function(){return this.options.xhtml?"<br/>":"<br>"},ae.del=function(ie){return"<del>"+ie+"</del>"},ae.link=function(ie,oe,he){if(ie=me(this.options.sanitize,this.options.baseUrl,ie),ie===null)return he;var ge='<a href="'+Ee(ie)+'"';return oe&&(ge+=' title="'+oe+'"'),ge+=">"+he+"</a>",ge},ae.image=function(ie,oe,he){if(ie=me(this.options.sanitize,this.options.baseUrl,ie),ie===null)return he;var ge='<img src="'+ie+'" alt="'+he+'"';return oe&&(ge+=' title="'+oe+'"'),ge+=this.options.xhtml?"/>":">",ge},ae.text=function(ie){return ie},te}(),Pe=function(){function te(){}var ae=te.prototype;return ae.strong=function(ie){return ie},ae.em=function(ie){return ie},ae.codespan=function(ie){return ie},ae.del=function(ie){return ie},ae.html=function(ie){return ie},ae.text=function(ie){return ie},ae.link=function(ie,oe,he){return""+he},ae.image=function(ie,oe,he){return""+he},ae.br=function(){return""},te}(),Ye=function(){function te(){this.seen={}}var ae=te.prototype;return ae.slug=function(ie){var oe=ie.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(oe)){var he=oe;do this.seen[he]++,oe=he+"-"+this.seen[he];while(this.seen.hasOwnProperty(oe))}return this.seen[oe]=0,oe},te}(),tt=K.defaults,ut=H.unescape,lt=function(){function te(ce){this.options=ce||tt,this.options.renderer=this.options.renderer||new Le,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Pe,this.slugger=new Ye}te.parse=function(ie,oe){var he=new te(oe);return he.parse(ie)};var ae=te.prototype;return ae.parse=function(ie,oe){oe===void 0&&(oe=!0);var he="",ge,_e,Oe,Ge,et,ct,st,nt,We,Ve,Ne,pe,xe,Xe,je,it,ot,Ke,Je=ie.length;for(ge=0;ge<Je;ge++){Ve=ie[ge];switch(Ve.type){case"space":continue;case"hr":{he+=this.renderer.hr();continue}case"heading":{he+=this.renderer.heading(this.parseInline(Ve.tokens),Ve.depth,ut(this.parseInline(Ve.tokens,this.textRenderer)),this.slugger);continue}case"code":{he+=this.renderer.code(Ve.text,Ve.lang,Ve.escaped);continue}case"table":{for(nt="",st="",Ge=Ve.header.length,_e=0;_e<Ge;_e++)st+=this.renderer.tablecell(this.parseInline(Ve.tokens.header[_e]),{header:!0,align:Ve.align[_e]});for(nt+=this.renderer.tablerow(st),We="",Ge=Ve.cells.length,_e=0;_e<Ge;_e++){for(ct=Ve.tokens.cells[_e],st="",et=ct.length,Oe=0;Oe<et;Oe++)st+=this.renderer.tablecell(this.parseInline(ct[Oe]),{header:!1,align:Ve.align[Oe]});We+=this.renderer.tablerow(st)}he+=this.renderer.table(nt,We);continue}case"blockquote":{We=this.parse(Ve.tokens),he+=this.renderer.blockquote(We);continue}case"list":{for(Ne=Ve.ordered,pe=Ve.start,xe=Ve.loose,Ge=Ve.items.length,We="",_e=0;_e<Ge;_e++)je=Ve.items[_e],it=je.checked,ot=je.task,Xe="",je.task&&(Ke=this.renderer.checkbox(it),xe?je.tokens.length>0&&je.tokens[0].type==="text"?(je.tokens[0].text=Ke+" "+je.tokens[0].text,je.tokens[0].tokens&&je.tokens[0].tokens.length>0&&je.tokens[0].tokens[0].type==="text"&&(je.tokens[0].tokens[0].text=Ke+" "+je.tokens[0].tokens[0].text)):je.tokens.unshift({type:"text",text:Ke}):Xe+=Ke),Xe+=this.parse(je.tokens,xe),We+=this.renderer.listitem(Xe,ot,it);he+=this.renderer.list(We,Ne,pe);continue}case"html":{he+=this.renderer.html(Ve.text);continue}case"paragraph":{he+=this.renderer.paragraph(this.parseInline(Ve.tokens));continue}case"text":{for(We=Ve.tokens?this.parseInline(Ve.tokens):Ve.text;ge+1<Je&&ie[ge+1].type==="text";)Ve=ie[++ge],We+=`
`+(Ve.tokens?this.parseInline(Ve.tokens):Ve.text);he+=oe?this.renderer.paragraph(We):We;continue}default:{var Qe='Token with "'+Ve.type+'" type was not found.';if(this.options.silent){console.error(Qe);return}else throw new Error(Qe)}}}return he},ae.parseInline=function(ie,oe){oe=oe||this.renderer;var he="",ge,_e,Oe=ie.length;for(ge=0;ge<Oe;ge++){_e=ie[ge];switch(_e.type){case"escape":{he+=oe.text(_e.text);break}case"html":{he+=oe.html(_e.text);break}case"link":{he+=oe.link(_e.href,_e.title,this.parseInline(_e.tokens,oe));break}case"image":{he+=oe.image(_e.href,_e.title,_e.text);break}case"strong":{he+=oe.strong(this.parseInline(_e.tokens,oe));break}case"em":{he+=oe.em(this.parseInline(_e.tokens,oe));break}case"codespan":{he+=oe.codespan(_e.text);break}case"br":{he+=oe.br();break}case"del":{he+=oe.del(this.parseInline(_e.tokens,oe));break}case"text":{he+=oe.text(_e.text);break}default:{var Ge='Token with "'+_e.type+'" type was not found.';if(this.options.silent){console.error(Ge);return}else throw new Error(Ge)}}}return he},te}(),gt=H.merge,ht=H.checkSanitizeDeprecation,Ie=H.escape,Re=K.getDefaults,$e=K.changeDefaults,Ze=K.defaults;function ue(te,ae,ce){if(typeof te=="undefined"||te===null)throw new Error("marked(): input parameter is undefined or null");if(typeof te!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(te)+", string expected");if(typeof ae=="function"&&(ce=ae,ae=null),ae=gt({},ue.defaults,ae||{}),ht(ae),ce){var ie=ae.highlight,oe;try{oe=Me.lex(te,ae)}catch(Oe){return ce(Oe)}var he=function(Ge){var et;if(!Ge)try{et=lt.parse(oe,ae)}catch(ct){Ge=ct}return ae.highlight=ie,Ge?ce(Ge):ce(null,et)};if(!ie||ie.length<3)return he();if(delete ae.highlight,!oe.length)return he();var ge=0;ue.walkTokens(oe,function(Oe){Oe.type==="code"&&(ge++,setTimeout(function(){ie(Oe.text,Oe.lang,function(Ge,et){if(Ge)return he(Ge);et!=null&&et!==Oe.text&&(Oe.text=et,Oe.escaped=!0),ge--,ge===0&&he()})},0))}),ge===0&&he();return}try{var _e=Me.lex(te,ae);return ae.walkTokens&&ue.walkTokens(_e,ae.walkTokens),lt.parse(_e,ae)}catch(Oe){if(Oe.message+=`
Please report this to https://github.com/markedjs/marked.`,ae.silent)return"<p>An error occurred:</p><pre>"+Ie(Oe.message+"",!0)+"</pre>";throw Oe}}ue.options=ue.setOptions=function(te){return gt(ue.defaults,te),$e(ue.defaults),ue},ue.getDefaults=Re,ue.defaults=Ze,ue.use=function(te){var ae=gt({},te);if(te.renderer&&function(){var ie=ue.defaults.renderer||new Le,oe=function(_e){var Oe=ie[_e];ie[_e]=function(){for(var Ge=arguments.length,et=new Array(Ge),ct=0;ct<Ge;ct++)et[ct]=arguments[ct];var st=te.renderer[_e].apply(ie,et);return st===!1&&(st=Oe.apply(ie,et)),st}};for(var he in te.renderer)oe(he);ae.renderer=ie}(),te.tokenizer&&function(){var ie=ue.defaults.tokenizer||new be,oe=function(_e){var Oe=ie[_e];ie[_e]=function(){for(var Ge=arguments.length,et=new Array(Ge),ct=0;ct<Ge;ct++)et[ct]=arguments[ct];var st=te.tokenizer[_e].apply(ie,et);return st===!1&&(st=Oe.apply(ie,et)),st}};for(var he in te.tokenizer)oe(he);ae.tokenizer=ie}(),te.walkTokens){var ce=ue.defaults.walkTokens;ae.walkTokens=function(ie){te.walkTokens(ie),ce&&ce(ie)}}ue.setOptions(ae)},ue.walkTokens=function(te,ae){for(var ce=N(te),ie;!(ie=ce()).done;){var oe=ie.value;ae(oe);switch(oe.type){case"table":{for(var he=N(oe.tokens.header),ge;!(ge=he()).done;){var _e=ge.value;ue.walkTokens(_e,ae)}for(var Oe=N(oe.tokens.cells),Ge;!(Ge=Oe()).done;)for(var et=Ge.value,ct=N(et),st;!(st=ct()).done;){var nt=st.value;ue.walkTokens(nt,ae)}break}case"list":{ue.walkTokens(oe.items,ae);break}default:oe.tokens&&ue.walkTokens(oe.tokens,ae)}}},ue.Parser=lt,ue.parser=lt.parse,ue.Renderer=Le,ue.TextRenderer=Pe,ue.Lexer=Me,ue.lexer=Me.lex,ue.Tokenizer=be,ue.Slugger=Ye,ue.parse=ue;var q=ue;return q})},"DlR+":function(Ue,de,M){var J=M("MFOe"),z=J.Global,D=J.trim;Ue.exports={name:"cookieStorage",read:N,write:K,each:O,remove:W,clearAll:n};var V=z.document;function N(g){if(!g||!I(g))return null;var f="(?:^|.*;\\s*)"+escape(g).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(V.cookie.replace(new RegExp(f),"$1"))}function O(g){for(var f=V.cookie.split(/; ?/g),h=f.length-1;h>=0;h--){if(!D(f[h]))continue;var c=f[h].split("="),s=unescape(c[0]),d=unescape(c[1]);g(d,s)}}function K(g,f){if(!g)return;V.cookie=escape(g)+"="+escape(f)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function W(g){if(!g||!I(g))return;V.cookie=escape(g)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function n(){O(function(g,f){W(f)})}function I(g){return new RegExp("(?:^|;\\s*)"+escape(g).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(V.cookie)}},EHPI:function(Ue,de,M){"use strict";var J=M("bbsP"),z=M("/wGt"),D=M("tJVT"),V=M("k1fw"),N=M("q1tI"),O=M.n(N),K=M("ZW9T"),W=M("ZD9Y"),n=M("M8RZ"),I=M("bCnd"),g=M("fcyK"),f=M.n(g),h={theme:Object(I.a)("cmCodeMode","vs-dark"),fontSize:Object(I.a)("cmFontSize",14),showEditorSetting:!1,tabToSpace:Object(I.a)("cmTabToSpace",!0)},c;(function(i){i[i.set_font_size=0]="set_font_size",i[i.set_theme=1]="set_theme",i[i.on_tab_to_space=2]="on_tab_to_space",i[i.set_show_editor_setting=3]="set_show_editor_setting"})(c||(c={}));function s(i,a){switch(a.type){case c.set_show_editor_setting:return Object(V.a)(Object(V.a)({},i),{},{showEditorSetting:a.payload});case c.set_theme:return Object(V.a)(Object(V.a)({},i),{},{theme:a.payload});case c.set_font_size:return Object(V.a)(Object(V.a)({},i),{},{fontSize:a.payload});case c.on_tab_to_space:return Object(V.a)(Object(V.a)({},i),{},{tabToSpace:a.payload});default:throw new Error}}de.a=function(i){var a=i.isLoading,r=i.value,o=i.onChange,T=i.language,w=i.ActionBarRender,x=w===void 0?function(H){return O.a.createElement(d,{onShowCodeSetting:H})}:w,L=Object(N.useReducer)(s,h),A=Object(D.a)(L,2),_=A[0],b=A[1],m=_.theme,p=_.fontSize,C=_.showEditorSetting,E=_.tabToSpace,v={onFontSizeChange:function(U){b({type:c.set_font_size,payload:U}),Object(I.b)("cmFontSize",U)},tabToSpace:E,cmFontSize:p,className:"oj",cmCodeMode:m,onTabToSpace:function(U){b({type:c.on_tab_to_space,payload:U}),Object(I.b)("cmTabToSpace",U)},onCodeModeChange:function(U){b({type:c.set_theme,payload:U}),Object(I.b)("cmCodeMode",U)}};function P(){b({type:c.set_show_editor_setting,payload:!1})}function F(){b({type:c.set_show_editor_setting,payload:!0})}var R={value:r,language:T,onChange:o,theme:m,height:"calc(100% - 56px)",options:{fontSize:p,insertSpaces:E}};return O.a.createElement(N.Fragment,null,O.a.createElement("div",{className:"code-panel-container"},x(F),!a&&O.a.createElement(K.b,R)),O.a.createElement(n.a,null,O.a.createElement(z.a,{className:"oj",title:null,placement:"right",closable:!1,visible:C,onClose:P},O.a.createElement(W.a,v))))};function d(i){var a=i.onShowCodeSetting;return O.a.createElement("div",{className:"action-bar"},O.a.createElement("span",null,"\u5B66\u5458\u521D\u59CB\u4EE3\u7801\u6587\u4EF6"),O.a.createElement("a",{onClick:a},O.a.createElement("i",{className:"iconfont icon-shezhi"})))}},ELLl:function(Ue,de,M){(function(J){J(M("VrN/"))})(function(J){var z={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},D=J.Pos;J.defineOption("autoCloseBrackets",!1,function(s,d,i){i&&i!=J.Init&&(s.removeKeyMap(N),s.state.closeBrackets=null),d&&(O(V(d,"pairs")),s.state.closeBrackets=d,s.addKeyMap(N))});function V(s,d){return d=="pairs"&&typeof s=="string"?s:typeof s=="object"&&s[d]!=null?s[d]:z[d]}var N={Backspace:n,Enter:I};function O(s){for(var d=0;d<s.length;d++){var i=s.charAt(d),a="'"+i+"'";N[a]||(N[a]=K(i))}}O(z.pairs+"`");function K(s){return function(d){return f(d,s)}}function W(s){var d=s.state.closeBrackets;if(!d||d.override)return d;var i=s.getModeAt(s.getCursor());return i.closeBrackets||d}function n(s){var d=W(s);if(!d||s.getOption("disableInput"))return J.Pass;for(var i=V(d,"pairs"),a=s.listSelections(),r=0;r<a.length;r++){if(!a[r].empty())return J.Pass;var o=h(s,a[r].head);if(!o||i.indexOf(o)%2!=0)return J.Pass}for(var r=a.length-1;r>=0;r--){var T=a[r].head;s.replaceRange("",D(T.line,T.ch-1),D(T.line,T.ch+1),"+delete")}}function I(s){var d=W(s),i=d&&V(d,"explode");if(!i||s.getOption("disableInput"))return J.Pass;for(var a=s.listSelections(),r=0;r<a.length;r++){if(!a[r].empty())return J.Pass;var o=h(s,a[r].head);if(!o||i.indexOf(o)%2!=0)return J.Pass}s.operation(function(){var T=s.lineSeparator()||`
`;s.replaceSelection(T+T,null),s.execCommand("goCharLeft"),a=s.listSelections();for(var w=0;w<a.length;w++){var x=a[w].head.line;s.indentLine(x,null,!0),s.indentLine(x+1,null,!0)}})}function g(s){var d=J.cmpPos(s.anchor,s.head)>0;return{anchor:new D(s.anchor.line,s.anchor.ch+(d?-1:1)),head:new D(s.head.line,s.head.ch+(d?1:-1))}}function f(s,d){var i=W(s);if(!i||s.getOption("disableInput"))return J.Pass;var a=V(i,"pairs"),r=a.indexOf(d);if(r==-1)return J.Pass;for(var o=V(i,"closeBefore"),T=V(i,"triples"),w=a.charAt(r+1)==d,x=s.listSelections(),L=r%2==0,A,_=0;_<x.length;_++){var b=x[_],m=b.head,p,C=s.getRange(m,D(m.line,m.ch+1));if(L&&!b.empty())p="surround";else if((w||!L)&&C==d)w&&c(s,m)?p="both":T.indexOf(d)>=0&&s.getRange(m,D(m.line,m.ch+3))==d+d+d?p="skipThree":p="skip";else if(w&&m.ch>1&&T.indexOf(d)>=0&&s.getRange(D(m.line,m.ch-2),m)==d+d){if(m.ch>2&&/\bstring/.test(s.getTokenTypeAt(D(m.line,m.ch-2))))return J.Pass;p="addFour"}else if(w){var E=m.ch==0?" ":s.getRange(D(m.line,m.ch-1),m);if(!J.isWordChar(C)&&E!=d&&!J.isWordChar(E))p="both";else return J.Pass}else if(L&&(C.length===0||/\s/.test(C)||o.indexOf(C)>-1))p="both";else return J.Pass;if(!A)A=p;else if(A!=p)return J.Pass}var v=r%2?a.charAt(r-1):d,P=r%2?d:a.charAt(r+1);s.operation(function(){if(A=="skip")s.execCommand("goCharRight");else if(A=="skipThree")for(var F=0;F<3;F++)s.execCommand("goCharRight");else if(A=="surround"){for(var R=s.getSelections(),F=0;F<R.length;F++)R[F]=v+R[F]+P;s.replaceSelections(R,"around"),R=s.listSelections().slice();for(var F=0;F<R.length;F++)R[F]=g(R[F]);s.setSelections(R)}else A=="both"?(s.replaceSelection(v+P,null),s.triggerElectric(v+P),s.execCommand("goCharLeft")):A=="addFour"&&(s.replaceSelection(v+v+v+v,"before"),s.execCommand("goCharRight"))})}function h(s,d){var i=s.getRange(D(d.line,d.ch-1),D(d.line,d.ch+1));return i.length==2?i:null}function c(s,d){var i=s.getTokenAt(D(d.line,d.ch+1));return/\bstring/.test(i.type)&&i.start==d.ch&&(d.ch==0||!/\bstring/.test(s.getTokenTypeAt(d)))}})},FOrL:function(Ue,de,M){Ue.exports=M.p+"static/nodata.a6b3f948.png"},FWmy:function(Ue,de,M){"use strict";M.d(de,"a",function(){return J});function J(z,D){if(!z)throw new Error(D?`Assertion failed (${D})`:"Assertion Failed")}},Gytx:function(Ue,de){Ue.exports=function(J,z,D,V){var N=D?D.call(V,J,z):void 0;if(N!==void 0)return!!N;if(J===z)return!0;if(typeof J!="object"||!J||typeof z!="object"||!z)return!1;var O=Object.keys(J),K=Object.keys(z);if(O.length!==K.length)return!1;for(var W=Object.prototype.hasOwnProperty.bind(z),n=0;n<O.length;n++){var I=O[n];if(!W(I))return!1;var g=J[I],f=z[I];if(N=D?D.call(V,g,f,I):void 0,N===!1||N===void 0&&g!==f)return!1}return!0}},H2Ag:function(Ue,de,M){Ue.exports={flex_box_center:"flex_box_center___2pJkw",flex_space_between:"flex_space_between___2XyGR",flex_box_vertical_center:"flex_box_vertical_center___3RcdW",flex_box_center_end:"flex_box_center_end___ELbjB",flex_box_column:"flex_box_column___1nxOL","left-panel":"left-panel___19pOi","tab-panel-body":"tab-panel-body___1Wa4B",b1:"b1___rOGbM","oj-width-input":"oj-width-input___1L1MS","oj-mr":"oj-mr___2FJRu","s-navs":"s-navs___Rtxdn","bg-white":"bg-white___3Or1a",active:"active___x-fRG",list:"list___2RvQV",btns:"btns___FcbS4",drawer:"drawer___2L-f8"}},HmJG:function(Ue,de,M){},I8Z2:function(Ue,de,M){"use strict";M.d(de,"a",function(){return V}),M.d(de,"b",function(){return h}),M.d(de,"c",function(){return s});var J=M("q1tI"),z=function(){var d=function(i,a){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var T in o)o.hasOwnProperty(T)&&(r[T]=o[T])},d(i,a)};return function(i,a){d(i,a);function r(){this.constructor=i}i.prototype=a===null?Object.create(a):(r.prototype=a.prototype,new r)}}(),D=J.createContext(null),V=function(d){z(i,d);function i(){return d!==null&&d.apply(this,arguments)||this}return i.prototype.render=function(){return J.createElement(D.Provider,{value:this.props.store},this.props.children)},i}(J.Component),N=M("Gytx"),O=M.n(N),K=M("2mql"),W=M.n(K),n=function(){var d=function(i,a){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var T in o)o.hasOwnProperty(T)&&(r[T]=o[T])},d(i,a)};return function(i,a){d(i,a);function r(){this.constructor=i}i.prototype=a===null?Object.create(a):(r.prototype=a.prototype,new r)}}(),I=function(){return I=Object.assign||function(d){for(var i,a=1,r=arguments.length;a<r;a++){i=arguments[a];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(d[o]=i[o])}return d},I.apply(this,arguments)};function g(d){return d.displayName||d.name||"Component"}var f=function(){return{}};function h(d,i){i===void 0&&(i={});var a=!!d,r=d||f;return function(T){var w=function(L){n(A,L);function A(_,b){var m=L.call(this,_,b)||this;return m.unsubscribe=null,m.handleChange=function(){if(!m.unsubscribe)return;var p=r(m.store.getState(),m.props);m.setState({subscribed:p})},m.store=m.context,m.state={subscribed:r(m.store.getState(),_),store:m.store,props:_},m}return A.getDerivedStateFromProps=function(_,b){return d&&d.length===2&&_!==b.props?{subscribed:r(b.store.getState(),_),props:_}:{props:_}},A.prototype.componentDidMount=function(){this.trySubscribe()},A.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},A.prototype.shouldComponentUpdate=function(_,b){return!O()(this.props,_)||!O()(this.state.subscribed,b.subscribed)},A.prototype.trySubscribe=function(){a&&(this.unsubscribe=this.store.subscribe(this.handleChange),this.handleChange())},A.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},A.prototype.render=function(){var _=I(I(I({},this.props),this.state.subscribed),{store:this.store});return J.createElement(T,I({},_,{ref:this.props.miniStoreForwardedRef}))},A.displayName="Connect("+g(T)+")",A.contextType=D,A}(J.Component);if(i.forwardRef){var x=J.forwardRef(function(L,A){return J.createElement(w,I({},L,{miniStoreForwardedRef:A}))});return W()(x,T)}return W()(w,T)}}var c=function(){return c=Object.assign||function(d){for(var i,a=1,r=arguments.length;a<r;a++){i=arguments[a];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(d[o]=i[o])}return d},c.apply(this,arguments)};function s(d){var i=d,a=[];function r(w){i=c(c({},i),w);for(var x=0;x<a.length;x++)a[x]()}function o(){return i}function T(w){return a.push(w),function(){var L=a.indexOf(w);a.splice(L,1)}}return{setState:r,getState:o,subscribe:T}}},IBYe:function(Ue,de,M){"use strict";function J(z){return null}de.a=J},IxHN:function(Ue,de,M){"use strict";var J=M("q1tI"),z=M.n(J),D=M("07cG"),V=M.n(D);de.a=function(N){var O=N.message,K=N.className,W=N.children,n=N.style,I=n===void 0?{}:n;return z.a.createElement("div",{className:"".concat(V.a.idsRingWrapper," ").concat(K)},z.a.createElement("div",{className:V.a.ldsRing},z.a.createElement("div",null),z.a.createElement("div",null),z.a.createElement("div",null),z.a.createElement("div",null)),O?z.a.createElement("p",{style:I},O):null,W)}},J66h:function(Ue,de,M){(function(J){var z,D;(function(V,N){Ue.exports=N(V)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof J!="undefined"?J:this,function(V){"use strict";V=V||{};var N=V.Base64,O="2.6.4",K="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",W=function(v){for(var P={},F=0,R=v.length;F<R;F++)P[v.charAt(F)]=F;return P}(K),n=String.fromCharCode,I=function(v){if(v.length<2){var P=v.charCodeAt(0);return P<128?v:P<2048?n(192|P>>>6)+n(128|P&63):n(224|P>>>12&15)+n(128|P>>>6&63)+n(128|P&63)}else{var P=65536+(v.charCodeAt(0)-55296)*1024+(v.charCodeAt(1)-56320);return n(240|P>>>18&7)+n(128|P>>>12&63)+n(128|P>>>6&63)+n(128|P&63)}},g=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,f=function(v){return v.replace(g,I)},h=function(v){var P=[0,2,1][v.length%3],F=v.charCodeAt(0)<<16|(v.length>1?v.charCodeAt(1):0)<<8|(v.length>2?v.charCodeAt(2):0),R=[K.charAt(F>>>18),K.charAt(F>>>12&63),P>=2?"=":K.charAt(F>>>6&63),P>=1?"=":K.charAt(F&63)];return R.join("")},c=V.btoa&&typeof V.btoa=="function"?function(v){return V.btoa(v)}:function(v){if(v.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return v.replace(/[\s\S]{1,3}/g,h)},s=function(v){return c(f(String(v)))},d=function(v){return v.replace(/[+\/]/g,function(P){return P=="+"?"-":"_"}).replace(/=/g,"")},i=function(v,P){return P?d(s(v)):s(v)},a=function(v){return i(v,!0)},r;V.Uint8Array&&(r=function(v,P){for(var F="",R=0,H=v.length;R<H;R+=3){var U=v[R],S=v[R+1],G=v[R+2],Q=U<<16|S<<8|G;F+=K.charAt(Q>>>18)+K.charAt(Q>>>12&63)+(typeof S!="undefined"?K.charAt(Q>>>6&63):"=")+(typeof G!="undefined"?K.charAt(Q&63):"=")}return P?d(F):F});var o=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,T=function(v){switch(v.length){case 4:var P=(7&v.charCodeAt(0))<<18|(63&v.charCodeAt(1))<<12|(63&v.charCodeAt(2))<<6|63&v.charCodeAt(3),F=P-65536;return n((F>>>10)+55296)+n((F&1023)+56320);case 3:return n((15&v.charCodeAt(0))<<12|(63&v.charCodeAt(1))<<6|63&v.charCodeAt(2));default:return n((31&v.charCodeAt(0))<<6|63&v.charCodeAt(1))}},w=function(v){return v.replace(o,T)},x=function(v){var P=v.length,F=P%4,R=(P>0?W[v.charAt(0)]<<18:0)|(P>1?W[v.charAt(1)]<<12:0)|(P>2?W[v.charAt(2)]<<6:0)|(P>3?W[v.charAt(3)]:0),H=[n(R>>>16),n(R>>>8&255),n(R&255)];return H.length-=[0,0,2,1][F],H.join("")},L=V.atob&&typeof V.atob=="function"?function(v){return V.atob(v)}:function(v){return v.replace(/\S{1,4}/g,x)},A=function(v){return L(String(v).replace(/[^A-Za-z0-9\+\/]/g,""))},_=function(v){return w(L(v))},b=function(v){return String(v).replace(/[-_]/g,function(P){return P=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},m=function(v){return _(b(v))},p;V.Uint8Array&&(p=function(v){return Uint8Array.from(A(b(v)),function(P){return P.charCodeAt(0)})});var C=function(){var v=V.Base64;return V.Base64=N,v};if(V.Base64={VERSION:O,atob:A,btoa:c,fromBase64:m,toBase64:i,utob:f,encode:i,encodeURI:a,btou:w,decode:m,noConflict:C,fromUint8Array:r,toUint8Array:p},typeof Object.defineProperty=="function"){var E=function(v){return{value:v,enumerable:!1,writable:!0,configurable:!0}};V.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",E(function(){return m(this)})),Object.defineProperty(String.prototype,"toBase64",E(function(v){return i(this,v)})),Object.defineProperty(String.prototype,"toBase64URI",E(function(){return i(this,!0)}))}}return V.Meteor&&(Base64=V.Base64),Ue.exports?Ue.exports.Base64=V.Base64:!(z=[],D=function(){return V.Base64}.apply(de,z),D!==void 0&&(Ue.exports=D)),{Base64:V.Base64}})}).call(this,M("IyRk"))},JB8y:function(Ue,de,M){"use strict";M.d(de,"a",function(){return J});var J;(function(z){z[z.NOMATCH=-1]="NOMATCH",z[z.OK=0]="OK",z[z.TIMEOUT=2]="TIMEOUT",z[z.PODFAILURE=3]="PODFAILURE",z[z.COMPILEFAILURE=4]="COMPILEFAILURE",z[z.EXECUTEFAILURE=5]="EXECUTEFAILURE"})(J||(J={}))},JPnl:function(Ue,de,M){"use strict";M.d(de,"a",function(){return b}),M.d(de,"c",function(){return C});var J=M("+L6B"),z=M("2/Rp"),D=M("tJVT"),V=M("9og8"),N=M("k1fw"),O=M("jrin"),K=M("5NDa"),W=M("5rEg"),n=M("WmNS"),I=M.n(n),g=M("q1tI"),f=M.n(g),h=M("8Skl"),c=M("y3Kf"),s=M("JB8y"),d=M("J66h"),i=M.n(d),a=M("a4uL"),r=M.n(a),o=M("IxHN"),T=M("9Bee"),w=M("1vsH"),x=M("ErOA"),L,A=W.a.TextArea,_={visible:!1,tabIndex:"0"},b=(L={},Object(O.a)(L,s.a.NOMATCH,"\u6D4B\u8BD5\u7528\u4F8B\u7ED3\u679C\u4E0D\u5339\u914D"),Object(O.a)(L,s.a.OK,"\u8C03\u8BD5\u901A\u8FC7"),Object(O.a)(L,2,"\u8C03\u8BD5\u8D85\u65F6"),Object(O.a)(L,3,"\u8C03\u8BD5pod\u5931\u8D25"),Object(O.a)(L,4,"\u7F16\u8BD1\u5931\u8D25"),Object(O.a)(L,5,"\u6267\u884C\u5931\u8D25"),L),m;(function(v){v[v.SET_VISIBLE=0]="SET_VISIBLE",v[v.SET_TABINDEX=1]="SET_TABINDEX"})(m||(m={}));function p(v,P){switch(P.type){case m.SET_VISIBLE:return Object(N.a)(Object(N.a)({},v),{},{visible:P.payload});case m.SET_TABINDEX:return Object(N.a)(Object(N.a)({},v),{},{tabIndex:P.payload});default:throw new Error}}function C(v){var P=v.status,F=v.error_msg,R=v.output,H=v.input,U=v.expected_output,S=v.is_file,G=v.input_file_url,Q=v.output_file_url,se=v.expected_output_file_url,fe=v.setMonacoValue,we=v.setData,be=null,Se={minHeight:150,marginBottom:10,paddingLeft:24,background:"#070f19",color:"#fff"};switch(P){case s.a.NOMATCH:be=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),!S&&f.a.createElement(T.a,{value:H,style:Se}),S&&f.a.createElement("div",{style:Se},f.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(V.a)(I.a.mark(function Ae(){var De;return I.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,fetch(G,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 2:return De=Y.sent,Y.t0=fe,Y.next=6,De.text();case 6:Y.t1=Y.sent,(0,Y.t0)(Y.t1),setTimeout(function(){we(G)},200);case 9:case"end":return Y.stop()}},Ae)}))},H)),f.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),!S&&f.a.createElement(T.a,{value:R&&d.Base64.decode(R)||"",style:Se}),S&&f.a.createElement("div",{style:Se},f.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(V.a)(I.a.mark(function Ae(){var De;return I.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(x.a)(Q,{method:"Get",headers:{"Content-Type":"application/xml",Accept:"*/*"}});case 2:De=Y.sent,fe(De),setTimeout(function(){we(Q)},200);case 5:case"end":return Y.stop()}},Ae)}))},R)),f.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),!S&&f.a.createElement(T.a,{value:U&&d.Base64.decode(U)||"",style:Se}),S&&f.a.createElement("div",{style:Se},f.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(V.a)(I.a.mark(function Ae(){var De;return I.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,fetch(se,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 2:return De=Y.sent,Y.t0=fe,Y.next=6,De.text();case 6:Y.t1=Y.sent,(0,Y.t0)(Y.t1),setTimeout(function(){we(se)},200);case 9:case"end":return Y.stop()}},Ae)}))},U)));break;case s.a.EXECUTEFAILURE:be=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!S&&f.a.createElement(T.a,{value:H,style:Se}),S&&f.a.createElement("div",{style:Se},f.a.createElement("a",{onClick:function(){return Object(w.y)(G,H)}},H)),f.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),f.a.createElement("pre",{className:"error"},d.Base64.decode(F)));break;case s.a.COMPILEFAILURE:be=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!S&&f.a.createElement(T.a,{value:H,style:Se}),S&&f.a.createElement("div",{style:Se},f.a.createElement("a",{onClick:function(){return Object(w.y)(G,H)}},H)),f.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),f.a.createElement("pre",{className:"error"},d.Base64.decode(F)));break;case s.a.PODFAILURE:be=f.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case s.a.TIMEOUT:be=f.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return f.a.createElement(f.a.Fragment,null," ",be," ")}function E(v){var P=v.status,F=v.error_msg,R=v.execute_time,H=v.output,U=v.input,S=v.expected_output,G=v.is_file,Q=v.input_file_url,se=v.output_file_url,fe=v.expected_output_file_url,we=null;switch(P){case s.a.OK:we=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6267\u884C\u7528\u65F6\uFF1A",R,"ms"),f.a.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A"),f.a.createElement("pre",null,d.Base64.decode(H)));break;case s.a.NOMATCH:we=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u8F93\u5165\uFF1A",f.a.createElement("pre",null,U)),f.a.createElement("p",null,"\u8F93\u51FA\uFF1A",H&&d.Base64.decode(H)),f.a.createElement("p",null,"\u9884\u671F\u8F93\u51FA\uFF1A",S&&d.Base64.decode(S)));break;case s.a.EXECUTEFAILURE:we=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,U)),f.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),f.a.createElement("pre",{className:"error"},d.Base64.decode(F)));break;case s.a.COMPILEFAILURE:we=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,U)),f.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),f.a.createElement("pre",{className:"error"},d.Base64.decode(F)));break;case s.a.PODFAILURE:we=f.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case s.a.TIMEOUT:we=f.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return f.a.createElement(f.a.Fragment,null," ",we," ")}de.b=function(v){var P=v.input,F=v.debuging,R=v.submitting,H=v.executingMessage,U=v.debugResult,S=v.onChangeInput,G=v.onDebugCode,Q=v.onSubmitCode,se=v.hack,fe=v.user,we=Object(g.useReducer)(p,_),be=Object(D.a)(we,2),Se=be[0],Ae=be[1],De=Se.visible,ve=Se.tabIndex;function Y(X){var ye=X.target.id;Ae({type:m.SET_TABINDEX,payload:ye})}function k(){Ae({type:m.SET_VISIBLE,payload:!De})}var B=Object(g.useMemo)(function(){if(U){var X=U.status;return f.a.createElement(f.a.Fragment,null,E(U))}return null},[U]);function Z(){Ae({type:m.SET_VISIBLE,payload:!0}),Ae({type:m.SET_TABINDEX,payload:"1"}),G()}var re=function(){var X=Object(V.a)(I.a.mark(function ye(Me){var He;return I.a.wrap(function(Ee){for(;;)switch(Ee.prev=Ee.next){case 0:return Ee.next=2,Object(x.a)("/api/problems/".concat(Me,"/start.json"),{method:"get",params:{hack_user_id:fe==null?void 0:fe.user_id}});case 2:He=Ee.sent,He&&(window.location.href="/myproblems/".concat(He==null?void 0:He.identifier,"?type=1"));case 4:case"end":return Ee.stop()}},ye)}));return function(Me){return X.apply(this,arguments)}}();return f.a.createElement("div",{className:"test-case-panel"},f.a.createElement("div",{className:"test-case-panel-body ".concat(De?"active":"")},f.a.createElement("ul",{className:"s-navs"},f.a.createElement("li",null,f.a.createElement("a",{className:ve==="0"?"active":"",id:"0",onClick:Y},"\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B")),f.a.createElement("li",null,f.a.createElement("a",{className:ve==="1"?"active":"",id:"1",onClick:Y},"\u4EE3\u7801\u6267\u884C\u7ED3\u679C"))),f.a.createElement("div",{className:"tab-panel-body ".concat(ve==="0"?"":"hide")},f.a.createElement(A,{placeholder:"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D",value:P,onChange:S})),f.a.createElement("div",{className:"tab-panel-body ".concat(ve==="1"?"":"hide")},F?f.a.createElement(o.a,{message:H}):U?f.a.createElement("section",{style:{height:200}}," ",B," "):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(De?"up":""),onClick:k},De?f.a.createElement(h.a,null):f.a.createElement(c.a,null)),f.a.createElement("footer",{className:"footer"},f.a.createElement("span",null,"\u63A7\u5236\u53F0"),f.a.createElement("div",{className:"flex-container"},(se==null?void 0:se.is_program)&&(se==null?void 0:se.above_question)&&f.a.createElement(z.a,{onClick:function(){return re(se==null?void 0:se.above_question)},id:"oj-prev",className:"btn-blue",type:"ghost"},"\u4E0A\u4E00\u9898"),(se==null?void 0:se.is_program)&&(se==null?void 0:se.under_question)&&f.a.createElement(z.a,{onClick:function(){return re(se==null?void 0:se.under_question)},id:"oj-next",className:"btn-blue",type:"ghost"},"\u4E0B\u4E00\u9898"),f.a.createElement(z.a,{className:"btn-green",type:"ghost",loading:F,onClick:Z},"\u8C03\u8BD5\u4EE3\u7801"),f.a.createElement(z.a,{type:"primary",loading:R,disabled:R,onClick:function(){Ae({type:m.SET_VISIBLE,payload:!1}),Q()}},"\u8BC4\u6D4B\u5E76\u63D0\u4EA4"))))}},JYp7:function(Ue,de,M){"use strict";M.d(de,"a",function(){return J});var J;(function(z){function D(o){return o&&typeof o=="object"&&typeof o[Symbol.iterator]=="function"}z.is=D;const V=Object.freeze([]);function N(){return V}z.empty=N;function*O(o){yield o}z.single=O;function K(o){return o||V}z.from=K;function W(o){return!o||o[Symbol.iterator]().next().done===!0}z.isEmpty=W;function n(o){return o[Symbol.iterator]().next().value}z.first=n;function I(o,T){for(const w of o)if(T(w))return!0;return!1}z.some=I;function g(o,T){for(const w of o)if(T(w))return w;return}z.find=g;function*f(o,T){for(const w of o)T(w)&&(yield w)}z.filter=f;function*h(o,T){let w=0;for(const x of o)yield T(x,w++)}z.map=h;function*c(...o){for(const T of o)for(const w of T)yield w}z.concat=c;function*s(o){for(const T of o)for(const w of T)yield w}z.concatNested=s;function d(o,T,w){let x=w;for(const L of o)x=T(x,L);return x}z.reduce=d;function*i(o,T,w=o.length){for(T<0&&(T+=o.length),w<0?w+=o.length:w>o.length&&(w=o.length);T<w;T++)yield o[T]}z.slice=i;function a(o,T=Number.POSITIVE_INFINITY){const w=[];if(T===0)return[w,o];const x=o[Symbol.iterator]();for(let L=0;L<T;L++){const A=x.next();if(A.done)return[w,z.empty()];w.push(A.value)}return[w,{[Symbol.iterator](){return x}}]}z.consume=a;function r(o,T,w=(x,L)=>x===L){const x=o[Symbol.iterator](),L=T[Symbol.iterator]();for(;;){const A=x.next(),_=L.next();if(A.done!==_.done)return!1;if(A.done)return!0;if(!w(A.value,_.value))return!1}}z.equals=r})(J||(J={}))},LdHM:function(Ue,de,M){"use strict";M.d(de,"b",function(){return o}),M.d(de,"a",function(){return w});var J=M("1OyB"),z=M("vuIU"),D=M("Ji7U"),V=M("LK+K"),N=M("q1tI"),O=M("rePB"),K=M("Ff2n"),W=M("ODXe"),n=M("4IlW"),I=M("bX4T"),g=M("YrtM"),f=M("TSYQ"),h=M.n(f),c=M("+nKL"),s=M("8OUc"),d=function(G,Q){var se=G.prefixCls,fe=G.id,we=G.flattenOptions,be=G.childrenAsData,Se=G.values,Ae=G.searchValue,De=G.multiple,ve=G.defaultActiveFirstOption,Y=G.height,k=G.itemHeight,B=G.notFoundContent,Z=G.open,re=G.menuItemSelectedIcon,X=G.virtual,ye=G.onSelect,Me=G.onToggleOpen,He=G.onActiveValue,me=G.onScroll,Ee=G.onMouseEnter,Le="".concat(se,"-item"),Pe=Object(g.a)(function(){return we},[Z,we],function(q,te){return te[0]&&q[1]!==te[1]}),Ye=N.useRef(null),tt=function(te){te.preventDefault()},ut=function(te){Ye.current&&Ye.current.scrollTo({index:te})},lt=function(te){for(var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ce=Pe.length,ie=0;ie<ce;ie+=1){var oe=(te+ie*ae+ce)%ce,he=Pe[oe],ge=he.group,_e=he.data;if(!ge&&!_e.disabled)return oe}return-1},gt=N.useState(function(){return lt(0)}),ht=Object(W.a)(gt,2),Ie=ht[0],Re=ht[1],$e=function(te){Re(te);var ae=Pe[te];if(!ae){He(null,-1);return}He(ae.data.value,te)};N.useEffect(function(){$e(ve!==!1?lt(0):-1)},[Pe.length,Ae]),N.useEffect(function(){var q=setTimeout(function(){if(!De&&Z&&Se.size===1){var te=Array.from(Se)[0],ae=Pe.findIndex(function(ce){var ie=ce.data;return ie.value===te});$e(ae),ut(ae)}});return function(){return clearTimeout(q)}},[Z]);var Ze=function(te){te!==void 0&&ye(te,{selected:!Se.has(te)}),De||Me(!1)};if(N.useImperativeHandle(Q,function(){return{onKeyDown:function(te){var ae=te.which;switch(ae){case n.a.UP:case n.a.DOWN:{var ce=0;if(ae===n.a.UP?ce=-1:ae===n.a.DOWN&&(ce=1),ce!==0){var ie=lt(Ie+ce,ce);ut(ie),$e(ie)}break}case n.a.ENTER:{var oe=Pe[Ie];oe&&!oe.data.disabled?Ze(oe.data.value):Ze(void 0),Z&&te.preventDefault();break}case n.a.ESC:Me(!1)}},onKeyUp:function(){},scrollTo:function(te){ut(te)}}}),Pe.length===0)return N.createElement("div",{role:"listbox",id:"".concat(fe,"_list"),className:"".concat(Le,"-empty"),onMouseDown:tt},B);function ue(q){var te=Pe[q];if(!te)return null;var ae=te.data||{},ce=ae.value,ie=ae.label,oe=ae.children,he=Object(I.a)(ae,!0),ge=be?oe:ie;return te?N.createElement("div",Object.assign({"aria-label":typeof ge=="string"?ge:null},he,{key:q,role:"option",id:"".concat(fe,"_list_").concat(q),"aria-selected":Se.has(ce)}),ce):null}return N.createElement(N.Fragment,null,N.createElement("div",{role:"listbox",id:"".concat(fe,"_list"),style:{height:0,width:0,overflow:"hidden"}},ue(Ie-1),ue(Ie),ue(Ie+1)),N.createElement(c.a,{itemKey:"key",ref:Ye,data:Pe,height:Y,itemHeight:k,fullHeight:!1,onMouseDown:tt,onScroll:me,virtual:X,onMouseEnter:Ee},function(q,te){var ae,ce=q.group,ie=q.groupOption,oe=q.data,he=oe.label,ge=oe.key;if(ce)return N.createElement("div",{className:h()(Le,"".concat(Le,"-group"))},he!==void 0?he:ge);var _e=oe.disabled,Oe=oe.value,Ge=oe.title,et=oe.children,ct=oe.style,st=oe.className,nt=Object(K.a)(oe,["disabled","value","title","children","style","className"]),We=Se.has(Oe),Ve="".concat(Le,"-option"),Ne=h()(Le,Ve,st,(ae={},Object(O.a)(ae,"".concat(Ve,"-grouped"),ie),Object(O.a)(ae,"".concat(Ve,"-active"),Ie===te&&!_e),Object(O.a)(ae,"".concat(Ve,"-disabled"),_e),Object(O.a)(ae,"".concat(Ve,"-selected"),We),ae)),pe=be?et:he,xe=!re||typeof re=="function"||We;return N.createElement("div",Object.assign({},nt,{"aria-selected":We,className:Ne,title:Ge,onMouseMove:function(){if(Ie===te||_e)return;$e(te)},onClick:function(){_e||Ze(Oe)},style:ct}),N.createElement("div",{className:"".concat(Ve,"-content")},pe||Oe),N.isValidElement(re)||We,xe&&N.createElement(s.a,{className:"".concat(Le,"-option-state"),customizeIcon:re,customizeIconProps:{isSelected:We}},We?"\u2713":null))}))},i=N.forwardRef(d);i.displayName="OptionList";var a=i,r=function(){return null};r.isSelectOption=!0;var o=r,T=function(){return null};T.isSelectOptGroup=!0;var w=T,x=M("VTBJ"),L=M("Zm9Q");function A(S){var G=S.key,Q=S.props,se=Q.children,fe=Q.value,we=Object(K.a)(Q,["children","value"]);return Object(x.a)({key:G,value:fe!==void 0?fe:G,children:se},we)}function _(S){var G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(L.a)(S).map(function(Q,se){if(!N.isValidElement(Q)||!Q.type)return null;var fe=Q.type.isSelectOptGroup,we=Q.key,be=Q.props,Se=be.children,Ae=Object(K.a)(be,["children"]);return G||!fe?A(Q):Object(x.a)(Object(x.a)({key:"__RC_SELECT_GRP__".concat(we===null?se:we,"__"),label:we},Ae),{},{options:_(Se)})}).filter(function(Q){return Q})}var b=M("2Qr1"),m=M("qNPg"),p=M("U8pU"),C=M("Kwbf"),E=M("WKfj");function v(S){var G=S.mode,Q=S.options,se=S.children,fe=S.backfill,we=S.allowClear,be=S.placeholder,Se=S.getInputElement,Ae=S.showSearch,De=S.onSearch,ve=S.defaultOpen,Y=S.autoFocus,k=S.labelInValue,B=S.value,Z=S.inputValue,re=S.optionLabelProp,X=G==="multiple"||G==="tags",ye=Ae!==void 0?Ae:X||G==="combobox",Me=Q||_(se);if(Object(C.a)(G!=="tags"||Me.every(function(Le){return!Le.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),G==="tags"||G==="combobox"){var He=Me.some(function(Le){return Le.options?Le.options.some(function(Pe){return typeof("value"in Pe?Pe.value:Pe.key)=="number"}):typeof("value"in Le?Le.value:Le.key)=="number"});Object(C.a)(!He,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(C.a)(G!=="combobox"||!re,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(C.a)(G==="combobox"||!fe,"`backfill` only works with `combobox` mode."),Object(C.a)(G==="combobox"||!Se,"`getInputElement` only work with `combobox` mode."),Object(C.b)(G!=="combobox"||!Se||!we||!be,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),De&&!ye&&G!=="combobox"&&G!=="tags"&&Object(C.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(C.b)(!ve||Y,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),B!=null){var me=Object(E.d)(B);Object(C.a)(!k||me.every(function(Le){return Object(p.a)(Le)==="object"&&("key"in Le||"value"in Le)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(C.a)(!X||Array.isArray(B),"`value` should be array when `mode` is `multiple` or `tags`")}if(se){var Ee=null;Object(L.a)(se).some(function(Le){if(!N.isValidElement(Le)||!Le.type)return!1;var Pe=Le.type;if(Pe.isSelectOption)return!1;if(Pe.isSelectOptGroup){var Ye=Object(L.a)(Le.props.children).every(function(tt){return!N.isValidElement(tt)||!Le.type||tt.type.isSelectOption?!0:(Ee=tt.type,!1)});return!Ye}return Ee=Pe,!0}),Ee&&Object(C.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ee.displayName||Ee.name||Ee,"`.")),Object(C.a)(Z===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var P=v,F=Object(m.a)({prefixCls:"rc-select",components:{optionList:a},convertChildrenToData:_,flattenOptions:b.d,getLabeledValue:b.e,filterOptions:b.b,isValueDisabled:b.g,findValueOption:b.c,warningProps:P,fillOptionsWithMissingValue:b.a}),R=function(S){Object(D.a)(Q,S);var G=Object(V.a)(Q);function Q(){var se;return Object(J.a)(this,Q),se=G.apply(this,arguments),se.selectRef=N.createRef(),se.focus=function(){se.selectRef.current.focus()},se.blur=function(){se.selectRef.current.blur()},se}return Object(z.a)(Q,[{key:"render",value:function(){return N.createElement(F,Object.assign({ref:this.selectRef},this.props))}}]),Q}(N.Component);R.Option=o,R.OptGroup=w;var H=R,U=de.c=H},M8RZ:function(Ue,de,M){"use strict";M.d(de,"a",function(){return n});var J=M("fWQN"),z=M("mtLc"),D=M("yKVA"),V=M("879j"),N=M("q1tI"),O=M.n(N),K=M("i8i4"),W=M.n(K),n=function(I){Object(D.a)(f,I);var g=Object(V.a)(f);function f(h){var c;Object(J.a)(this,f),c=g.call(this,h);var s=window.document;return c.node=s.createElement("div"),s.body.appendChild(c.node),c}return Object(z.a)(f,[{key:"render",value:function(){var c=this.props.children;return Object(K.createPortal)(c,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),f}(O.a.Component)},MFOe:function(Ue,de,M){(function(J){var z=O(),D=K(),V=W(),N=typeof window!="undefined"?window:J;Ue.exports={assign:z,create:D,trim:V,bind:n,slice:I,each:g,map:f,pluck:h,isList:c,isFunction:s,isObject:d,Global:N};function O(){return Object.assign?Object.assign:function(a,r,o,T){for(var w=1;w<arguments.length;w++)g(Object(arguments[w]),function(x,L){a[L]=x});return a}}function K(){if(Object.create)return function(r,o,T,w){var x=I(arguments,1);return z.apply(this,[Object.create(r)].concat(x))};{function i(){}return function(r,o,T,w){var x=I(arguments,1);return i.prototype=r,z.apply(this,[new i].concat(x))}}}function W(){return String.prototype.trim?function(a){return String.prototype.trim.call(a)}:function(a){return a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}}function n(i,a){return function(){return a.apply(i,Array.prototype.slice.call(arguments,0))}}function I(i,a){return Array.prototype.slice.call(i,a||0)}function g(i,a){h(i,function(r,o){return a(r,o),!1})}function f(i,a){var r=c(i)?[]:{};return h(i,function(o,T){return r[T]=a(o,T),!1}),r}function h(i,a){if(c(i)){for(var r=0;r<i.length;r++)if(a(i[r],r))return i[r]}else for(var o in i)if(i.hasOwnProperty(o)&&a(i[o],o))return i[o]}function c(i){return i!=null&&typeof i!="function"&&typeof i.length=="number"}function s(i){return i&&{}.toString.call(i)==="[object Function]"}function d(i){return i&&{}.toString.call(i)==="[object Object]"}}).call(this,M("IyRk"))},MI8n:function(Ue,de,M){"use strict";M.d(de,"c",function(){return N}),M.d(de,"b",function(){return n}),M.d(de,"e",function(){return I}),M.d(de,"a",function(){return g}),M.d(de,"d",function(){return f}),M.d(de,"f",function(){return h});var J=M("/cxE"),z=M("pmY6"),D=M("24hK"),V=M("5Y4S"),N;(function(c){c.None=()=>z.a.None;function s(v){return(P,F=null,R)=>{let H=!1,U;return U=v(S=>H?void 0:(U?U.dispose():H=!0,P.call(F,S)),null,R),H&&U.dispose(),U}}c.once=s;function d(v,P){return w((F,R=null,H)=>v(U=>F.call(R,P(U)),null,H))}c.map=d;function i(v,P){return w((F,R=null,H)=>v(U=>{P(U),F.call(R,U)},null,H))}c.forEach=i;function a(v,P){return w((F,R=null,H)=>v(U=>P(U)&&F.call(R,U),null,H))}c.filter=a;function r(v){return v}c.signal=r;function o(...v){return(P,F=null,R)=>Object(z.e)(...v.map(H=>H(U=>P.call(F,U),null,R)))}c.any=o;function T(v,P,F){let R=F;return d(v,H=>(R=P(R,H),R))}c.reduce=T;function w(v){let P;const F=new n({onFirstListenerAdd(){P=v(F.fire,F)},onLastListenerRemove(){P.dispose()}});return F.event}function x(v,P,F=100,R=!1,H){let U,S,G,Q=0;const se=new n({leakWarningThreshold:H,onFirstListenerAdd(){U=v(fe=>{Q++,S=P(S,fe),R&&!G&&(se.fire(S),S=void 0),clearTimeout(G),G=setTimeout(()=>{const we=S;S=void 0,G=void 0,(!R||Q>1)&&se.fire(we),Q=0},F)})},onLastListenerRemove(){U.dispose()}});return se.event}c.debounce=x;function L(v,P=(F,R)=>F===R){let F=!0,R;return a(v,H=>{const U=F||!P(H,R);return F=!1,R=H,U})}c.latch=L;function A(v,P){return[c.filter(v,P),c.filter(v,F=>!P(F))]}c.split=A;function _(v,P=!1,F=[]){let R=F.slice(),H=v(G=>{R?R.push(G):S.fire(G)});const U=()=>{R&&R.forEach(G=>S.fire(G)),R=null},S=new n({onFirstListenerAdd(){H||(H=v(G=>S.fire(G)))},onFirstListenerDidAdd(){R&&(P?setTimeout(U):U())},onLastListenerRemove(){H&&H.dispose(),H=null}});return S.event}c.buffer=_;class b{constructor(v){this.event=v}map(v){return new b(d(this.event,v))}forEach(v){return new b(i(this.event,v))}filter(v){return new b(a(this.event,v))}reduce(v,P){return new b(T(this.event,v,P))}latch(){return new b(L(this.event))}debounce(v,P=100,F=!1,R){return new b(x(this.event,v,P,F,R))}on(v,P,F){return this.event(v,P,F)}once(v,P,F){return s(this.event)(v,P,F)}}function m(v){return new b(v)}c.chain=m;function p(v,P,F=R=>R){const R=(...G)=>S.fire(F(...G)),H=()=>v.on(P,R),U=()=>v.removeListener(P,R),S=new n({onFirstListenerAdd:H,onLastListenerRemove:U});return S.event}c.fromNodeEventEmitter=p;function C(v,P,F=R=>R){const R=(...G)=>S.fire(F(...G)),H=()=>v.addEventListener(P,R),U=()=>v.removeEventListener(P,R),S=new n({onFirstListenerAdd:H,onLastListenerRemove:U});return S.event}c.fromDOMEventEmitter=C;function E(v){return new Promise(P=>s(v)(P))}c.toPromise=E})(N||(N={}));class O{constructor(c){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${c}_${O._idPool++}`}start(c){this._stopWatch=new V.a(!0),this._listenerCount=c}stop(){if(this._stopWatch){const c=this._stopWatch.elapsed();this._elapsedOverall+=c,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${c.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}O._idPool=0;let K=-1;class W{constructor(c,s=Math.random().toString(18).slice(2,5)){this.customThreshold=c,this.name=s,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(c){let s=K;if(typeof this.customThreshold=="number"&&(s=this.customThreshold),s<=0||c<s)return;this._stacks||(this._stacks=new Map);const d=new Error().stack.split(`
`).slice(3).join(`
`),i=this._stacks.get(d)||0;if(this._stacks.set(d,i+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=s*.5;let a,r=0;for(const[o,T]of this._stacks)(!a||r<T)&&(a=o,r=T);console.warn(`[${this.name}] potential listener LEAK detected, having ${c} listeners already. MOST frequent listener (${r}):`),console.warn(a)}return()=>{const a=this._stacks.get(d)||0;this._stacks.set(d,a-1)}}}class n{constructor(c){var s;this._disposed=!1,this._options=c,this._leakageMon=K>0?new W(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((s=this._options)===null||s===void 0?void 0:s._profName)?new O(this._options._profName):void 0}get event(){return this._event||(this._event=(c,s,d)=>{var i;this._listeners||(this._listeners=new D.a);const a=this._listeners.isEmpty();a&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const r=this._listeners.push(s?[c,s]:c);a&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,c,s);const o=(i=this._leakageMon)===null||i===void 0?void 0:i.check(this._listeners.size),T=Object(z.i)(()=>{if(o&&o(),!this._disposed&&(r(),this._options&&this._options.onLastListenerRemove)){const w=this._listeners&&!this._listeners.isEmpty();w||this._options.onLastListenerRemove(this)}});return d instanceof z.b?d.add(T):Array.isArray(d)&&d.push(T),T}),this._event}fire(c){var s,d;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new D.a);for(let i of this._listeners)this._deliveryQueue.push([i,c]);for((s=this._perfMon)===null||s===void 0||s.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[i,a]=this._deliveryQueue.shift();try{typeof i=="function"?i.call(void 0,a):i[0].call(i[1],a)}catch(r){Object(J.f)(r)}}(d=this._perfMon)===null||d===void 0||d.stop()}}dispose(){var c,s,d,i,a;this._disposed||(this._disposed=!0,(c=this._listeners)===null||c===void 0||c.clear(),(s=this._deliveryQueue)===null||s===void 0||s.clear(),(i=(d=this._options)===null||d===void 0?void 0:d.onLastListenerRemove)===null||i===void 0||i.call(d),(a=this._leakageMon)===null||a===void 0||a.dispose())}}class I extends n{constructor(c){super(c);this._isPaused=0,this._eventQueue=new D.a,this._mergeFn=c==null?void 0:c.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const c=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(c))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(c){this._listeners&&(this._isPaused!==0?this._eventQueue.push(c):super.fire(c))}}class g extends I{constructor(c){var s;super(c);this._delay=(s=c.delay)!==null&&s!==void 0?s:100}fire(c){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(c)}}class f{constructor(){this.buffers=[]}wrapEvent(c){return(s,d,i)=>c(a=>{const r=this.buffers[this.buffers.length-1];r?r.push(()=>s.call(d,a)):s.call(d,a)},void 0,i)}bufferEvents(c){const s=[];this.buffers.push(s);const d=c();return this.buffers.pop(),s.forEach(i=>i()),d}}class h{constructor(){this.listening=!1,this.inputEvent=N.None,this.inputEventListener=z.a.None,this.emitter=new n({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(c){this.inputEvent=c,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=c(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(Ue,de,M){"use strict";(function(J,z){M.d(de,"b",function(){return d}),M.d(de,"i",function(){return o}),M.d(de,"f",function(){return T}),M.d(de,"d",function(){return w}),M.d(de,"g",function(){return x}),M.d(de,"h",function(){return L}),M.d(de,"c",function(){return A}),M.d(de,"k",function(){return _}),M.d(de,"j",function(){return b}),M.d(de,"a",function(){return m}),M.d(de,"e",function(){return E});var D;const V="en";let N=!1,O=!1,K=!1,W=!1,n=!1,I=!1,g=!1,f,h=V,c,s;const d=typeof self=="object"?self:typeof J=="object"?J:{};let i;typeof d.vscode!="undefined"&&typeof d.vscode.process!="undefined"?i=d.vscode.process:typeof z!="undefined"&&(i=z);const a=typeof((D=i==null?void 0:i.versions)===null||D===void 0?void 0:D.electron)=="string"&&i.type==="renderer";if(typeof navigator=="object"&&!a)s=navigator.userAgent,N=s.indexOf("Windows")>=0,O=s.indexOf("Macintosh")>=0,g=(s.indexOf("Macintosh")>=0||s.indexOf("iPad")>=0||s.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,K=s.indexOf("Linux")>=0,I=!0,f=navigator.language,h=f;else if(typeof i=="object"){N=i.platform==="win32",O=i.platform==="darwin",K=i.platform==="linux",W=K&&!!i.env.SNAP&&!!i.env.SNAP_REVISION,f=V,h=V;const v=i.env.VSCODE_NLS_CONFIG;if(v)try{const P=JSON.parse(v),F=P.availableLanguages["*"];f=P.locale,h=F||V,c=P._translationsConfigFile}catch(P){}n=!0}else console.error("Unable to resolve platform.");let r=0;O?r=1:N?r=3:K&&(r=2);const o=N,T=O,w=K,x=n,L=I,A=g,_=s,b=function(){if(d.setImmediate)return d.setImmediate.bind(d);if(typeof d.postMessage=="function"&&!d.importScripts){let F=[];d.addEventListener("message",H=>{if(H.data&&H.data.vscodeSetImmediateId)for(let U=0,S=F.length;U<S;U++){const G=F[U];if(G.id===H.data.vscodeSetImmediateId){F.splice(U,1),G.callback();return}}});let R=0;return H=>{const U=++R;F.push({id:U,callback:H}),d.postMessage({vscodeSetImmediateId:U},"*")}}if(typeof(i==null?void 0:i.nextTick)=="function")return i.nextTick.bind(i);const P=Promise.resolve();return F=>P.then(F)}(),m=O||g?2:N?1:3;let p=!0,C=!1;function E(){if(!C){C=!0;const v=new Uint8Array(2);v[0]=1,v[1]=2;const P=new Uint16Array(v.buffer);p=P[0]===(2<<8)+1}return p}}).call(this,M("IyRk"),M("Q2Ig"))},N0LK:function(Ue,de,M){"use strict";M.d(de,"C",function(){return J}),M.d(de,"v",function(){return D}),M.d(de,"s",function(){return V}),M.d(de,"t",function(){return N}),M.d(de,"U",function(){return O}),M.d(de,"J",function(){return K}),M.d(de,"O",function(){return W}),M.d(de,"p",function(){return n}),M.d(de,"T",function(){return I}),M.d(de,"q",function(){return g}),M.d(de,"N",function(){return f}),M.d(de,"M",function(){return h}),M.d(de,"Q",function(){return c}),M.d(de,"u",function(){return s}),M.d(de,"x",function(){return d}),M.d(de,"I",function(){return i}),M.d(de,"f",function(){return a}),M.d(de,"h",function(){return r}),M.d(de,"g",function(){return o}),M.d(de,"i",function(){return T}),M.d(de,"G",function(){return w}),M.d(de,"H",function(){return x}),M.d(de,"r",function(){return L}),M.d(de,"R",function(){return A}),M.d(de,"d",function(){return _}),M.d(de,"e",function(){return b}),M.d(de,"E",function(){return m}),M.d(de,"F",function(){return p}),M.d(de,"j",function(){return C}),M.d(de,"z",function(){return E}),M.d(de,"K",function(){return P}),M.d(de,"L",function(){return F}),M.d(de,"m",function(){return H}),M.d(de,"k",function(){return S}),M.d(de,"A",function(){return Q}),M.d(de,"a",function(){return se}),M.d(de,"n",function(){return fe}),M.d(de,"l",function(){return we}),M.d(de,"D",function(){return be}),M.d(de,"B",function(){return Se}),M.d(de,"b",function(){return Ae}),M.d(de,"S",function(){return De}),M.d(de,"o",function(){return ve}),M.d(de,"P",function(){return Y}),M.d(de,"w",function(){return k}),M.d(de,"c",function(){return B}),M.d(de,"y",function(){return X});function J(me){return!me||typeof me!="string"?!0:me.trim().length===0}const z=/{(\d+)}/g;function D(me,...Ee){return Ee.length===0?me:me.replace(z,function(Le,Pe){const Ye=parseInt(Pe,10);return isNaN(Ye)||Ye<0||Ye>=Ee.length?Le:Ee[Ye]})}function V(me){return me.replace(/[<>&]/g,function(Ee){switch(Ee){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return Ee}})}function N(me){return me.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function O(me,Ee=" "){const Le=K(me,Ee);return W(Le,Ee)}function K(me,Ee){if(!me||!Ee)return me;const Le=Ee.length;if(Le===0||me.length===0)return me;let Pe=0;for(;me.indexOf(Ee,Pe)===Pe;)Pe=Pe+Le;return me.substring(Pe)}function W(me,Ee){if(!me||!Ee)return me;const Le=Ee.length,Pe=me.length;if(Le===0||Pe===0)return me;let Ye=Pe,tt=-1;for(;!(tt=me.lastIndexOf(Ee,Ye-1),tt===-1||tt+Le!==Ye);){if(tt===0)return"";Ye=tt}return me.substring(0,Ye)}function n(me){return me.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function I(me){return me.replace(/\*/g,"")}function g(me,Ee,Le={}){if(!me)throw new Error("Cannot create regex from empty string");Ee||(me=N(me)),Le.wholeWord&&(/\B/.test(me.charAt(0))||(me="\\b"+me),/\B/.test(me.charAt(me.length-1))||(me=me+"\\b"));let Pe="";return Le.global&&(Pe+="g"),Le.matchCase||(Pe+="i"),Le.multiline&&(Pe+="m"),Le.unicode&&(Pe+="u"),new RegExp(me,Pe)}function f(me){if(me.source==="^"||me.source==="^$"||me.source==="$"||me.source==="^\\s*$")return!1;const Ee=me.exec("");return!!(Ee&&me.lastIndex===0)}function h(me){return(me.global?"g":"")+(me.ignoreCase?"i":"")+(me.multiline?"m":"")+(me.unicode?"u":"")}function c(me){return me.split(/\r\n|\r|\n/)}function s(me){for(let Ee=0,Le=me.length;Ee<Le;Ee++){const Pe=me.charCodeAt(Ee);if(Pe!==32&&Pe!==9)return Ee}return-1}function d(me,Ee=0,Le=me.length){for(let Pe=Ee;Pe<Le;Pe++){const Ye=me.charCodeAt(Pe);if(Ye!==32&&Ye!==9)return me.substring(Ee,Pe)}return me.substring(Ee,Le)}function i(me,Ee=me.length-1){for(let Le=Ee;Le>=0;Le--){const Pe=me.charCodeAt(Le);if(Pe!==32&&Pe!==9)return Le}return-1}function a(me,Ee){return me<Ee?-1:me>Ee?1:0}function r(me,Ee,Le=0,Pe=me.length,Ye=0,tt=Ee.length){for(;Le<Pe&&Ye<tt;Le++,Ye++){let gt=me.charCodeAt(Le),ht=Ee.charCodeAt(Ye);if(gt<ht)return-1;if(gt>ht)return 1}const ut=Pe-Le,lt=tt-Ye;return ut<lt?-1:ut>lt?1:0}function o(me,Ee){return T(me,Ee,0,me.length,0,Ee.length)}function T(me,Ee,Le=0,Pe=me.length,Ye=0,tt=Ee.length){for(;Le<Pe&&Ye<tt;Le++,Ye++){let gt=me.charCodeAt(Le),ht=Ee.charCodeAt(Ye);if(gt===ht)continue;if(gt>=128||ht>=128)return r(me.toLowerCase(),Ee.toLowerCase(),Le,Pe,Ye,tt);w(gt)&&(gt-=32),w(ht)&&(ht-=32);const Ie=gt-ht;if(Ie===0)continue;return Ie}const ut=Pe-Le,lt=tt-Ye;return ut<lt?-1:ut>lt?1:0}function w(me){return me>=97&&me<=122}function x(me){return me>=65&&me<=90}function L(me,Ee){return me.length===Ee.length&&T(me,Ee)===0}function A(me,Ee){const Le=Ee.length;return Ee.length>me.length?!1:T(me,Ee,0,Le)===0}function _(me,Ee){let Le,Pe=Math.min(me.length,Ee.length);for(Le=0;Le<Pe;Le++)if(me.charCodeAt(Le)!==Ee.charCodeAt(Le))return Le;return Pe}function b(me,Ee){let Le,Pe=Math.min(me.length,Ee.length);const Ye=me.length-1,tt=Ee.length-1;for(Le=0;Le<Pe;Le++)if(me.charCodeAt(Ye-Le)!==Ee.charCodeAt(tt-Le))return Le;return Pe}function m(me){return 55296<=me&&me<=56319}function p(me){return 56320<=me&&me<=57343}function C(me,Ee){return(me-55296<<10)+(Ee-56320)+65536}function E(me,Ee,Le){const Pe=me.charCodeAt(Le);if(m(Pe)&&Le+1<Ee){const Ye=me.charCodeAt(Le+1);if(p(Ye))return C(Pe,Ye)}return Pe}function v(me,Ee){const Le=me.charCodeAt(Ee-1);if(p(Le)&&Ee>1){const Pe=me.charCodeAt(Ee-2);if(m(Pe))return C(Pe,Le)}return Le}function P(me,Ee){const Le=Z.getInstance(),Pe=Ee,Ye=me.length,tt=E(me,Ye,Ee);Ee+=tt>=65536?2:1;let ut=Le.getGraphemeBreakType(tt);for(;Ee<Ye;){const lt=E(me,Ye,Ee),gt=Le.getGraphemeBreakType(lt);if(B(ut,gt))break;Ee+=lt>=65536?2:1,ut=gt}return Ee-Pe}function F(me,Ee){const Le=Z.getInstance(),Pe=Ee,Ye=v(me,Ee);Ee-=Ye>=65536?2:1;let tt=Le.getGraphemeBreakType(Ye);for(;Ee>0;){const ut=v(me,Ee),lt=Le.getGraphemeBreakType(ut);if(B(lt,tt))break;Ee-=ut>=65536?2:1,tt=lt}return Pe-Ee}const R=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function H(me){return R.test(me)}const U=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function S(me){return U.test(me)}const G=/^[\t\n\r\x20-\x7E]*$/;function Q(me){return G.test(me)}const se=/[\u2028\u2029]/;function fe(me){return se.test(me)}function we(me){for(let Ee=0,Le=me.length;Ee<Le;Ee++)if(be(me.charCodeAt(Ee)))return!0;return!1}function be(me){return me=+me,me>=11904&&me<=55215||me>=63744&&me<=64255||me>=65281&&me<=65374}function Se(me){return me>=127462&&me<=127487||me===8986||me===8987||me===9200||me===9203||me>=9728&&me<=10175||me===11088||me===11093||me>=127744&&me<=128591||me>=128640&&me<=128764||me>=128992&&me<=129003||me>=129280&&me<=129535||me>=129648&&me<=129750}const Ae=String.fromCharCode(65279);function De(me){return!!(me&&me.length>0&&me.charCodeAt(0)===65279)}function ve(me,Ee=!1){return me?(Ee&&(me=me.replace(/\\./g,"")),me.toLowerCase()!==me):!1}function Y(me){const Ee=90-65+1;return me=me%(2*Ee),me<Ee?String.fromCharCode(97+me):String.fromCharCode(65+me-Ee)}function k(me){const Ee=Z.getInstance();return Ee.getGraphemeBreakType(me)}function B(me,Ee){return me===0?Ee!==5&&Ee!==7:me===2&&Ee===3?!1:me===4||me===2||me===3||(Ee===4||Ee===2||Ee===3)?!0:me===8&&(Ee===8||Ee===9||Ee===11||Ee===12)||((me===11||me===9)&&(Ee===9||Ee===10)||((me===12||me===10)&&Ee===10||(Ee===5||Ee===13||(Ee===7||(me===1||me===13&&Ee===14)))))?!1:!(me===6&&Ee===6)}class Z{constructor(){this._data=re()}static getInstance(){return Z._INSTANCE||(Z._INSTANCE=new Z),Z._INSTANCE}getGraphemeBreakType(me){if(me<32)return me===10?3:me===13?2:4;if(me<127)return 0;const Ee=this._data,Le=Ee.length/3;let Pe=1;for(;Pe<=Le;)if(me<Ee[3*Pe])Pe=2*Pe;else if(me>Ee[3*Pe+1])Pe=2*Pe+1;else return Ee[3*Pe+2];return 0}}Z._INSTANCE=null;function re(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function X(me,Ee){if(me===0)return 0;const Le=ye(me,Ee);if(Le!==void 0)return Le;const Pe=v(Ee,me);return me-=Me(Pe),me}function ye(me,Ee){let Le=v(Ee,me);for(me-=Me(Le);He(Le)||Le===65039||Le===8419;){if(me===0)return;Le=v(Ee,me),me-=Me(Le)}if(!Se(Le))return;if(me>=0){const Pe=v(Ee,me);Pe===8205&&(me-=Me(Pe))}return me}function Me(me){return me>=65536?2:1}function He(me){return 127995<=me&&me<=127999}},NvD2:function(Ue,de,M){"use strict";M.d(de,"a",function(){return O});var J=M("Kwbf");function z(K,W){var n=new Set;return K.forEach(function(I){W.has(I)||n.add(I)}),n}function D(K){var W=K||{},n=W.disabled,I=W.disableCheckbox,g=W.checkable;return!!(n||I)||g===!1}function V(K,W,n,I){for(var g=new Set(K),f=new Set,h=0;h<=n;h+=1){var c=W.get(h)||new Set;c.forEach(function(a){var r=a.key,o=a.node,T=a.children,w=T===void 0?[]:T;g.has(r)&&!I(o)&&w.filter(function(x){return!I(x.node)}).forEach(function(x){g.add(x.key)})})}for(var s=new Set,d=n;d>=0;d-=1){var i=W.get(d)||new Set;i.forEach(function(a){var r=a.parent,o=a.node;if(I(o)||!a.parent||s.has(a.parent.key))return;if(I(a.parent.node)){s.add(r.key);return}var T=!0,w=!1;(r.children||[]).filter(function(x){return!I(x.node)}).forEach(function(x){var L=x.key,A=g.has(L);T&&!A&&(T=!1),!w&&(A||f.has(L))&&(w=!0)}),T&&g.add(r.key),w&&f.add(r.key),s.add(r.key)})}return{checkedKeys:Array.from(g),halfCheckedKeys:Array.from(z(f,g))}}function N(K,W,n,I,g){for(var f=new Set(K),h=new Set(W),c=0;c<=I;c+=1){var s=n.get(c)||new Set;s.forEach(function(r){var o=r.key,T=r.node,w=r.children,x=w===void 0?[]:w;!f.has(o)&&!h.has(o)&&!g(T)&&x.filter(function(L){return!g(L.node)}).forEach(function(L){f.delete(L.key)})})}h=new Set;for(var d=new Set,i=I;i>=0;i-=1){var a=n.get(i)||new Set;a.forEach(function(r){var o=r.parent,T=r.node;if(g(T)||!r.parent||d.has(r.parent.key))return;if(g(r.parent.node)){d.add(o.key);return}var w=!0,x=!1;(o.children||[]).filter(function(L){return!g(L.node)}).forEach(function(L){var A=L.key,_=f.has(A);w&&!_&&(w=!1),!x&&(_||h.has(A))&&(x=!0)}),w||f.delete(o.key),x&&h.add(o.key),d.add(o.key)})}return{checkedKeys:Array.from(f),halfCheckedKeys:Array.from(z(h,f))}}function O(K,W,n,I){var g=[],f;I?f=I:f=D;var h=new Set(K.filter(function(i){var a=!!n[i];return a||g.push(i),a})),c=new Map,s=0;Object.keys(n).forEach(function(i){var a=n[i],r=a.level,o=c.get(r);o||(o=new Set,c.set(r,o)),o.add(a),s=Math.max(s,r)}),Object(J.a)(!g.length,"Tree missing follow keys: ".concat(g.slice(0,100).map(function(i){return"'".concat(i,"'")}).join(", ")));var d;return W===!0?d=V(h,c,s,f):d=N(h,W.halfCheckedKeys,c,s,f),d}},OJz4:function(Ue,de,M){"use strict";M.d(de,"d",function(){return z}),M.d(de,"h",function(){return D}),M.d(de,"b",function(){return V}),M.d(de,"f",function(){return N}),M.d(de,"e",function(){return O}),M.d(de,"c",function(){return K}),M.d(de,"a",function(){return W}),M.d(de,"g",function(){return n}),M.d(de,"i",function(){return I}),M.d(de,"k",function(){return g}),M.d(de,"j",function(){return f});var J=M("ErOA");function z(h){return Object(J.c)("myproblems/".concat(h,".json"),{hidePopLogin:!0})}function D(h,c){return Object(J.f)("myproblems/".concat(h,"/code_submit.json"),c)}function V(h,c){return Object(J.c)("myproblems/".concat(h,"/code_debug.json"),c)}function N(h,c){return Object(J.c)("myproblems/".concat(h,"/submit_records.json"),c)}function O(h){return Object(J.c)("myproblems/record_detail.json",{id:h})}function K(h,c){return Object(J.c)("myproblems/".concat(h,"/result.json"),{mode:c})}function W(h,c){return Object(J.f)("myproblems/".concat(h,"/add_notes.json"),c)}function n(h){return Object(J.f)("myproblems/".concat(h,"/restore_initial_code.json"))}function I(h){return Object(J.f)("myproblems/".concat(h,"/sync_code.json"))}function g(h,c){return Object(J.f)("myproblems/".concat(h,"/update_code.json"),c)}function f(h,c){return Object(J.f)("discusses/".concat(h,"/plus.json"),c)}},OLES:function(Ue,de,M){"use strict";var J=M("U8pU"),z=M("VTBJ"),D=M("Ff2n"),V=M("q1tI"),N=M("uciX"),O=M("7ixt"),K=function(h){var c=h.overlay,s=h.prefixCls,d=h.id,i=h.overlayInnerStyle;return V.createElement("div",{className:"".concat(s,"-inner"),id:d,role:"tooltip",style:i},typeof c=="function"?c():c)},W=K,n=function(h,c){var s=h.overlayClassName,d=h.trigger,i=d===void 0?["hover"]:d,a=h.mouseEnterDelay,r=a===void 0?0:a,o=h.mouseLeaveDelay,T=o===void 0?.1:o,w=h.overlayStyle,x=h.prefixCls,L=x===void 0?"rc-tooltip":x,A=h.children,_=h.onVisibleChange,b=h.afterVisibleChange,m=h.transitionName,p=h.animation,C=h.placement,E=C===void 0?"right":C,v=h.align,P=v===void 0?{}:v,F=h.destroyTooltipOnHide,R=F===void 0?!1:F,H=h.defaultVisible,U=h.getTooltipContainer,S=h.overlayInnerStyle,G=Object(D.a)(h,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),Q=Object(V.useRef)(null);Object(V.useImperativeHandle)(c,function(){return Q.current});var se=Object(z.a)({},G);"visible"in h&&(se.popupVisible=h.visible);var fe=function(){var De=h.arrowContent,ve=De===void 0?null:De,Y=h.overlay,k=h.id;return[V.createElement("div",{className:"".concat(L,"-arrow"),key:"arrow"},ve),V.createElement(W,{key:"content",prefixCls:L,id:k,overlay:Y,overlayInnerStyle:S})]},we=!1,be=!1;if(typeof R=="boolean")we=R;else if(R&&Object(J.a)(R)==="object"){var Se=R.keepParent;we=Se===!0,be=Se===!1}return V.createElement(N.a,Object.assign({popupClassName:s,prefixCls:L,popup:fe,action:i,builtinPlacements:O.a,popupPlacement:E,ref:Q,popupAlign:P,getPopupContainer:U,onPopupVisibleChange:_,afterPopupVisibleChange:b,popupTransitionName:m,popupAnimation:p,defaultPopupVisible:H,destroyPopupOnHide:we,autoDestroy:be,mouseLeaveDelay:T,popupStyle:w,mouseEnterDelay:r},se),A)},I=Object(V.forwardRef)(n),g=de.a=I},OZM5:function(Ue,de,M){"use strict";M.d(de,"b",function(){return I}),M.d(de,"a",function(){return g}),M.d(de,"k",function(){return f}),M.d(de,"h",function(){return h}),M.d(de,"i",function(){return c}),M.d(de,"g",function(){return s}),M.d(de,"c",function(){return d}),M.d(de,"d",function(){return i}),M.d(de,"j",function(){return o}),M.d(de,"e",function(){return T}),M.d(de,"f",function(){return w});var J=M("KQm4"),z=M("U8pU"),D=M("Ff2n"),V=M("q1tI"),N=M.n(V),O=M("Kwbf"),K=M("WaYH"),W=.25,n=2;function I(x,L){var A=x.slice(),_=A.indexOf(L);return _>=0&&A.splice(_,1),A}function g(x,L){var A=x.slice();return A.indexOf(L)===-1&&A.push(L),A}function f(x){return x.split("-")}function h(x,L){return"".concat(x,"-").concat(L)}function c(x){return x&&x.type&&x.type.isTreeNode}function s(x,L){var A=[x],_=L[x];function b(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];m.forEach(function(p){var C=p.key,E=p.children;A.push(C),b(E)})}return b(_.children),A}function d(x,L){var A=x.clientY,_=L.selectHandle.getBoundingClientRect(),b=_.top,m=_.bottom,p=_.height,C=Math.max(p*W,n);return A<=b+C?-1:A>=m-C?1:0}function i(x,L){if(!x)return;var A=L.multiple;return A?x.slice():x.length?[x[0]]:x}var a=function(L){return L};function r(x,L){if(!x)return[];var A=L||{},_=A.processProps,b=_===void 0?a:_,m=Array.isArray(x)?x:[x];return m.map(function(p){var C=p.children,E=Object(D.a)(p,["children"]),v=r(C,L);return N.a.createElement(K.a,Object.assign({},b(E)),v)})}function o(x){if(!x)return null;var L;if(Array.isArray(x))L={checkedKeys:x,halfCheckedKeys:void 0};else if(Object(z.a)(x)==="object")L={checkedKeys:x.checked||void 0,halfCheckedKeys:x.halfChecked||void 0};else return Object(O.a)(!1,"`checkedKeys` is not an array or an object"),null;return L}function T(x,L){var A=new Set;function _(b){if(A.has(b))return;var m=L[b];if(!m)return;A.add(b);var p=m.parent,C=m.node;if(C.disabled)return;p&&_(p.key)}return(x||[]).forEach(function(b){_(b)}),Object(J.a)(A)}function w(x){var L={};return Object.keys(x).forEach(function(A){(A.startsWith("data-")||A.startsWith("aria-"))&&(L[A]=x[A])}),L}},Ot1p:function(Ue,de,M){"use strict";var J=M("2qtc"),z=M("kLXV"),D=M("rAM+"),V=M("miYZ"),N=M("tsqr"),O=M("9og8"),K=M("tJVT"),W=M("jrin"),n=M("WmNS"),I=M.n(n),g=M("q1tI"),f=M.n(g),h=M("VrN/"),c=M.n(h),s=M("bdgK"),d=M("p77/"),i=M("Bd2K"),a=M("ELLl"),r=M("19Vz"),o=M("lZu9"),T=M("+NIl"),w=M("kSUc"),x=M("9Bee"),L=function(_e){var Oe=_e.value,Ge=Oe===void 0?"":Oe,et=_e.className,ct=_e.showTextOnly,st=_e.showLines,nt=_e.style,We=nt===void 0?{}:nt,Ve=Object(g.useMemo)(function(){return""},[Ge]);return f.a.createElement(f.a.Fragment,null,f.a.createElement("div",{dangerouslySetInnerHTML:{__html:Ve}}))},A=M("0Owb"),_=M("dejd"),b=M("C+DQ"),m=M("1vsH"),p=M("m3rI"),C=[{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 E(_e){var Oe=_e.onActionCallback,Ge=_e.title,et=_e.icon,ct=_e.actionName,st=_e.className,nt=st===void 0?"":st,We=_e.children;function Ve(){Oe(ct)}return f.a.createElement("a",{title:Ge,className:nt,onClick:Ve},f.a.createElement("i",{className:"md-iconfont ".concat(et)}),We)}var v=function(_e){var Oe=_e.watch,Ge=_e.showNullButton,et=_e.onActionCallback,ct=_e.fullScreen,st=_e.insertTemp,nt=_e.hidetoolBar,We=_e.uuid,Ve=_e.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(m.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(m.F)("_educoder_session"),"&key=").concat(We,"&api=").concat(encodeURIComponent(p.a.PROXY_SERVER)));var Ne=[].concat(C,[{title:"".concat(Oe?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Oe?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return f.a.createElement("ul",{className:"markdown-toolbar-container"},!nt&&Ne.map(function(pe,xe){return f.a.createElement("li",{key:xe},pe.actionName?f.a.createElement(E,Object(A.a)({},pe,{onActionCallback:et})):f.a.createElement("span",{className:"v-line"}))}),Ge?f.a.createElement("li",null,f.a.createElement(E,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:et},f.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,st&&f.a.createElement("li",null,f.a.createElement(E,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(st),onActionCallback:et},f.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),f.a.createElement("li",{className:"btn-full-screen"},f.a.createElement(E,{icon:"".concat(ct?"icon-shrink":"icon-enlarge"),title:ct?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:et})))},P=M("M8RZ"),F=M("+L6B"),R=M("2/Rp"),H=M("y8nQ"),U=M("Vl3Y"),S=M("5NDa"),G=M("5rEg"),Q={labelCol:{span:4},wrapperCol:{span:20}},se=function(_e){var Oe=_e.callback,Ge=_e.onCancel;function et(ct){Oe(ct)}return f.a.createElement(U.a,Object(A.a)({},Q,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:et}),f.a.createElement(U.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(U.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(R.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(R.a,{type:"ghost",onClick:Ge},"\u53D6\u6D88")))},fe=M("7ahc"),we=M("HmJG"),be=M("BjJ7"),Se=U.a.useForm,Ae={width:280,marginRight:10},De={labelCol:{span:5},wrapperCol:{span:19}},ve=function(_e){var Oe=_e.callback,Ge=_e.onCancel,et=Se(),ct=Object(K.a)(et,1),st=ct[0];function nt(Ne){Oe(Ne)}function We(Ne,pe){if(Ne.status===-1){N.b.error(Ne.message);return}st.setFieldsValue({src:"/api/attachments/".concat(Ne.id),type:pe.type})}function Ve(Ne){var pe=Ne.target.files[0];k(pe,We)}return f.a.createElement(U.a,Object(A.a)({form:st},De,{className:"upload-image-panel",onFinish:nt}),f.a.createElement(U.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},f.a.createElement("div",{className:"flex-container"},f.a.createElement(U.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},f.a.createElement(G.a,{style:Ae})),f.a.createElement(Y,{onFileChange:Ve}))),f.a.createElement(U.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},f.a.createElement(G.a,{style:{width:264}})),f.a.createElement(U.a.Item,{style:{textAlign:"right"}},f.a.createElement(R.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(R.a,{type:"ghost",onClick:Ge},"\u53D6\u6D88")))};function Y(_e){var Oe=_e.onFileChange;return f.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",f.a.createElement("input",{type:"file",onChange:Oe}))}function k(_e,Oe){if(!_e)throw new String("\u6CA1\u6709\u6587\u4EF6");var Ge=new FormData;Ge.append("editormd-image-file",_e),Ge.append("file_param_name","editormd-image-file"),Ge.append("byxhr","true");var et=new window.XMLHttpRequest;et.withCredentials=!0,et.addEventListener("load",function(ct){Oe(JSON.parse(ct.target.responseText),_e)},!1),et.addEventListener("error",function(ct){console.error(ct)},!1),et.open("POST","".concat(be.a,"/api/attachments.json")),et.send(Ge)}var B=M("giR+"),Z=M("fyUT"),re=M("7Kak"),X=M("9yH6"),ye=X.a.Group,Me={margin:"0 8px"},He=function(_e){var Oe=_e.callback,Ge=_e.onCancel;function et(ct){Oe(ct)}return f.a.createElement(U.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:et},f.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},f.a.createElement("span",{style:Me},"\u5355\u5143\u683C\u6570\uFF1A"),f.a.createElement("span",{style:Me},"\u884C\u6570"),f.a.createElement(U.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},f.a.createElement(Z.a,null)),f.a.createElement("span",{style:Me},"\u5217\u6570"),f.a.createElement(U.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},f.a.createElement(Z.a,null))),f.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},f.a.createElement("span",{style:Me},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),f.a.createElement(U.a.Item,{name:"align"},f.a.createElement(ye,null,f.a.createElement(X.a,{value:"default"},f.a.createElement("i",{className:"fa fa-align-justify"})),f.a.createElement(X.a,{value:"left"},f.a.createElement("i",{className:"fa fa-align-left"})),f.a.createElement(X.a,{value:"center"},f.a.createElement("i",{className:"fa fa-align-center"})),f.a.createElement(X.a,{value:"right"},f.a.createElement("i",{className:"fa fa-align-right"}))))),f.a.createElement("div",{className:"flex-container flex-end"},f.a.createElement(R.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(R.a,{type:"ghost",onClick:Ge},"\u53D6\u6D88")))},me=M("ErOA"),Ee=M("7Cbv"),Le="link",Pe="upload-image",Ye="code-block",tt="add-table",ut="------------",lt={default:ut,left:":".concat(ut),center:":".concat(ut,":"),right:"".concat(ut,":")},gt=M("9VGf"),ht,Ie;function Re(){}var $e=0,Ze=1e4,ue="\u2581",q=`
**\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 te(_e){return/^\d+$/.test(_e)?"".concat(_e,"px"):_e}var ae=navigator.platform.toUpperCase().indexOf("MAC")>=0,ce=ae?"Cmd":"Ctrl",ie=["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"],oe=(ht={},Object(W.a)(ht,ce+"-B","bold"),Object(W.a)(ht,ce+"-I","italic"),ht),he=(Ie={},Object(W.a)(Ie,Le,"\u6DFB\u52A0\u94FE\u63A5"),Object(W.a)(Ie,Ye,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(W.a)(Ie,Pe,"\u6DFB\u52A0\u6587\u4EF6"),Object(W.a)(Ie,tt,"\u6DFB\u52A0\u8868\u683C"),Ie),ge=de.a=function(_e){var Oe=_e.defaultValue,Ge=Oe===void 0?"":Oe,et=_e.onChange,ct=_e.width,st=ct===void 0?"100%":ct,nt=_e.height,We=nt===void 0?400:nt,Ve=_e.miniToolbar,Ne=Ve===void 0?!1:Ve,pe=_e.isFocus,xe=pe===void 0?!1:pe,Xe=_e.watch,je=_e.insertTemp,it=_e.mode,ot=it===void 0?"markdown":it,Ke=_e.id,Je=Ke===void 0?"markdown-editor-id":Ke,Qe=_e.showResizeBar,pt=Qe===void 0?!1:Qe,dt=_e.noStorage,Vt=dt===void 0?!1:dt,rn=_e.showNullButton,an=rn===void 0?!1:rn,ft=_e.hidetoolBar,Wt=ft===void 0?!1:ft,Xt=_e.fullScreen,Ot=Xt===void 0?!1:Xt,Mt=_e.onBlur,Ft=_e.onCMBeforeChange,On=_e.onFullScreen,vn=_e.className,rt=vn===void 0?"":vn,vt=_e.disablePaste,zn=vt===void 0?!1:vt,Tr=_e.placeholder,vr=Tr===void 0?"":Tr,Fr=_e.values,Wn=Fr===void 0?"":Fr,Dt=Object(g.useState)(null),ze=Object(K.a)(Dt,2),Fe=ze[0],Pt=ze[1],Yt=Object(g.useState)(Ge),Tn=Object(K.a)(Yt,2),yn=Tn[0],cn=Tn[1],$t=Object(g.useState)(Xe),It=Object(K.a)($t,2),Nt=It[0],Ht=It[1],kt=Object(g.useState)(Ot),on=Object(K.a)(kt,2),yt=on[0],mn=on[1],tn=Object(g.useState)(""),kn=Object(K.a)(tn,2),jt=kn[0],Nn=kn[1],jn=Object(g.useState)(0),Ln=Object(K.a)(jn,2),Sn=Ln[0],Mn=Ln[1],ir=Object(g.useState)(We),cr=Object(K.a)(ir,2),Yn=cr[0],An=cr[1],dr=Object(g.useState)(!1),gn=Object(K.a)(dr,2),bn=gn[0],_n=gn[1],Jt=Object(g.useRef)(Object(Ee.a)()),wt=Object(g.useRef)(!1),Kt=Object(g.useRef)(),xt=Object(g.useRef)(),sn=Object(g.useRef)(),Bt=Object(g.useRef)(),ar=Object(g.useRef)(),Un=function(){var Ct=Object(O.a)(I.a.mark(function Gt(){var Lt,Zt;return I.a.wrap(function(wn){for(;;)switch(wn.prev=wn.next){case 0:return wn.next=2,Object(me.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Jt.current}});case 2:Zt=wn.sent,Zt!=null&&(Lt=Zt.attachments)!==null&&Lt!==void 0&&Lt.length&&(console.log("cm:",Fe,xt),Zt.attachments.map(function(ln){ln.content_type.indexOf("image")>-1?Fe.replaceSelection("![,](/api/attachments/".concat(ln.id,"?type=").concat(ln.content_type,")")):ln.content_type.indexOf("video")>-1?Fe.replaceSelection('<video width="100%" controls src="'.concat(p.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):ln.content_type.indexOf("pdf")>-1?Fe.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(ln.id,"?type=").concat(ln.content_type,'&disposition=inline" target="_blank">').concat(ln.name,"</a>")):Fe.replaceSelection("[".concat(ln.name,"](").concat(p.a.API_SERVER,"/api/attachments/").concat(ln.id,"?type=").concat(ln.content_type,")"))}));case 4:case"end":return wn.stop()}},Gt)}));return function(){return Ct.apply(this,arguments)}}();Object(g.useEffect)(function(){cn(Wn),Fe==null||Fe.setValue(Wn)},[Wn]),Object(g.useEffect)(function(){On==null||On(yt)},[yt]),Object(g.useEffect)(function(){if(xt.current){var Ct=c.a.fromTextArea(xt.current,{mode:ot,lineNumbers:!Ne,lineWrapping:!0,value:Ge,autoCloseTags:!0,autoCloseBrackets:!0});xe&&Ct.focus();function Gt(Lt,Zt){if(zn){Zt.preventDefault();return}var qt=Zt.clipboardData;if(qt){var wn=qt.types.toString(),ln=qt.items;if(wn==="Files"||qt.types.indexOf("Files")>-1){if(Zt.preventDefault(),ot=="stex")return;try{var Fn,tr=ln[1];((Fn=ln[0])===null||Fn===void 0?void 0:Fn.kind)==="file"&&(tr=ln[0]);var Qt=tr.getAsFile(),br=Qt.name.split(".").pop();k(Qt,function(En){if(En.id){var $n,Jn,fr;(Qt==null||(($n=Qt.type)===null||$n===void 0)?void 0:$n.indexOf("image"))>-1?Ct.replaceSelection("![,](/api/attachments/".concat(En.id,"?type=").concat(En.content_type,")")):(Qt==null||((Jn=Qt.type)===null||Jn===void 0)?void 0:Jn.indexOf("video"))>-1?Ct.replaceSelection('<video width="100%" controls src="'.concat(p.a.API_SERVER,"/api/attachments/").concat(En.id,'"></video>')):(Qt==null||((fr=Qt.type)===null||fr===void 0)?void 0:fr.indexOf("pdf"))>-1?Ct.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(En.id,"?type=").concat(Qt.type,'&disposition=inline" target="_blank">').concat(Qt.name,"</a>")):ie.includes(br)?Ct.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(En.id,'?type=office&disposition=inline" target="_blank">').concat(Qt.name,"</a>")):Ct.replaceSelection("[".concat(Qt.name,"](").concat(p.a.API_SERVER,"/api/attachments/").concat(En.id,"?type=").concat(En.content_type,")"))}else(En==null?void 0:En.status)===401&&(document.location.href="/user/login")})}catch(En){N.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Ct.on("paste",Gt),Ct.on("dragleave",function(Lt,Zt){sn.current.classList.remove("mouse-hover-md")}),Ct.on("dragover",function(Lt,Zt){sn.current.classList.add("mouse-hover-md")}),Ct.on("drop",function(Lt,Zt){sn.current.classList.add("mouse-hover-md");var qt;if(qt=Zt.dataTransfer.files,qt.length>0){Zt.preventDefault(),Zt.stopPropagation();for(var wn=function(tr){var Qt=qt[tr],br=Qt.name.split(".").pop();k(Qt,function(En){if(En.id){var $n,Jn,fr;(Qt==null||(($n=Qt.type)===null||$n===void 0)?void 0:$n.indexOf("image"))>-1?Ct.replaceSelection("![,](/api/attachments/".concat(En.id,"?type=").concat(En.content_type,")")):(Qt==null||((Jn=Qt.type)===null||Jn===void 0)?void 0:Jn.indexOf("video"))>-1?Ct.replaceSelection('<video width="100%" controls src="'.concat(p.a.API_SERVER,"/api/attachments/").concat(En.id,'"></video>')):(Qt==null||((fr=Qt.type)===null||fr===void 0)?void 0:fr.indexOf("pdf"))>-1?Ct.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(En.id,"?type=").concat(Qt.type,'&disposition=inline" target="_blank">').concat(Qt.name,"</a>")):ie.includes(br)?Ct.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(En.id,'?type=office&disposition=inline" target="_blank">').concat(Qt.name,"</a>")):Ct.replaceSelection("[".concat(Qt.name,"](").concat(p.a.API_SERVER,"/api/attachments/").concat(En.id,"?type=").concat(En.content_type,")"))}else(En==null?void 0:En.status)===401&&(document.location.href="/user/login")})},ln=0;ln<qt.length;ln++)wn(ln)}}),Pt(Ct),function(){Ct.off("paste",Gt)}}},[]);var hr=Object(g.useCallback)(function(){if(sn.current)try{}catch(Ct){console.log(Ct,"---- to set md editor body height")}},[Yn,sn,yt]);Object(g.useEffect)(function(){function Ct(){var Lt=new s.default(function(Zt){var qt=Object(D.a)(Zt),wn;try{for(qt.s();!(wn=qt.n()).done;){var ln=wn.value;(ln.target.offsetHeight>0||ln.target.offsetWidth>0)&&(hr(),Fe.setSize("100%","100%"),Fe.refresh())}}catch(Fn){qt.e(Fn)}finally{qt.f()}});return Lt.observe(xt.current.parentElement),Lt}if(Fe){var Gt=Ct();return function(){Gt.unobserve(xt.current.parentElement)}}},[Fe,hr]),Object(g.useEffect)(function(){if(Fe){for(var Ct=[],Gt=function(){var ln=Zt[Lt];qt=Object(K.a)(ln,2);var Fn=qt[0],tr=qt[1],Qt=Object(W.a)({},Fn,function(){Zr(tr)});Ct.push(Qt),Fe.addKeyMap(Qt)},Lt=0,Zt=Object.entries(oe);Lt<Zt.length;Lt++){var qt;Gt()}return Kt.current=setInterval(function(){wt.current&&Un()},4e3),function(){clearInterval(Kt.current);var wn=Object(D.a)(Ct),ln;try{for(wn.s();!(ln=wn.n()).done;){var Fn=ln.value;Fe.removeKeyMap(Fn)}}catch(tr){wn.e(tr)}finally{wn.f()}}}},[Fe]),Object(g.useEffect)(function(){Ot!==yt&&mn(Ot)},[Ot]),Object(gt.a)(function(){if(!Vt&&Sn>0){var Ct=new Date().getTime(),Gt=window.sessionStorage.getItem(Je);Ct>=Sn+Ze&&(!Gt||Gt!==yn)&&(window.sessionStorage.setItem(Je,yn),_n(!0))}},Ze),Object(g.useEffect)(function(){Ht(Xe)},[Fe,Xe]),Object(g.useEffect)(function(){Fe&&(xe&&Fe.focus())},[Fe,xe]),Object(g.useEffect)(function(){if(Nt&&Fe){var Ct=Fe.getScrollerElement();function Gt(Lt){var Zt=Lt.target;if(ar.current){var qt=Zt.scrollTop/Zt.scrollHeight;ar.current.scrollTop=ar.current.scrollHeight*qt}}return Ct.addEventListener("scroll",Gt),function(){Ct.removeEventListener("scroll",Gt)}}},[Fe,Nt]),Object(g.useEffect)(function(){if(Fe&&Ft){function Ct(Gt,Lt){Ft(Gt,Lt)}return Fe.on("beforeChange",Ct),function(){Fe.off("beforeChange",Ct)}}},[Fe,Ft]),Object(g.useEffect)(function(){if(Fe&&Mt){function Ct(){Mt(Fe.getValue())}return Fe.on("blur",Ct),function(){Fe.off("blur",Ct)}}},[Fe,Mt]),Object(g.useEffect)(function(){if(Fe){function Ct(Gt){var Lt=Gt.getValue();cn(Lt),Mn(new Date().getTime()),Gt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),et&&et(Lt)}return Fe.on("change",Ct),function(){Fe.off("change",Ct)}}},[Fe,et]),Object(g.useEffect)(function(){Fe&&(Ge==null?(Fe.setValue(""),cn("")):Ge!==Fe.getValue()&&(Fe.setValue(Ge),cn(Ge),Fe.setCursor(Fe.lineCount(),0)))},[Fe,Ge]);var Zr=Object(g.useCallback)(function(Ct){var Gt=Fe.getCursor(),Lt=Fe.getSelection(),Zt=Lt.split(`
`);switch(Ct){case"bold":return Fe.replaceSelection("**"+Lt+"**"),Lt===""&&Fe.setCursor(Gt.line,Gt.ch+2),Fe.focus();case"italic":return Fe.replaceSelection("*"+Lt+"*"),Lt===""&&Fe.setCursor(Gt.line,Gt.ch+1),Fe.focus();case"code":return Fe.replaceSelection("`"+Lt+"`"),Lt===""&&Fe.setCursor(Gt.line,Gt.ch+1),Fe.focus();case"inline-latex":return Fe.replaceSelection("`$$"+Lt+"$$`"),Lt===""&&Fe.setCursor(Gt.line,Gt.ch+3),Fe.focus();case"latex":return Fe.replaceSelection("```latex\n"+Lt+"\n```"),Fe.setCursor(Gt.line+1,Lt.length+1),Fe.focus();case"line-break":return Fe.replaceSelection(`<br/>
`),Fe.focus();case"list-ul":return Lt===""?Fe.replaceSelection("- "+Lt):Fe.replaceSelection(Zt.map(function(qt){return qt===""?"":"- ".concat(qt)}).join(`
`)),Fe.focus();case"list-ol":return Lt===""?Fe.replaceSelection("1. "+Lt):Fe.replaceSelection(Zt.map(function(qt,wn){return qt===""?"":"".concat(wn+1,". ").concat(qt)}).join(`
`)),Fe.focus();case"add-null-ch":return Lt===""&&Fe.setCursor(Gt.line,Gt.ch+1),Fe.replaceSelection(ue),Fe.focus();case"inster-template-1":return Lt===""&&Fe.setCursor(Gt.line,Gt.ch),Fe.replaceSelection(q),Fe.focus();case"eraser":return Fe.setValue(""),Fe.focus();case"trigger-watch":return Ht(!Nt),Fe.focus();case"trigger-full-screen":return mn(!yt),Fe.focus();case Le:Nn(Le);return;case Ye:Nn(Ye);return;case Pe:Nn(Pe);return;case tt:Nn(tt);return;default:throw new Error}},[Fe,Nt,yt]),Pr=Object(g.useCallback)(function(Ct){Nn("");switch(jt){case Le:var Gt=Ct.title,Lt=Ct.link;return Fe.replaceSelection("[".concat(Gt,"](").concat(Lt,")")),Fe.focus();case Ye:var Zt=Ct.language,qt=Ct.content;return Fe.replaceSelection(["```"+Zt,qt,"```"].join(`
`)),Fe.focus();case Pe:var wn=Ct.src,ln=Ct.alt;return ln?Fe.replaceSelection("![ ".concat(ln," ]( ").concat(wn,' "').concat(ln,'" )')):Fe.replaceSelection("![,](".concat(wn,")")),Fe.focus();case tt:for(var Fn=Ct.row,tr=Ct.col,Qt=Ct.align,br=`
`,En=0;En<Fn;En++){for(var $n=[],Jn=[],fr=0;fr<tr;fr++)En===1&&Jn.push(lt[Qt]),$n.push(" ");En===1&&(br+="| ".concat(Jn.join(" | "),` |
`)),br+="| ".concat($n.join(tr===1?"":" | "),` |
`)}return Fe.replaceSelection(br+`
`),Fe.focus();default:throw new Error}},[Fe,jt]),zr=Object(g.useMemo)(function(){switch(jt){case Le:return f.a.createElement(se,{callback:Pr,onCancel:kr});case Ye:return f.a.createElement(fe.b,{callback:Pr,onCancel:kr});case Pe:return f.a.createElement(ve,{callback:Pr,onCancel:kr});case tt:return f.a.createElement(He,{callback:Pr,onCancel:kr});default:return null}},[jt]);function kr(){Nn("")}Object(g.useEffect)(function(){if(Bt.current){var Ct=Bt.current,Gt=!1,Lt=0;function Zt(ln){Gt=!0,Lt=ln.pageY}function qt(){Gt=!1}function wn(ln){if(Gt){var Fn=ln.pageY-Lt;Fn<0&&(Fn=0),Fn>300&&(Fn=300);var tr=We+Fn+"px";An(tr)}}return Ct.addEventListener("mousedown",Zt),document.addEventListener("mousemove",wn),document.addEventListener("mouseup",qt),function(){Ct.removeEventListener("mousedown",Zt),document.removeEventListener("mousemove",wn),document.removeEventListener("mouseup",qt)}}},[Fe,Bt]),Object(g.useEffect)(function(){An(We)},[We]);var Ar=te(st),Kr=te(Yn),Hn={width:Ar,height:Kr},Rt=Object(g.useMemo)(function(){if(Sn){var Ct=new Date(Sn),Gt=Ct.getHours(),Lt=Ct.getMinutes(),Zt=Ct.getSeconds();return Gt=Gt<10?"0"+Gt:Gt,Lt=Lt<10?"0"+Lt:Lt,Zt=Zt<10?"0"+Zt:Zt,"".concat(Gt,":").concat(Lt,":").concat(Zt)}return 0},[Sn]);function Vr(){window.sessionStorage.removeItem(Je),_n(!1),Mn(0)}function yr(){_n(!1),Mn(0),Fe.setValue(window.sessionStorage.getItem(Je))}function ni(Ct,Gt){var Lt=Fe.getValue();Lt=Lt.replace(Ct,Gt),cn(Lt),Fe==null||Fe.setValue(Lt)}return f.a.createElement(g.Fragment,null,f.a.createElement("div",{className:"markdown-editor-wrapper",ref:sn},f.a.createElement("div",{className:"markdown-editor-container ".concat(rt," ").concat(Nt?"on-preview":""," ").concat(Ne?"mini":""," ").concat(yt?"full-screen":""),style:Hn},f.a.createElement(v,{insertTemp:je,watch:Nt,fullScreen:yt,showNullButton:an,onActionCallback:Zr,hidetoolBar:Wt,uuid:Jt.current,setOpenPhones:function(){wt.current=!0}}),f.a.createElement("div",{className:"markdown-editor-body"},f.a.createElement("div",{className:"codemirror-container"},f.a.createElement("textarea",{ref:xt,placeholder:vr})),Nt?f.a.createElement("div",{ref:ar,className:"preview-container"},ot==="stex"&&f.a.createElement(L,{value:yn}),ot!=="stex"&&f.a.createElement(x.a,{edit:!0,value:yn,replaces:ni})):null))),pt?f.a.createElement("a",{ref:Bt,className:"editor-resize"}):null,f.a.createElement(P.a,null,he[jt]?f.a.createElement(z.a,{centered:!0,title:he[jt],visible:!0,onCancel:kr,footer:null,className:"markdown-popup-form"},zr):null))}},PD8m:function(Ue,de){Ue.exports={name:"memoryStorage",read:J,write:z,each:D,remove:V,clearAll:N};var M={};function J(O){return M[O]}function z(O,K){M[O]=K}function D(O){for(var K in M)M.hasOwnProperty(K)&&O(M[K],K)}function V(O){delete M[O]}function N(O){M={}}},QUZ3:function(Ue,de,M){"use strict";M.r(de);var J=M("0Owb"),z=M("PpiC"),D=M("OaEy"),V=M("2fM7"),N=M("T2oS"),O=M("W9HT"),K=M("+L6B"),W=M("2/Rp"),n=M("9og8"),I=M("2qtc"),g=M("kLXV"),f=M("tJVT"),h=M("k1fw"),c=M("aHsQ"),s=M("sGsY"),d=M("WmNS"),i=M.n(d),a=M("q1tI"),r=M.n(a),o=M("Icgb"),T=M("Fvcw"),w=M("GIiI"),x=M("Ty5D"),L=M("55Ip"),A=M("OJz4"),_=M("V0Rq"),b=M("bntm"),m=M("cDPC"),p=M("m3rI"),C=M("RCxd"),E=M("EHPI"),v=M("S+dL"),P=M.n(v),F=M("J66h"),R=M("uMZB"),H=M.n(R),U=M("p/48"),S=M("JPnl"),G=M("y8nQ"),Q=M("Vl3Y"),se=M("5NDa"),fe=M("5rEg"),we=fe.a.TextArea,be=5e3,Se=function(ze){var Fe=ze.callback,Pt=ze.onCancel,Yt=ze.notes;function Tn(yn){Fe(yn)}return r.a.createElement(Q.a,{className:"note-form-panel",onFinish:Tn,initialValues:{notes:Yt}},r.a.createElement(Q.a.Item,{name:"notes",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9"},{max:be,message:"\u7B14\u8BB0\u6700\u5927\u5B57\u6570\u4E3A".concat(be)}]},r.a.createElement(we,{placeholder:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9",rows:5})),r.a.createElement(Q.a.Item,{style:{textAlign:"right"}},r.a.createElement(W.a,{type:"ghost",onClick:Pt,style:{marginRight:10}}," ","\u53D6\u6D88"," "),r.a.createElement(W.a,{type:"primary",htmlType:"submit"}," ","\u63D0\u4EA4"," ")))},Ae=M("bbsP"),De=M("/wGt"),ve=M("DjyN"),Y=M("NUBc"),k=M("H2Ag"),B=M.n(k),Z=M("miYZ"),re=M("tsqr"),X=M("g9YV"),ye=M("wCAj"),Me=M("+k/U"),He=M.n(Me),me=M("ye1Q"),Ee=M("lfch"),Le=M("JB8y"),Pe=M("p5ED"),Ye=M("ErOA"),tt=M("wd/R"),ut=M.n(tt),lt=ye.a.Column,gt=function(ze){var Fe,Pt=ze.submitResult,Yt=ze.submitting,Tn=ze.submitRecords,yn=ze.page,cn=ze.onPageChange,$t=ze.topicId,It=Pt||{},Nt=It.status,Ht=It.id,kt=It.input,on=It.output,yt=It.expected_output,mn=It.is_file,tn=It.input_file_url,kn=It.output_file_url,jt=It.expected_output_file_url,Nn=It.error_msg,jn=Tn||{},Ln=jn.records,Sn=jn.records_count,Mn=Object(a.useState)(""),ir=Object(f.a)(Mn,2),cr=ir[0],Yn=ir[1],An=Object(a.useState)(""),dr=Object(f.a)(An,2),gn=dr[0],bn=dr[1],_n=Object(x.h)(),Jt=(_n==null||((Fe=_n.query)===null||Fe===void 0)?void 0:Fe.type)==="1";function wt(){mn?navigator.clipboard.writeText(F.Base64.decode(Nn)).then(function(){re.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")}):navigator.clipboard.writeText(F.Base64.decode(on)).then(function(){re.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")})}return r.a.createElement(O.a,{spinning:Yt,tip:"\u8BC4\u6D4B\u4E2D...",indicator:r.a.createElement(me.a,{style:{fontSize:24},spin:!0})},Ht?r.a.createElement(r.a.Fragment,null,r.a.createElement("ul",{className:He.a.info},r.a.createElement("li",null,"\u6267\u884C\u7ED3\u679C\uFF1A",r.a.createElement("span",{className:Nt===Le.a.OK?"c-green":"c-red"},S.a[Nt])),r.a.createElement("li",{className:He.a.error},r.a.createElement("a",{onClick:wt},"\u590D\u5236\u9519\u8BEF\u4FE1\u606F ",r.a.createElement(Ee.a,null)," ")),r.a.createElement("li",null,r.a.createElement(L.a,{to:"/myproblems/".concat($t,"/record-detail/").concat(Ht)},"\u663E\u793A\u8BE6\u60C5 >"," "))),Nt!==Le.a.OK?r.a.createElement(r.a.Fragment,null,r.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),r.a.createElement("pre",null,!mn&&kt,mn&&r.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(n.a)(i.a.mark(function Kt(){var xt;return i.a.wrap(function(Bt){for(;;)switch(Bt.prev=Bt.next){case 0:return Bt.next=2,fetch(tn,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 2:return xt=Bt.sent,Bt.t0=bn,Bt.next=6,xt.text();case 6:Bt.t1=Bt.sent,(0,Bt.t0)(Bt.t1),setTimeout(function(){Yn(tn)},200);case 9:case"end":return Bt.stop()}},Kt)}))},kt)),r.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),r.a.createElement("pre",null,(Nt===4||Nt===5)&&F.Base64.decode(Nn),Nt!=4&&Nt!=5&&(mn?r.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(n.a)(i.a.mark(function Kt(){var xt;return i.a.wrap(function(Bt){for(;;)switch(Bt.prev=Bt.next){case 0:return Bt.next=2,Object(Ye.a)(kn,{method:"Get",headers:{"Content-Type":"application/xml",Accept:"*/*"}});case 2:xt=Bt.sent;try{bn(xt)}catch(ar){bn("")}setTimeout(function(){Yn(kn)},200);case 5:case"end":return Bt.stop()}},Kt)}))},on):F.Base64.decode(on))),r.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),r.a.createElement("pre",null,!mn&&F.Base64.decode(yt),mn&&r.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(n.a)(i.a.mark(function Kt(){var xt;return i.a.wrap(function(Bt){for(;;)switch(Bt.prev=Bt.next){case 0:return Bt.next=2,fetch(jt,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 2:return xt=Bt.sent,Bt.t0=bn,Bt.next=6,xt.text();case 6:Bt.t1=Bt.sent,(0,Bt.t0)(Bt.t1),setTimeout(function(){Yn(jt)},200);case 9:case"end":return Bt.stop()}},Kt)}))},yt))):null):null,(Ln==null?void 0:Ln.length)>0?r.a.createElement(ye.a,{dataSource:Ln,rowKey:"id",pagination:!1},r.a.createElement(lt,{title:"\u63D0\u4EA4\u65F6\u95F4",dataIndex:"created_at",key:"created_at",render:function(xt,sn){return r.a.createElement("span",null," ",ut()(xt).format("YYYY-MM-DD HH:mm:ss"))}}),r.a.createElement(lt,{title:"\u63D0\u4EA4\u7ED3\u679C",dataIndex:"status",key:"status",render:function(xt,sn){var Bt;return r.a.createElement(L.a,{className:xt===0?"c-green":"c-red",to:"/myproblems/".concat($t,"/record-detail/").concat(sn.id)},(Bt=S.a[xt])===null||Bt===void 0?void 0:Bt.replace("\u8C03\u8BD5","\u8BC4\u6D4B"))}}),r.a.createElement(lt,{title:"\u6267\u884C\u7528\u65F6 (".concat(Jt?"MS":"S",")"),dataIndex:"execute_time",key:"execute_time",render:function(xt){return xt?Jt?xt:xt/1e3:""}}),r.a.createElement(lt,{title:"\u5185\u5B58\u6D88\u8017\uFF08".concat(Jt?"KB":"MB","\uFF09"),dataIndex:"execute_memory",key:"execute_memory",render:function(xt){return xt?Jt?xt:parseFloat((xt/1024).toFixed(2)):""}}),r.a.createElement(lt,{title:"\u8BED\u8A00",dataIndex:"language",key:"language"}),r.a.createElement(lt,{title:"\u64CD\u4F5C",dataIndex:"status",key:"status",render:function(xt,sn){return r.a.createElement(L.a,{className:"c-light-primary",to:"/myproblems/".concat($t,"/record-detail/").concat(sn.id)},"\u67E5\u770B")}})):r.a.createElement("div",{style:{height:300,width:"100%"}}),Sn>15?r.a.createElement(Y.a,{className:He.a.pagination,current:yn,pageSize:15,total:Sn,onChange:cn}):null,r.a.createElement(Pe.a,{close:!0,data:cr,type:cr.length?"txt":"",onClose:function(){return Yn("")},monacoEditor:{value:gn,language:"txt",onChange:function(){},options:{fontSize:14,readOnly:!0,minimap:{enabled:!1}}}}))},ht=M("BdwD"),Ie=M("DYRE"),Re=M("zeV3"),$e=M("+BJd"),Ze=M("mr32"),ue=M("pPuO"),q=M.n(ue),te=M("9Bee"),ae={1:{name:"\u7B80\u5355",color:"#52c41a"},2:{name:"\u4E2D\u7B49",color:"#faad14"},3:{name:"\u56F0\u96BE",color:"#f5222d"}},ce=function(ze){var Fe=ze.hack,Pt=ze.onTriggerPraise,Yt=ze.toDiscuss,Tn=Fe.language,yn=Fe.difficult,cn=Fe.time_limit,$t=Fe.username,It=Fe.user_path,Nt=Fe.user_praise,Ht=Fe.comments_count,kt=Fe.praises_count,on=Fe.description,yt=Fe.pass_count,mn=Fe.submit_count,tn=Object(x.h)(),kn=ae[yn];return r.a.createElement(r.a.Fragment,null,r.a.createElement("ul",{className:q.a.info},r.a.createElement("li",null,"\u7F16\u7A0B\u8BED\uFF1A",r.a.createElement("b",null,Tn)),r.a.createElement("li",null,"\u96BE\u5EA6\uFF1A",r.a.createElement(Ze.a,{color:kn.color},kn.name)),r.a.createElement("li",null,"\u8BC4\u6D4B\u65F6\u957F\u9650\u5236\uFF1A",r.a.createElement("b",null,cn,"\u79D2"))),r.a.createElement(te.a,{value:on,className:q.a.desc}),r.a.createElement("ul",{className:q.a["commit-info"]},r.a.createElement("li",null,r.a.createElement(Re.a,{size:4},r.a.createElement("span",null,"\u901A\u8FC7\u6B21\u6570")," ",r.a.createElement("b",null,yt))),r.a.createElement("li",null,r.a.createElement(Re.a,{size:4},r.a.createElement("span",null,"\u63D0\u4EA4\u6B21\u6570")," ",r.a.createElement("b",null,mn))," "),r.a.createElement("li",{style:{flex:"1 0 0"}}),tn.query.type!=="exercises"&&r.a.createElement("li",null,r.a.createElement(Re.a,{size:4},r.a.createElement("i",{className:"iconfont icon-huifu1",onClick:Yt})," ",r.a.createElement("b",null,Ht))," ")))},ie=M("dhSg"),oe=M("oBTY"),he=M("M8RZ"),ge=M("qJ4+");function _e(ze,Fe){return Object(Ye.c)("/problems/".concat(ze,"/comments.json?page=").concat(Fe,"&limit=10"))}function Oe(ze){return Object(Ye.f)("/discusses/".concat(ze,"/plus.json"),{container_type:"Discuss",type:1})}function Ge(ze,Fe,Pt){return Object(Ye.f)("/problems/".concat(ze,"/comments/reply.json"),{comments:{content:Pt,parent_id:Fe}})}function et(ze,Fe){return Object(Ye.f)("/problems/".concat(ze,"/comments.json"),{comments:{content:Fe}})}function ct(ze,Fe,Pt){return Object(Ye.f)("/problems/".concat(ze,"/comments/").concat(Fe,"/hidden.json"),Pt)}function st(ze,Fe){return Object(Ye.b)("/problems/".concat(ze,"/comments/").concat(Fe))}var nt=M("U7T7"),We=M("AMnG");function Ve(ze){var Fe=ze.author;return r.a.createElement("a",{href:"/users/".concat(Fe.login),target:"_blank"},r.a.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",height:"50",style:{borderRadius:"50%"},src:"".concat(p.a.IMG_SERVER,"/images/").concat(Fe.image_url),width:"50"}))}function Ne(ze){var Fe=ze.data,Pt=ze.index,Yt=ze.parentDiscussIndex,Tn=ze.user,yn=ze.onSetActionType,cn=Fe.author,$t=Fe.can_delete,It=Fe.content,Nt=Fe.id,Ht=Fe.time;function kt(){yn({id:Nt,index:Pt,type:"delete-discuss",parentDiscussIndex:Yt,message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}var on=Tn.admin||$t||cn.user_id===Tn.user_id;return r.a.createElement("div",{className:"discuss-item-container second-discuss "},r.a.createElement(Ve,{author:cn}),r.a.createElement("section",null,r.a.createElement("div",{className:"discuss-info"},r.a.createElement("a",{href:"/users/".concat(cn.login),target:"_blank"},cn.name),r.a.createElement("span",{className:"grey"},Ht),r.a.createElement("div",{className:"btn-group",style:{marginBottom:0}},on?r.a.createElement("a",{onClick:kt,title:"\u5220\u9664"},r.a.createElement("i",{className:"iconfont icon-shanchu"})):null)),r.a.createElement(te.a,{className:"discuss-content",value:It})))}var pe=function(ze){var Fe=ze.user,Pt=ze.data,Yt=ze.index,Tn=ze.onPlusDiscuss,yn=ze.onSetActionType,cn=ze.activeDiscussIndex,$t=ze.onReplyDiscuss,It=ze.onSetActiveDiscussIndex,Nt=Pt.content,Ht=Pt.children,kt=Pt.hidden,on=Pt.id,yt=Pt.praise_count,mn=Pt.time,tn=Pt.user_praise,kn=Pt.can_delete,jt=Pt.author;function Nn(){It(on)}function jn(){Tn(on,!tn,Yt)}function Ln(){yn({id:on,index:Yt,type:"delete-discuss",message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}function Sn(){yn({id:on,index:Yt,params:{hidden:kt?"0":"1"},type:"hidden-discuss",message:kt?"\u786E\u5B9A\u8981\u53D6\u6D88\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417":"\u786E\u5B9A\u8981\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417"})}var Mn=Fe.admin||Fe.user_id===jt.user_id;return r.a.createElement("div",{className:"discuss-item-container",key:on},r.a.createElement(Ve,{author:jt}),r.a.createElement("section",null,r.a.createElement("div",{className:"discuss-info"},r.a.createElement("a",{href:"/users/".concat(jt.login),target:"_blank"}," ",jt.name," "),r.a.createElement("span",{className:"grey"},mn)),r.a.createElement(te.a,{className:"discuss-content",value:Nt}),Ht&&Ht.length>0?r.a.createElement("div",{className:"reply-discuss-container"},Ht.map(function(ir,cr){return r.a.createElement(Ne,{key:ir.id,data:ir,index:cr,user:Fe,onSetActionType:yn,parentDiscussIndex:Yt})})):null,r.a.createElement("div",{className:"btn-group"},Mn?r.a.createElement("a",{onClick:Sn,title:kt?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF\u8BC4\u8BBA"},r.a.createElement("i",{className:kt?"iconfont icon-yincangbiyan":"fa fa-eye"})):null,kn&&(!Ht||Ht.length==0)?r.a.createElement("a",{onClick:Ln,title:"\u5220\u9664"},r.a.createElement("i",{className:"iconfont icon-shanchu"})):null,r.a.createElement("a",{onClick:Nn,title:"\u56DE\u590D"}," ",r.a.createElement("i",{className:"iconfont icon-huifu1"})," "),r.a.createElement("a",{onClick:jn,className:tn?"c-orange":""},r.a.createElement("i",{className:tn?"iconfont icon-dianzan mr3":"iconfont icon-dianzan-xian mr3 "}),r.a.createElement("span",null,yt||""))),r.a.createElement(We.a,{id:on,activeDiscussIndex:cn,onReplyDiscuss:$t})))},xe=M("kaH+"),Xe=M("uD2n"),je=M.n(Xe),it=M("Ot1p"),ot=function(ze){var Fe=ze.user_praise,Pt=ze.praise_count,Yt=ze.praisePlus,Tn=ze.onCreateDiscuss,yn=ze.discuss_count,cn=Object(a.useState)(!1),$t=Object(f.a)(cn,2),It=$t[0],Nt=$t[1],Ht=Object(a.useState)(""),kt=Object(f.a)(Ht,2),on=kt[0],yt=kt[1];function mn(jn){yt(jn)}function tn(){Nt(!0)}function kn(){Nt(!1)}function jt(){return Nn.apply(this,arguments)}function Nn(){return Nn=Object(n.a)(i.a.mark(function jn(){return i.a.wrap(function(Sn){for(;;)switch(Sn.prev=Sn.next){case 0:Tn(on),yt(""),Nt(!1);case 3:case"end":return Sn.stop()}},jn)})),Nn.apply(this,arguments)}return r.a.createElement("div",{className:"".concat(je.a["dis-input-editor-container"]," ").concat(It?je.a.active:""," "),style:{paddingLeft:"100px"}},r.a.createElement("div",{className:It?"hide ".concat(je.a["text-area"]):je.a["text-area"]},r.a.createElement("input",{placeholder:"\u8BF4\u70B9\u4EC0\u4E48",onClick:tn}),r.a.createElement("a",null," ",r.a.createElement("i",{className:"iconfont icon-huifu1"})," \xA0 \xA0",yn," "),r.a.createElement("a",{className:"c-light-black",onClick:Yt,title:Fe?"\u53D6\u6D88\u70B9\u8D5E":"\u70B9\u8D5E"},r.a.createElement("i",{className:"mr3 ".concat(Fe?"iconfont icon-dianzan c-orange":"iconfont icon-dianzan-xian"," ")}),Pt?r.a.createElement("span",null,Pt):"")),It?r.a.createElement("div",{className:je.a["input-mask"],onClick:kn}):null,r.a.createElement("div",{className:It?je.a["md-container"]:"".concat(je.a["md-container"]," hide")},r.a.createElement(it.a,{id:"discuss-input-editor",miniToolbar:!0,watch:!1,noStorage:!0,defaultValue:on,height:240,onChange:mn}),r.a.createElement("div",{className:je.a["tip-container"],onClick:kn},r.a.createElement("a",{className:je.a["btn-send"],onClick:jt}," ","\u53D1\u9001"," "))))},Ke={loading:!1,page:1,data:[],count:0,actionType:null,activeDiscussIndex:null},Je;(function(ze){ze[ze.GET_DISCUSSES=0]="GET_DISCUSSES",ze[ze.TOP_OR_DOWN_DISCUSS=1]="TOP_OR_DOWN_DISCUSS",ze[ze.ACTIVE_DISCUSS_INDEX=2]="ACTIVE_DISCUSS_INDEX",ze[ze.PLUS_DISCUSS=3]="PLUS_DISCUSS",ze[ze.SET_ACTION_TYPE=4]="SET_ACTION_TYPE",ze[ze.SET_PAGE=5]="SET_PAGE",ze[ze.SHOW_DISCUSSES_LOADING=6]="SHOW_DISCUSSES_LOADING"})(Je||(Je={}));function Qe(ze,Fe){switch(Fe.type){case Je.SHOW_DISCUSSES_LOADING:return Object(h.a)(Object(h.a)({},ze),{},{loading:!0});case Je.GET_DISCUSSES:return Object(h.a)(Object(h.a)({},ze),Fe.payload);case Je.TOP_OR_DOWN_DISCUSS:return Object(h.a)(Object(h.a)({},ze),Fe.payload);case Je.SET_ACTION_TYPE:return Object(h.a)(Object(h.a)({},ze),Fe.payload);case Je.PLUS_DISCUSS:return Object(h.a)(Object(h.a)({},ze),Fe.payload);case Je.SET_PAGE:return Object(h.a)(Object(h.a)({},ze),{},{page:Fe.payload});case Je.ACTIVE_DISCUSS_INDEX:return Object(h.a)(Object(h.a)({},ze),Fe.payload);default:throw new Error}}var pt=function(ze){var Fe=ze.user,Pt=ze.identifier,Yt=ze.hack,Tn=ze.onTriggerPraise,yn=Object(a.useReducer)(Qe,Ke),cn=Object(f.a)(yn,2),$t=cn[0],It=cn[1],Nt=$t.loading,Ht=$t.page,kt=$t.data,on=$t.count,yt=$t.actionType,mn=$t.activeDiscussIndex,tn=Object(a.useCallback)(Object(n.a)(i.a.mark(function gn(){var bn,_n,Jt;return i.a.wrap(function(Kt){for(;;)switch(Kt.prev=Kt.next){case 0:return It({type:Je.SHOW_DISCUSSES_LOADING}),Kt.next=3,_e(Pt,Ht);case 3:bn=Kt.sent,_n=bn.comments,Jt=bn.disscuss_count,It({type:Je.GET_DISCUSSES,payload:{data:_n,count:Jt,loading:!1}});case 6:case"end":return Kt.stop()}},gn)})),[Ht,Pt]);Object(a.useEffect)(function(){tn()},[Pt,Ht]);function kn(gn){It({type:Je.SET_PAGE,page:gn})}function jt(gn){It({type:Je.SET_ACTION_TYPE,payload:{actionType:gn}})}function Nn(gn){mn===gn?It({type:Je.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:null}}):It({type:Je.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:gn}})}function jn(gn,bn,_n){return Ln.apply(this,arguments)}function Ln(){return Ln=Object(n.a)(i.a.mark(function gn(bn,_n,Jt){var wt;return i.a.wrap(function(xt){for(;;)switch(xt.prev=xt.next){case 0:return xt.prev=0,xt.next=3,Oe(bn);case 3:wt=xt.sent,kt[Jt].user_praise=_n,kt[Jt].praise_count=wt.praise_count,It({type:Je.PLUS_DISCUSS,payload:{data:Object(oe.a)(kt)}}),xt.next=12;break;case 9:xt.prev=9,xt.t0=xt.catch(0),console.log(xt.t0);case 12:case"end":return xt.stop()}},gn,null,[[0,9]])})),Ln.apply(this,arguments)}function Sn(){return Mn.apply(this,arguments)}function Mn(){return Mn=Object(n.a)(i.a.mark(function gn(){var bn,_n,Jt,wt,Kt,xt,sn,Bt;return i.a.wrap(function(Un){for(;;)switch(Un.prev=Un.next){case 0:if(bn=yt.id,_n=yt.params,Jt=yt.type,wt=yt.index,Kt=yt.parentDiscussIndex,!(Jt==="hidden-discuss")){Un.next=6;break}return Un.next=4,ct(Pt,bn,_n);case 4:Kt?kt[Kt].children[wt].hidden=_n.hidden==1:kt[wt].hidden=_n.hidden==1,It({type:Je.SET_ACTION_TYPE,payload:{actionType:null,data:Object(oe.a)(kt)}});case 6:if(!(Jt==="delete-discuss")){Un.next=31;break}return Un.next=9,st(Pt,bn);case 9:if(!(Kt||Kt===0)){Un.next=22;break}xt=kt[Kt].children,sn=xt.length-1;case 12:if(!(sn>=0)){Un.next=19;break}if(!(xt[sn].id===bn)){Un.next=16;break}return xt.splice(sn,1),Un.abrupt("break",19);case 16:sn--,Un.next=12;break;case 19:kt[Kt].children=xt,Un.next=30;break;case 22:Bt=kt.length-1;case 23:if(!(Bt>=0)){Un.next=30;break}if(!(kt[Bt].id===bn)){Un.next=27;break}return kt.splice(Bt,1),Un.abrupt("break",30);case 27:Bt--,Un.next=23;break;case 30:It({type:Je.SET_ACTION_TYPE,payload:{actionType:null,data:Object(oe.a)(kt)}});case 31:case"end":return Un.stop()}},gn)})),Mn.apply(this,arguments)}function ir(){It({type:Je.SET_ACTION_TYPE,payload:{actionType:null}})}function cr(gn,bn){return Yn.apply(this,arguments)}function Yn(){return Yn=Object(n.a)(i.a.mark(function gn(bn,_n){return i.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.prev=0,wt.next=3,Ge(Pt,bn,_n);case 3:tn(),wt.next=9;break;case 6:wt.prev=6,wt.t0=wt.catch(0),console.log(wt.t0);case 9:case"end":return wt.stop()}},gn,null,[[0,6]])})),Yn.apply(this,arguments)}function An(gn){return dr.apply(this,arguments)}function dr(){return dr=Object(n.a)(i.a.mark(function gn(bn){return i.a.wrap(function(Jt){for(;;)switch(Jt.prev=Jt.next){case 0:return It({type:Je.SHOW_DISCUSSES_LOADING}),Jt.next=3,et(Pt,bn);case 3:tn();case 4:case"end":return Jt.stop()}},gn)})),dr.apply(this,arguments)}return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{className:"discuss-panel"},kt.length===0?r.a.createElement(ht.a,null):kt.map(function(gn,bn){return r.a.createElement(pe,{onReplyDiscuss:cr,onPlusDiscuss:jn,onSetActiveDiscussIndex:Nn,onSetActionType:jt,data:gn,index:bn,user:Fe,activeDiscussIndex:mn})}),on>10?r.a.createElement("div",{className:"pagination-container"},r.a.createElement(Y.a,{showQuickJumper:!0,onChange:kn,current:Ht,total:on})):null),r.a.createElement(ot,{user_praise:Yt.user_praise,praise_count:Yt.praises_count,praisePlus:Tn,discuss_count:Yt.comments_count,onCreateDiscuss:An}),r.a.createElement(he.a,null,r.a.createElement(g.a,{centered:!0,title:"\u63D0\u793A",visible:!!yt,onOk:Sn,onCancel:ir},r.a.createElement("p",null,yt?yt.message:"")),r.a.createElement(xe.a,null)))},dt=M("9kvl"),Vt={1:"\u7B80\u5355",2:"\u9002\u4E2D",3:"\u56F0\u96BE"},rn={1:"#2fa34f",2:"#0152d9",3:"#fa6400"},an=function(ze){var Fe,Pt=ze.hack,Yt=ze.onTriggerPraise,Tn=ze.topicId,yn=ze.page,cn=ze.onPageChange,$t=ze.user,It=ze.submitRecords,Nt=ze.submitting,Ht=ze.submitResult,kt=Object(a.useState)("0"),on=Object(f.a)(kt,2),yt=on[0],mn=on[1],tn=Object(x.h)(),kn=Object(a.useState)(!1),jt=Object(f.a)(kn,2),Nn=jt[0],jn=jt[1],Ln=Object(a.useState)([]),Sn=Object(f.a)(Ln,2),Mn=Sn[0],ir=Sn[1],cr=Object(a.useState)(Object(h.a)(Object(h.a)({},Object(x.i)()),{},{page:1,per_page:20,name:""})),Yn=Object(f.a)(cr,2),An=Yn[0],dr=Yn[1];function gn(wt){var Kt=wt.target.id;mn(Kt)}Object(a.useEffect)(function(){var wt=ie.a.subscribe("to-commit-info",function(){mn("1")});return wt},[]);function bn(){mn("2")}function _n(){return Jt.apply(this,arguments)}function Jt(){return Jt=Object(n.a)(i.a.mark(function wt(){var Kt;return i.a.wrap(function(sn){for(;;)switch(sn.prev=sn.next){case 0:return sn.next=2,Object(Ye.a)("/api/problems/my_hack_list.json",{method:"get",params:Object(h.a)({identifier:An==null?void 0:An.id},An)});case 2:Kt=sn.sent,ir(Kt);case 4:case"end":return sn.stop()}},wt)})),Jt.apply(this,arguments)}return console.log(It,"submitRecords"),r.a.createElement("div",{className:B.a["left-panel"]},r.a.createElement("ul",{className:"".concat(B.a["s-navs"]," ").concat(B.a["bg-white"]," ").concat(B.a.b1)},r.a.createElement("li",null,r.a.createElement("a",{className:yt==="0"?B.a.active:"",id:"0",onClick:gn},"\u4EFB\u52A1\u63CF\u8FF0")),r.a.createElement("li",null,r.a.createElement("a",{className:yt==="1"?B.a.active:"",id:"1",onClick:gn},"\u63D0\u4EA4\u8BB0\u5F55")),tn.query.type!=="exercises"&&r.a.createElement("li",null,r.a.createElement("a",{className:yt==="2"?B.a.active:"",id:"2",onClick:gn},"\u8BC4\u8BBA"))),r.a.createElement("div",{className:"".concat(B.a["tab-panel-body"]," ").concat(yt==="0"?"":"hide")},r.a.createElement(ce,{hack:Pt,onTriggerPraise:Yt,toDiscuss:bn})),r.a.createElement("div",{style:{padding:"0 12px"},className:"".concat(B.a["tab-panel-body"]," ").concat(yt==="1"?"":"hide")},!!(It!=null&&It.records_count)||Nt?r.a.createElement(gt,{page:yn,onPageChange:cn,topicId:Tn,submitting:Nt,submitRecords:It,submitResult:Ht}):r.a.createElement(ht.a,null)),r.a.createElement("div",{className:"".concat(B.a["tab-panel-body"]," ").concat(yt==="2"?"":"hide"),style:{padding:0}},r.a.createElement(pt,{user:$t,identifier:Pt.identifier,hack:Pt,onTriggerPraise:Yt})),r.a.createElement(De.a,{className:B.a.drawer,headerStyle:{background:"#000",border:0},closable:!1,title:r.a.createElement("div",{style:{display:"flex",alignItems:"center"}},r.a.createElement("span",{style:{color:"#fff"}},"\u9898\u76EE\u5217\u8868"),r.a.createElement(fe.a.Search,{onSearch:function(Kt){An.name=Kt,An.page=1,dr(Object(h.a)({},An)),_n()},style:{width:180,margin:"0px 20px",marginLeft:"auto"},placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE\u540D\u79F0\u641C\u7D22"}),r.a.createElement(V.a,{style:{width:100},placeholder:"\u8BF7\u9009\u62E9\u96BE\u5EA6",onChange:function(Kt){An.page=1,An.difficult=Kt||null,dr(Object(h.a)({},An)),_n()}},r.a.createElement(V.a.Option,{value:0},"\u5168\u90E8"),r.a.createElement(V.a.Option,{value:1},"\u7B80\u5355"),r.a.createElement(V.a.Option,{value:2},"\u9002\u4E2D"),r.a.createElement(V.a.Option,{value:3},"\u56F0\u96BE"))),bodyStyle:{background:"#0f1e31",padding:"20px 0px"},footerStyle:{background:"#0f1e31",border:0,textAlign:"center"},footer:r.a.createElement("div",null,r.a.createElement(Y.a,{current:An.page,className:"mt10 mb10",hideOnSinglePage:!0,total:Mn==null?void 0:Mn.count,pageSize:An.per_page,onChange:function(Kt,xt){An.page=Kt,An.per_page=xt,_n()}})),width:530,placement:"left",onClose:function(){return jn(!1)},visible:Nn},Mn==null||((Fe=Mn.data)===null||Fe===void 0)?void 0:Fe.map(function(wt,Kt){return r.a.createElement("div",{onClick:Object(n.a)(i.a.mark(function xt(){var sn;return i.a.wrap(function(ar){for(;;)switch(ar.prev=ar.next){case 0:return ar.next=2,Object(Ye.a)("/api/problems/".concat(wt==null?void 0:wt.identifier,"/start.json"),{method:"get",params:{hack_user_id:$t==null?void 0:$t.user_id}});case 2:sn=ar.sent,sn&&(dt.d.replace("/myproblems/".concat(sn==null?void 0:sn.identifier,"?type=1")),window.location.reload());case 4:case"end":return ar.stop()}},xt)})),className:"".concat(B.a.list," ").concat(wt!=null&&wt.checked?B.a.active:"")},r.a.createElement("div",null,(wt==null?void 0:wt.opened)&&(wt==null?void 0:wt.passed)&&r.a.createElement("i",{className:"iconfont icon-wancheng1 c-green-29b"}),(wt==null?void 0:wt.opened)&&!(wt!=null&&wt.passed)&&r.a.createElement("i",{className:"iconfont icon-cuowu c-red"}),r.a.createElement("span",{style:{color:"rgb(186, 196, 205)",fontWeight:400,fontSize:14,marginLeft:10}},wt.name)),r.a.createElement("span",{style:{color:rn[wt.difficult]}},Vt[wt.difficult]))})),(Pt==null?void 0:Pt.is_program)&&r.a.createElement("div",{onClick:function(){_n(),jn(!0)},className:B.a.btns},r.a.createElement("i",{className:"iconfont icon-timuliebiao"}),r.a.createElement("span",null,"\u9898\u76EE\u5217\u8868")))},ft=M("oFv4"),Wt=M.n(ft),Xt=M("+aKw"),Ot=M("S/kP"),Mt=M.n(Ot),Ft=M("t/PP"),On=M.n(Ft),vn=s.a.Countdown,rt={Java:"java",C:"c",Python:"py","C++":"c"},vt;(function(ze){ze[ze.SET_LOADING=0]="SET_LOADING",ze[ze.GET_DATA=1]="GET_DATA",ze[ze.GET_SUBMIT_RECORDS=2]="GET_SUBMIT_RECORDS",ze[ze.SET_DATA=3]="SET_DATA",ze[ze.SET_DEBUGING=4]="SET_DEBUGING",ze[ze.SET_SUBMITING=5]="SET_SUBMITING",ze[ze.SET_EXECUTE_MESSAGE=6]="SET_EXECUTE_MESSAGE",ze[ze.SET_EXECUTE_RESULT=7]="SET_EXECUTE_RESULT",ze[ze.SET_SUBMIT_RESULT=8]="SET_SUBMIT_RESULT",ze[ze.SET_SHOW_NOTE=9]="SET_SHOW_NOTE",ze[ze.SET_PAGE=10]="SET_PAGE"})(vt||(vt={}));function zn(){return new Date().getTime()}var Tr={loading:!0,data:void 0,showNote:!1,debugResult:void 0,submitResult:void 0,debuging:!1,submitting:!1,submitRecords:void 0,submitRecordPage:1,executingMessage:""};function vr(ze,Fe){switch(Fe.type){case vt.GET_DATA:return Object(h.a)(Object(h.a)({},ze),Fe.payload);case vt.SET_DATA:return Object(h.a)(Object(h.a)({},ze),{},{data:Fe.payload});case vt.SET_LOADING:return Object(h.a)(Object(h.a)({},ze),{},{loading:Fe.payload});case vt.SET_SHOW_NOTE:return Object(h.a)(Object(h.a)({},ze),{},{showNote:Fe.payload});case vt.SET_DEBUGING:return Object(h.a)(Object(h.a)({},ze),{},{debuging:Fe.payload});case vt.SET_SUBMITING:return Object(h.a)(Object(h.a)({},ze),{},{submitting:Fe.payload});case vt.GET_SUBMIT_RECORDS:return Object(h.a)(Object(h.a)({},ze),{},{submitRecords:Fe.payload});case vt.SET_PAGE:return Object(h.a)(Object(h.a)({},ze),{},{submitRecordPage:Fe.payload});case vt.SET_EXECUTE_MESSAGE:return Object(h.a)(Object(h.a)({},ze),{},{executingMessage:Fe.payload});case vt.SET_EXECUTE_RESULT:return Object(h.a)(Object(h.a)({},ze),Fe.payload);case vt.SET_SUBMIT_RESULT:return Object(h.a)(Object(h.a)({},ze),Fe.payload);default:throw new Error}}var Fr=de.default=function(ze){var Fe,Pt,Yt,Tn,yn=ze.children,cn=Object(a.useReducer)(vr,Tr),$t=Object(f.a)(cn,2),It=$t[0],Nt=$t[1],Ht=Object(x.i)(),kt=Ht.id,on=Object(x.g)(),yt=Object(x.h)(),mn=It.loading,tn=It.data,kn=It.debugResult,jt=It.submitResult,Nn=It.submitRecords,jn=It.submitRecordPage,Ln=It.showNote,Sn=It.debuging,Mn=It.submitting,ir=It.executingMessage,cr=Object(a.useState)("#FFF"),Yn=Object(f.a)(cr,2),An=Yn[0],dr=Yn[1],gn=Object(a.useState)(null),bn=Object(f.a)(gn,2),_n=bn[0],Jt=bn[1],wt=Object(a.useState)({}),Kt=Object(f.a)(wt,2),xt=Kt[0],sn=Kt[1],Bt=Object(a.useState)(!0),ar=Object(f.a)(Bt,2),Un=ar[0],hr=ar[1],Zr=Object(a.useState)(!1),Pr=Object(f.a)(Zr,2),zr=Pr[0],kr=Pr[1],Ar=Object(a.useRef)(null),Kr=Object(a.useRef)(0),Hn=tn==null?void 0:tn.user,Rt=tn==null?void 0:tn.hack,Vr=Object(a.useRef)(),yr=Object(a.useRef)();Object(a.useEffect)(function(){var nn;if(clearTimeout(Vr.current),clearTimeout(yr.current),xt!=null&&(nn=xt.exercise)!==null&&nn!==void 0&&nn.left_time){var At,en;if((xt==null||((At=xt.exercise)===null||At===void 0)?void 0:At.left_time)>1800){var Et;yr.current=setTimeout(function(){g.a.info({content:"\u5F53\u524D\u8DDD\u79BB\u8003\u8BD5\u7ED3\u675F\u8FD8\u670930\u5206\u949F",icon:r.a.createElement(o.a,null),okText:"\u77E5\u9053\u4E86"})},((xt==null||((Et=xt.exercise)===null||Et===void 0)?void 0:Et.left_time)-1800)*1e3)}if((xt==null||((en=xt.exercise)===null||en===void 0)?void 0:en.left_time)>900){var hn;Vr.current=setTimeout(function(){g.a.info({content:"\u5F53\u524D\u8DDD\u79BB\u8003\u8BD5\u7ED3\u675F\u8FD8\u670915\u5206\u949F",icon:r.a.createElement(o.a,null),okText:"\u77E5\u9053\u4E86"})},((xt==null||((hn=xt.exercise)===null||hn===void 0)?void 0:hn.left_time)-900)*1e3)}}},[xt]),Object(a.useEffect)(function(){function nn(){return At.apply(this,arguments)}function At(){return At=Object(n.a)(i.a.mark(function en(){var Et,hn,In,Zn,wr,Qn,pn,Dn,Xr,jr,Vn,mr;return i.a.wrap(function(nr){for(;;)switch(nr.prev=nr.next){case 0:return hr(!0),nr.next=3,Object(A.d)(kt);case 3:if(Et=nr.sent,setTimeout(function(){hr(!1)},800),Et.status===401)document.location.href="/user/login";else{try{Et.hack.code=F.Base64.decode(Et.hack.code)}catch(Gr){console.log(Gr)}Et.hack=Object(h.a)(Object(h.a)({},Et.hack),{},{is_program:(yt==null||((hn=yt.query)===null||hn===void 0)?void 0:hn.type)==="1"}),Nt({type:vt.GET_DATA,payload:{loading:!1,data:Et}})}if(!(yt.query.type==="exercises")){nr.next=18;break}if(!(yt.query.coursesId=="coursesId")){nr.next=13;break}return nr.next=10,Object(_.Z)({categoryId:yt.query.exercisesId,login:yt.query.login});case 10:Qn=nr.sent,nr.next=16;break;case 13:return nr.next=15,Object(_.z)({categoryId:yt.query.exercisesId,login:yt.query.login});case 15:Qn=nr.sent;case 16:sn(Object(h.a)({},Qn)),(In=Qn)!==null&&In!==void 0&&In.left_banner_id&&(Zn=Qn)!==null&&Zn!==void 0&&(wr=Zn.exercise)!==null&&wr!==void 0&&wr.left_time&&(Jt(Date.now()+((pn=Qn)===null||pn===void 0||((Dn=pn.exercise)===null||Dn===void 0)?void 0:Dn.left_time)*1e3),setTimeout(function(){dr("red")},(((Xr=Qn)===null||Xr===void 0||((jr=Xr.exercise)===null||jr===void 0)?void 0:jr.left_time)-300>0?((Vn=Qn)===null||Vn===void 0||((mr=Vn.exercise)===null||mr===void 0)?void 0:mr.left_time)-300:0)*1e3));case 18:case"end":return nr.stop()}},en)})),At.apply(this,arguments)}kt&&nn()},[kt]),Object(a.useEffect)(function(){return yt.query.type==="exercises"&&(window.addEventListener(Object(b.c)(),Ct),window.focus(),window.onblur=function(){Object(b.a)()&&Object(b.b)()}),function(){document.removeEventListener(Object(b.c)(),Ct)}},[kt]),Object(a.useEffect)(function(){kt&&Rt!==null&&Rt!==void 0&&Rt.language&&Gt()},[kt,jn,Rt==null?void 0:Rt.language]),Object(a.useEffect)(function(){return Rt!=null&&Rt.is_program&&(Kr.current=0,Ar.current=setInterval(function(){ni()},15e3)),function(){clearInterval(Ar.current)}},[Rt==null?void 0:Rt.is_program]);var ni=function(){var nn=Object(n.a)(i.a.mark(function At(){var en;return i.a.wrap(function(hn){for(;;)switch(hn.prev=hn.next){case 0:return hn.next=2,Object(Ye.a)("/api/myproblems/".concat(kt,"/save_long_time.json"),{method:"get",params:{answer_long_time:Kr.current}});case 2:en=hn.sent;case 3:case"end":return hn.stop()}},At)}));return function(){return nn.apply(this,arguments)}}(),Ct=function(){window.parent.postMessage("backExercise","*")};function Gt(){return Lt.apply(this,arguments)}function Lt(){return Lt=Object(n.a)(i.a.mark(function nn(){var At;return i.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:return Et.prev=0,Et.next=3,Object(A.f)(kt,{limit:15,page:jn,language:Rt==null?void 0:Rt.language});case 3:At=Et.sent,Nt({type:vt.GET_SUBMIT_RECORDS,payload:At}),Et.next=10;break;case 7:Et.prev=7,Et.t0=Et.catch(0),console.log(Et.t0);case 10:case"end":return Et.stop()}},nn,null,[[0,7]])})),Lt.apply(this,arguments)}function Zt(nn){Nt({type:vt.SET_PAGE,payload:nn})}function qt(){return wn.apply(this,arguments)}function wn(){return wn=Object(n.a)(i.a.mark(function nn(){var At;return i.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:return Et.next=2,Object(A.k)(kt,{code:F.Base64.encode(Rt.code),language:Rt==null?void 0:Rt.language});case 2:return At=Et.sent,Et.abrupt("return",At);case 4:case"end":return Et.stop()}},nn)})),wn.apply(this,arguments)}function ln(){return Fn.apply(this,arguments)}function Fn(){return Fn=Object(n.a)(i.a.mark(function nn(){var At,en,Et,hn,In,Zn,wr,Qn;return i.a.wrap(function(Dn){for(;;)switch(Dn.prev=Dn.next){case 0:if(!Mn){Dn.next=2;break}return Dn.abrupt("return");case 2:return Nt({type:vt.SET_SUBMITING,payload:!0}),Dn.prev=3,ie.a.publish("to-commit-info"),Dn.next=7,qt();case 7:if(At=Dn.sent,console.log(At,1),!(At.status===0)){Dn.next=23;break}return Qn=function(){return Qn=Object(n.a)(i.a.mark(function jr(){var Vn,mr,Sr,nr,Gr,wi,Br;return i.a.wrap(function(_r){for(;;)switch(_r.prev=_r.next){case 0:return _r.next=2,Object(A.c)(kt,"submit");case 2:if(Vn=_r.sent,mr=Vn.status,Sr=Vn.data,nr=zn(),Gr=nr-Zn>(In+3)*1e3,mr!==0&&!Gr&&setTimeout(wr,1e3),!Gr){_r.next=12;break}return g.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),Nt({type:vt.SET_SUBMITING,payload:!1}),_r.abrupt("return");case 12:if(!(mr===0)){_r.next=19;break}return Sr.status===2&&g.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),(Sr==null?void 0:Sr.status)===0&&(yt==null||((wi=yt.query)===null||wi===void 0)?void 0:wi.type)==="1"&&kr(!0),_r.next=17,Object(A.f)(kt,{limit:15,page:jn,language:Rt==null?void 0:Rt.language});case 17:Br=_r.sent,Nt({type:vt.SET_SUBMIT_RESULT,payload:Object(h.a)(Object(h.a)({},It),{},{submitResult:Sr,submitting:!1,submitRecords:Br})});case 19:case"end":return _r.stop()}},jr)})),Qn.apply(this,arguments)},wr=function(){return Qn.apply(this,arguments)},Et={},yt.query.type==="exercises"&&(Et.extras={exercise_id:yt.query.exercisesId,question_id:yt.query.questionId}),Dn.next=16,Object(A.h)(kt,Et);case 16:if(hn=Dn.sent,!(hn.status===-1&&yt!==null&&yt!==void 0&&(en=yt.query)!==null&&en!==void 0&&en.coursesId)){Dn.next=20;break}return window.parent.location.href="/classrooms/".concat(yt.query.coursesId,"/exercise/").concat(yt.query.exercisesId,"/detail"),Dn.abrupt("return");case 20:In=Rt.time_limit,Zn=zn(),wr();case 23:Dn.next=29;break;case 25:Dn.prev=25,Dn.t0=Dn.catch(3),console.log(Dn.t0),Nt({type:vt.SET_SUBMITING,payload:!1});case 29:case"end":return Dn.stop()}},nn,null,[[3,25]])})),Fn.apply(this,arguments)}function tr(){return Qt.apply(this,arguments)}function Qt(){return Qt=Object(n.a)(i.a.mark(function nn(){var At,en,Et,hn,In,Zn,wr;return i.a.wrap(function(pn){for(;;)switch(pn.prev=pn.next){case 0:return It.debuging=!0,Nt({type:vt.SET_DEBUGING,payload:!0}),pn.prev=2,pn.next=5,qt();case 5:if(At=pn.sent,!(At.status===0)){pn.next=22;break}return wr=function(){return wr=Object(n.a)(i.a.mark(function Xr(){var jr,Vn,mr,Sr,nr,Gr;return i.a.wrap(function(Br){for(;;)switch(Br.prev=Br.next){case 0:return Br.next=2,Object(A.c)(kt,"debug");case 2:if(jr=Br.sent,Vn=jr.status,mr=jr.message,Sr=jr.data,nr=zn(),Gr=nr-In>(en+3)*1e3,Vn!==0&&!Gr&&(Nt({type:vt.SET_EXECUTE_MESSAGE,payload:mr}),setTimeout(Zn,1e3)),!Gr){Br.next=13;break}return g.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),Nt({type:vt.SET_DEBUGING,payload:!1}),Br.abrupt("return");case 13:Vn===0&&(Nt({type:vt.SET_DEBUGING,payload:!1}),Sr.status===2&&g.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),Sr.status===2&&g.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),Nt({type:vt.SET_EXECUTE_RESULT,payload:Object(h.a)(Object(h.a)({},It),{},{debugResult:Sr,debuging:!1})}));case 14:case"end":return Br.stop()}},Xr)})),wr.apply(this,arguments)},Zn=function(){return wr.apply(this,arguments)},en=Rt.time_limit,Et={input:encodeURIComponent(tn.test_case.input)},yt.query.type==="exercises"&&(Et.exercise_id=yt.query.exercisesId),pn.next=14,Object(A.b)(kt,Et);case 14:if(hn=pn.sent,!(hn.status===-1&&yt.query.coursesId)){pn.next=18;break}return window.parent.location.href="/classrooms/".concat(yt.query.coursesId,"/exercise/").concat(yt.query.exercisesId,"/detail"),pn.abrupt("return");case 18:In=zn(),Zn(),pn.next=23;break;case 22:Nt({type:vt.SET_DEBUGING,payload:!1});case 23:pn.next=28;break;case 25:pn.prev=25,pn.t0=pn.catch(2),console.log(pn.t0);case 28:return pn.prev=28,pn.finish(28);case 30:case"end":return pn.stop()}},nn,null,[[2,25,28,30]])})),Qt.apply(this,arguments)}function br(nn){Nt({type:vt.SET_DATA,payload:Object(h.a)(Object(h.a)({},tn),{},{hack:Object(h.a)(Object(h.a)({},Rt),{},{code:nn})})})}var En=function(){var nn=Object(n.a)(i.a.mark(function At(en){var Et,hn;return i.a.wrap(function(Zn){for(;;)switch(Zn.prev=Zn.next){case 0:return Zn.next=2,Object(Ye.a)("/api/problems/".concat(Rt==null?void 0:Rt.identifier,"/start.json"),{method:"get",params:{language:en==="C++"||en==="c++"?encodeURIComponent(en):en,hack_user_id:Hn==null?void 0:Hn.user_id}});case 2:Et=Zn.sent,Et.status!==-1&&on.replace("/myproblems/".concat(Et==null?void 0:Et.identifier,"?type=").concat(yt==null||((hn=yt.query)===null||hn===void 0)?void 0:hn.type));case 4:case"end":return Zn.stop()}},At)}));return function(en){return nn.apply(this,arguments)}}();function $n(nn){var At=nn.target.value;Nt({type:vt.SET_DATA,payload:Object(h.a)(Object(h.a)({},tn),{},{test_case:{input:At}})})}function Jn(){return fr.apply(this,arguments)}function fr(){return fr=Object(n.a)(i.a.mark(function nn(){var At;return i.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:return Et.prev=0,Et.next=3,Object(A.g)(kt);case 3:At=Et.sent,At.status===401?on.replace("/login",{from:yt.pathname}):br(F.Base64.decode(At.code)),Et.next=10;break;case 7:Et.prev=7,Et.t0=Et.catch(0),console.log(Et.t0);case 10:case"end":return Et.stop()}},nn,null,[[0,7]])})),fr.apply(this,arguments)}function Wi(){g.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:r.a.createElement("p",null,"\u521D\u59CB\u4EE3\u7801\u6709\u4FEE\u6539\uFF0C\u66F4\u65B0\u540E\u5C06\u8986\u76D6\u73B0\u6709\u4EE3\u7801\u54E6~ ",r.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(n.a)(i.a.mark(function At(){var en;return i.a.wrap(function(hn){for(;;)switch(hn.prev=hn.next){case 0:return hn.next=2,Object(A.i)(kt);case 2:en=hn.sent,en.status===401?on.replace("/login",{from:yt.pathname}):br(F.Base64.decode(en.code));case 4:case"end":return hn.stop()}},At)}))()}})}function xn(){Nt({type:vt.SET_SHOW_NOTE,payload:!0})}function dn(){Nt({type:vt.SET_SHOW_NOTE,payload:!1})}function fn(nn){return pr.apply(this,arguments)}function pr(){return pr=Object(n.a)(i.a.mark(function nn(At){return i.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:return Et.next=2,Object(A.a)(kt,At);case 2:Nt({type:vt.GET_DATA,payload:{showNote:!1,data:Object(h.a)(Object(h.a)({},tn),{},{hack:Object(h.a)(Object(h.a)({},Rt),{},{notes:At.notes})})}});case 3:case"end":return Et.stop()}},nn)})),pr.apply(this,arguments)}var Qr={hack:Rt,isLoading:Un,input:tn==null||((Fe=tn.test_case)===null||Fe===void 0)?void 0:Fe.input,language:Rt==null?void 0:Rt.language,code:Rt==null?void 0:Rt.code,title:"main."+rt[Rt==null?void 0:Rt.language],modify_code:Rt==null?void 0:Rt.modify_code,notes:Rt==null?void 0:Rt.notes,debugResult:kn,debuging:Sn,submitting:Mn,executingMessage:ir,onCancelNote:dn,onAddNote:fn,showNote:Ln,user:Hn,onShowNote:xn,onSubmitCode:ln,onChangeCode:br,onChangeInput:$n,onDebugCode:tr,onResetCode:Jn,onSyncCode:Wi,onUpdateCode:qt,onChangeLanguage:En};function qr(){return ri.apply(this,arguments)}function ri(){return ri=Object(n.a)(i.a.mark(function nn(){var At,en,Et;return i.a.wrap(function(In){for(;;)switch(In.prev=In.next){case 0:return In.next=2,Object(A.j)(Rt.id,{container_type:"Hack",type:1});case 2:At=In.sent,en=At.praise_count,Et=Object(h.a)(Object(h.a)({},tn),{},{hack:Object(h.a)(Object(h.a)({},Rt),{},{praises_count:en,user_praise:!Rt.user_praise})}),Nt({type:vt.SET_DATA,payload:Et});case 6:case"end":return In.stop()}},nn)})),ri.apply(this,arguments)}var Ti={topicId:kt,submitResult:jt,submitRecords:Nn,submitting:Mn,page:jn,onPageChange:Zt,hack:Rt,user:tn==null?void 0:tn.user,onTriggerPraise:qr};return r.a.createElement(r.a.Fragment,null,r.a.createElement(O.a,{spinning:mn,delay:500},tn?r.a.createElement(r.a.Fragment,null,r.a.createElement("header",{className:H.a.header},yt.query.type!=="exercises"&&r.a.createElement("div",null,r.a.createElement("img",{src:"".concat(p.a.IMG_SERVER,"/images/").concat(Hn.image_url),alt:"user",width:30}),r.a.createElement("span",null,Hn.name)),r.a.createElement("h2",{className:"flex-wrp flex_box_column flex_box_center"},r.a.createElement("div",null,Rt.name),(Rt==null?void 0:Rt.is_program)&&r.a.createElement(Xt.a,{defaultValue:Rt==null?void 0:Rt.answer_long_time,onChange:function(At){console.log(At),Kr.current=At},className:"font12 c-grey-999"})),Hn.hack_manager?r.a.createElement(L.a,{className:H.a.btn_back,to:(yt==null||((Pt=yt.query)===null||Pt===void 0)?void 0:Pt.type)==="1"?"/problems/".concat(Rt.identifier,"/edit?type=1"):"/problems/".concat(Rt.identifier,"/edit"),style:{marginRight:10}}," ",r.a.createElement(T.a,null)," \u7F16\u8F91"):null,(xt==null||((Yt=xt.exercise)===null||Yt===void 0)?void 0:Yt.left_time)&&r.a.createElement(r.a.Fragment,null,r.a.createElement("span",{style:{color:An},className:"iconfont icon-kaoshishichang mr5"}),r.a.createElement("span",{className:"c-white mr20"},r.a.createElement(vn,{valueStyle:{color:An,fontSize:16,fontWeight:"normal"},title:r.a.createElement("span",{style:{color:An,fontSize:16}},"\u5269\u4F59\u65F6\u95F4\uFF1A"),value:_n,onFinish:Object(n.a)(i.a.mark(function nn(){var At,en;return i.a.wrap(function(hn){for(;;)switch(hn.prev=hn.next){case 0:return hn.next=2,Object(_.ab)({categoryId:yt.query.exercisesId,commit_method:2});case 2:At=hn.sent,(At==null?void 0:At.status)===0&&(qt(),g.a.info({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",content:r.a.createElement("div",{className:"tc font16"},"\u7B54\u9898\u7ED3\u675F\u4E86\uFF0C\u7CFB\u7EDF\u5DF2\u81EA\u52A8\u63D0\u4EA4\u8BD5\u5377",r.a.createElement("br",null),"\u4E0D\u80FD\u518D\u4FEE\u6539\u7B54\u9898"),onOk:function(){var In=Object(n.a)(i.a.mark(function wr(){return i.a.wrap(function(pn){for(;;)switch(pn.prev=pn.next){case 0:window.parent.location.href="/classrooms/".concat(yt.query.coursesId,"/exercise/").concat(yt.query.exercisesId,"/detail");case 1:case"end":return pn.stop()}},wr)}));function Zn(){return In.apply(this,arguments)}return Zn}()})),(At==null?void 0:At.status)===-3&&(en=parseInt(At==null?void 0:At.message),Jt(Date.now()+en*1e3));case 5:case"end":return hn.stop()}},nn)}))}))),(yt==null||((Tn=yt.query)===null||Tn===void 0)?void 0:Tn.type)==="exercises"?r.a.createElement(W.a,{type:"primary",onClick:function(){qt(),g.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:r.a.createElement("div",{className:"tc"},"\u8BF7\u786E\u8BA4\u4F60\u7684\u7B54\u9898\u5185\u5BB9\u5DF2\u7ECF\u63D0\u4EA4\uFF1F"),onOk:function(){Ct()}})}},r.a.createElement("span",{className:"iconfont icon-yiguanbi mr5 font14"})," ","\u8FD4\u56DE\u8BD5\u5377"):r.a.createElement("span",{className:H.a.btn_back,onClick:function(){var At;if((yt==null||((At=yt.query)===null||At===void 0)?void 0:At.type)==="1"){var en,Et=(en=localStorage.getItem("program_homework"))===null||en===void 0?void 0:en.split(",");on.push("/classrooms/".concat(Et==null?void 0:Et[0],"/program_homework/").concat(Et==null?void 0:Et[1],"/detail"))}else on.push("/problemset")}}," ",r.a.createElement(w.a,null),"\u9000\u51FA")),r.a.createElement(O.a,{size:"large",spinning:Un},r.a.createElement(m.a,{className:"my-problems",leftChild:r.a.createElement(an,Ti),rightChild:r.a.createElement(Dt,Qr)}))):null,r.a.createElement(g.a,{centered:!0,closable:!1,width:680,footer:null,visible:zr,className:"oj-modal"},r.a.createElement("section",{className:"oj-modal-content"},r.a.createElement("div",{className:"oj-modal-head"},r.a.createElement("img",{src:Wt.a,alt:""}),r.a.createElement("i",{onClick:function(){return kr(!1)},className:"iconfont icon-guanbi1"})),r.a.createElement("aside",null,r.a.createElement("img",{className:"mr30",src:On.a}),"\u8FD0\u884C\u65F6\u95F4:\xA0",r.a.createElement("span",{style:{color:"#75d6ba",marginRight:100}},jt==null?void 0:jt.execute_time,"ms"),"\u4F18\u4E8E",r.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(jt==null?void 0:jt.time_better_than)||100,"%"),"\u7684\u7528\u6237"),r.a.createElement("aside",{className:"mb50"},r.a.createElement("img",{src:Mt.a,className:"mr30"}),r.a.createElement("span",{className:"oj-modal-tt"},r.a.createElement("span",null,r.a.createElement("span",null,"\u5360\u7528\u5185\u5B58:\xA0"),r.a.createElement("span",{className:"c-light-primary"},jt==null?void 0:jt.execute_memory,"kb")),r.a.createElement("span",null,r.a.createElement("span",null))),"\u4F18\u4E8E",r.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(jt==null?void 0:jt.memory_better_than)||100,"%"),"\u7684\u7528\u6237"),r.a.createElement("div",{id:"oj-modal-next",onClick:Object(n.a)(i.a.mark(function nn(){var At,en,Et;return i.a.wrap(function(In){for(;;)switch(In.prev=In.next){case 0:if(!(jt!=null&&jt.next_identifier)){In.next=7;break}return In.next=3,Object(Ye.a)("/api/problems/".concat(jt==null?void 0:jt.next_identifier,"/start.json"),{method:"get",params:{hack_user_id:Hn==null?void 0:Hn.user_id}});case 3:At=In.sent,At&&(on.replace("/myproblems/".concat(At==null?void 0:At.identifier,"?type=1")),window.location.reload()),In.next=9;break;case 7:Et=(en=localStorage.getItem("program_homework"))===null||en===void 0?void 0:en.split(","),on.push("/classrooms/".concat(Et==null?void 0:Et[0],"/program_homework/").concat(Et==null?void 0:Et[1],"/detail"));case 9:case"end":return In.stop()}},nn)})),className:"oj-modal-btn"},jt!=null&&jt.next_identifier?"\u8FDB\u5165\u4E0B\u4E00\u9898":"\u56DE\u5230\u4F5C\u4E1A\u8BE6\u60C5\u9875")))))};function Wn(ze){var Fe,Pt=ze.title,Yt=ze.modify_code,Tn=ze.onSyncCode,yn=ze.onShowCodeSetting,cn=ze.onResetCode,$t=ze.hack,It=ze.onChangeLanguage,Nt=function(){g.a.confirm({title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",icon:r.a.createElement(C.a,null),content:"\u4F60\u5728\u672C\u6587\u4EF6\u4E2D\u4FEE\u6539\u7684\u5185\u5BB9\u5C06\u4E22\u5931\uFF0C\u662F\u5426\u786E\u5B9A\u91CD\u65B0\u52A0\u8F7D\u521D\u59CB\u4EE3\u7801\uFF1F",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:cn})};return console.log($t,"hack"),r.a.createElement("div",{className:"action-bar",style:{paddingLeft:0}},($t==null?void 0:$t.is_program)&&r.a.createElement(V.a,{className:"oj-select",value:$t==null?void 0:$t.language,style:{width:100},placeholder:"\u9009\u62E9\u8BED\u8A00",onChange:It},$t==null||((Fe=$t.all_language)===null||Fe===void 0)?void 0:Fe.map(function(Ht){return r.a.createElement(V.a.Option,{key:Ht,value:Ht},Ht)})),r.a.createElement("span",null),Yt?r.a.createElement("a",{title:"\u66F4\u65B0\u901A\u77E5",onClick:Tn},r.a.createElement("img",{src:P.a,alt:"notice"})):null,r.a.createElement("a",{title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",onClick:Nt},r.a.createElement("i",{className:"iconfont icon-zhongzhi font-20 "})),r.a.createElement("a",{onClick:yn},r.a.createElement("i",{className:"iconfont icon-shezhi"})))}function Dt(ze){var Fe=ze.input,Pt=ze.showNote,Yt=ze.onShowNote,Tn=ze.notes,yn=ze.onCancelNote,cn=ze.onAddNote,$t=ze.debugResult,It=ze.language,Nt=ze.debuging,Ht=ze.submitting,kt=ze.executingMessage,on=ze.code,yt=ze.onSubmitCode,mn=ze.onDebugCode,tn=ze.onChangeCode,kn=ze.onChangeInput,jt=ze.onUpdateCode,Nn=ze.user,jn=ze.isLoading,Ln=Object(z.a)(ze,["input","showNote","onShowNote","notes","onCancelNote","onAddNote","debugResult","language","debuging","submitting","executingMessage","code","onSubmitCode","onDebugCode","onChangeCode","onChangeInput","onUpdateCode","user","isLoading"]);function Sn(ir){return r.a.createElement(Wn,Object(J.a)({},Ln,{onShowCodeSetting:ir}))}var Mn=Object(h.a)({input:Fe,debugResult:$t,debuging:Nt,submitting:Ht,executingMessage:kt,onDebugCode:mn,onChangeCode:tn,onSubmitCode:yt,onChangeInput:kn,user:Nn},Ln);return r.a.createElement("div",{className:"right-panel"},r.a.createElement(E.a,{isLoading:jn,language:It,value:on,onChange:tn,ActionBarRender:Sn}),r.a.createElement("div",{className:"note-form-area ".concat(Pt?"active":"")},r.a.createElement(Se,{onCancel:yn,notes:Tn,callback:cn})),r.a.createElement(S.b,Mn))}},RELg:function(Ue,de,M){var J=M("MFOe"),z=J.Global;Ue.exports={name:"oldIE-userDataStorage",write:K,read:W,each:n,remove:I,clearAll:g};var D="storejs",V=z.document,N=c(),O=(z.navigator?z.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function K(s,d){if(O)return;var i=h(s);N(function(a){a.setAttribute(i,d),a.save(D)})}function W(s){if(O)return;var d=h(s),i=null;return N(function(a){i=a.getAttribute(d)}),i}function n(s){N(function(d){for(var i=d.XMLDocument.documentElement.attributes,a=i.length-1;a>=0;a--){var r=i[a];s(d.getAttribute(r.name),r.name)}})}function I(s){var d=h(s);N(function(i){i.removeAttribute(d),i.save(D)})}function g(){N(function(s){var d=s.XMLDocument.documentElement.attributes;s.load(D);for(var i=d.length-1;i>=0;i--)s.removeAttribute(d[i].name);s.save(D)})}var f=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function h(s){return s.replace(/^\d/,"___$&").replace(f,"___")}function c(){if(!V||!V.documentElement||!V.documentElement.addBehavior)return null;var s="script",d,i,a;try{i=new ActiveXObject("htmlfile"),i.open(),i.write("<"+s+">document.w=window</"+s+'><iframe src="/favicon.ico"></iframe>'),i.close(),d=i.w.frames[0].document,a=d.createElement("div")}catch(r){a=V.createElement("div"),d=V.body}return function(r){var o=[].slice.call(arguments,0);o.unshift(a),d.appendChild(a),a.addBehavior("#default#userData"),a.load(D),r.apply(this,o),d.removeChild(a);return}}},"S+dL":function(Ue,de){Ue.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(Ue,de,M){Ue.exports=M.p+"static/time.a3dc82f3.svg"},"SA+Z":function(Ue,de,M){var J=M("wTVA"),z=M("EbDI"),D=M("ZhPi"),V=M("wkBT");function N(O){return J(O)||z(O)||D(O)||V()}Ue.exports=N,Ue.exports.__esModule=!0,Ue.exports.default=Ue.exports},SJMd:function(Ue,de){/**
* @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 M,J,z,D=!1,V,N;window.PR_SHOULD_USE_CONTINUATION=!0;var O,K;(function(){var W=window,n=["break,continue,do,else,for,if,return,while"],I=[n,"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"],h=[g,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],c=[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",d=[g,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],i="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",a=[n,"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"],r=[n,"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"],o=[n,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],T=[f,c,h,d,i,a,r,o],w=/^(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",L="kwd",A="com",_="typ",b="lit",m="pun",p="pln",C="tag",E="dec",v="src",P="atn",F="atv",R="nocode",H="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function U(ye){for(var Me=0,He=!1,me=!1,Ee=0,Le=ye.length;Ee<Le;++Ee){var Pe=ye[Ee];if(Pe.ignoreCase)me=!0;else if(/[a-z]/i.test(Pe.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){He=!0,me=!1;break}}var Ye={b:8,t:9,n:10,v:11,f:12,r:13};function tt(Ie){var Re=Ie.charCodeAt(0);if(Re!==92)return Re;var $e=Ie.charAt(1);return Re=Ye[$e],Re||("0"<=$e&&$e<="7"?parseInt(Ie.substring(1),8):$e==="u"||$e==="x"?parseInt(Ie.substring(2),16):Ie.charCodeAt(1))}function ut(Ie){if(Ie<32)return(Ie<16?"\\x0":"\\x")+Ie.toString(16);var Re=String.fromCharCode(Ie);return Re==="\\"||Re==="-"||Re==="]"||Re==="^"?"\\"+Re:Re}function lt(Ie){var Re=Ie.substring(1,Ie.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),$e=[],Ze=Re[0]==="^",ue=["["];Ze&&ue.push("^");for(var q=Ze?1:0,te=Re.length;q<te;++q){var ae=Re[q];if(/\\[bdsw]/i.test(ae))ue.push(ae);else{var ce=tt(ae),ie;q+2<te&&Re[q+1]==="-"?(ie=tt(Re[q+2]),q+=2):ie=ce,$e.push([ce,ie]),ie<65||ce>122||(ie<65||ce>90||$e.push([Math.max(65,ce)|32,Math.min(ie,90)|32]),ie<97||ce>122||$e.push([Math.max(97,ce)&~32,Math.min(ie,122)&~32]))}}$e.sort(function(_e,Oe){return _e[0]-Oe[0]||Oe[1]-_e[1]});for(var oe=[],he=[],q=0;q<$e.length;++q){var ge=$e[q];ge[0]<=he[1]+1?he[1]=Math.max(he[1],ge[1]):oe.push(he=ge)}for(var q=0;q<oe.length;++q){var ge=oe[q];ue.push(ut(ge[0])),ge[1]>ge[0]&&(ge[1]+1>ge[0]&&ue.push("-"),ue.push(ut(ge[1])))}return ue.push("]"),ue.join("")}function gt(Ie){for(var Re=Ie.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")),$e=Re.length,Ze=[],ue=0,q=0;ue<$e;++ue){var te=Re[ue];if(te==="(")++q;else if(te.charAt(0)==="\\"){var ae=+te.substring(1);ae&&(ae<=q?Ze[ae]=-1:Re[ue]=ut(ae))}}for(var ue=1;ue<Ze.length;++ue)Ze[ue]===-1&&(Ze[ue]=++Me);for(var ue=0,q=0;ue<$e;++ue){var te=Re[ue];if(te==="(")++q,Ze[q]||(Re[ue]="(?:");else if(te.charAt(0)==="\\"){var ae=+te.substring(1);ae&&ae<=q&&(Re[ue]="\\"+Ze[ae])}}for(var ue=0;ue<$e;++ue)Re[ue]==="^"&&Re[ue+1]!=="^"&&(Re[ue]="");if(Ie.ignoreCase&&He)for(var ue=0;ue<$e;++ue){var te=Re[ue],ce=te.charAt(0);te.length>=2&&ce==="["?Re[ue]=lt(te):ce!=="\\"&&(Re[ue]=te.replace(/[a-zA-Z]/g,function(he){var ge=he.charCodeAt(0);return"["+String.fromCharCode(ge&~32,ge|32)+"]"}))}return Re.join("")}for(var ht=[],Ee=0,Le=ye.length;Ee<Le;++Ee){var Pe=ye[Ee];if(Pe.global||Pe.multiline)throw new Error(""+Pe);ht.push("(?:"+gt(Pe)+")")}return new RegExp(ht.join("|"),me?"gi":"g")}function S(ye,Me){var He=/(?:^|\s)nocode(?:\s|$)/,me=[],Ee=0,Le=[],Pe=0;function Ye(tt){var ut=tt.nodeType;if(ut==1){if(He.test(tt.className))return;for(var lt=tt.firstChild;lt;lt=lt.nextSibling)Ye(lt);var gt=tt.nodeName.toLowerCase();(gt==="br"||gt==="li")&&(me[Pe]=`
`,Le[Pe<<1]=Ee++,Le[Pe++<<1|1]=tt)}else if(ut==3||ut==4){var ht=tt.nodeValue;ht.length&&(Me?ht=ht.replace(/\r\n?/g,`
`):ht=ht.replace(/[ \t\r\n]+/g," "),me[Pe]=ht,Le[Pe<<1]=Ee,Ee+=ht.length,Le[Pe++<<1|1]=tt)}}return Ye(ye),{sourceCode:me.join("").replace(/\n$/,""),spans:Le}}function G(ye,Me,He,me,Ee){if(!He)return;var Le={sourceNode:ye,pre:1,langExtension:null,numberLines:null,sourceCode:He,spans:null,basePos:Me,decorations:null};me(Le),Ee.push.apply(Ee,Le.decorations)}var Q=/\S/;function se(ye){for(var Me=void 0,He=ye.firstChild;He;He=He.nextSibling){var me=He.nodeType;Me=me===1?Me?ye:He:me===3&&Q.test(He.nodeValue)?ye:Me}return Me===ye?void 0:Me}function fe(ye,Me){var He={},me;(function(){for(var Pe=ye.concat(Me),Ye=[],tt={},ut=0,lt=Pe.length;ut<lt;++ut){var gt=Pe[ut],ht=gt[3];if(ht)for(var Ie=ht.length;--Ie>=0;)He[ht.charAt(Ie)]=gt;var Re=gt[1],$e=""+Re;tt.hasOwnProperty($e)||(Ye.push(Re),tt[$e]=null)}Ye.push(/[\0-\uffff]/),me=U(Ye)})();var Ee=Me.length,Le=function(Pe){for(var Ye=Pe.sourceCode,tt=Pe.basePos,ut=Pe.sourceNode,lt=[tt,p],gt=0,ht=Ye.match(me)||[],Ie={},Re=0,$e=ht.length;Re<$e;++Re){var Ze=ht[Re],ue=Ie[Ze],q=void 0,te;if(typeof ue=="string")te=!1;else{var ae=He[Ze.charAt(0)];if(ae)q=Ze.match(ae[1]),ue=ae[0];else{for(var ce=0;ce<Ee;++ce)if(ae=Me[ce],q=Ze.match(ae[1]),q){ue=ae[0];break}q||(ue=p)}te=ue.length>=5&&ue.substring(0,5)==="lang-",te&&!(q&&typeof q[1]=="string")&&(te=!1,ue=v),te||(Ie[Ze]=ue)}var ie=gt;if(gt+=Ze.length,!te)lt.push(tt+ie,ue);else{var oe=q[1],he=Ze.indexOf(oe),ge=he+oe.length;q[2]&&(ge=Ze.length-q[2].length,he=ge-oe.length);var _e=ue.substring(5);G(ut,tt+ie,Ze.substring(0,he),Le,lt),G(ut,tt+ie+he,oe,Y(_e,oe),lt),G(ut,tt+ie+ge,Ze.substring(ge),Le,lt)}}Pe.decorations=lt};return Le}function we(ye){var Me=[],He=[];ye.tripleQuotedStrings?Me.push([x,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ye.multiLineStrings?Me.push([x,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Me.push([x,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ye.verbatimStrings&&He.push([x,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var me=ye.hashComments;me&&(ye.cStyleComments?(me>1?Me.push([A,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Me.push([A,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),He.push([x,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Me.push([A,/^#[^\r\n]*/,null,"#"])),ye.cStyleComments&&(He.push([A,/^\/\/[^\r\n]*/,null]),He.push([A,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ee=ye.regexLiterals;if(Ee){var Le=Ee>1?"":`
\r`,Pe=Le?".":"[\\S\\s]",Ye="/(?=[^/*"+Le+"])(?:[^/\\x5B\\x5C"+Le+"]|\\x5C"+Pe+"|\\x5B(?:[^\\x5C\\x5D"+Le+"]|\\x5C"+Pe+")*(?:\\x5D|$))+/";He.push(["lang-regex",RegExp("^"+H+"("+Ye+")")])}var tt=ye.types;tt&&He.push([_,tt]);var ut=(""+ye.keywords).replace(/^ | $/g,"");ut.length&&He.push([L,new RegExp("^(?:"+ut.replace(/[\s,]+/g,"|")+")\\b"),null]),Me.push([p,/^\s+/,null,` \r
\xA0`]);var lt="^.[^\\s\\w.$@'\"`/\\\\]*";return ye.regexLiterals&&(lt+="(?!s*/)"),He.push([b,/^@[a-z_$][a-z_$@0-9]*/i,null],[_,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[p,/^[a-z_$][a-z_$@0-9]*/i,null],[b,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[p,/^\\[\s\S]?/,null],[m,new RegExp(lt),null]),fe(Me,He)}var be=we({keywords:T,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Se(ye,Me,He){for(var me=/(?:^|\s)nocode(?:\s|$)/,Ee=/\r\n?|\n/,Le=ye.ownerDocument,Pe=Le.createElement("li");ye.firstChild;)Pe.appendChild(ye.firstChild);var Ye=[Pe];function tt(Re){var $e=Re.nodeType;if($e==1&&!me.test(Re.className))if(Re.nodeName==="br")ut(Re),Re.parentNode&&Re.parentNode.removeChild(Re);else for(var Ze=Re.firstChild;Ze;Ze=Ze.nextSibling)tt(Ze);else if(($e==3||$e==4)&&He){var ue=Re.nodeValue,q=ue.match(Ee);if(q){var te=ue.substring(0,q.index);Re.nodeValue=te;var ae=ue.substring(q.index+q[0].length);if(ae){var ce=Re.parentNode;ce.insertBefore(Le.createTextNode(ae),Re.nextSibling)}ut(Re),te||Re.parentNode.removeChild(Re)}}}function ut(Re){for(;!Re.nextSibling;)if(Re=Re.parentNode,!Re)return;function $e(q,te){var ae=te?q.cloneNode(!1):q,ce=q.parentNode;if(ce){var ie=$e(ce,1),oe=q.nextSibling;ie.appendChild(ae);for(var he=oe;he;he=oe)oe=he.nextSibling,ie.appendChild(he)}return ae}for(var Ze=$e(Re.nextSibling,0),ue;(ue=Ze.parentNode)&&ue.nodeType===1;)Ze=ue;Ye.push(Ze)}for(var lt=0;lt<Ye.length;++lt)tt(Ye[lt]);Me===(Me|0)&&Ye[0].setAttribute("value",Me);var gt=Le.createElement("ol");gt.className="linenums";for(var ht=Math.max(0,Me-1|0)||0,lt=0,Ie=Ye.length;lt<Ie;++lt)Pe=Ye[lt],Pe.className="L"+(lt+ht)%10,Pe.firstChild||Pe.appendChild(Le.createTextNode("\xA0")),gt.appendChild(Pe);ye.appendChild(gt)}function Ae(ye){var Me=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Me=Me&&+Me[1]<=8;var He=/\n/g,me=ye.sourceCode,Ee=me.length,Le=0,Pe=ye.spans,Ye=Pe.length,tt=0,ut=ye.decorations,lt=ut.length,gt=0;ut[lt]=Ee;var ht,Ie;for(Ie=ht=0;Ie<lt;)ut[Ie]!==ut[Ie+2]?(ut[ht++]=ut[Ie++],ut[ht++]=ut[Ie++]):Ie+=2;for(lt=ht,Ie=ht=0;Ie<lt;){for(var Re=ut[Ie],$e=ut[Ie+1],Ze=Ie+2;Ze+2<=lt&&ut[Ze+1]===$e;)Ze+=2;ut[ht++]=Re,ut[ht++]=$e,Ie=Ze}lt=ut.length=ht;var ue=ye.sourceNode,q="";ue&&(q=ue.style.display,ue.style.display="none");try{for(var te=null;tt<Ye;){var ae=Pe[tt],ce=Pe[tt+2]||Ee,ie=ut[gt+2]||Ee,Ze=Math.min(ce,ie),oe=Pe[tt+1],he;if(oe.nodeType!==1&&(he=me.substring(Le,Ze))){Me&&(he=he.replace(He,"\r")),oe.nodeValue=he;var ge=oe.ownerDocument,_e=ge.createElement("span");_e.className=ut[gt+1];var Oe=oe.parentNode;Oe.replaceChild(_e,oe),_e.appendChild(oe),Le<ce&&(Pe[tt+1]=oe=ge.createTextNode(me.substring(Ze,ce)),Oe.insertBefore(oe,_e.nextSibling))}Le=Ze,Le>=ce&&(tt+=2),Le>=ie&&(gt+=2)}}finally{ue&&(ue.style.display=q)}}var De={};function ve(ye,Me){for(var He=Me.length;--He>=0;){var me=Me[He];De.hasOwnProperty(me)?W.console&&console.warn("cannot override language handler %s",me):De[me]=ye}}function Y(ye,Me){return ye&&De.hasOwnProperty(ye)||(ye=/^\s*</.test(Me)?"default-markup":"default-code"),De[ye]}ve(be,["default-code"]),ve(fe([],[[p,/^[^<?]+/],[E,/^<!\w[^>]*(?:>|$)/],[A,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[m,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),ve(fe([[p,/^[\s]+/,null,` \r
`],[F,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[C,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[m,/^[=<>\/]+/],["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"]),ve(fe([],[[F,/^[\s\S]+/]]),["uq.val"]),ve(we({keywords:f,hashComments:!0,cStyleComments:!0,types:w}),["c","cc","cpp","cxx","cyc","m"]),ve(we({keywords:"null,true,false"}),["json"]),ve(we({keywords:c,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:w}),["cs"]),ve(we({keywords:h,cStyleComments:!0}),["java"]),ve(we({keywords:o,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ve(we({keywords:a,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ve(we({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ve(we({keywords:r,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ve(we({keywords:d,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ve(we({keywords:s,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ve(fe([],[[x,/^[\s\S]+/]]),["regex"]);function k(ye){var Me=ye.langExtension;try{var He=S(ye.sourceNode,ye.pre),me=He.sourceCode;ye.sourceCode=me,ye.spans=He.spans,ye.basePos=0,Y(Me,me)(ye),Ae(ye)}catch(Ee){W.console&&console.log(Ee&&Ee.stack||Ee)}}function B(ye,Me,He){var me=He||!1,Ee=Me||null,Le=document.createElement("div");Le.innerHTML="<pre>"+ye+"</pre>",Le=Le.firstChild,me&&Se(Le,me,!0);var Pe={langExtension:Ee,numberLines:me,sourceNode:Le,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return k(Pe),Le.innerHTML}function Z(ye,Me){var He=Me||document.body,me=He.ownerDocument||document;function Ee(ae){return He.getElementsByTagName(ae)}for(var Le=[Ee("pre"),Ee("code"),Ee("xmp")],Pe=[],Ye=0;Ye<Le.length;++Ye)for(var tt=0,ut=Le[Ye].length;tt<ut;++tt)Pe.push(Le[Ye][tt]);Le=null;var lt=Date;lt.now||(lt={now:function(){return+new Date}});var gt=0,ht=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ie=/\bprettyprint\b/,Re=/\bprettyprinted\b/,$e=/pre|xmp/i,Ze=/^code$/i,ue=/^(?:pre|code|xmp)$/i,q={};function te(){for(var ae=W.PR_SHOULD_USE_CONTINUATION?lt.now()+250:Infinity;gt<Pe.length&&lt.now()<ae;gt++){for(var ce=Pe[gt],ie=q,oe=ce;oe=oe.previousSibling;){var he=oe.nodeType,ge=(he===7||he===8)&&oe.nodeValue;if(ge?!/^\??prettify\b/.test(ge):he!==3||/\S/.test(oe.nodeValue))break;if(ge){ie={},ge.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Xe,je,it){ie[je]=it});break}}var _e=ce.className;if((ie!==q||Ie.test(_e))&&!Re.test(_e)){for(var Oe=!1,Ge=ce.parentNode;Ge;Ge=Ge.parentNode){var et=Ge.tagName;if(ue.test(et)&&Ge.className&&Ie.test(Ge.className)){Oe=!0;break}}if(!Oe){ce.className+=" prettyprinted";var ct=ie.lang;if(!ct){ct=_e.match(ht);var st;!ct&&(st=se(ce))&&Ze.test(st.tagName)&&(ct=st.className.match(ht)),ct&&(ct=ct[1])}var nt;if($e.test(ce.tagName))nt=1;else{var We=ce.currentStyle,Ve=me.defaultView,Ne=We?We.whiteSpace:Ve&&Ve.getComputedStyle?Ve.getComputedStyle(ce,null).getPropertyValue("white-space"):0;nt=Ne&&Ne.substring(0,3)==="pre"}var pe=ie.linenums;(pe=pe==="true"||+pe)||(pe=_e.match(/\blinenums\b(?::(\d+))?/),pe=pe?pe[1]&&pe[1].length?+pe[1]:!0:!1),pe&&Se(ce,pe,nt);var xe={langExtension:ct,sourceNode:ce,numberLines:pe,pre:nt,sourceCode:null,basePos:null,spans:null,decorations:null};k(xe)}}}gt<Pe.length?W.setTimeout(te,250):typeof ye=="function"&&ye()}te()}var re=W.PR={createSimpleLexer:fe,registerLangHandler:ve,sourceDecorator:we,PR_ATTRIB_NAME:P,PR_ATTRIB_VALUE:F,PR_COMMENT:A,PR_DECLARATION:E,PR_KEYWORD:L,PR_LITERAL:b,PR_NOCODE:R,PR_PLAIN:p,PR_PUNCTUATION:m,PR_SOURCE:v,PR_STRING:x,PR_TAG:C,PR_TYPE:_,prettyPrintOne:D?W.prettyPrintOne=B:O=B,prettyPrint:K=D?W.prettyPrint=Z:K=Z},X=W.define;typeof X=="function"&&X.amd&&X("google-code-prettify",[],function(){return re})})()},STEk:function(Ue,de,M){"use strict";M.d(de,"a",function(){return ve});/*! *****************************************************************************
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 J=function(Y,k){return(J=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(B,Z){B.__proto__=Z}||function(B,Z){for(var re in Z)Object.prototype.hasOwnProperty.call(Z,re)&&(B[re]=Z[re])})(Y,k)};function z(Y,k){function B(){this.constructor=Y}J(Y,k),Y.prototype=k===null?Object.create(k):(B.prototype=k.prototype,new B)}function D(Y,k,B,Z){return new(B||(B=Promise))(function(re,X){function ye(me){try{He(Z.next(me))}catch(Ee){X(Ee)}}function Me(me){try{He(Z.throw(me))}catch(Ee){X(Ee)}}function He(me){var Ee;me.done?re(me.value):(Ee=me.value,Ee instanceof B?Ee:new B(function(Le){Le(Ee)})).then(ye,Me)}He((Z=Z.apply(Y,k||[])).next())})}function V(Y,k){var B,Z,re,X,ye={label:0,sent:function(){if(1&re[0])throw re[1];return re[1]},trys:[],ops:[]};return X={next:Me(0),throw:Me(1),return:Me(2)},typeof Symbol=="function"&&(X[Symbol.iterator]=function(){return this}),X;function Me(He){return function(me){return function(Ee){if(B)throw new TypeError("Generator is already executing.");for(;ye;)try{if(B=1,Z&&(re=2&Ee[0]?Z.return:Ee[0]?Z.throw||((re=Z.return)&&re.call(Z),0):Z.next)&&!(re=re.call(Z,Ee[1])).done)return re;switch(Z=0,re&&(Ee=[2&Ee[0],re.value]),Ee[0]){case 0:case 1:re=Ee;break;case 4:return ye.label++,{value:Ee[1],done:!1};case 5:ye.label++,Z=Ee[1],Ee=[0];continue;case 7:Ee=ye.ops.pop(),ye.trys.pop();continue;default:if(!(re=ye.trys,(re=re.length>0&&re[re.length-1])||Ee[0]!==6&&Ee[0]!==2)){ye=0;continue}if(Ee[0]===3&&(!re||Ee[1]>re[0]&&Ee[1]<re[3])){ye.label=Ee[1];break}if(Ee[0]===6&&ye.label<re[1]){ye.label=re[1],re=Ee;break}if(re&&ye.label<re[2]){ye.label=re[2],ye.ops.push(Ee);break}re[2]&&ye.ops.pop(),ye.trys.pop();continue}Ee=k.call(Y,ye)}catch(Le){Ee=[6,Le],Z=0}finally{B=re=0}if(5&Ee[0])throw Ee[1];return{value:Ee[0]?Ee[1]:void 0,done:!0}}([He,me])}}}function N(){for(var Y=0,k=0,B=arguments.length;k<B;k++)Y+=arguments[k].length;var Z=Array(Y),re=0;for(k=0;k<B;k++)for(var X=arguments[k],ye=0,Me=X.length;ye<Me;ye++,re++)Z[re]=X[ye];return Z}var O=function(){function Y(){}return Y.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Y.setAttributes=function(k,B){for(var Z=0,re=B;Z<re.length;Z++){var X=re[Z],ye=X[0],Me=X[1];k.setAttribute(ye,Me)}},Y.createRect=function(k,B,Z){var re=document.createElementNS("http://www.w3.org/2000/svg","rect");return re.setAttribute("width",k.toString()),re.setAttribute("height",B.toString()),Z&&Y.setAttributes(re,Z),re},Y.createLine=function(k,B,Z,re,X){var ye=document.createElementNS("http://www.w3.org/2000/svg","line");return ye.setAttribute("x1",k.toString()),ye.setAttribute("y1",B.toString()),ye.setAttribute("x2",Z.toString()),ye.setAttribute("y2",re.toString()),X&&Y.setAttributes(ye,X),ye},Y.createPolygon=function(k,B){var Z=document.createElementNS("http://www.w3.org/2000/svg","polygon");return Z.setAttribute("points",k),B&&Y.setAttributes(Z,B),Z},Y.createCircle=function(k,B){var Z=document.createElementNS("http://www.w3.org/2000/svg","circle");return Z.setAttribute("cx",(k/2).toString()),Z.setAttribute("cy",(k/2).toString()),Z.setAttribute("r",k.toString()),B&&Y.setAttributes(Z,B),Z},Y.createEllipse=function(k,B,Z){var re=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return re.setAttribute("cx",(k/2).toString()),re.setAttribute("cy",(B/2).toString()),re.setAttribute("rx",(k/2).toString()),re.setAttribute("ry",(B/2).toString()),Z&&Y.setAttributes(re,Z),re},Y.createGroup=function(k){var B=document.createElementNS("http://www.w3.org/2000/svg","g");return k&&Y.setAttributes(B,k),B},Y.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Y.createMarker=function(k,B,Z,re,X,ye,Me){var He=document.createElementNS("http://www.w3.org/2000/svg","marker");return Y.setAttributes(He,[["id",k],["orient",B],["markerWidth",Z.toString()],["markerHeight",re.toString()],["refX",X.toString()],["refY",ye.toString()]]),He.appendChild(Me),He},Y.createText=function(k){var B=document.createElementNS("http://www.w3.org/2000/svg","text");return B.setAttribute("x","0"),B.setAttribute("y","0"),k&&Y.setAttributes(B,k),B},Y.createTSpan=function(k,B){var Z=document.createElementNS("http://www.w3.org/2000/svg","tspan");return Z.textContent=k,B&&Y.setAttributes(Z,B),Z},Y.createImage=function(k){var B=document.createElementNS("http://www.w3.org/2000/svg","image");return k&&Y.setAttributes(B,k),B},Y.createPoint=function(k,B){var Z=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return Z.x=k,Z.y=B,Z},Y.createPath=function(k,B){var Z=document.createElementNS("http://www.w3.org/2000/svg","path");return Z.setAttribute("d",k),B&&Y.setAttributes(Z,B),Z},Y}(),K=function(){function Y(){}return Y.addKey=function(k){Y.key=k},Object.defineProperty(Y,"isLicensed",{get:function(){return!!Y.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(Y.key)},enumerable:!1,configurable:!0}),Y}(),W=function(){function Y(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return Y.prototype.rasterize=function(k,B,Z){var re=this;return new Promise(function(X){var ye=Z!==void 0?Z:document.createElement("canvas");k===null&&(re.markersOnly=!0,re.naturalSize=!1);var Me=document.createElementNS("http://www.w3.org/2000/svg","svg");Me.setAttribute("xmlns","http://www.w3.org/2000/svg"),Me.setAttribute("width",B.width.baseVal.valueAsString),Me.setAttribute("height",B.height.baseVal.valueAsString),Me.setAttribute("viewBox","0 0 "+B.viewBox.baseVal.width.toString()+" "+B.viewBox.baseVal.height.toString()),Me.innerHTML=B.innerHTML,re.naturalSize===!0?(Me.width.baseVal.value=k.naturalWidth,Me.height.baseVal.value=k.naturalHeight):re.width!==void 0&&re.height!==void 0&&(Me.width.baseVal.value=re.width,Me.height.baseVal.value=re.height),ye.width=Me.width.baseVal.value,ye.height=Me.height.baseVal.value;var He=Me.outerHTML,me=ye.getContext("2d");re.markersOnly!==!0&&me.drawImage(k,0,0,ye.width,ye.height);var Ee=window.URL,Le=new Image(ye.width,ye.height);Le.setAttribute("crossOrigin","anonymous");var Pe=new Blob([He],{type:"image/svg+xml"}),Ye=Ee.createObjectURL(Pe);Le.onload=function(){me.drawImage(Le,0,0),Ee.revokeObjectURL(Ye);var tt=ye.toDataURL(re.imageType,re.imageQuality);X(tt)},Le.src=Ye})},Y}(),n=function(){},I=function(){function Y(k){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+k+"_"}return Object.defineProperty(Y.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),Y.prototype.addClass=function(k){return this.styleSheet===void 0&&this.addStyleSheet(),k.name=""+this.classNamePrefix+k.localName,this.classes.push(k),this.styleSheet.sheet.insertRule("."+k.name+" {"+k.style+"}",this.styleSheet.sheet.cssRules.length),k},Y.prototype.addRule=function(k){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(k),this.styleSheet.sheet.insertRule(k.selector+" {"+k.style+"}",this.styleSheet.sheet.cssRules.length)},Y.prototype.addStyleSheet=function(){var k;this.styleSheet=document.createElement("style"),((k=this.styleSheetRoot)!==null&&k!==void 0?k:document.head).appendChild(this.styleSheet),this.addRule(new g("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new g("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new g("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new f("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new f("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},Y.prototype.removeStyleSheet=function(){var k;this.styleSheet&&(((k=this.styleSheetRoot)!==null&&k!==void 0?k:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Y}(),g=function(Y,k){this.selector=Y,this.style=k},f=function(Y,k){this.localName=Y,this.style=k},h=function(){function Y(k,B,Z,re,X){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=k,this.displayMode=B,this.markerItems=Z,this.uiStyleSettings=re,this.styles=X,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return Y.prototype.show=function(k){var B=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=k,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var Z=document.createElement("div");Z.className=this.toolbarBlockStyleClass.name,Z.style.whiteSpace="nowrap",this.uiContainer.appendChild(Z),this.addActionButton(Z,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(Z,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(Z,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(Z,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(Z,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(Z,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(Z,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(Z,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"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=""+B.toolbarButtonStyleClass.name,ye.setAttribute("data-type-name",X.typeName),ye.innerHTML=X.icon,ye.addEventListener("click",function(){B.markerToolbarButtonClicked(ye,X)}),B.buttons.push(ye),B.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='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var re=document.createElement("div");re.className=this.toolbarBlockStyleClass.name,re.style.whiteSpace="nowrap",re.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(re),this.addActionButton(re,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(re,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},Y.prototype.addButtonClickListener=function(k){this.buttonClickListeners.push(k)},Y.prototype.removeButtonClickListener=function(k){this.buttonClickListeners.indexOf(k)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(k),1)},Y.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},Y.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var k=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var B=0;B<this.markerButtons.length;B++)B<k||B===k&&this.markerButtons.length-1===k?this.markerButtonBlock.appendChild(this.markerButtons[B]):(B===k&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[B]))}},Y.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},Y.prototype.resetButtonStyles=function(){var k=this;this.buttons.forEach(function(B){B.className=B.className.replace(k.uiStyleSettings.toolbarButtonStyleColorsClassName?k.uiStyleSettings.toolbarButtonStyleColorsClassName:k.toolbarButtonStyleColorsClass.name,"").trim(),B.className=B.className.replace(k.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?k.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:k.toolbarActiveButtonStyleColorsClass.name,"").trim(),B.className+=" "+(k.uiStyleSettings.toolbarButtonStyleColorsClassName?k.uiStyleSettings.toolbarButtonStyleColorsClassName:k.toolbarButtonStyleColorsClass.name)})},Y.prototype.addActionButton=function(k,B,Z){var re=this,X=document.createElement("div");switch(X.className=""+this.toolbarButtonStyleClass.name,X.innerHTML=B,X.setAttribute("data-action",Z),X.addEventListener("click",function(){re.actionToolbarButtonClicked(X,Z)}),Z){case"select":X.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":X.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":X.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":X.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":X.style.fill=this.uiStyleSettings.closeButtonColor}k.appendChild(X),this.buttons.push(X)},Y.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new f("toolbar",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.uiStyleSettings.toolbarHeight+`px;
box-sizing: content-box;
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new f("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new f("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new f("toolbar-overflow-block",`
position: absolute;
top: `+this.uiStyleSettings.toolbarHeight+`px;
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
z-index: 10;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new f("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var k=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new f("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*k)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*k)+`px;
padding: `+k+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new f("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new f("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new g("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new g("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},Y.prototype.markerToolbarButtonClicked=function(k,B){this.setActiveButton(k),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(Z){return Z("marker",B)}),this.markerButtonOverflowBlock.style.display="none"},Y.prototype.actionToolbarButtonClicked=function(k,B){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(Z){return Z("action",B)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},Y.prototype.setActiveButton=function(k){this.resetButtonStyles(),k.className=k.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),k.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},Y.prototype.setActiveMarkerButton=function(k){var B=this.markerButtons.find(function(Z){return Z.getAttribute("data-type-name")===k});B&&this.setActiveButton(B)},Y.prototype.setCurrentMarker=function(k){var B=this;this.currentMarker=k,this.buttons.filter(function(Z){return/delete|notes/.test(Z.getAttribute("data-action"))}).forEach(function(Z){B.currentMarker===void 0?(Z.style.fillOpacity="0.4",Z.style.pointerEvents="none"):(Z.style.fillOpacity="1",Z.style.pointerEvents="all")})},Y}(),c=function(){function Y(k,B,Z,re){this.panels=[],this.panelButtons=[],this.markerjsContainer=k,this.displayMode=B,this.uiStyleSettings=Z,this.styles=re,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return Y.prototype.addStyles=function(){var k;this.toolboxStyleClass=this.styles.addClass(new f("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 f("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var B=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new f("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new f("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new f("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 f("toolbox-panel-row_colors",`
background-color: `+((k=this.uiStyleSettings.toolboxBackgroundColor)!==null&&k!==void 0?k:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new f("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*B)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*B)+`px;
padding: `+B+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new f("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new f("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new g("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new g("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},Y.prototype.show=function(k){var B;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=k,this.uiContainer.className=this.toolboxStyleClass.name+" "+((B=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&B!==void 0?B:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},Y.prototype.setPanelButtons=function(k){var B,Z,re=this;this.panels=k,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((B=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&B!==void 0?B:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((Z=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&Z!==void 0?Z:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(X){var ye;X.uiStyleSettings=re.uiStyleSettings;var Me=document.createElement("div");Me.className=re.toolboxButtonStyleClass.name+" "+((ye=re.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ye!==void 0?ye:re.toolboxButtonStyleColorsClass.name),Me.innerHTML=X.icon,Me.title=X.title,Me.addEventListener("click",function(){re.panelButtonClick(X)}),re.panelButtons.push(Me),re.buttonRow.appendChild(Me)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},Y.prototype.panelButtonClick=function(k){var B=this,Z=-1;if(k!==this.activePanel){Z=this.panels.indexOf(k),this.panelRow.innerHTML="";var re=k.getUi();re.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(re),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=k}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){B.displayMode==="inline"?B.panelRow.style.display="none":B.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(X,ye){var Me,He;X.className=B.toolboxButtonStyleClass.name+" "+(ye===Z?""+((Me=B.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Me!==void 0?Me:B.toolboxActiveButtonStyleColorsClass.name):""+((He=B.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&He!==void 0?He:B.toolboxButtonStyleColorsClass.name))})},Y}(),s=function(Y,k){this.title=Y,this.icon=k},d=function(Y){function k(B,Z,re,X){var ye=Y.call(this,B,X||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return ye.colors=[],ye.addTransparent=!1,ye.colorBoxes=[],ye.colors=Z,ye.currentColor=re,ye.setCurrentColor=ye.setCurrentColor.bind(ye),ye.getColorBox=ye.getColorBox.bind(ye),ye}return z(k,Y),k.prototype.getUi=function(){var B=this,Z=document.createElement("div");return Z.style.overflow="hidden",Z.style.whiteSpace="nowrap",this.colors.forEach(function(re){var X=B.getColorBox(re);Z.appendChild(X),B.colorBoxes.push(X)}),Z},k.prototype.getColorBox=function(B){var Z=this,re=this.uiStyleSettings.toolbarHeight/4,X=this.uiStyleSettings.toolbarHeight-re,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=B===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ye.addEventListener("click",function(){Z.setCurrentColor(B,ye)});var Me=document.createElement("div");return Me.style.display="inline-block",Me.style.width=X-2+"px",Me.style.height=X-2+"px",Me.style.backgroundColor=B,Me.style.borderRadius=X/2+"px",B==="transparent"&&(Me.style.fill=this.uiStyleSettings.toolboxAccentColor,Me.innerHTML=`<svg viewBox="0 0 24 24">
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
</svg>`),ye.appendChild(Me),ye},k.prototype.setCurrentColor=function(B,Z){var re=this;this.currentColor=B,this.colorBoxes.forEach(function(X){X.style.borderColor=X===Z?re.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(B)},k}(s),i=function(){function Y(k,B,Z){this._state="new",this._isSelected=!1,this._container=k,this._overlayContainer=B,this.globalSettings=Z,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(Y.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),Y.prototype.ownsTarget=function(k){return!1},Object.defineProperty(Y.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),Y.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},Y.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},Y.prototype.pointerDown=function(k,B){},Y.prototype.dblClick=function(k,B){},Y.prototype.manipulate=function(k){},Y.prototype.pointerUp=function(k){this.stateChanged()},Y.prototype.dispose=function(){},Y.prototype.addMarkerVisualToContainer=function(k){this.container.childNodes.length>0?this.container.insertBefore(k,this.container.childNodes[0]):this.container.appendChild(k)},Y.prototype.getState=function(){return{typeName:Y.typeName,state:this.state,notes:this.notes}},Y.prototype.restoreState=function(k){this._state=k.state,this.notes=k.notes},Y.prototype.scale=function(k,B){},Y.prototype.colorChanged=function(k){this.onColorChanged&&this.onColorChanged(k),this.stateChanged()},Y.prototype.fillColorChanged=function(k){this.onFillColorChanged&&this.onFillColorChanged(k),this.stateChanged()},Y.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var k=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),k.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(k)&&this.onStateChanged(this)}},Y.typeName="MarkerBase",Y}(),a=function(){function Y(){this.findGripByVisual=this.findGripByVisual.bind(this)}return Y.prototype.findGripByVisual=function(k){return this.topLeft.ownsTarget(k)?this.topLeft:this.topCenter.ownsTarget(k)?this.topCenter:this.topRight.ownsTarget(k)?this.topRight:this.centerLeft.ownsTarget(k)?this.centerLeft:this.centerRight.ownsTarget(k)?this.centerRight:this.bottomLeft.ownsTarget(k)?this.bottomLeft:this.bottomCenter.ownsTarget(k)?this.bottomCenter:this.bottomRight.ownsTarget(k)?this.bottomRight:void 0},Y}(),r=function(){function Y(){this.GRIP_SIZE=10,this.visual=O.createGroup(),this.visual.appendChild(O.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(O.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Y.prototype.ownsTarget=function(k){return k===this.visual||k===this.visual.childNodes[0]||k===this.visual.childNodes[1]},Y}(),o=function(){function Y(){}return Y.toITransformMatrix=function(k){return{a:k.a,b:k.b,c:k.c,d:k.d,e:k.e,f:k.f}},Y.toSVGMatrix=function(k,B){return k.a=B.a,k.b=B.b,k.c=B.c,k.d=B.d,k.e=B.e,k.f=B.f,k},Y}(),T=function(Y){function k(B,Z,re){var X=Y.call(this,B,Z,re)||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(O.createTransform()),X.setupControlBox(),X}return z(k,Y),Object.defineProperty(k.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"visual",{get:function(){return this._visual},set:function(B){this._visual=B;var Z=O.createTransform();this._visual.transform.baseVal.appendItem(Z)},enumerable:!1,configurable:!0}),k.prototype.ownsTarget=function(B){return!!Y.prototype.ownsTarget.call(this,B)||!!(this.controlGrips.findGripByVisual(B)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(B))},k.prototype.pointerDown=function(B,Z){Y.prototype.pointerDown.call(this,B,Z),this.state==="new"&&(this.left=B.x,this.top=B.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var re=this.unrotatePoint(B);if(this.manipulationStartX=re.x,this.manipulationStartY=re.y,this.offsetX=re.x-this.left,this.offsetY=re.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(Z),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(Z)){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"},k.prototype.pointerUp=function(B){var Z=this.state;Y.prototype.pointerUp.call(this,B),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(B),this._state="select",Z==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},k.prototype.moveVisual=function(B){this.visual.style.transform="translate("+B.x+"px, "+B.y+"px)"},k.prototype.manipulate=function(B){var Z=this.unrotatePoint(B);this.state==="creating"?this.resize(B):this.state==="move"?(this.left=this.manipulationStartLeft+(Z.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(Z.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(Z):this.state==="rotate"&&this.rotate(B)},k.prototype.resize=function(B){var Z=this.manipulationStartLeft,re=this.manipulationStartWidth,X=this.manipulationStartTop,ye=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:Z=this.manipulationStartLeft+B.x-this.manipulationStartX,re=this.manipulationStartWidth+this.manipulationStartLeft-Z;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:re=this.manipulationStartWidth+B.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:X=this.manipulationStartTop+B.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+B.y-this.manipulationStartY}re>=0?(this.left=Z,this.width=re):(this.left=Z+re,this.width=-re),ye>=0?(this.top=X,this.height=ye):(this.top=X+ye,this.height=-ye),this.setSize()},k.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},k.prototype.rotate=function(B){if(Math.abs(B.x-this.centerX)>.1){var Z=Math.sign(B.x-this.centerX);this.rotationAngle=180*Math.atan((B.y-this.centerY)/(B.x-this.centerX))/Math.PI+90*Z,this.applyRotation()}},k.prototype.applyRotation=function(){var B=this.container.transform.baseVal.getItem(0);B.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(B,0)},k.prototype.rotatePoint=function(B){if(this.rotationAngle===0)return B;var Z=this.container.getCTM(),re=O.createPoint(B.x,B.y);return{x:(re=re.matrixTransform(Z)).x,y:re.y}},k.prototype.unrotatePoint=function(B){if(this.rotationAngle===0)return B;var Z=this.container.getCTM();Z=Z.inverse();var re=O.createPoint(B.x,B.y);return{x:(re=re.matrixTransform(Z)).x,y:re.y}},k.prototype.select=function(){Y.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},k.prototype.deselect=function(){Y.prototype.deselect.call(this),this.controlBox.style.display="none"},k.prototype.setupControlBox=function(){this.controlBox=O.createGroup();var B=O.createTransform();B.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(B),this.container.appendChild(this.controlBox),this.controlRect=O.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=O.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 a,this.addControlGrips(),this.controlBox.style.display="none"},k.prototype.adjustControlBox=function(){var B=this.controlBox.transform.baseVal.getItem(0);B.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(B,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()},k.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()},k.prototype.createGrip=function(){var B=new r;return B.visual.transform.baseVal.appendItem(O.createTransform()),this.controlBox.appendChild(B.visual),B},k.prototype.positionGrips=function(){var B=this.controlGrips.topLeft.GRIP_SIZE,Z=-B/2,re=Z,X=(this.width+this.CB_DISTANCE)/2-B/2,ye=(this.height+this.CB_DISTANCE)/2-B/2,Me=this.height+this.CB_DISTANCE-B/2,He=this.width+this.CB_DISTANCE-B/2;this.positionGrip(this.controlGrips.topLeft.visual,Z,re),this.positionGrip(this.controlGrips.topCenter.visual,X,re),this.positionGrip(this.controlGrips.topRight.visual,He,re),this.positionGrip(this.controlGrips.centerLeft.visual,Z,ye),this.positionGrip(this.controlGrips.centerRight.visual,He,ye),this.positionGrip(this.controlGrips.bottomLeft.visual,Z,Me),this.positionGrip(this.controlGrips.bottomCenter.visual,X,Me),this.positionGrip(this.controlGrips.bottomRight.visual,He,Me),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,X,re-3*this.CB_DISTANCE)},k.prototype.positionGrip=function(B,Z,re){var X=B.transform.baseVal.getItem(0);X.setTranslate(Z,re),B.transform.baseVal.replaceItem(X,0)},k.prototype.hideControlBox=function(){this.controlBox.style.display="none"},k.prototype.showControlBox=function(){this.controlBox.style.display=""},k.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:o.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:o.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},Y.prototype.getState.call(this))},k.prototype.restoreState=function(B){Y.prototype.restoreState.call(this,B);var Z=B;this.left=Z.left,this.top=Z.top,this.width=Z.width,this.height=Z.height,this.rotationAngle=Z.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(o.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,Z.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(o.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,Z.containerTransformMatrix))},k.prototype.scale=function(B,Z){Y.prototype.scale.call(this,B,Z);var re=this.rotatePoint({x:this.left,y:this.top}),X=this.unrotatePoint({x:re.x*B,y:re.y*Z});this.left=X.x,this.top=X.y,this.width=this.width*B,this.height=this.height*Z,this.adjustControlBox()},k}(i),w=function(Y){function k(B,Z,re){var X=Y.call(this,B,Z,re)||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 z(k,Y),k.prototype.ownsTarget=function(B){return!(!Y.prototype.ownsTarget.call(this,B)&&B!==this.visual)},k.prototype.createVisual=function(){this.visual=O.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)},k.prototype.pointerDown=function(B,Z){Y.prototype.pointerDown.call(this,B,Z),this.state==="new"&&(this.createVisual(),this.moveVisual(B),this._state="creating")},k.prototype.manipulate=function(B){Y.prototype.manipulate.call(this,B)},k.prototype.resize=function(B){Y.prototype.resize.call(this,B),this.setSize()},k.prototype.setSize=function(){Y.prototype.setSize.call(this),O.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},k.prototype.pointerUp=function(B){Y.prototype.pointerUp.call(this,B),this.setSize()},k.prototype.setStrokeColor=function(B){this.strokeColor=B,this.visual&&O.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(B),this.stateChanged()},k.prototype.setFillColor=function(B){this.fillColor=B,this.visual&&O.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},k.prototype.setStrokeWidth=function(B){this.strokeWidth=B,this.visual&&O.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},k.prototype.setStrokeDasharray=function(B){this.strokeDasharray=B,this.visual&&O.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},k.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Y.prototype.getState.call(this))},k.prototype.restoreState=function(B){var Z=B;this.fillColor=Z.fillColor,this.strokeColor=Z.strokeColor,this.strokeWidth=Z.strokeWidth,this.strokeDasharray=Z.strokeDasharray,this.opacity=Z.opacity,this.createVisual(),Y.prototype.restoreState.call(this,B),this.setSize()},k.prototype.scale=function(B,Z){Y.prototype.scale.call(this,B,Z),this.setSize()},k.title="Rectangle marker",k}(T),x=function(Y){function k(B,Z,re,X){var ye=Y.call(this,B,X||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return ye.widths=[],ye.widthBoxes=[],ye.widths=Z,ye.currentWidth=re,ye.setCurrentWidth=ye.setCurrentWidth.bind(ye),ye}return z(k,Y),k.prototype.getUi=function(){var B=this,Z=document.createElement("div");return Z.style.display="flex",Z.style.overflow="hidden",Z.style.flexGrow="2",this.widths.forEach(function(re){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=re===B.currentWidth?B.uiStyleSettings.toolboxAccentColor:"transparent",X.addEventListener("click",function(){B.setCurrentWidth(re,X)}),Z.appendChild(X);var ye=document.createElement("div");ye.innerText=re.toString(),ye.style.marginRight="5px",X.appendChild(ye);var Me=document.createElement("div");Me.style.minHeight="20px",Me.style.flexGrow="2",Me.style.display="flex",Me.style.alignItems="center";var He=document.createElement("hr");He.style.minWidth="20px",He.style.border="0px",He.style.borderTop=re+"px solid "+B.uiStyleSettings.toolboxColor,He.style.flexGrow="2",Me.appendChild(He),X.appendChild(Me),B.widthBoxes.push(X)}),Z},k.prototype.setCurrentWidth=function(B,Z){var re=this;this.currentWidth=B,this.widthBoxes.forEach(function(X){X.style.borderColor=X===Z?re.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},k}(s),L=function(Y){function k(B,Z,re,X){var ye=Y.call(this,B,X||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return ye.styles=[],ye.styleBoxes=[],ye.styles=Z,ye.currentStyle=re,ye.setCurrentStyle=ye.setCurrentStyle.bind(ye),ye}return z(k,Y),k.prototype.getUi=function(){var B=this,Z=document.createElement("div");return Z.style.display="flex",Z.style.overflow="hidden",Z.style.flexGrow="2",this.styles.forEach(function(re){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/B.styles.length-5+"%",X.style.borderColor=re===B.currentStyle?B.uiStyleSettings.toolboxAccentColor:"transparent",X.addEventListener("click",function(){B.setCurrentStyle(re,X)}),Z.appendChild(X);var ye=document.createElement("div");ye.style.minHeight="20px",ye.style.flexGrow="2",ye.style.overflow="hidden";var Me=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+B.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(re!==""?'stroke-dasharray="'+re+'"':"")+` />
</svg>`;ye.innerHTML=Me,X.appendChild(ye),B.styleBoxes.push(X)}),Z},k.prototype.setCurrentStyle=function(B,Z){var re=this;this.currentStyle=B,this.styleBoxes.forEach(function(X){X.style.borderColor=X===Z?re.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},k}(s),A=function(Y){function k(B,Z,re){var X=Y.call(this,B,Z,re)||this;return X.strokeColor=re.defaultColor,X.strokeWidth=re.defaultStrokeWidth,X.strokeDasharray=re.defaultStrokeDasharray,X.strokePanel=new d("Line color",re.defaultColorSet,re.defaultColor),X.strokePanel.onColorChanged=X.setStrokeColor,X.strokeWidthPanel=new x("Line width",re.defaultStrokeWidths,re.defaultStrokeWidth),X.strokeWidthPanel.onWidthChanged=X.setStrokeWidth,X.strokeStylePanel=new L("Line style",re.defaultStrokeDasharrays,re.defaultStrokeDasharray),X.strokeStylePanel.onStyleChanged=X.setStrokeDasharray,X}return z(k,Y),Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),k.prototype.getState=function(){var B=Y.prototype.getState.call(this);return B.typeName=k.typeName,B},k.typeName="FrameMarker",k.title="Frame marker",k.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',k}(w),_=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},b=function(Y){function k(B,Z,re){var X=Y.call(this,B,Z,re)||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 z(k,Y),k.prototype.ownsTarget=function(B){return!!Y.prototype.ownsTarget.call(this,B)||!(!this.grip1.ownsTarget(B)&&!this.grip2.ownsTarget(B))},k.prototype.pointerDown=function(B,Z){Y.prototype.pointerDown.call(this,B,Z),this.manipulationStartX=B.x,this.manipulationStartY=B.y,this.state==="new"&&(this.x1=B.x,this.y1=B.y,this.x2=B.x,this.y2=B.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(Z)?this.activeGrip=this.grip1:this.grip2.ownsTarget(Z)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},k.prototype.pointerUp=function(B){var Z=this.state;Y.prototype.pointerUp.call(this,B),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(B),this._state="select",Z==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},k.prototype.adjustVisual=function(){},k.prototype.manipulate=function(B){this.state==="creating"?this.resize(B):this.state==="move"?(this.x1=this.manipulationStartX1+B.x-this.manipulationStartX,this.y1=this.manipulationStartY1+B.y-this.manipulationStartY,this.x2=this.manipulationStartX2+B.x-this.manipulationStartX,this.y2=this.manipulationStartY2+B.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(B)},k.prototype.resize=function(B){switch(this.activeGrip){case this.grip1:this.x1=B.x,this.y1=B.y;break;case this.grip2:case void 0:this.x2=B.x,this.y2=B.y}this.adjustVisual(),this.adjustControlBox()},k.prototype.select=function(){Y.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},k.prototype.deselect=function(){Y.prototype.deselect.call(this),this.controlBox.style.display="none"},k.prototype.setupControlBox=function(){this.controlBox=O.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},k.prototype.adjustControlBox=function(){this.positionGrips()},k.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},k.prototype.createGrip=function(){var B=new r;return B.visual.transform.baseVal.appendItem(O.createTransform()),this.controlBox.appendChild(B.visual),B},k.prototype.positionGrips=function(){var B=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-B/2,this.y1-B/2),this.positionGrip(this.grip2.visual,this.x2-B/2,this.y2-B/2)},k.prototype.positionGrip=function(B,Z,re){var X=B.transform.baseVal.getItem(0);X.setTranslate(Z,re),B.transform.baseVal.replaceItem(X,0)},k.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},Y.prototype.getState.call(this))},k.prototype.restoreState=function(B){Y.prototype.restoreState.call(this,B);var Z=B;this.x1=Z.x1,this.y1=Z.y1,this.x2=Z.x2,this.y2=Z.y2},k.prototype.scale=function(B,Z){Y.prototype.scale.call(this,B,Z),this.x1=this.x1*B,this.y1=this.y1*Z,this.x2=this.x2*B,this.y2=this.y2*Z,this.adjustVisual(),this.adjustControlBox()},k}(i),m=function(Y){function k(B,Z,re){var X=Y.call(this,B,Z,re)||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=re.defaultColor,X.strokeWidth=re.defaultStrokeWidth,X.strokeDasharray=re.defaultStrokeDasharray,X.strokePanel=new d("Line color",re.defaultColorSet,re.defaultColor),X.strokePanel.onColorChanged=X.setStrokeColor,X.strokeWidthPanel=new x("Line width",re.defaultStrokeWidths,re.defaultStrokeWidth),X.strokeWidthPanel.onWidthChanged=X.setStrokeWidth,X.strokeStylePanel=new L("Line style",re.defaultStrokeDasharrays,re.defaultStrokeDasharray),X.strokeStylePanel.onStyleChanged=X.setStrokeDasharray,X}return z(k,Y),k.prototype.ownsTarget=function(B){return!(!Y.prototype.ownsTarget.call(this,B)&&B!==this.visual&&B!==this.selectorLine&&B!==this.visibleLine)},k.prototype.createVisual=function(){this.visual=O.createGroup(),this.selectorLine=O.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=O.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)},k.prototype.pointerDown=function(B,Z){Y.prototype.pointerDown.call(this,B,Z),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},k.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()),O.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),O.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),O.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},k.prototype.setStrokeColor=function(B){this.strokeColor=B,this.adjustVisual(),this.colorChanged(B)},k.prototype.setStrokeWidth=function(B){this.strokeWidth=B,this.adjustVisual()},k.prototype.setStrokeDasharray=function(B){this.strokeDasharray=B,this.adjustVisual(),this.stateChanged()},Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),k.prototype.getState=function(){var B=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},Y.prototype.getState.call(this));return B.typeName=k.typeName,B},k.prototype.restoreState=function(B){Y.prototype.restoreState.call(this,B);var Z=B;this.strokeColor=Z.strokeColor,this.strokeWidth=Z.strokeWidth,this.strokeDasharray=Z.strokeDasharray,this.createVisual(),this.adjustVisual()},k.typeName="LineMarker",k.title="Line marker",k.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',k}(b),p=function(Y){function k(B,Z,re,X){var ye=Y.call(this,B,X||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return ye.fonts=[],ye.fontBoxes=[],ye.fonts=Z,ye.currentFont=re,ye.setCurrentFont=ye.setCurrentFont.bind(ye),ye}return z(k,Y),k.prototype.getUi=function(){var B=this,Z=document.createElement("div");return Z.style.overflow="hidden",Z.style.flexGrow="2",this.fonts.forEach(function(re){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/B.fonts.length-5+"%",X.style.borderColor=re===B.currentFont?B.uiStyleSettings.toolboxAccentColor:"transparent",X.addEventListener("click",function(){B.setCurrentFont(re,X)}),Z.appendChild(X);var ye=document.createElement("div");ye.style.display="flex",ye.style.minHeight="20px",ye.style.flexGrow="2",ye.style.fontFamily=re,ye.style.overflow="hidden";var Me=document.createElement("div");Me.style.whiteSpace="nowrap",Me.style.overflow="hidden",Me.style.textOverflow="ellipsis",Me.innerHTML="The quick brown fox jumps over the lazy dog",ye.appendChild(Me),X.appendChild(ye),B.fontBoxes.push(X)}),Z},k.prototype.setCurrentFont=function(B,Z){var re=this;this.currentFont=B,this.fontBoxes.forEach(function(X){X.style.borderColor=X===Z?re.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},k}(s),C=function(Y){function k(B,Z,re){var X=Y.call(this,B,Z,re)||this;return X.color="transparent",X.padding=5,X.DEFAULT_TEXT="your text here",X.text=X.DEFAULT_TEXT,X.isMoved=!1,X.color=re.defaultColor,X.fontFamily=re.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 d("Color",re.defaultColorSet,re.defaultColor),X.colorPanel.onColorChanged=X.setColor,X.fontFamilyPanel=new p("Font",re.defaultFontFamilies,re.defaultFontFamily),X.fontFamilyPanel.onFontChanged=X.setFont,X}return z(k,Y),k.prototype.ownsTarget=function(B){if(Y.prototype.ownsTarget.call(this,B)||B===this.visual||B===this.textElement||B===this.bgRectangle)return!0;var Z=!1;return this.textElement.childNodes.forEach(function(re){re===B&&(Z=!0)}),Z},k.prototype.createVisual=function(){this.visual=O.createGroup(),this.bgRectangle=O.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=O.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(O.createTransform()),this.textElement.transform.baseVal.appendItem(O.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},k.prototype.pointerDown=function(B,Z){Y.prototype.pointerDown.call(this,B,Z),this.isMoved=!1,this.pointerDownPoint=B,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(B),this._state="creating")},k.prototype.renderText=function(){var B=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(Z){B.textElement.appendChild(O.createTSpan(Z.trim()===""?" ":Z.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},k.prototype.getTextScale=function(){var B=this.textElement.getBBox(),Z=1;if(B.width>0&&B.height>0){var re=(1*this.width-this.width*this.padding*2/100)/B.width,X=(1*this.height-this.height*this.padding*2/100)/B.height;Z=Math.min(re,X)}return Z},k.prototype.getTextPosition=function(B){var Z=this.textElement.getBBox(),re=0,X=0;return Z.width>0&&Z.height>0&&(re=(this.width-Z.width*B)/2,X=this.height/2-Z.height*B/2),{x:re,y:X}},k.prototype.sizeText=function(){var B=this.textElement.getBBox(),Z=this.getTextScale(),re=this.getTextPosition(Z);re.y-=B.y*Z,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+re.x+"px, "+re.y+"px) scale("+Z+", "+Z+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(re.x,re.y),this.textElement.transform.baseVal.getItem(1).setScale(Z,Z))},k.prototype.manipulate=function(B){Y.prototype.manipulate.call(this,B),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(B.x-this.pointerDownPoint.x)>5||Math.abs(B.y-this.pointerDownPoint.y)>5)},k.prototype.resize=function(B){Y.prototype.resize.call(this,B),this.isMoved=!0,this.setSize(),this.sizeText()},k.prototype.setSize=function(){Y.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(O.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),O.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},k.prototype.pointerUp=function(B){var Z=this.state;Z==="creating"&&(this._suppressMarkerCreateEvent=!0),Y.prototype.pointerUp.call(this,B),this.setSize(),(Z==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},k.prototype.showTextEditor=function(){var B=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(Z){Z.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var Z=Number.parseFloat(B.textEditor.style.fontSize);B.textEditor.clientWidth>=Number.parseInt(B.textEditor.style.maxWidth)&&Z>.9;)Z-=.1,B.textEditor.style.fontSize=Math.max(Z,.9)+"em"}),this.textEditor.addEventListener("keyup",function(Z){Z.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(Z){if(Z.clipboardData){var re=Z.clipboardData.getData("text"),X=window.getSelection();if(!X.rangeCount)return!1;X.deleteFromDocument(),X.getRangeAt(0).insertNode(document.createTextNode(re)),Z.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){B.textEditDivClicked(B.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},k.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var B=this.getTextScale(),Z=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),re=this.textElement.getBBox(),X={x:re.width*B,y:re.height*B};Z.x-=X.x/2,Z.y-=X.y/2,this.textEditor.style.top=Z.y+"px",this.textEditor.style.left=Z.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-Z.x+"px",this.textEditor.style.fontSize=Math.max(16*B,12)+"px",this.textElement.style.display="none"}},k.prototype.textEditDivClicked=function(B){this.text=B.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},k.prototype.select=function(){Y.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},k.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),Y.prototype.deselect.call(this)},k.prototype.dblClick=function(B,Z){Y.prototype.dblClick.call(this,B,Z),this.showTextEditor()},k.prototype.setColor=function(B){this.textElement&&O.setAttributes(this.textElement,[["fill",B]]),this.color=B,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(B)},k.prototype.setFont=function(B){this.textElement&&O.setAttributes(this.textElement,[["font-family",B]]),this.fontFamily=B,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},k.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},k.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),k.prototype.getState=function(){var B=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},Y.prototype.getState.call(this));return B.typeName=k.typeName,B},k.prototype.restoreState=function(B){var Z=B;this.color=Z.color,this.fontFamily=Z.fontFamily,this.padding=Z.padding,this.text=Z.text,this.createVisual(),Y.prototype.restoreState.call(this,B),this.setSize()},k.prototype.scale=function(B,Z){Y.prototype.scale.call(this,B,Z),this.setSize(),this.sizeText(),this.positionTextEditor()},k.typeName="TextMarker",k.title="Text marker",k.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',k}(T),E=function(Y){function k(B,Z,re){var X=Y.call(this,B,Z,re)||this;return X.color="transparent",X.lineWidth=3,X.drawing=!1,X.pixelRatio=1,X.color=re.defaultColor,X.lineWidth=re.defaultStrokeWidth,X.pixelRatio=re.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 d("Color",re.defaultColorSet,re.defaultColor),X.colorPanel.onColorChanged=X.setColor,X.lineWidthPanel=new x("Line width",re.defaultStrokeWidths,re.defaultStrokeWidth),X.lineWidthPanel.onWidthChanged=X.setLineWidth,X}return z(k,Y),k.prototype.ownsTarget=function(B){return!(!Y.prototype.ownsTarget.call(this,B)&&B!==this.visual&&B!==this.drawingImage)},k.prototype.createVisual=function(){this.visual=O.createGroup(),this.drawingImage=O.createImage(),this.visual.appendChild(this.drawingImage);var B=O.createTransform();this.visual.transform.baseVal.appendItem(B),this.addMarkerVisualToContainer(this.visual)},k.prototype.pointerDown=function(B,Z){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(B.x,B.y),this.drawing=!0):Y.prototype.pointerDown.call(this,B,Z)},k.prototype.manipulate=function(B){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(B.x,B.y),this.canvasContext.stroke()):Y.prototype.manipulate.call(this,B)},k.prototype.resize=function(B){Y.prototype.resize.call(this,B),O.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),O.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},k.prototype.pointerUp=function(B){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):Y.prototype.pointerUp.call(this,B)},k.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)},k.prototype.select=function(){this.state==="creating"&&this.finishCreation(),Y.prototype.select.call(this)},k.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),Y.prototype.deselect.call(this)},k.prototype.finishCreation=function(){for(var B=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),Z=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],re=Z[0],X=Z[1],ye=Z[2],Me=Z[3],He=!1,me=0;me<this.canvasElement.height;me++)for(var Ee=0;Ee<this.canvasElement.width;Ee++)B.data[me*this.canvasElement.width*4+4*Ee+3]>0&&(He=!0,me<X&&(X=me),Ee<re&&(re=Ee),me>Me&&(Me=me),Ee>ye&&(ye=Ee));if(He){this.left=re/this.pixelRatio,this.top=X/this.pixelRatio,this.width=(ye-re)/this.pixelRatio,this.height=(Me-X)/this.pixelRatio;var Le=document.createElement("canvas");Le.width=ye-re,Le.height=Me-X,Le.getContext("2d").putImageData(this.canvasContext.getImageData(re,X,ye-re,Me-X),0,0),this.drawingImgUrl=Le.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},k.prototype.setDrawingImage=function(){O.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),O.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},k.prototype.setColor=function(B){this.color=B,this.colorChanged(B)},k.prototype.setLineWidth=function(B){this.lineWidth=B},Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),k.prototype.getState=function(){var B=Object.assign({drawingImgUrl:this.drawingImgUrl},Y.prototype.getState.call(this));return B.typeName=k.typeName,B},k.prototype.restoreState=function(B){this.createVisual(),Y.prototype.restoreState.call(this,B),this.drawingImgUrl=B.drawingImgUrl,this.setDrawingImage()},k.prototype.scale=function(B,Z){Y.prototype.scale.call(this,B,Z),this.setDrawingImage()},k.typeName="FreehandMarker",k.title="Freehand marker",k.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',k}(T),v=function(Y){function k(B,Z,re){var X=Y.call(this,B,re||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return X.typeBoxes=[],X.currentType=Z,X.setCurrentType=X.setCurrentType.bind(X),X}return z(k,Y),k.prototype.getUi=function(){var B=this,Z=document.createElement("div");Z.style.display="flex",Z.style.overflow="hidden",Z.style.flexGrow="2";for(var re=function(Me){var He="both";switch(Me){case 0:He="both";break;case 1:He="start";break;case 2:He="end";break;case 3:He="none"}var me=document.createElement("div");if(me.style.display="flex",me.style.flexGrow="2",me.style.alignItems="center",me.style.justifyContent="space-between",me.style.padding="5px",me.style.borderWidth="2px",me.style.borderStyle="solid",me.style.borderColor=He===X.currentType?X.uiStyleSettings.toolboxAccentColor:"transparent",me.addEventListener("click",function(){B.setCurrentType(He,me)}),Z.appendChild(me),He==="both"||He==="start"){var Ee=document.createElement("div");Ee.style.display="flex",Ee.style.alignItems="center",Ee.style.minHeight="20px",Ee.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,5 10,0 10,10" fill="`+(X.uiStyleSettings!==void 0?X.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Ee.style.marginLeft="5px",me.appendChild(Ee)}var Le=document.createElement("div");Le.style.display="flex",Le.style.alignItems="center",Le.style.minHeight="20px",Le.style.flexGrow="2";var Pe=document.createElement("hr");if(Pe.style.minWidth="20px",Pe.style.border="0px",Pe.style.borderTop="3px solid "+(X.uiStyleSettings!==void 0?X.uiStyleSettings.toolboxColor:"#eeeeee"),Pe.style.flexGrow="2",Le.appendChild(Pe),me.appendChild(Le),He==="both"||He==="end"){var Ye=document.createElement("div");Ye.style.display="flex",Ye.style.alignItems="center",Ye.style.minHeight="20px",Ye.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 10,5 0,10" fill="`+(X.uiStyleSettings!==void 0?X.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Ye.style.marginRight="5px",me.appendChild(Ye)}X.typeBoxes.push(me)},X=this,ye=0;ye<4;ye++)re(ye);return Z},k.prototype.setCurrentType=function(B,Z){var re=this;this.currentType=B,this.typeBoxes.forEach(function(X){X.style.borderColor=X===Z?re.uiStyleSettings!==void 0?re.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},k}(s),P=function(Y){function k(B,Z,re){var X=Y.call(this,B,Z,re)||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 v("Arrow type","end"),X.arrowTypePanel.onArrowTypeChanged=X.setArrowType,X}return z(k,Y),k.prototype.ownsTarget=function(B){return!(!Y.prototype.ownsTarget.call(this,B)&&B!==this.arrow1&&B!==this.arrow2)},k.prototype.getArrowPoints=function(B,Z){var re=this.arrowBaseWidth+2*this.strokeWidth,X=this.arrowBaseHeight+2*this.strokeWidth;return B-re/2+","+(Z+X/2)+" "+B+","+(Z-X/2)+" "+(B+re/2)+","+(Z+X/2)},k.prototype.createTips=function(){this.arrow1=O.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(O.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=O.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(O.createTransform()),this.visual.appendChild(this.arrow2)},k.prototype.pointerDown=function(B,Z){Y.prototype.pointerDown.call(this,B,Z),this.state==="creating"&&this.createTips()},k.prototype.adjustVisual=function(){if(Y.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",O.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),O.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var B=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),Z=this.arrow1.transform.baseVal.getItem(0);Z.setRotate(B,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(Z,0);var re=this.arrow2.transform.baseVal.getItem(0);re.setRotate(B+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(re,0)}},k.prototype.setArrowType=function(B){this.arrowType=B,this.adjustVisual(),this.stateChanged()},Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),k.prototype.getState=function(){var B=Object.assign({arrowType:this.arrowType},Y.prototype.getState.call(this));return B.typeName=k.typeName,B},k.prototype.restoreState=function(B){Y.prototype.restoreState.call(this,B);var Z=B;this.arrowType=Z.arrowType,this.createTips(),this.adjustVisual()},k.typeName="ArrowMarker",k.title="Arrow marker",k.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',k}(m),F=function(Y){function k(B,Z,re){var X=Y.call(this,B,Z,re)||this;return X.fillColor=re.defaultFillColor,X.strokeWidth=0,X.fillPanel=new d("Color",re.defaultColorSet,re.defaultFillColor),X.fillPanel.onColorChanged=X.setFillColor,X}return z(k,Y),Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),k.prototype.getState=function(){var B=Y.prototype.getState.call(this);return B.typeName=k.typeName,B},k.typeName="CoverMarker",k.title="Cover marker",k.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',k}(w),R=function(Y){function k(B,Z,re,X){var ye=Y.call(this,B,X||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return ye.opacities=[],ye.opacityBoxes=[],ye.opacities=Z,ye.currentOpacity=re,ye.setCurrentOpacity=ye.setCurrentOpacity.bind(ye),ye}return z(k,Y),k.prototype.getUi=function(){var B=this,Z=document.createElement("div");return Z.style.display="flex",Z.style.overflow="hidden",Z.style.flexGrow="2",Z.style.justifyContent="space-between",this.opacities.forEach(function(re){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=re===B.currentOpacity?B.uiStyleSettings.toolboxAccentColor:"transparent",X.addEventListener("click",function(){B.setCurrentOpacity(re,X)}),Z.appendChild(X);var ye=document.createElement("div");ye.innerText=100*re+"%",X.appendChild(ye),B.opacityBoxes.push(X)}),Z},k.prototype.setCurrentOpacity=function(B,Z){var re=this;this.currentOpacity=B,this.opacityBoxes.forEach(function(X){X.style.borderColor=X===Z?re.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},k}(s),H=function(Y){function k(B,Z,re){var X=Y.call(this,B,Z,re)||this;return X.setOpacity=X.setOpacity.bind(X),X.fillColor=re.defaultHighlightColor,X.strokeWidth=0,X.opacity=re.defaultHighlightOpacity,X.fillPanel=new d("Color",re.defaultColorSet,X.fillColor),X.fillPanel.onColorChanged=X.setFillColor,X.opacityPanel=new R("Opacity",re.defaultOpacitySteps,X.opacity),X.opacityPanel.onOpacityChanged=X.setOpacity,X}return z(k,Y),k.prototype.setOpacity=function(B){this.opacity=B,this.visual&&O.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),k.prototype.getState=function(){var B=Y.prototype.getState.call(this);return B.typeName=k.typeName,B},k.typeName="HighlightMarker",k.title="Highlight marker",k.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',k}(F),U='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',S=function(Y){function k(B,Z,re){var X=Y.call(this,B,Z,re)||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=re.defaultStrokeColor,X.bgColor=re.defaultFillColor,X.fontFamily=re.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 d("Text color",re.defaultColorSet,X.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),X.colorPanel.onColorChanged=X.setColor,X.bgColorPanel=new d("Fill color",re.defaultColorSet,X.bgColor,U),X.bgColorPanel.onColorChanged=X.setBgColor,X.fontFamilyPanel=new p("Font",re.defaultFontFamilies,re.defaultFontFamily),X.fontFamilyPanel.onFontChanged=X.setFont,X.tipGrip=new r,X.tipGrip.visual.transform.baseVal.appendItem(O.createTransform()),X.controlBox.appendChild(X.tipGrip.visual),X}return z(k,Y),k.prototype.ownsTarget=function(B){return Y.prototype.ownsTarget.call(this,B)||this.tipGrip.ownsTarget(B)||this.tip===B},k.prototype.createTip=function(){O.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=O.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},k.prototype.pointerDown=function(B,Z){this.state==="new"&&Y.prototype.pointerDown.call(this,B,Z),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(Z)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):Y.prototype.pointerDown.call(this,B,Z)},k.prototype.pointerUp=function(B){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,Y.prototype.pointerUp.call(this,B);else{var Z=this.state==="creating";Y.prototype.pointerUp.call(this,B),this.setTipPoints(Z),this.positionTip()}},k.prototype.manipulate=function(B){if(this.tipMoving){var Z=this.unrotatePoint(B);this.tipPosition={x:Z.x-this.manipulationStartLeft,y:Z.y-this.manipulationStartTop},this.positionTip()}else Y.prototype.manipulate.call(this,B)},k.prototype.setBgColor=function(B){this.bgRectangle&&this.tip&&(O.setAttributes(this.bgRectangle,[["fill",B]]),O.setAttributes(this.tip,[["fill",B]])),this.bgColor=B,this.fillColorChanged(B)},k.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},k.prototype.setTipPoints=function(B){B===void 0&&(B=!1);var Z=Math.min(this.height/2,15),re=this.height/5;B&&(this.tipPosition={x:Z+re/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.height/2?X<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(re=this.width/5,Z=Math.min(this.width/2,15),this.tipBase1Position={x:Z,y:0},this.tipBase2Position={x:Z+re,y:0}):(this.tipBase1Position={x:0,y:Z},this.tipBase2Position={x:0,y:Z+re}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?X<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(re=this.width/5,Z=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-Z-re,y:0},this.tipBase2Position={x:this.width-Z,y:0}):(this.tipBase1Position={x:this.width,y:Z},this.tipBase2Position={x:this.width,y:Z+re}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?X<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(re=this.width/5,Z=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-Z-re,y:this.height},this.tipBase2Position={x:this.width-Z,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-Z-re},this.tipBase2Position={x:this.width,y:this.height-Z}):X<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(re=this.width/5,Z=Math.min(this.width/2,15),this.tipBase1Position={x:Z,y:this.height},this.tipBase2Position={x:Z+re,y:this.height}):(this.tipBase1Position={x:0,y:this.height-Z},this.tipBase2Position={x:0,y:this.height-Z-re})},k.prototype.resize=function(B){Y.prototype.resize.call(this,B),this.positionTip()},k.prototype.positionTip=function(){O.setAttributes(this.tip,[["points",this.getTipPoints()]]);var B=this.tipGrip.visual.transform.baseVal.getItem(0);B.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(B,0)},Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),k.prototype.select=function(){this.positionTip(),Y.prototype.select.call(this)},k.prototype.getState=function(){var B=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},Y.prototype.getState.call(this));return B.typeName=k.typeName,B},k.prototype.restoreState=function(B){var Z=B;this.bgColor=Z.bgColor,this.tipPosition=Z.tipPosition,Y.prototype.restoreState.call(this,B),this.createTip(),this.setTipPoints()},k.prototype.scale=function(B,Z){Y.prototype.scale.call(this,B,Z),this.tipPosition={x:this.tipPosition.x*B,y:this.tipPosition.y*Z},this.positionTip()},k.typeName="CalloutMarker",k.title="Callout marker",k.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',k}(C),G=function(Y){function k(B,Z,re){var X=Y.call(this,B,Z,re)||this;return X.fillColor="transparent",X.strokeColor="transparent",X.strokeWidth=0,X.strokeDasharray="",X.opacity=1,X.strokeColor=re.defaultColor,X.strokeWidth=re.defaultStrokeWidth,X.strokeDasharray=re.defaultStrokeDasharray,X.fillColor=re.defaultFillColor,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.setOpacity=X.setOpacity.bind(X),X.createVisual=X.createVisual.bind(X),X.strokePanel=new d("Line color",N(re.defaultColorSet,["transparent"]),re.defaultColor),X.strokePanel.onColorChanged=X.setStrokeColor,X.fillPanel=new d("Fill color",N(re.defaultColorSet,["transparent"]),X.fillColor,U),X.fillPanel.onColorChanged=X.setFillColor,X.strokeWidthPanel=new x("Line width",re.defaultStrokeWidths,re.defaultStrokeWidth),X.strokeWidthPanel.onWidthChanged=X.setStrokeWidth,X.strokeStylePanel=new L("Line style",re.defaultStrokeDasharrays,re.defaultStrokeDasharray),X.strokeStylePanel.onStyleChanged=X.setStrokeDasharray,X.opacityPanel=new R("Opacity",re.defaultOpacitySteps,X.opacity),X.opacityPanel.onOpacityChanged=X.setOpacity,X}return z(k,Y),k.prototype.ownsTarget=function(B){return!(!Y.prototype.ownsTarget.call(this,B)&&B!==this.visual)},k.prototype.createVisual=function(){this.visual=O.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},k.prototype.pointerDown=function(B,Z){Y.prototype.pointerDown.call(this,B,Z),this.state==="new"&&(this.createVisual(),this.moveVisual(B),this._state="creating")},k.prototype.manipulate=function(B){Y.prototype.manipulate.call(this,B)},k.prototype.resize=function(B){Y.prototype.resize.call(this,B),this.setSize()},k.prototype.setSize=function(){Y.prototype.setSize.call(this),O.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},k.prototype.pointerUp=function(B){Y.prototype.pointerUp.call(this,B),this.setSize()},k.prototype.setStrokeColor=function(B){this.strokeColor=B,this.visual&&O.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(B),this.stateChanged()},k.prototype.setFillColor=function(B){this.fillColor=B,this.visual&&O.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(B),this.stateChanged()},k.prototype.setStrokeWidth=function(B){this.strokeWidth=B,this.visual&&O.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},k.prototype.setStrokeDasharray=function(B){this.strokeDasharray=B,this.visual&&O.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},k.prototype.setOpacity=function(B){this.opacity=B,this.visual&&O.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),k.prototype.getState=function(){var B=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Y.prototype.getState.call(this));return B.typeName=k.typeName,B},k.prototype.restoreState=function(B){var Z=B;this.fillColor=Z.fillColor,this.strokeColor=Z.strokeColor,this.strokeWidth=Z.strokeWidth,this.strokeDasharray=Z.strokeDasharray,this.opacity=Z.opacity,this.createVisual(),Y.prototype.restoreState.call(this,B),this.setSize()},k.prototype.scale=function(B,Z){Y.prototype.scale.call(this,B,Z),this.setSize()},k.typeName="EllipseMarker",k.title="Ellipse marker",k.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',k}(T),Q=function(Y){function k(B,Z,re){return Y.call(this,B,Z,re)||this}return z(k,Y),Object.defineProperty(k.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),k.prototype.ownsTarget=function(B){return!(!Y.prototype.ownsTarget.call(this,B)&&B!==this.tip1&&B!==this.tip2)},k.prototype.createTips=function(){this.tip1=O.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(O.createTransform()),this.visual.appendChild(this.tip1),this.tip2=O.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(O.createTransform()),this.visual.appendChild(this.tip2)},k.prototype.pointerDown=function(B,Z){Y.prototype.pointerDown.call(this,B,Z),this.state==="creating"&&this.createTips()},k.prototype.adjustVisual=function(){if(Y.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(O.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),O.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var B=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),Z=this.tip1.transform.baseVal.getItem(0);Z.setRotate(B,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(Z,0);var re=this.tip2.transform.baseVal.getItem(0);re.setRotate(B+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(re,0)}},Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),k.prototype.getState=function(){var B=Y.prototype.getState.call(this);return B.typeName=k.typeName,B},k.prototype.restoreState=function(B){Y.prototype.restoreState.call(this,B),this.createTips(),this.adjustVisual()},k.typeName="MeasurementMarker",k.title="Measurement marker",k.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',k}(m),se=function(Y){function k(B,Z,re){var X=Y.call(this,B,Z,re)||this;return X.strokePanel.colors=re.defaultColorSet,X.fillColor="transparent",X}return z(k,Y),Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),k.prototype.getState=function(){var B=Y.prototype.getState.call(this);return B.typeName=k.typeName,B},k.typeName="EllipseFrameMarker",k.title="Ellipse frame marker",k.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',k}(G),fe=function(){function Y(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(Y.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),Y.prototype.addUndoStep=function(k){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(k)||(this.undoStack.push(k),JSON.stringify(this.lastRedoStep)!==JSON.stringify(k)&&this.redoStack.splice(0,this.redoStack.length))},Y.prototype.replaceLastUndoStep=function(k){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=k)},Y.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},Y.prototype.undo=function(){if(this.undoStack.length>1){var k=this.undoStack.pop();return k!==void 0&&this.redoStack.push(k),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},Y.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},Y}(),we=function(Y){function k(B,Z,re){var X=Y.call(this,B,Z,re)||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=re.defaultColor,X.strokeWidth=re.defaultStrokeWidth,X.strokeDasharray=re.defaultStrokeDasharray,X.strokePanel=new d("Line color",re.defaultColorSet,re.defaultColor),X.strokePanel.onColorChanged=X.setStrokeColor,X.strokeWidthPanel=new x("Line width",re.defaultStrokeWidths,re.defaultStrokeWidth),X.strokeWidthPanel.onWidthChanged=X.setStrokeWidth,X.strokeStylePanel=new L("Line style",re.defaultStrokeDasharrays,re.defaultStrokeDasharray),X.strokeStylePanel.onStyleChanged=X.setStrokeDasharray,X}return z(k,Y),k.prototype.ownsTarget=function(B){return!(!Y.prototype.ownsTarget.call(this,B)&&B!==this.visual&&B!==this.selectorCurve&&B!==this.visibleCurve&&!this.curveGrip.ownsTarget(B))},k.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},k.prototype.createVisual=function(){this.visual=O.createGroup(),this.selectorCurve=O.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=O.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)},k.prototype.pointerDown=function(B,Z){Y.prototype.pointerDown.call(this,B,Z),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=B.x,this.curveY=B.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(Z)&&(this.activeGrip=this.curveGrip,this._state="resize")},k.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),O.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),O.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),O.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},k.prototype.setupControlBox=function(){Y.prototype.setupControlBox.call(this),this.curveControlLine1=O.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=O.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)},k.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,Y.prototype.addControlGrips.call(this)},k.prototype.positionGrips=function(){Y.prototype.positionGrips.call(this);var B=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-B/2,this.curveY-B/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()))},k.prototype.manipulate=function(B){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+B.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+B.y-this.manipulationStartY),Y.prototype.manipulate.call(this,B)},k.prototype.resize=function(B){this.activeGrip===this.curveGrip&&(this.curveX=B.x,this.curveY=B.y),Y.prototype.resize.call(this,B),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},k.prototype.setStrokeColor=function(B){this.strokeColor=B,this.adjustVisual(),this.colorChanged(B)},k.prototype.setStrokeWidth=function(B){this.strokeWidth=B,this.adjustVisual()},k.prototype.setStrokeDasharray=function(B){this.strokeDasharray=B,this.adjustVisual()},k.prototype.scale=function(B,Z){this.curveX=this.curveX*B,this.curveY=this.curveY*Z,Y.prototype.scale.call(this,B,Z)},Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),k.prototype.getState=function(){var B=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},Y.prototype.getState.call(this));return B.typeName=k.typeName,B},k.prototype.restoreState=function(B){Y.prototype.restoreState.call(this,B);var Z=B;this.strokeColor=Z.strokeColor,this.strokeWidth=Z.strokeWidth,this.strokeDasharray=Z.strokeDasharray,this.curveX=Z.curveX,this.curveY=Z.curveY,this.createVisual(),this.adjustVisual()},k.typeName="CurveMarker",k.title="Curve marker",k.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',k}(b),be=function(){function Y(k,B){B===void 0&&(B=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=k,this.cancelable=B}return Object.defineProperty(Y.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),Y.prototype.preventDefault=function(){this._defaultPrevented=!0},Y}(),Se=function(Y){function k(B,Z,re){var X=Y.call(this,B,!1)||this;return X.dataUrl=Z,X.state=re,X}return z(k,Y),k}(be),Ae=function(Y){function k(B,Z,re){re===void 0&&(re=!1);var X=Y.call(this,B,re)||this;return X.marker=Z,X}return z(k,Y),k}(be),De=function(){function Y(){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 Y.prototype.addEventListener=function(k,B){this[k].push(B)},Y.prototype.removeEventListener=function(k,B){var Z=this[k].indexOf(B);Z>-1&&this[k].splice(Z,1)},Y}(),ve=function(){function Y(k){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new _,this._isOpen=!1,this.undoRedoManager=new fe,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 De,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=Y.instanceCounter++,this.styles=new I(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=k,this.targetRoot=document.body,this.width=k.clientWidth,this.height=k.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(Y.prototype,"ALL_MARKER_TYPES",{get:function(){return[A,E,P,C,se,G,H,S,Q,F,m,we]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[A,E,P,C,G,H,S]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"BASIC_MARKER_TYPES",{get:function(){return[A,E,P,C,H]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(k){var B=this;this._availableMarkerTypes.splice(0),k.forEach(function(Z){if(typeof Z=="string"){var re=B.ALL_MARKER_TYPES.find(function(X){return X.typeName===Z});re!==void 0&&B._availableMarkerTypes.push(re)}else B._availableMarkerTypes.push(Z)})},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(k){this._zoomLevel=k,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(Y.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Y.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),K.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},Y.prototype.show=function(){var k=this;this.styles.styleSheetRoot===void 0&&n.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=n.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(B){return B(new be(k))})},Y.prototype.render=function(){return D(this,void 0,void 0,function(){var k;return V(this,function(B){switch(B.label){case 0:return this.setCurrentMarker(),(k=new W).naturalSize=this.renderAtNaturalSize,k.imageType=this.renderImageType,k.imageQuality=this.renderImageQuality,k.markersOnly=this.renderMarkersOnly,k.width=this.renderWidth,k.height=this.renderHeight,[4,k.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return B.sent(),[4,k.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,B.sent()]}})})},Y.prototype.close=function(k){var B=this;if(k===void 0&&(k=!1),this.isOpen){var Z=!1;k||this.eventListeners.beforeclose.forEach(function(re){var X=new be(B,!0);re(X),X.defaultPrevented&&(Z=!0)}),Z||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(re){return re(new be(B))}),this.detachEvents(),this._isOpen=!1)}},Y.prototype.addMarkersToToolbar=function(){for(var k,B=[],Z=0;Z<arguments.length;Z++)B[Z]=arguments[Z];(k=this._availableMarkerTypes).push.apply(k,B)},Y.prototype.addRenderEventListener=function(k){this.addEventListener("render",function(B){k(B.dataUrl,B.state)})},Y.prototype.removeRenderEventListener=function(k){},Y.prototype.addCloseEventListener=function(k){this.addEventListener("close",function(){k()})},Y.prototype.removeCloseEventListener=function(k){},Y.prototype.setupResizeObserver=function(){var k=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){k.resize(k.target.clientWidth,k.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return k.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},Y.prototype.onPopupTargetResize=function(){var k=1*this.target.clientWidth/this.target.clientHeight,B=this.editorCanvas.clientWidth/k>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*k:this.editorCanvas.clientWidth,Z=B<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/k;this.resize(B,Z)},Y.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Y.prototype.resize=function(k,B){this._isResizing=!0;var Z=k/this.imageWidth,re=B/this.imageHeight;this.imageWidth=Math.round(k),this.imageHeight=Math.round(B),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(Z,re),this._isResizing=!1},Y.prototype.scaleMarkers=function(k,B){var Z,re=this;this._currentMarker&&this._currentMarker instanceof C?this._currentMarker.scale(k,B):(Z=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(X){X!==re._currentMarker&&X.scale(k,B)}),Z!==void 0&&this.setCurrentMarker(Z)},Y.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},Y.prototype.setTopLeft=function(){var k=this.editingTarget.getBoundingClientRect(),B=this.editorCanvas.getBoundingClientRect();this.left=k.left-B.left,this.top=k.top-B.top},Y.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},Y.prototype.addDefs=function(){for(var k,B=[],Z=0;Z<arguments.length;Z++)B[Z]=arguments[Z];this.defs=O.createDefs(),this.addDefsToImage(),(k=this.defs).append.apply(k,B)},Y.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},Y.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},Y.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},Y.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},Y.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},Y.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},Y.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},Y.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var k=document.createElement("a");k.href="https://markerjs.com/",k.target="_blank",k.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',k.title="Powered by marker.js",k.style.display="grid",k.style.alignItems="center",k.style.justifyItems="center",k.style.padding="3px",k.style.width="20px",k.style.height="20px",this.logoUI.appendChild(k),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},Y.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")},Y.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"},Y.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Y.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 k=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=k+"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 h(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<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new c(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},Y.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},Y.prototype.removeMarker=function(k){this.markerImage.removeChild(k.container),this.markers.indexOf(k)>-1&&this.markers.splice(this.markers.indexOf(k),1),k.dispose()},Y.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())},Y.prototype.toolbarButtonClicked=function(k,B){if(k==="marker"&&B!==void 0)this.createNewMarker(B);else if(k==="action")switch(B){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()}},Y.prototype.deleteSelectedMarker=function(){var k=this;if(this._currentMarker!==void 0){var B=!1;if(this.eventListeners.markerbeforedelete.forEach(function(re){var X=new Ae(k,k._currentMarker,!0);re(X),X.defaultPrevented&&(B=!0)}),!B){var Z=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(re){return re(new Ae(k,Z))})}}},Y.prototype.clear=function(){var k=this,B=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ye){var Me=new Ae(k,void 0,!0);ye(Me),Me.defaultPrevented&&(B=!0)}),!B)){this.setCurrentMarker();for(var Z=function(ye){var Me=re.markers[ye];re.setCurrentMarker(re.markers[ye]),re._currentMarker.dispose(),re.markerImage.removeChild(re._currentMarker.container),re.markers.splice(re.markers.indexOf(re._currentMarker),1),re.eventListeners.markerdelete.forEach(function(He){return He(new Ae(k,Me))})},re=this,X=this.markers.length-1;X>=0;X--)Z(X);this.addUndoStep()}},Object.defineProperty(Y.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),Y.prototype.showNotesEditor=function(){var k;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=(k=this._currentMarker.notes)!==null&&k!==void 0?k:"",this.overlayContainer.appendChild(this.notesArea))},Y.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)},Y.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},Y.prototype.addUndoStep=function(){var k=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var B=this.getState(),Z=this.undoRedoManager.getLastUndoStep();if(!Z||Z.width===B.width&&Z.height===B.height){var re=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(B),re<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(X){return X(new be(k))})}else this.undoRedoManager.replaceLastUndoStep(B),this.eventListeners.statechange.forEach(function(X){return X(new be(k))})}},Y.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},Y.prototype.undoStep=function(){var k=this,B=this.undoRedoManager.undo();B!==void 0&&(this.restoreState(B),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(Z){return Z(new be(k))}))},Y.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},Y.prototype.redoStep=function(){var k=this,B=this.undoRedoManager.redo();B!==void 0&&(this.restoreState(B),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(Z){return Z(new be(k))}))},Y.prototype.stepZoom=function(){var k=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=k<this.zoomSteps.length-1?this.zoomSteps[k+1]:this.zoomSteps[0]},Y.prototype.panTo=function(k){this.contentDiv.scrollBy({left:this.prevPanPoint.x-k.x,top:this.prevPanPoint.y-k.y}),this.prevPanPoint=k},Y.prototype.startRenderAndClose=function(){return D(this,void 0,void 0,function(){var k,B,Z=this;return V(this,function(re){switch(re.label){case 0:return[4,this.render()];case 1:return k=re.sent(),B=this.getState(),this.eventListeners.render.forEach(function(X){return X(new Se(Z,k,B))}),this.close(!0),[2]}})})},Y.prototype.getState=function(k){k===!0&&this.setCurrentMarker();var B={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(Z){return B.markers.push(Z.getState())}),B},Y.prototype.restoreState=function(k){var B=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);k.markers.forEach(function(Z){var re=B._availableMarkerTypes.find(function(ye){return ye.typeName===Z.typeName});if(re!==void 0){var X=B.addNewMarker(re);X.restoreState(Z),B.markers.push(X)}}),k.width&&k.height&&(k.width!==this.imageWidth||k.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/k.width,this.imageHeight/k.height),this.eventListeners.restorestate.forEach(function(Z){return Z(new be(B))})},Y.prototype.addNewMarker=function(k){var B=O.createGroup();return this.markerImage.appendChild(B),new k(B,this.overlayContainer,this.settings)},Y.prototype.createNewMarker=function(k){var B,Z=this;(B=typeof k=="string"?this._availableMarkerTypes.find(function(re){return re.typeName===k}):k)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(B),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(B.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(re){return re(new Ae(Z,Z._currentMarker))}))},Y.prototype.markerCreated=function(k){var B=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(k),this.setCurrentMarker(k),k instanceof E&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(E):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(Z){return Z(new Ae(B,B._currentMarker))})},Y.prototype.colorChanged=function(k){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=k,this.settings.defaultStrokeColor=k)},Y.prototype.fillColorChanged=function(k){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=k)},Y.prototype.markerStateChanged=function(k){var B=this;this.eventListeners.markerchange.forEach(function(Z){return Z(new Ae(B,k))})},Y.prototype.setCurrentMarker=function(k){var B=this;this._currentMarker!==k&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(Z){return Z(new Ae(B,B._currentMarker))})),this._currentMarker=k,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(Z){return Z(new Ae(B,B._currentMarker))}))},Y.prototype.onPointerDown=function(k){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||k.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var B=this.markers.find(function(Z){return Z.ownsTarget(k.target)});B!==void 0?(this.setCurrentMarker(B),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(k.clientX,k.clientY),k.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:k.clientX,y:k.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(k.clientX,k.clientY))},Y.prototype.onDblClick=function(k){if(this._isFocused||this.focus(),this.mode==="select"){var B=this.markers.find(function(Z){return Z.ownsTarget(k.target)});B!==void 0&&B!==this._currentMarker&&this.setCurrentMarker(B),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(k.clientX,k.clientY),k.target):this.setCurrentMarker()}},Y.prototype.onPointerMove=function(k){this.touchPoints!==1&&k.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||k.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(k.clientX,k.clientY)):this.zoomLevel>1&&this.panTo({x:k.clientX,y:k.clientY}))},Y.prototype.onPointerUp=function(k){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(k.clientX,k.clientY)),this.isDragging=!1,this.addUndoStep()},Y.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},Y.prototype.onKeyUp=function(k){this._currentMarker===void 0||this.notesArea!==void 0||k.key!=="Delete"&&k.key!=="Backspace"||this.deleteSelectedMarker()},Y.prototype.clientToLocalCoordinates=function(k,B){var Z=this.markerImage.getBoundingClientRect();return{x:(k-Z.left)/this.zoomLevel,y:(B-Z.top)/this.zoomLevel}},Y.prototype.onWindowResize=function(){this.positionUI()},Y.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var k=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=k+"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()},Y.prototype.addLicenseKey=function(k){K.addKey(k)},Y.prototype.addEventListener=function(k,B){this.eventListeners.addEventListener(k,B)},Y.prototype.removeEventListener=function(k,B){this.eventListeners.removeEventListener(k,B)},Y.prototype.renderState=function(k){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(k),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(Y.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),Y.prototype.focus=function(){var k=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(B){return B(new be(k))}))},Y.prototype.blur=function(){var k=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(B){return B(new be(k))}))},Y.instanceCounter=0,Y}()},T8No:function(Ue,de,M){"use strict";M.d(de,"a",function(){return K}),M.d(de,"e",function(){return W}),M.d(de,"c",function(){return m}),M.d(de,"b",function(){return p}),M.d(de,"d",function(){return C}),M.d(de,"f",function(){return P});var J=M("MNsG"),z=M("N0LK"),D=M("Cg/j");let V=J.k||"";const N=new Map;N.set("false",!1),N.set("true",!0),N.set("isMac",J.f),N.set("isLinux",J.d),N.set("isWindows",J.i),N.set("isWeb",J.h),N.set("isMacNative",J.f&&!J.h),N.set("isEdge",V.indexOf("Edg/")>=0),N.set("isFirefox",V.indexOf("Firefox")>=0),N.set("isChrome",V.indexOf("Chrome")>=0),N.set("isSafari",V.indexOf("Safari")>=0);const O=Object.prototype.hasOwnProperty;class K{static has(R){return f.create(R)}static equals(R,H){return h.create(R,H)}static regex(R,H){return x.create(R,H)}static not(R){return i.create(R)}static and(...R){return _.create(R,null)}static or(...R){return b.create(R,null,!0)}static deserialize(R,H=!1){return R?this._deserializeOrExpression(R,H):void 0}static _deserializeOrExpression(R,H){let U=R.split("||");return b.create(U.map(S=>this._deserializeAndExpression(S,H)),null,!0)}static _deserializeAndExpression(R,H){let U=R.split("&&");return _.create(U.map(S=>this._deserializeOne(S,H)),null)}static _deserializeOne(R,H){if(R=R.trim(),R.indexOf("!=")>=0){let U=R.split("!=");return d.create(U[0].trim(),this._deserializeValue(U[1],H))}if(R.indexOf("==")>=0){let U=R.split("==");return h.create(U[0].trim(),this._deserializeValue(U[1],H))}if(R.indexOf("=~")>=0){let U=R.split("=~");return x.create(U[0].trim(),this._deserializeRegexValue(U[1],H))}if(R.indexOf(" in ")>=0){let U=R.split(" in ");return c.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(R)){const U=R.split(">=");return o.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(R)){const U=R.split(">");return r.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(R)){const U=R.split("<=");return w.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(R)){const U=R.split("<");return T.create(U[0].trim(),U[1].trim())}return/^\!\s*/.test(R)?i.create(R.substr(1).trim()):f.create(R)}static _deserializeValue(R,H){if(R=R.trim(),R==="true")return!0;if(R==="false")return!1;let U=/^'([^']*)'$/.exec(R);return U?U[1].trim():R}static _deserializeRegexValue(R,H){if(Object(z.C)(R)){if(H)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let U=R.indexOf("/"),S=R.lastIndexOf("/");if(U===S||U<0){if(H)throw new Error(`bad regexp-value '${R}', missing /-enclosure`);return console.warn(`bad regexp-value '${R}', missing /-enclosure`),null}let G=R.slice(U+1,S),Q=R[S+1]==="i"?"i":"";try{return new RegExp(G,Q)}catch(se){if(H)throw new Error(`bad regexp-value '${R}', parse error: ${se}`);return console.warn(`bad regexp-value '${R}', parse error: ${se}`),null}}}function W(R,H){const U=R?R.substituteConstants():void 0,S=H?H.substituteConstants():void 0;return!U&&!S?!0:!U||!S?!1:U.equals(S)}function n(R,H){return R.cmp(H)}class I{constructor(){this.type=0}cmp(R){return this.type-R.type}equals(R){return R.type===this.type}substituteConstants(){return this}evaluate(R){return!1}serialize(){return"false"}keys(){return[]}negate(){return g.INSTANCE}}I.INSTANCE=new I;class g{constructor(){this.type=1}cmp(R){return this.type-R.type}equals(R){return R.type===this.type}substituteConstants(){return this}evaluate(R){return!0}serialize(){return"true"}keys(){return[]}negate(){return I.INSTANCE}}g.INSTANCE=new g;class f{constructor(R,H){this.key=R,this.negated=H,this.type=2}static create(R,H=null){const U=N.get(R);return typeof U=="boolean"?U?g.INSTANCE:I.INSTANCE:new f(R,H)}cmp(R){return R.type!==this.type?this.type-R.type:E(this.key,R.key)}equals(R){return R.type===this.type?this.key===R.key:!1}substituteConstants(){const R=N.get(this.key);return typeof R=="boolean"?R?g.INSTANCE:I.INSTANCE:this}evaluate(R){return!!R.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=i.create(this.key,this)),this.negated}}class h{constructor(R,H,U){this.key=R,this.value=H,this.negated=U,this.type=4}static create(R,H,U=null){if(typeof H=="boolean")return H?f.create(R,U):i.create(R,U);const S=N.get(R);if(typeof S=="boolean"){const G=S?"true":"false";return H===G?g.INSTANCE:I.INSTANCE}return new h(R,H,U)}cmp(R){return R.type!==this.type?this.type-R.type:v(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){const R=N.get(this.key);if(typeof R=="boolean"){const H=R?"true":"false";return this.value===H?g.INSTANCE:I.INSTANCE}return this}evaluate(R){return R.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=d.create(this.key,this.value,this)),this.negated}}class c{constructor(R,H){this.key=R,this.valueKey=H,this.type=10,this.negated=null}static create(R,H){return new c(R,H)}cmp(R){return R.type!==this.type?this.type-R.type:v(this.key,this.valueKey,R.key,R.valueKey)}equals(R){return R.type===this.type?this.key===R.key&&this.valueKey===R.valueKey:!1}substituteConstants(){return this}evaluate(R){const H=R.getValue(this.valueKey),U=R.getValue(this.key);return Array.isArray(H)?H.indexOf(U)>=0:typeof U=="string"&&typeof H=="object"&&H!==null?O.call(H,U):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=s.create(this)),this.negated}}class s{constructor(R){this._actual=R,this.type=11}static create(R){return new s(R)}cmp(R){return R.type!==this.type?this.type-R.type:this._actual.cmp(R._actual)}equals(R){return R.type===this.type?this._actual.equals(R._actual):!1}substituteConstants(){return this}evaluate(R){return!this._actual.evaluate(R)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class d{constructor(R,H,U){this.key=R,this.value=H,this.negated=U,this.type=5}static create(R,H,U=null){if(typeof H=="boolean")return H?i.create(R,U):f.create(R,U);const S=N.get(R);if(typeof S=="boolean"){const G=S?"true":"false";return H===G?I.INSTANCE:g.INSTANCE}return new d(R,H,U)}cmp(R){return R.type!==this.type?this.type-R.type:v(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){const R=N.get(this.key);if(typeof R=="boolean"){const H=R?"true":"false";return this.value===H?I.INSTANCE:g.INSTANCE}return this}evaluate(R){return R.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=h.create(this.key,this.value,this)),this.negated}}class i{constructor(R,H){this.key=R,this.negated=H,this.type=3}static create(R,H=null){const U=N.get(R);return typeof U=="boolean"?U?I.INSTANCE:g.INSTANCE:new i(R,H)}cmp(R){return R.type!==this.type?this.type-R.type:E(this.key,R.key)}equals(R){return R.type===this.type?this.key===R.key:!1}substituteConstants(){const R=N.get(this.key);return typeof R=="boolean"?R?I.INSTANCE:g.INSTANCE:this}evaluate(R){return!R.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=f.create(this.key,this)),this.negated}}function a(R,H){if(typeof R=="string"){const U=parseFloat(R);isNaN(U)||(R=U)}return typeof R=="string"||typeof R=="number"?H(R):I.INSTANCE}class r{constructor(R,H,U){this.key=R,this.value=H,this.negated=U,this.type=12}static create(R,H,U=null){return a(H,S=>new r(R,S,U))}cmp(R){return R.type!==this.type?this.type-R.type:v(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){return this}evaluate(R){return typeof this.value=="string"?!1:parseFloat(R.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=w.create(this.key,this.value,this)),this.negated}}class o{constructor(R,H,U){this.key=R,this.value=H,this.negated=U,this.type=13}static create(R,H,U=null){return a(H,S=>new o(R,S,U))}cmp(R){return R.type!==this.type?this.type-R.type:v(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){return this}evaluate(R){return typeof this.value=="string"?!1:parseFloat(R.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=T.create(this.key,this.value,this)),this.negated}}class T{constructor(R,H,U){this.key=R,this.value=H,this.negated=U,this.type=14}static create(R,H,U=null){return a(H,S=>new T(R,S,U))}cmp(R){return R.type!==this.type?this.type-R.type:v(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){return this}evaluate(R){return typeof this.value=="string"?!1:parseFloat(R.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=o.create(this.key,this.value,this)),this.negated}}class w{constructor(R,H,U){this.key=R,this.value=H,this.negated=U,this.type=15}static create(R,H,U=null){return a(H,S=>new w(R,S,U))}cmp(R){return R.type!==this.type?this.type-R.type:v(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){return this}evaluate(R){return typeof this.value=="string"?!1:parseFloat(R.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=r.create(this.key,this.value,this)),this.negated}}class x{constructor(R,H){this.key=R,this.regexp=H,this.type=7,this.negated=null}static create(R,H){return new x(R,H)}cmp(R){if(R.type!==this.type)return this.type-R.type;if(this.key<R.key)return-1;if(this.key>R.key)return 1;const H=this.regexp?this.regexp.source:"",U=R.regexp?R.regexp.source:"";return H<U?-1:H>U?1:0}equals(R){if(R.type===this.type){const H=this.regexp?this.regexp.source:"",U=R.regexp?R.regexp.source:"";return this.key===R.key&&H===U}return!1}substituteConstants(){return this}evaluate(R){let H=R.getValue(this.key);return this.regexp?this.regexp.test(H):!1}serialize(){const R=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${R}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=L.create(this)),this.negated}}class L{constructor(R){this._actual=R,this.type=8}static create(R){return new L(R)}cmp(R){return R.type!==this.type?this.type-R.type:this._actual.cmp(R._actual)}equals(R){return R.type===this.type?this._actual.equals(R._actual):!1}substituteConstants(){return this}evaluate(R){return!this._actual.evaluate(R)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function A(R){let H=null;for(let U=0,S=R.length;U<S;U++){const G=R[U].substituteConstants();if(R[U]!==G&&H===null){H=[];for(let Q=0;Q<U;Q++)H[Q]=R[Q]}H!==null&&(H[U]=G)}return H===null?R:H}class _{constructor(R,H){this.expr=R,this.negated=H,this.type=6}static create(R,H){return _._normalizeArr(R,H)}cmp(R){if(R.type!==this.type)return this.type-R.type;if(this.expr.length<R.expr.length)return-1;if(this.expr.length>R.expr.length)return 1;for(let H=0,U=this.expr.length;H<U;H++){const S=n(this.expr[H],R.expr[H]);if(S!==0)return S}return 0}equals(R){if(R.type===this.type){if(this.expr.length!==R.expr.length)return!1;for(let H=0,U=this.expr.length;H<U;H++)if(!this.expr[H].equals(R.expr[H]))return!1;return!0}return!1}substituteConstants(){const R=A(this.expr);return R===this.expr?this:_.create(R,this.negated)}evaluate(R){for(let H=0,U=this.expr.length;H<U;H++)if(!this.expr[H].evaluate(R))return!1;return!0}static _normalizeArr(R,H){const U=[];let S=!1;for(const G of R){if(!G)continue;if(G.type===1){S=!0;continue}if(G.type===0)return I.INSTANCE;if(G.type===6){U.push(...G.expr);continue}U.push(G)}if(U.length===0&&S)return g.INSTANCE;if(U.length===0)return;if(U.length===1)return U[0];U.sort(n);for(let G=1;G<U.length;G++)U[G-1].equals(U[G])&&(U.splice(G,1),G--);if(U.length===1)return U[0];for(;U.length>1;){const G=U[U.length-1];if(G.type!==9)break;U.pop();const Q=U.pop(),se=U.length===0,fe=b.create(G.expr.map(we=>_.create([we,Q],null)),null,se);fe&&(U.push(fe),U.sort(n))}return U.length===1?U[0]:new _(U,H)}serialize(){return this.expr.map(R=>R.serialize()).join(" && ")}keys(){const R=[];for(let H of this.expr)R.push(...H.keys());return R}negate(){if(!this.negated){const R=[];for(let H of this.expr)R.push(H.negate());this.negated=b.create(R,this,!0)}return this.negated}}class b{constructor(R,H){this.expr=R,this.negated=H,this.type=9}static create(R,H,U){return b._normalizeArr(R,H,U)}cmp(R){if(R.type!==this.type)return this.type-R.type;if(this.expr.length<R.expr.length)return-1;if(this.expr.length>R.expr.length)return 1;for(let H=0,U=this.expr.length;H<U;H++){const S=n(this.expr[H],R.expr[H]);if(S!==0)return S}return 0}equals(R){if(R.type===this.type){if(this.expr.length!==R.expr.length)return!1;for(let H=0,U=this.expr.length;H<U;H++)if(!this.expr[H].equals(R.expr[H]))return!1;return!0}return!1}substituteConstants(){const R=A(this.expr);return R===this.expr?this:b.create(R,this.negated,!1)}evaluate(R){for(let H=0,U=this.expr.length;H<U;H++)if(this.expr[H].evaluate(R))return!0;return!1}static _normalizeArr(R,H,U){let S=[],G=!1;if(R){for(let Q=0,se=R.length;Q<se;Q++){const fe=R[Q];if(!fe)continue;if(fe.type===0){G=!0;continue}if(fe.type===1)return g.INSTANCE;if(fe.type===9){S=S.concat(fe.expr);continue}S.push(fe)}if(S.length===0&&G)return I.INSTANCE;S.sort(n)}if(S.length===0)return;if(S.length===1)return S[0];for(let Q=1;Q<S.length;Q++)S[Q-1].equals(S[Q])&&(S.splice(Q,1),Q--);if(S.length===1)return S[0];if(U){for(let Q=0;Q<S.length;Q++)for(let se=Q+1;se<S.length;se++)P(S[Q],S[se])&&(S.splice(se,1),se--);if(S.length===1)return S[0]}return new b(S,H)}serialize(){return this.expr.map(R=>R.serialize()).join(" || ")}keys(){const R=[];for(let H of this.expr)R.push(...H.keys());return R}negate(){if(!this.negated){let R=[];for(let H of this.expr)R.push(H.negate());for(;R.length>1;){const H=R.shift(),U=R.shift(),S=[];for(const Q of F(H))for(const se of F(U))S.push(_.create([Q,se],null));const G=R.length===0;R.unshift(b.create(S,null,G))}this.negated=R[0]}return this.negated}}class m extends f{constructor(R,H,U){super(R,null);this._defaultValue=H,typeof U=="object"?m._info.push(Object.assign(Object.assign({},U),{key:R})):U!==!0&&m._info.push({key:R,description:U,type:H!=null?typeof H:void 0})}static all(){return m._info.values()}bindTo(R){return R.createKey(this.key,this._defaultValue)}getValue(R){return R.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(R){return h.create(this.key,R)}}m._info=[];const p=Object(D.c)("contextKeyService"),C="setContext";function E(R,H){return R<H?-1:R>H?1:0}function v(R,H,U,S){return R<U?-1:R>U?1:H<S?-1:H>S?1:0}function P(R,H){if(H.type===6&&R.type!==9&&R.type!==6){for(const G of H.expr)if(R.equals(G))return!0}const U=R.negate(),S=F(U).concat(F(H));S.sort(n);for(let G=0;G<S.length;G++){const Q=S[G],se=Q.negate();for(let fe=G+1;fe<S.length;fe++){const we=S[fe];if(se.equals(we))return!0}}return!1}function F(R){return R.type===9?R.expr:[R]}},TXwP:function(Ue,de,M){var J,z;(function(){var D;(function(){"use strict";var N=[,,function(n){function I(h){this.__parent=h,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=[]}I.prototype.clone_empty=function(){var h=new I(this.__parent);return h.set_indent(this.__indent_count,this.__alignment_count),h},I.prototype.item=function(h){return h<0?this.__items[this.__items.length+h]:this.__items[h]},I.prototype.has_match=function(h){for(var c=this.__items.length-1;c>=0;c--)if(this.__items[c].match(h))return!0;return!1},I.prototype.set_indent=function(h,c){this.is_empty()&&(this.__indent_count=h||0,this.__alignment_count=c||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 h=this.__parent.current_line;return h.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),h.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),h.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,h.__items[0]===" "&&(h.__items.splice(0,1),h.__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(h){this.__items.push(h);var c=h.lastIndexOf(`
`);c!==-1?this.__character_count=h.length-c:this.__character_count+=h.length},I.prototype.pop=function(){var h=null;return this.is_empty()||(h=this.__items.pop(),this.__character_count-=h.length),h},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 h="";return this.is_empty()?this.__parent.indent_empty_lines&&(h=this.__parent.get_indent_string(this.__indent_count)):(h=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),h+=this.__items.join("")),h};function g(h,c){this.__cache=[""],this.__indent_size=h.indent_size,this.__indent_string=h.indent_char,h.indent_with_tabs||(this.__indent_string=new Array(h.indent_size+1).join(h.indent_char)),c=c||"",h.indent_level>0&&(c=new Array(h.indent_level+1).join(this.__indent_string)),this.__base_string=c,this.__base_string_length=c.length}g.prototype.get_indent_size=function(h,c){var s=this.__base_string_length;return c=c||0,h<0&&(s=0),s+=h*this.__indent_size,s+=c,s},g.prototype.get_indent_string=function(h,c){var s=this.__base_string;return c=c||0,h<0&&(h=0,s=""),c+=h*this.__indent_size,this.__ensure_cache(c),s+=this.__cache[c],s},g.prototype.__ensure_cache=function(h){for(;h>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var h=this.__cache.length,c=0,s="";this.__indent_size&&h>=this.__indent_size&&(c=Math.floor(h/this.__indent_size),h-=c*this.__indent_size,s=new Array(c+1).join(this.__indent_string)),h&&(s+=new Array(h+1).join(" ")),this.__cache.push(s)};function f(h,c){this.__indent_cache=new g(h,c),this.raw=!1,this._end_with_newline=h.end_with_newline,this.indent_size=h.indent_size,this.wrap_line_length=h.wrap_line_length,this.indent_empty_lines=h.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(h,c){return this.__indent_cache.get_indent_string(h,c)},f.prototype.get_indent_size=function(h,c){return this.__indent_cache.get_indent_size(h,c)},f.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},f.prototype.add_new_line=function(h){return this.is_empty()||!h&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},f.prototype.get_code=function(h){this.trim(!0);var c=this.current_line.pop();c&&(c[c.length-1]===`
`&&(c=c.replace(/\n+$/g,"")),this.current_line.push(c)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(`
`);return h!==`
`&&(s=s.replace(/[\n]/g,h)),s},f.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},f.prototype.set_indent=function(h,c){return h=h||0,c=c||0,this.next_line.set_indent(h,c),this.__lines.length>1?(this.current_line.set_indent(h,c),!0):(this.current_line.set_indent(),!1)},f.prototype.add_raw_token=function(h){for(var c=0;c<h.newlines;c++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(h.whitespace_before),this.current_line.push(h.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},f.prototype.add_token=function(h){this.__add_space_before_token(),this.current_line.push(h),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},f.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},f.prototype.remove_indent=function(h){for(var c=this.__lines.length;h<c;)this.__lines[h]._remove_indent(),h++;this.current_line._remove_wrap_indent()},f.prototype.trim=function(h){for(h=h===void 0?!1:h,this.current_line.trim();h&&this.__lines.length>1&&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(h,c){for(var s=this.__lines.length-2;s>=0;){var d=this.__lines[s];if(d.is_empty())break;if(d.item(0).indexOf(h)!==0&&d.item(-1)!==c){this.__lines.splice(s+1,0,new I(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},n.exports.Output=f},,,,function(n){function I(h,c){this.raw_options=g(h,c),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(h,c){var s=this.raw_options[h],d=c||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(d=s.concat()):typeof s=="string"&&(d=s.split(/[^a-zA-Z0-9_\/\-]+/)),d},I.prototype._get_boolean=function(h,c){var s=this.raw_options[h],d=s===void 0?!!c:!!s;return d},I.prototype._get_characters=function(h,c){var s=this.raw_options[h],d=c||"";return typeof s=="string"&&(d=s.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),d},I.prototype._get_number=function(h,c){var s=this.raw_options[h];c=parseInt(c,10),isNaN(c)&&(c=0);var d=parseInt(s,10);return isNaN(d)&&(d=c),d},I.prototype._get_selection=function(h,c,s){var d=this._get_selection_list(h,c,s);if(d.length!==1)throw new Error("Invalid Option Value: The option '"+h+`' can only be one of the following values:
`+c+`
You passed in: '`+this.raw_options[h]+"'");return d[0]},I.prototype._get_selection_list=function(h,c,s){if(!c||c.length===0)throw new Error("Selection list cannot be empty.");if(s=s||[c[0]],!this._is_valid_selection(s,c))throw new Error("Invalid Default Value!");var d=this._get_array(h,s);if(!this._is_valid_selection(d,c))throw new Error("Invalid Option Value: The option '"+h+`' can contain only the following values:
`+c+`
You passed in: '`+this.raw_options[h]+"'");return d},I.prototype._is_valid_selection=function(h,c){return h.length&&c.length&&!h.some(function(s){return c.indexOf(s)===-1})};function g(h,c){var s={};h=f(h);var d;for(d in h)d!==c&&(s[d]=h[d]);if(c&&h[c])for(d in h[c])s[d]=h[c][d];return s}function f(h){var c={},s;for(s in h){var d=s.replace(/-/g,"_");c[d]=h[s]}return c}n.exports.Options=I,n.exports.normalizeOpts=f,n.exports.mergeOpts=g},,function(n){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<this.__input_length},g.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__input.charAt(this.__position),this.__position+=1),f},g.prototype.peek=function(f){var h=null;return f=f||0,f+=this.__position,f>=0&&f<this.__input_length&&(h=this.__input.charAt(f)),h},g.prototype.__match=function(f,h){f.lastIndex=h;var c=f.exec(this.__input);return c&&!(I&&f.sticky)&&(c.index!==h&&(c=null)),c},g.prototype.test=function(f,h){return h=h||0,h+=this.__position,h>=0&&h<this.__input_length?!!this.__match(f,h):!1},g.prototype.testChar=function(f,h){var c=this.peek(h);return f.lastIndex=0,c!==null&&f.test(c)},g.prototype.match=function(f){var h=this.__match(f,this.__position);return h?this.__position+=h[0].length:h=null,h},g.prototype.read=function(f,h,c){var s="",d;return f&&(d=this.match(f),d&&(s+=d[0])),h&&(d||!f)&&(s+=this.readUntil(h,c)),s},g.prototype.readUntil=function(f,h){var c="",s=this.__position;f.lastIndex=this.__position;var d=f.exec(this.__input);return d?(s=d.index,h&&(s+=d[0].length)):s=this.__input_length,c=this.__input.substring(this.__position,s),this.__position=s,c},g.prototype.readUntilAfter=function(f){return this.readUntil(f,!0)},g.prototype.get_regexp=function(f,h){var c=null,s="g";return h&&I&&(s="y"),typeof f=="string"&&f!==""?c=new RegExp(f,s):f&&(c=new RegExp(f.source,s)),c},g.prototype.get_literal_regexp=function(f){return RegExp(f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(f){var h=this.__position,c=this.readUntilAfter(f);return this.__position=h,c},g.prototype.lookBack=function(f){var h=this.__position-1;return h>=f.length&&this.__input.substring(h-f.length,h).toLowerCase()===f},n.exports.InputScanner=g},,,,,function(n){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 h=this.__directive_pattern.exec(g);h;)f[h[1]]=h[2],h=this.__directive_pattern.exec(g);return f},I.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=I},,function(n,I,g){var f=g(16).Beautifier,h=g(17).Options;function c(s,d){var i=new f(s,d);return i.beautify()}n.exports=c,n.exports.defaultOptions=function(){return new h}},function(n,I,g){var f=g(17).Options,h=g(2).Output,c=g(8).InputScanner,s=g(13).Directives,d=new s(/\/\*/,/\*\//),i=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,r=/\s/,o=/(?:\s|\n)+/g,T=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,w=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function x(L,A){this._source_text=L||"",this._options=new f(A),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(L){var A="";for(this._ch=this._input.next();this._ch;){if(A+=this._ch,this._ch==="\\")A+=this._input.next();else if(L.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return A},x.prototype.eatWhitespace=function(L){for(var A=r.test(this._input.peek()),_=0;r.test(this._input.peek());)this._ch=this._input.next(),L&&this._ch===`
`&&((_===0||_<this._options.max_preserve_newlines)&&(_++,this._output.add_new_line(!0)));return A},x.prototype.foundNestedPseudoClass=function(){for(var L=0,A=1,_=this._input.peek(A);_;){if(_==="{")return!0;if(_==="(")L+=1;else if(_===")"){if(L===0)return!1;L-=1}else if(_===";"||_==="}")return!1;A++,_=this._input.peek(A)}return!1},x.prototype.print_string=function(L){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(L)},x.prototype.preserveSingleSpace=function(L){L&&(this._output.space_before_token=!0)},x.prototype.indent=function(){this._indentLevel++},x.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},x.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var L=this._source_text,A=this._options.eol;A==="auto"&&(A=`
`,L&&i.test(L||"")&&(A=L.match(i)[0])),L=L.replace(a,`
`);var _=L.match(/^[\t ]*/)[0];this._output=new h(this._options,_),this._input=new c(L),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var b=0,m=!1,p=!1,C=!1,E=!1,v=!1,P=!1,F=this._ch,R=!1,H,U,S;H=this._input.read(o),U=H!=="",S=F,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),F=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var G=this._input.read(T),Q=d.get_directives(G);Q&&Q.ignore==="start"&&(G+=d.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(w)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(U),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var se=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);se.match(/[ :]$/)&&(se=this.eatString(": ").replace(/\s$/,""),this.print_string(se),this._output.space_before_token=!0),se=se.replace(/\s$/,""),se==="extend"?E=!0:se==="import"&&(v=!0),se in this.NESTED_AT_RULE?(this._nestedLevel+=1,se in this.CONDITIONAL_GROUP_RULE&&(C=!0)):!m&&b===0&&se.indexOf(":")!==-1&&(p=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(U),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")p&&(p=!1,this.outdent()),C?(C=!1,m=this._indentLevel>=this._nestedLevel):m=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&m&&(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)):(S==="("?this._output.space_before_token=!1:S!==","&&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(),S==="{"&&this._output.trim(!0),v=!1,E=!1,p&&(this.outdent(),p=!1),this.print_string(this._ch),m=!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 fe=0;fe<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;fe++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[fe])){R=!0;break}(m||C)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!E&&b===0?(this.print_string(":"),p||(p=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var we=S==='"'||S==="'";this.preserveSingleSpace(we||U),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")R=!1,b===0?(p&&(this.outdent(),p=!1),E=!1,v=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),b++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),b&&(b--,this.outdent()));else{var be=!1;this._input.lookBack("with")&&(be=!0),this.preserveSingleSpace(U||be),this.print_string(this._ch),p&&S==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),P=!0):(this.eatWhitespace(),b++,this.indent())}else if(this._ch===")")b&&(b--,this.outdent()),P&&this._input.peek()===";"&&this._options.selector_separator_newline&&(P=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!p||P)&&b===0&&!v&&!E?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!p&&b===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&&r.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(U),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),r.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 Se=S==='"'||S==="'";this.preserveSingleSpace(Se||U),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&R&&this._output.add_new_line()}var Ae=this._output.get_code(A);return Ae},n.exports.Beautifier=x},function(n,I,g){var f=g(6).Options;function h(c){f.call(this,c,"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 d=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var i=0;i<d.length;i++)d[i]!=="expand"?this.brace_style="collapse":this.brace_style=d[i]}h.prototype=new f,n.exports.Options=h}],O={};function K(n){var I=O[n];if(I!==void 0)return I.exports;var g=O[n]={exports:{}};return N[n](g,g.exports,K),g.exports}var W=K(15);D=W})();var V=D;!(J=[],z=function(){return{css_beautify:V}}.apply(de,J),z!==void 0&&(Ue.exports=z))})()},U7T7:function(Ue,de,M){},UZu5:function(Ue,de,M){},Vhoy:function(Ue,de,M){"use strict";M.d(de,"d",function(){return V}),M.d(de,"e",function(){return N}),M.d(de,"c",function(){return O}),M.d(de,"b",function(){return K}),M.d(de,"a",function(){return W});var J=M("MI8n");class z{constructor(){this._icons=new Map,this._onDidRegister=new J.b}add(n){const I=this._icons.get(n.id);I?n.description?I.description=n.description:console.error(`Duplicate registration of codicon ${n.id}`):(this._icons.set(n.id,n),this._onDidRegister.fire(n))}get(n){return this._icons.get(n)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const D=new z,V=D;function N(n,I){return new K(n,I)}function O(n){return n?n.replace(/\$\((.*?)\)/g,(I,g)=>` ${g} `).trim():""}class K{constructor(n,I,g){this.id=n,this.definition=I,this.description=g,D.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var W;(function(n){n.iconNameSegment="[A-Za-z0-9]+",n.iconNameExpression="[A-Za-z0-9\\-]+",n.iconModifierExpression="~[A-Za-z]+";const I=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function g(c){if(c instanceof K)return["codicon","codicon-"+c.id];const s=I.exec(c.id);if(!s)return g(K.error);let[,d,i]=s;const a=["codicon","codicon-"+d];return i&&a.push("codicon-modifier-"+i.substr(1)),a}n.asClassNameArray=g;function f(c){return g(c).join(" ")}n.asClassName=f;function h(c){return"."+g(c).join(".")}n.asCSSSelector=h})(W||(W={})),function(n){n.add=new n("add",{fontCharacter:"\\ea60"}),n.plus=new n("plus",n.add.definition),n.gistNew=new n("gist-new",n.add.definition),n.repoCreate=new n("repo-create",n.add.definition),n.lightbulb=new n("lightbulb",{fontCharacter:"\\ea61"}),n.lightBulb=new n("light-bulb",{fontCharacter:"\\ea61"}),n.repo=new n("repo",{fontCharacter:"\\ea62"}),n.repoDelete=new n("repo-delete",{fontCharacter:"\\ea62"}),n.gistFork=new n("gist-fork",{fontCharacter:"\\ea63"}),n.repoForked=new n("repo-forked",{fontCharacter:"\\ea63"}),n.gitPullRequest=new n("git-pull-request",{fontCharacter:"\\ea64"}),n.gitPullRequestAbandoned=new n("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),n.recordKeys=new n("record-keys",{fontCharacter:"\\ea65"}),n.keyboard=new n("keyboard",{fontCharacter:"\\ea65"}),n.tag=new n("tag",{fontCharacter:"\\ea66"}),n.tagAdd=new n("tag-add",{fontCharacter:"\\ea66"}),n.tagRemove=new n("tag-remove",{fontCharacter:"\\ea66"}),n.person=new n("person",{fontCharacter:"\\ea67"}),n.personFollow=new n("person-follow",{fontCharacter:"\\ea67"}),n.personOutline=new n("person-outline",{fontCharacter:"\\ea67"}),n.personFilled=new n("person-filled",{fontCharacter:"\\ea67"}),n.gitBranch=new n("git-branch",{fontCharacter:"\\ea68"}),n.gitBranchCreate=new n("git-branch-create",{fontCharacter:"\\ea68"}),n.gitBranchDelete=new n("git-branch-delete",{fontCharacter:"\\ea68"}),n.sourceControl=new n("source-control",{fontCharacter:"\\ea68"}),n.mirror=new n("mirror",{fontCharacter:"\\ea69"}),n.mirrorPublic=new n("mirror-public",{fontCharacter:"\\ea69"}),n.star=new n("star",{fontCharacter:"\\ea6a"}),n.starAdd=new n("star-add",{fontCharacter:"\\ea6a"}),n.starDelete=new n("star-delete",{fontCharacter:"\\ea6a"}),n.starEmpty=new n("star-empty",{fontCharacter:"\\ea6a"}),n.comment=new n("comment",{fontCharacter:"\\ea6b"}),n.commentAdd=new n("comment-add",{fontCharacter:"\\ea6b"}),n.alert=new n("alert",{fontCharacter:"\\ea6c"}),n.warning=new n("warning",{fontCharacter:"\\ea6c"}),n.search=new n("search",{fontCharacter:"\\ea6d"}),n.searchSave=new n("search-save",{fontCharacter:"\\ea6d"}),n.logOut=new n("log-out",{fontCharacter:"\\ea6e"}),n.signOut=new n("sign-out",{fontCharacter:"\\ea6e"}),n.logIn=new n("log-in",{fontCharacter:"\\ea6f"}),n.signIn=new n("sign-in",{fontCharacter:"\\ea6f"}),n.eye=new n("eye",{fontCharacter:"\\ea70"}),n.eyeUnwatch=new n("eye-unwatch",{fontCharacter:"\\ea70"}),n.eyeWatch=new n("eye-watch",{fontCharacter:"\\ea70"}),n.circleFilled=new n("circle-filled",{fontCharacter:"\\ea71"}),n.primitiveDot=new n("primitive-dot",{fontCharacter:"\\ea71"}),n.closeDirty=new n("close-dirty",{fontCharacter:"\\ea71"}),n.debugBreakpoint=new n("debug-breakpoint",{fontCharacter:"\\ea71"}),n.debugBreakpointDisabled=new n("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),n.debugHint=new n("debug-hint",{fontCharacter:"\\ea71"}),n.primitiveSquare=new n("primitive-square",{fontCharacter:"\\ea72"}),n.edit=new n("edit",{fontCharacter:"\\ea73"}),n.pencil=new n("pencil",{fontCharacter:"\\ea73"}),n.info=new n("info",{fontCharacter:"\\ea74"}),n.issueOpened=new n("issue-opened",{fontCharacter:"\\ea74"}),n.gistPrivate=new n("gist-private",{fontCharacter:"\\ea75"}),n.gitForkPrivate=new n("git-fork-private",{fontCharacter:"\\ea75"}),n.lock=new n("lock",{fontCharacter:"\\ea75"}),n.mirrorPrivate=new n("mirror-private",{fontCharacter:"\\ea75"}),n.close=new n("close",{fontCharacter:"\\ea76"}),n.removeClose=new n("remove-close",{fontCharacter:"\\ea76"}),n.x=new n("x",{fontCharacter:"\\ea76"}),n.repoSync=new n("repo-sync",{fontCharacter:"\\ea77"}),n.sync=new n("sync",{fontCharacter:"\\ea77"}),n.clone=new n("clone",{fontCharacter:"\\ea78"}),n.desktopDownload=new n("desktop-download",{fontCharacter:"\\ea78"}),n.beaker=new n("beaker",{fontCharacter:"\\ea79"}),n.microscope=new n("microscope",{fontCharacter:"\\ea79"}),n.vm=new n("vm",{fontCharacter:"\\ea7a"}),n.deviceDesktop=new n("device-desktop",{fontCharacter:"\\ea7a"}),n.file=new n("file",{fontCharacter:"\\ea7b"}),n.fileText=new n("file-text",{fontCharacter:"\\ea7b"}),n.more=new n("more",{fontCharacter:"\\ea7c"}),n.ellipsis=new n("ellipsis",{fontCharacter:"\\ea7c"}),n.kebabHorizontal=new n("kebab-horizontal",{fontCharacter:"\\ea7c"}),n.mailReply=new n("mail-reply",{fontCharacter:"\\ea7d"}),n.reply=new n("reply",{fontCharacter:"\\ea7d"}),n.organization=new n("organization",{fontCharacter:"\\ea7e"}),n.organizationFilled=new n("organization-filled",{fontCharacter:"\\ea7e"}),n.organizationOutline=new n("organization-outline",{fontCharacter:"\\ea7e"}),n.newFile=new n("new-file",{fontCharacter:"\\ea7f"}),n.fileAdd=new n("file-add",{fontCharacter:"\\ea7f"}),n.newFolder=new n("new-folder",{fontCharacter:"\\ea80"}),n.fileDirectoryCreate=new n("file-directory-create",{fontCharacter:"\\ea80"}),n.trash=new n("trash",{fontCharacter:"\\ea81"}),n.trashcan=new n("trashcan",{fontCharacter:"\\ea81"}),n.history=new n("history",{fontCharacter:"\\ea82"}),n.clock=new n("clock",{fontCharacter:"\\ea82"}),n.folder=new n("folder",{fontCharacter:"\\ea83"}),n.fileDirectory=new n("file-directory",{fontCharacter:"\\ea83"}),n.symbolFolder=new n("symbol-folder",{fontCharacter:"\\ea83"}),n.logoGithub=new n("logo-github",{fontCharacter:"\\ea84"}),n.markGithub=new n("mark-github",{fontCharacter:"\\ea84"}),n.github=new n("github",{fontCharacter:"\\ea84"}),n.terminal=new n("terminal",{fontCharacter:"\\ea85"}),n.console=new n("console",{fontCharacter:"\\ea85"}),n.repl=new n("repl",{fontCharacter:"\\ea85"}),n.zap=new n("zap",{fontCharacter:"\\ea86"}),n.symbolEvent=new n("symbol-event",{fontCharacter:"\\ea86"}),n.error=new n("error",{fontCharacter:"\\ea87"}),n.stop=new n("stop",{fontCharacter:"\\ea87"}),n.variable=new n("variable",{fontCharacter:"\\ea88"}),n.symbolVariable=new n("symbol-variable",{fontCharacter:"\\ea88"}),n.array=new n("array",{fontCharacter:"\\ea8a"}),n.symbolArray=new n("symbol-array",{fontCharacter:"\\ea8a"}),n.symbolModule=new n("symbol-module",{fontCharacter:"\\ea8b"}),n.symbolPackage=new n("symbol-package",{fontCharacter:"\\ea8b"}),n.symbolNamespace=new n("symbol-namespace",{fontCharacter:"\\ea8b"}),n.symbolObject=new n("symbol-object",{fontCharacter:"\\ea8b"}),n.symbolMethod=new n("symbol-method",{fontCharacter:"\\ea8c"}),n.symbolFunction=new n("symbol-function",{fontCharacter:"\\ea8c"}),n.symbolConstructor=new n("symbol-constructor",{fontCharacter:"\\ea8c"}),n.symbolBoolean=new n("symbol-boolean",{fontCharacter:"\\ea8f"}),n.symbolNull=new n("symbol-null",{fontCharacter:"\\ea8f"}),n.symbolNumeric=new n("symbol-numeric",{fontCharacter:"\\ea90"}),n.symbolNumber=new n("symbol-number",{fontCharacter:"\\ea90"}),n.symbolStructure=new n("symbol-structure",{fontCharacter:"\\ea91"}),n.symbolStruct=new n("symbol-struct",{fontCharacter:"\\ea91"}),n.symbolParameter=new n("symbol-parameter",{fontCharacter:"\\ea92"}),n.symbolTypeParameter=new n("symbol-type-parameter",{fontCharacter:"\\ea92"}),n.symbolKey=new n("symbol-key",{fontCharacter:"\\ea93"}),n.symbolText=new n("symbol-text",{fontCharacter:"\\ea93"}),n.symbolReference=new n("symbol-reference",{fontCharacter:"\\ea94"}),n.goToFile=new n("go-to-file",{fontCharacter:"\\ea94"}),n.symbolEnum=new n("symbol-enum",{fontCharacter:"\\ea95"}),n.symbolValue=new n("symbol-value",{fontCharacter:"\\ea95"}),n.symbolRuler=new n("symbol-ruler",{fontCharacter:"\\ea96"}),n.symbolUnit=new n("symbol-unit",{fontCharacter:"\\ea96"}),n.activateBreakpoints=new n("activate-breakpoints",{fontCharacter:"\\ea97"}),n.archive=new n("archive",{fontCharacter:"\\ea98"}),n.arrowBoth=new n("arrow-both",{fontCharacter:"\\ea99"}),n.arrowDown=new n("arrow-down",{fontCharacter:"\\ea9a"}),n.arrowLeft=new n("arrow-left",{fontCharacter:"\\ea9b"}),n.arrowRight=new n("arrow-right",{fontCharacter:"\\ea9c"}),n.arrowSmallDown=new n("arrow-small-down",{fontCharacter:"\\ea9d"}),n.arrowSmallLeft=new n("arrow-small-left",{fontCharacter:"\\ea9e"}),n.arrowSmallRight=new n("arrow-small-right",{fontCharacter:"\\ea9f"}),n.arrowSmallUp=new n("arrow-small-up",{fontCharacter:"\\eaa0"}),n.arrowUp=new n("arrow-up",{fontCharacter:"\\eaa1"}),n.bell=new n("bell",{fontCharacter:"\\eaa2"}),n.bold=new n("bold",{fontCharacter:"\\eaa3"}),n.book=new n("book",{fontCharacter:"\\eaa4"}),n.bookmark=new n("bookmark",{fontCharacter:"\\eaa5"}),n.debugBreakpointConditionalUnverified=new n("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),n.debugBreakpointConditional=new n("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),n.debugBreakpointConditionalDisabled=new n("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),n.debugBreakpointDataUnverified=new n("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),n.debugBreakpointData=new n("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),n.debugBreakpointDataDisabled=new n("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),n.debugBreakpointLogUnverified=new n("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),n.debugBreakpointLog=new n("debug-breakpoint-log",{fontCharacter:"\\eaab"}),n.debugBreakpointLogDisabled=new n("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),n.briefcase=new n("briefcase",{fontCharacter:"\\eaac"}),n.broadcast=new n("broadcast",{fontCharacter:"\\eaad"}),n.browser=new n("browser",{fontCharacter:"\\eaae"}),n.bug=new n("bug",{fontCharacter:"\\eaaf"}),n.calendar=new n("calendar",{fontCharacter:"\\eab0"}),n.caseSensitive=new n("case-sensitive",{fontCharacter:"\\eab1"}),n.check=new n("check",{fontCharacter:"\\eab2"}),n.checklist=new n("checklist",{fontCharacter:"\\eab3"}),n.chevronDown=new n("chevron-down",{fontCharacter:"\\eab4"}),n.dropDownButton=new n("drop-down-button",n.chevronDown.definition),n.chevronLeft=new n("chevron-left",{fontCharacter:"\\eab5"}),n.chevronRight=new n("chevron-right",{fontCharacter:"\\eab6"}),n.chevronUp=new n("chevron-up",{fontCharacter:"\\eab7"}),n.chromeClose=new n("chrome-close",{fontCharacter:"\\eab8"}),n.chromeMaximize=new n("chrome-maximize",{fontCharacter:"\\eab9"}),n.chromeMinimize=new n("chrome-minimize",{fontCharacter:"\\eaba"}),n.chromeRestore=new n("chrome-restore",{fontCharacter:"\\eabb"}),n.circleOutline=new n("circle-outline",{fontCharacter:"\\eabc"}),n.debugBreakpointUnverified=new n("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),n.circleSlash=new n("circle-slash",{fontCharacter:"\\eabd"}),n.circuitBoard=new n("circuit-board",{fontCharacter:"\\eabe"}),n.clearAll=new n("clear-all",{fontCharacter:"\\eabf"}),n.clippy=new n("clippy",{fontCharacter:"\\eac0"}),n.closeAll=new n("close-all",{fontCharacter:"\\eac1"}),n.cloudDownload=new n("cloud-download",{fontCharacter:"\\eac2"}),n.cloudUpload=new n("cloud-upload",{fontCharacter:"\\eac3"}),n.code=new n("code",{fontCharacter:"\\eac4"}),n.collapseAll=new n("collapse-all",{fontCharacter:"\\eac5"}),n.colorMode=new n("color-mode",{fontCharacter:"\\eac6"}),n.commentDiscussion=new n("comment-discussion",{fontCharacter:"\\eac7"}),n.compareChanges=new n("compare-changes",{fontCharacter:"\\eafd"}),n.creditCard=new n("credit-card",{fontCharacter:"\\eac9"}),n.dash=new n("dash",{fontCharacter:"\\eacc"}),n.dashboard=new n("dashboard",{fontCharacter:"\\eacd"}),n.database=new n("database",{fontCharacter:"\\eace"}),n.debugContinue=new n("debug-continue",{fontCharacter:"\\eacf"}),n.debugDisconnect=new n("debug-disconnect",{fontCharacter:"\\ead0"}),n.debugPause=new n("debug-pause",{fontCharacter:"\\ead1"}),n.debugRestart=new n("debug-restart",{fontCharacter:"\\ead2"}),n.debugStart=new n("debug-start",{fontCharacter:"\\ead3"}),n.debugStepInto=new n("debug-step-into",{fontCharacter:"\\ead4"}),n.debugStepOut=new n("debug-step-out",{fontCharacter:"\\ead5"}),n.debugStepOver=new n("debug-step-over",{fontCharacter:"\\ead6"}),n.debugStop=new n("debug-stop",{fontCharacter:"\\ead7"}),n.debug=new n("debug",{fontCharacter:"\\ead8"}),n.deviceCameraVideo=new n("device-camera-video",{fontCharacter:"\\ead9"}),n.deviceCamera=new n("device-camera",{fontCharacter:"\\eada"}),n.deviceMobile=new n("device-mobile",{fontCharacter:"\\eadb"}),n.diffAdded=new n("diff-added",{fontCharacter:"\\eadc"}),n.diffIgnored=new n("diff-ignored",{fontCharacter:"\\eadd"}),n.diffModified=new n("diff-modified",{fontCharacter:"\\eade"}),n.diffRemoved=new n("diff-removed",{fontCharacter:"\\eadf"}),n.diffRenamed=new n("diff-renamed",{fontCharacter:"\\eae0"}),n.diff=new n("diff",{fontCharacter:"\\eae1"}),n.discard=new n("discard",{fontCharacter:"\\eae2"}),n.editorLayout=new n("editor-layout",{fontCharacter:"\\eae3"}),n.emptyWindow=new n("empty-window",{fontCharacter:"\\eae4"}),n.exclude=new n("exclude",{fontCharacter:"\\eae5"}),n.extensions=new n("extensions",{fontCharacter:"\\eae6"}),n.eyeClosed=new n("eye-closed",{fontCharacter:"\\eae7"}),n.fileBinary=new n("file-binary",{fontCharacter:"\\eae8"}),n.fileCode=new n("file-code",{fontCharacter:"\\eae9"}),n.fileMedia=new n("file-media",{fontCharacter:"\\eaea"}),n.filePdf=new n("file-pdf",{fontCharacter:"\\eaeb"}),n.fileSubmodule=new n("file-submodule",{fontCharacter:"\\eaec"}),n.fileSymlinkDirectory=new n("file-symlink-directory",{fontCharacter:"\\eaed"}),n.fileSymlinkFile=new n("file-symlink-file",{fontCharacter:"\\eaee"}),n.fileZip=new n("file-zip",{fontCharacter:"\\eaef"}),n.files=new n("files",{fontCharacter:"\\eaf0"}),n.filter=new n("filter",{fontCharacter:"\\eaf1"}),n.flame=new n("flame",{fontCharacter:"\\eaf2"}),n.foldDown=new n("fold-down",{fontCharacter:"\\eaf3"}),n.foldUp=new n("fold-up",{fontCharacter:"\\eaf4"}),n.fold=new n("fold",{fontCharacter:"\\eaf5"}),n.folderActive=new n("folder-active",{fontCharacter:"\\eaf6"}),n.folderOpened=new n("folder-opened",{fontCharacter:"\\eaf7"}),n.gear=new n("gear",{fontCharacter:"\\eaf8"}),n.gift=new n("gift",{fontCharacter:"\\eaf9"}),n.gistSecret=new n("gist-secret",{fontCharacter:"\\eafa"}),n.gist=new n("gist",{fontCharacter:"\\eafb"}),n.gitCommit=new n("git-commit",{fontCharacter:"\\eafc"}),n.gitCompare=new n("git-compare",{fontCharacter:"\\eafd"}),n.gitMerge=new n("git-merge",{fontCharacter:"\\eafe"}),n.githubAction=new n("github-action",{fontCharacter:"\\eaff"}),n.githubAlt=new n("github-alt",{fontCharacter:"\\eb00"}),n.globe=new n("globe",{fontCharacter:"\\eb01"}),n.grabber=new n("grabber",{fontCharacter:"\\eb02"}),n.graph=new n("graph",{fontCharacter:"\\eb03"}),n.gripper=new n("gripper",{fontCharacter:"\\eb04"}),n.heart=new n("heart",{fontCharacter:"\\eb05"}),n.home=new n("home",{fontCharacter:"\\eb06"}),n.horizontalRule=new n("horizontal-rule",{fontCharacter:"\\eb07"}),n.hubot=new n("hubot",{fontCharacter:"\\eb08"}),n.inbox=new n("inbox",{fontCharacter:"\\eb09"}),n.issueClosed=new n("issue-closed",{fontCharacter:"\\eba4"}),n.issueReopened=new n("issue-reopened",{fontCharacter:"\\eb0b"}),n.issues=new n("issues",{fontCharacter:"\\eb0c"}),n.italic=new n("italic",{fontCharacter:"\\eb0d"}),n.jersey=new n("jersey",{fontCharacter:"\\eb0e"}),n.json=new n("json",{fontCharacter:"\\eb0f"}),n.kebabVertical=new n("kebab-vertical",{fontCharacter:"\\eb10"}),n.key=new n("key",{fontCharacter:"\\eb11"}),n.law=new n("law",{fontCharacter:"\\eb12"}),n.lightbulbAutofix=new n("lightbulb-autofix",{fontCharacter:"\\eb13"}),n.linkExternal=new n("link-external",{fontCharacter:"\\eb14"}),n.link=new n("link",{fontCharacter:"\\eb15"}),n.listOrdered=new n("list-ordered",{fontCharacter:"\\eb16"}),n.listUnordered=new n("list-unordered",{fontCharacter:"\\eb17"}),n.liveShare=new n("live-share",{fontCharacter:"\\eb18"}),n.loading=new n("loading",{fontCharacter:"\\eb19"}),n.location=new n("location",{fontCharacter:"\\eb1a"}),n.mailRead=new n("mail-read",{fontCharacter:"\\eb1b"}),n.mail=new n("mail",{fontCharacter:"\\eb1c"}),n.markdown=new n("markdown",{fontCharacter:"\\eb1d"}),n.megaphone=new n("megaphone",{fontCharacter:"\\eb1e"}),n.mention=new n("mention",{fontCharacter:"\\eb1f"}),n.milestone=new n("milestone",{fontCharacter:"\\eb20"}),n.mortarBoard=new n("mortar-board",{fontCharacter:"\\eb21"}),n.move=new n("move",{fontCharacter:"\\eb22"}),n.multipleWindows=new n("multiple-windows",{fontCharacter:"\\eb23"}),n.mute=new n("mute",{fontCharacter:"\\eb24"}),n.noNewline=new n("no-newline",{fontCharacter:"\\eb25"}),n.note=new n("note",{fontCharacter:"\\eb26"}),n.octoface=new n("octoface",{fontCharacter:"\\eb27"}),n.openPreview=new n("open-preview",{fontCharacter:"\\eb28"}),n.package_=new n("package",{fontCharacter:"\\eb29"}),n.paintcan=new n("paintcan",{fontCharacter:"\\eb2a"}),n.pin=new n("pin",{fontCharacter:"\\eb2b"}),n.play=new n("play",{fontCharacter:"\\eb2c"}),n.run=new n("run",{fontCharacter:"\\eb2c"}),n.plug=new n("plug",{fontCharacter:"\\eb2d"}),n.preserveCase=new n("preserve-case",{fontCharacter:"\\eb2e"}),n.preview=new n("preview",{fontCharacter:"\\eb2f"}),n.project=new n("project",{fontCharacter:"\\eb30"}),n.pulse=new n("pulse",{fontCharacter:"\\eb31"}),n.question=new n("question",{fontCharacter:"\\eb32"}),n.quote=new n("quote",{fontCharacter:"\\eb33"}),n.radioTower=new n("radio-tower",{fontCharacter:"\\eb34"}),n.reactions=new n("reactions",{fontCharacter:"\\eb35"}),n.references=new n("references",{fontCharacter:"\\eb36"}),n.refresh=new n("refresh",{fontCharacter:"\\eb37"}),n.regex=new n("regex",{fontCharacter:"\\eb38"}),n.remoteExplorer=new n("remote-explorer",{fontCharacter:"\\eb39"}),n.remote=new n("remote",{fontCharacter:"\\eb3a"}),n.remove=new n("remove",{fontCharacter:"\\eb3b"}),n.replaceAll=new n("replace-all",{fontCharacter:"\\eb3c"}),n.replace=new n("replace",{fontCharacter:"\\eb3d"}),n.repoClone=new n("repo-clone",{fontCharacter:"\\eb3e"}),n.repoForcePush=new n("repo-force-push",{fontCharacter:"\\eb3f"}),n.repoPull=new n("repo-pull",{fontCharacter:"\\eb40"}),n.repoPush=new n("repo-push",{fontCharacter:"\\eb41"}),n.report=new n("report",{fontCharacter:"\\eb42"}),n.requestChanges=new n("request-changes",{fontCharacter:"\\eb43"}),n.rocket=new n("rocket",{fontCharacter:"\\eb44"}),n.rootFolderOpened=new n("root-folder-opened",{fontCharacter:"\\eb45"}),n.rootFolder=new n("root-folder",{fontCharacter:"\\eb46"}),n.rss=new n("rss",{fontCharacter:"\\eb47"}),n.ruby=new n("ruby",{fontCharacter:"\\eb48"}),n.saveAll=new n("save-all",{fontCharacter:"\\eb49"}),n.saveAs=new n("save-as",{fontCharacter:"\\eb4a"}),n.save=new n("save",{fontCharacter:"\\eb4b"}),n.screenFull=new n("screen-full",{fontCharacter:"\\eb4c"}),n.screenNormal=new n("screen-normal",{fontCharacter:"\\eb4d"}),n.searchStop=new n("search-stop",{fontCharacter:"\\eb4e"}),n.server=new n("server",{fontCharacter:"\\eb50"}),n.settingsGear=new n("settings-gear",{fontCharacter:"\\eb51"}),n.settings=new n("settings",{fontCharacter:"\\eb52"}),n.shield=new n("shield",{fontCharacter:"\\eb53"}),n.smiley=new n("smiley",{fontCharacter:"\\eb54"}),n.sortPrecedence=new n("sort-precedence",{fontCharacter:"\\eb55"}),n.splitHorizontal=new n("split-horizontal",{fontCharacter:"\\eb56"}),n.splitVertical=new n("split-vertical",{fontCharacter:"\\eb57"}),n.squirrel=new n("squirrel",{fontCharacter:"\\eb58"}),n.starFull=new n("star-full",{fontCharacter:"\\eb59"}),n.starHalf=new n("star-half",{fontCharacter:"\\eb5a"}),n.symbolClass=new n("symbol-class",{fontCharacter:"\\eb5b"}),n.symbolColor=new n("symbol-color",{fontCharacter:"\\eb5c"}),n.symbolConstant=new n("symbol-constant",{fontCharacter:"\\eb5d"}),n.symbolEnumMember=new n("symbol-enum-member",{fontCharacter:"\\eb5e"}),n.symbolField=new n("symbol-field",{fontCharacter:"\\eb5f"}),n.symbolFile=new n("symbol-file",{fontCharacter:"\\eb60"}),n.symbolInterface=new n("symbol-interface",{fontCharacter:"\\eb61"}),n.symbolKeyword=new n("symbol-keyword",{fontCharacter:"\\eb62"}),n.symbolMisc=new n("symbol-misc",{fontCharacter:"\\eb63"}),n.symbolOperator=new n("symbol-operator",{fontCharacter:"\\eb64"}),n.symbolProperty=new n("symbol-property",{fontCharacter:"\\eb65"}),n.wrench=new n("wrench",{fontCharacter:"\\eb65"}),n.wrenchSubaction=new n("wrench-subaction",{fontCharacter:"\\eb65"}),n.symbolSnippet=new n("symbol-snippet",{fontCharacter:"\\eb66"}),n.tasklist=new n("tasklist",{fontCharacter:"\\eb67"}),n.telescope=new n("telescope",{fontCharacter:"\\eb68"}),n.textSize=new n("text-size",{fontCharacter:"\\eb69"}),n.threeBars=new n("three-bars",{fontCharacter:"\\eb6a"}),n.thumbsdown=new n("thumbsdown",{fontCharacter:"\\eb6b"}),n.thumbsup=new n("thumbsup",{fontCharacter:"\\eb6c"}),n.tools=new n("tools",{fontCharacter:"\\eb6d"}),n.triangleDown=new n("triangle-down",{fontCharacter:"\\eb6e"}),n.triangleLeft=new n("triangle-left",{fontCharacter:"\\eb6f"}),n.triangleRight=new n("triangle-right",{fontCharacter:"\\eb70"}),n.triangleUp=new n("triangle-up",{fontCharacter:"\\eb71"}),n.twitter=new n("twitter",{fontCharacter:"\\eb72"}),n.unfold=new n("unfold",{fontCharacter:"\\eb73"}),n.unlock=new n("unlock",{fontCharacter:"\\eb74"}),n.unmute=new n("unmute",{fontCharacter:"\\eb75"}),n.unverified=new n("unverified",{fontCharacter:"\\eb76"}),n.verified=new n("verified",{fontCharacter:"\\eb77"}),n.versions=new n("versions",{fontCharacter:"\\eb78"}),n.vmActive=new n("vm-active",{fontCharacter:"\\eb79"}),n.vmOutline=new n("vm-outline",{fontCharacter:"\\eb7a"}),n.vmRunning=new n("vm-running",{fontCharacter:"\\eb7b"}),n.watch=new n("watch",{fontCharacter:"\\eb7c"}),n.whitespace=new n("whitespace",{fontCharacter:"\\eb7d"}),n.wholeWord=new n("whole-word",{fontCharacter:"\\eb7e"}),n.window=new n("window",{fontCharacter:"\\eb7f"}),n.wordWrap=new n("word-wrap",{fontCharacter:"\\eb80"}),n.zoomIn=new n("zoom-in",{fontCharacter:"\\eb81"}),n.zoomOut=new n("zoom-out",{fontCharacter:"\\eb82"}),n.listFilter=new n("list-filter",{fontCharacter:"\\eb83"}),n.listFlat=new n("list-flat",{fontCharacter:"\\eb84"}),n.listSelection=new n("list-selection",{fontCharacter:"\\eb85"}),n.selection=new n("selection",{fontCharacter:"\\eb85"}),n.listTree=new n("list-tree",{fontCharacter:"\\eb86"}),n.debugBreakpointFunctionUnverified=new n("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),n.debugBreakpointFunction=new n("debug-breakpoint-function",{fontCharacter:"\\eb88"}),n.debugBreakpointFunctionDisabled=new n("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),n.debugStackframeActive=new n("debug-stackframe-active",{fontCharacter:"\\eb89"}),n.debugStackframeDot=new n("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),n.debugStackframe=new n("debug-stackframe",{fontCharacter:"\\eb8b"}),n.debugStackframeFocused=new n("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),n.debugBreakpointUnsupported=new n("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),n.symbolString=new n("symbol-string",{fontCharacter:"\\eb8d"}),n.debugReverseContinue=new n("debug-reverse-continue",{fontCharacter:"\\eb8e"}),n.debugStepBack=new n("debug-step-back",{fontCharacter:"\\eb8f"}),n.debugRestartFrame=new n("debug-restart-frame",{fontCharacter:"\\eb90"}),n.callIncoming=new n("call-incoming",{fontCharacter:"\\eb92"}),n.callOutgoing=new n("call-outgoing",{fontCharacter:"\\eb93"}),n.menu=new n("menu",{fontCharacter:"\\eb94"}),n.expandAll=new n("expand-all",{fontCharacter:"\\eb95"}),n.feedback=new n("feedback",{fontCharacter:"\\eb96"}),n.groupByRefType=new n("group-by-ref-type",{fontCharacter:"\\eb97"}),n.ungroupByRefType=new n("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),n.account=new n("account",{fontCharacter:"\\eb99"}),n.bellDot=new n("bell-dot",{fontCharacter:"\\eb9a"}),n.debugConsole=new n("debug-console",{fontCharacter:"\\eb9b"}),n.library=new n("library",{fontCharacter:"\\eb9c"}),n.output=new n("output",{fontCharacter:"\\eb9d"}),n.runAll=new n("run-all",{fontCharacter:"\\eb9e"}),n.syncIgnored=new n("sync-ignored",{fontCharacter:"\\eb9f"}),n.pinned=new n("pinned",{fontCharacter:"\\eba0"}),n.githubInverted=new n("github-inverted",{fontCharacter:"\\eba1"}),n.debugAlt=new n("debug-alt",{fontCharacter:"\\eb91"}),n.serverProcess=new n("server-process",{fontCharacter:"\\eba2"}),n.serverEnvironment=new n("server-environment",{fontCharacter:"\\eba3"}),n.pass=new n("pass",{fontCharacter:"\\eba4"}),n.stopCircle=new n("stop-circle",{fontCharacter:"\\eba5"}),n.playCircle=new n("play-circle",{fontCharacter:"\\eba6"}),n.record=new n("record",{fontCharacter:"\\eba7"}),n.debugAltSmall=new n("debug-alt-small",{fontCharacter:"\\eba8"}),n.vmConnect=new n("vm-connect",{fontCharacter:"\\eba9"}),n.cloud=new n("cloud",{fontCharacter:"\\ebaa"}),n.merge=new n("merge",{fontCharacter:"\\ebab"}),n.exportIcon=new n("export",{fontCharacter:"\\ebac"}),n.graphLeft=new n("graph-left",{fontCharacter:"\\ebad"}),n.magnet=new n("magnet",{fontCharacter:"\\ebae"}),n.notebook=new n("notebook",{fontCharacter:"\\ebaf"}),n.redo=new n("redo",{fontCharacter:"\\ebb0"}),n.checkAll=new n("check-all",{fontCharacter:"\\ebb1"}),n.pinnedDirty=new n("pinned-dirty",{fontCharacter:"\\ebb2"}),n.passFilled=new n("pass-filled",{fontCharacter:"\\ebb3"}),n.circleLargeFilled=new n("circle-large-filled",{fontCharacter:"\\ebb4"}),n.circleLargeOutline=new n("circle-large-outline",{fontCharacter:"\\ebb5"}),n.combine=new n("combine",{fontCharacter:"\\ebb6"}),n.gather=new n("gather",{fontCharacter:"\\ebb6"}),n.table=new n("table",{fontCharacter:"\\ebb7"}),n.variableGroup=new n("variable-group",{fontCharacter:"\\ebb8"}),n.typeHierarchy=new n("type-hierarchy",{fontCharacter:"\\ebb9"}),n.typeHierarchySub=new n("type-hierarchy-sub",{fontCharacter:"\\ebba"}),n.typeHierarchySuper=new n("type-hierarchy-super",{fontCharacter:"\\ebbb"}),n.gitPullRequestCreate=new n("git-pull-request-create",{fontCharacter:"\\ebbc"}),n.runAbove=new n("run-above",{fontCharacter:"\\ebbd"}),n.runBelow=new n("run-below",{fontCharacter:"\\ebbe"}),n.notebookTemplate=new n("notebook-template",{fontCharacter:"\\ebbf"}),n.debugRerun=new n("debug-rerun",{fontCharacter:"\\ebc0"}),n.workspaceTrusted=new n("workspace-trusted",{fontCharacter:"\\ebc1"}),n.workspaceUntrusted=new n("workspace-untrusted",{fontCharacter:"\\ebc2"}),n.workspaceUnspecified=new n("workspace-unspecified",{fontCharacter:"\\ebc3"}),n.terminalCmd=new n("terminal-cmd",{fontCharacter:"\\ebc4"}),n.terminalDebian=new n("terminal-debian",{fontCharacter:"\\ebc5"}),n.terminalLinux=new n("terminal-linux",{fontCharacter:"\\ebc6"}),n.terminalPowershell=new n("terminal-powershell",{fontCharacter:"\\ebc7"}),n.terminalTmux=new n("terminal-tmux",{fontCharacter:"\\ebc8"}),n.terminalUbuntu=new n("terminal-ubuntu",{fontCharacter:"\\ebc9"}),n.terminalBash=new n("terminal-bash",{fontCharacter:"\\ebca"}),n.arrowSwap=new n("arrow-swap",{fontCharacter:"\\ebcb"}),n.copy=new n("copy",{fontCharacter:"\\ebcc"}),n.personAdd=new n("person-add",{fontCharacter:"\\ebcd"}),n.filterFilled=new n("filter-filled",{fontCharacter:"\\ebce"}),n.wand=new n("wand",{fontCharacter:"\\ebcf"}),n.debugLineByLine=new n("debug-line-by-line",{fontCharacter:"\\ebd0"}),n.inspect=new n("inspect",{fontCharacter:"\\ebd1"}),n.layers=new n("layers",{fontCharacter:"\\ebd2"}),n.layersDot=new n("layers-dot",{fontCharacter:"\\ebd3"}),n.layersActive=new n("layers-active",{fontCharacter:"\\ebd4"}),n.compass=new n("compass",{fontCharacter:"\\ebd5"}),n.compassDot=new n("compass-dot",{fontCharacter:"\\ebd6"}),n.compassActive=new n("compass-active",{fontCharacter:"\\ebd7"}),n.azure=new n("azure",{fontCharacter:"\\ebd8"}),n.issueDraft=new n("issue-draft",{fontCharacter:"\\ebd9"}),n.gitPullRequestClosed=new n("git-pull-request-closed",{fontCharacter:"\\ebda"}),n.gitPullRequestDraft=new n("git-pull-request-draft",{fontCharacter:"\\ebdb"}),n.debugAll=new n("debug-all",{fontCharacter:"\\ebdc"}),n.debugCoverage=new n("debug-coverage",{fontCharacter:"\\ebdd"}),n.runErrors=new n("run-errors",{fontCharacter:"\\ebde"}),n.folderLibrary=new n("folder-library",{fontCharacter:"\\ebdf"}),n.debugContinueSmall=new n("debug-continue-small",{fontCharacter:"\\ebe0"}),n.beakerStop=new n("beaker-stop",{fontCharacter:"\\ebe1"}),n.graphLine=new n("graph-line",{fontCharacter:"\\ebe2"}),n.graphScatter=new n("graph-scatter",{fontCharacter:"\\ebe3"}),n.pieChart=new n("pie-chart",{fontCharacter:"\\ebe4"}),n.bracket=new n("bracket",n.json.definition),n.bracketDot=new n("bracket-dot",{fontCharacter:"\\ebe5"}),n.bracketError=new n("bracket-error",{fontCharacter:"\\ebe6"}),n.lockSmall=new n("lock-small",{fontCharacter:"\\ebe7"}),n.azureDevops=new n("azure-devops",{fontCharacter:"\\ebe8"}),n.verifiedFilled=new n("verified-filled",{fontCharacter:"\\ebe9"})}(K||(K={}))},"VrN/":function(Ue,de,M){(function(J,z){Ue.exports=z()})(this,function(){"use strict";var J=navigator.userAgent,z=navigator.platform,D=/gecko\/\d/i.test(J),V=/MSIE \d/.test(J),N=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(J),O=/Edge\/(\d+)/.exec(J),K=V||N||O,W=K&&(V?document.documentMode||6:+(O||N)[1]),n=!O&&/WebKit\//.test(J),I=n&&/Qt\/\d+\.\d+/.test(J),g=!O&&/Chrome\//.test(J),f=/Opera\//.test(J),h=/Apple Computer/.test(navigator.vendor),c=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(J),s=/PhantomJS/.test(J),d=!O&&/AppleWebKit/.test(J)&&/Mobile\/\w+/.test(J),i=/Android/.test(J),a=d||i||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(J),r=d||/Mac/.test(z),o=/\bCrOS\b/.test(J),T=/win/i.test(z),w=f&&J.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(f=!1,n=!0);var x=r&&(I||f&&(w==null||w<12.11)),L=D||K&&W>=9;function A(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var _=function(e,t){var u=e.className,l=A(t).exec(u);if(l){var y=u.slice(l.index+l[0].length);e.className=u.slice(0,l.index)+(y?l[1]+y:"")}};function b(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function m(e,t){return b(e).appendChild(t)}function p(e,t,u,l){var y=document.createElement(e);if(u&&(y.className=u),l&&(y.style.cssText=l),typeof t=="string")y.appendChild(document.createTextNode(t));else if(t)for(var j=0;j<t.length;++j)y.appendChild(t[j]);return y}function C(e,t,u,l){var y=p(e,t,u,l);return y.setAttribute("role","presentation"),y}var E;document.createRange?E=function(e,t,u,l){var y=document.createRange();return y.setEnd(l||e,u),y.setStart(e,t),y}:E=function(e,t,u){var l=document.body.createTextRange();try{l.moveToElementText(e.parentNode)}catch(y){return l}return l.collapse(!0),l.moveEnd("character",u),l.moveStart("character",t),l};function v(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function P(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function F(e,t){var u=e.className;A(t).test(u)||(e.className+=(u?" ":"")+t)}function R(e,t){for(var u=e.split(" "),l=0;l<u.length;l++)u[l]&&!A(u[l]).test(t)&&(t+=" "+u[l]);return t}var H=function(e){e.select()};d?H=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:K&&(H=function(e){try{e.select()}catch(t){}});function U(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function S(e,t,u){t||(t={});for(var l in e)e.hasOwnProperty(l)&&(u!==!1||!t.hasOwnProperty(l))&&(t[l]=e[l]);return t}function G(e,t,u,l,y){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var j=l||0,$=y||0;;){var ee=e.indexOf(" ",j);if(ee<0||ee>=t)return $+(t-j);$+=ee-j,$+=u-$%u,j=ee+1}}var Q=function(){this.id=null,this.f=null,this.time=0,this.handler=U(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 u=+new Date+e;(!this.id||u<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=u)};function se(e,t){for(var u=0;u<e.length;++u)if(e[u]==t)return u;return-1}var fe=50,we={toString:function(){return"CodeMirror.Pass"}},be={scroll:!1},Se={origin:"*mouse"},Ae={origin:"+move"};function De(e,t,u){for(var l=0,y=0;;){var j=e.indexOf(" ",l);j==-1&&(j=e.length);var $=j-l;if(j==e.length||y+$>=t)return l+Math.min($,t-y);if(y+=j-l,y+=u-y%u,l=j+1,y>=t)return l}}var ve=[""];function Y(e){for(;ve.length<=e;)ve.push(k(ve)+" ");return ve[e]}function k(e){return e[e.length-1]}function B(e,t){for(var u=[],l=0;l<e.length;l++)u[l]=t(e[l],l);return u}function Z(e,t,u){for(var l=0,y=u(t);l<e.length&&u(e[l])<=y;)l++;e.splice(l,0,t)}function re(){}function X(e,t){var u;return Object.create?u=Object.create(e):(re.prototype=e,u=new re),t&&S(t,u),u}var ye=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Me(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ye.test(e))}function He(e,t){return t?t.source.indexOf("\\w")>-1&&Me(e)?!0:t.test(e):Me(e)}function me(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Ee=/[\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 Le(e){return e.charCodeAt(0)>=768&&Ee.test(e)}function Pe(e,t,u){for(;(u<0?t>0:t<e.length)&&Le(e.charAt(t));)t+=u;return t}function Ye(e,t,u){for(var l=t>u?-1:1;;){if(t==u)return t;var y=(t+u)/2,j=l<0?Math.ceil(y):Math.floor(y);if(j==t)return e(j)?t:u;e(j)?u=j:t=j+l}}function tt(e,t,u,l){if(!e)return l(t,u,"ltr",0);for(var y=!1,j=0;j<e.length;++j){var $=e[j];($.from<u&&$.to>t||t==u&&$.to==t)&&(l(Math.max($.from,t),Math.min($.to,u),$.level==1?"rtl":"ltr",j),y=!0)}y||l(t,u,"ltr")}var ut=null;function lt(e,t,u){var l;ut=null;for(var y=0;y<e.length;++y){var j=e[y];if(j.from<t&&j.to>t)return y;j.to==t&&(j.from!=j.to&&u=="before"?l=y:ut=y),j.from==t&&(j.from!=j.to&&u!="before"?l=y:ut=y)}return l!=null?l:ut}var gt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function u(le){return le<=247?e.charAt(le):1424<=le&&le<=1524?"R":1536<=le&&le<=1785?t.charAt(le-1536):1774<=le&&le<=2220?"r":8192<=le&&le<=8203?"w":le==8204?"b":"L"}var l=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,y=/[stwN]/,j=/[LRr]/,$=/[Lb1n]/,ee=/[1n]/;function ne(le,Te,Ce){this.level=le,this.from=Te,this.to=Ce}return function(le,Te){var Ce=Te=="ltr"?"L":"R";if(le.length==0||Te=="ltr"&&!l.test(le))return!1;for(var Be=le.length,ke=[],qe=0;qe<Be;++qe)ke.push(u(le.charCodeAt(qe)));for(var at=0,mt=Ce;at<Be;++at){var bt=ke[at];bt=="m"?ke[at]=mt:mt=bt}for(var Tt=0,_t=Ce;Tt<Be;++Tt){var St=ke[Tt];St=="1"&&_t=="r"?ke[Tt]="n":j.test(St)&&(_t=St,St=="r"&&(ke[Tt]="R"))}for(var zt=1,Ut=ke[0];zt<Be-1;++zt){var un=ke[zt];un=="+"&&Ut=="1"&&ke[zt+1]=="1"?ke[zt]="1":un==","&&Ut==ke[zt+1]&&(Ut=="1"||Ut=="n")&&(ke[zt]=Ut),Ut=un}for(var Pn=0;Pn<Be;++Pn){var lr=ke[Pn];if(lr==",")ke[Pn]="N";else if(lr=="%"){var Kn=void 0;for(Kn=Pn+1;Kn<Be&&ke[Kn]=="%";++Kn);for(var Ur=Pn&&ke[Pn-1]=="!"||Kn<Be&&ke[Kn]=="1"?"1":"N",Ir=Pn;Ir<Kn;++Ir)ke[Ir]=Ur;Pn=Kn-1}}for(var qn=0,Dr=Ce;qn<Be;++qn){var gr=ke[qn];Dr=="L"&&gr=="1"?ke[qn]="L":j.test(gr)&&(Dr=gr)}for(var rr=0;rr<Be;++rr)if(y.test(ke[rr])){var er=void 0;for(er=rr+1;er<Be&&y.test(ke[er]);++er);for(var Gn=(rr?ke[rr-1]:Ce)=="L",Mr=(er<Be?ke[er]:Ce)=="L",ji=Gn==Mr?Gn?"L":"R":Ce,fi=rr;fi<er;++fi)ke[fi]=ji;rr=er-1}for(var xr=[],ti,ur=0;ur<Be;)if($.test(ke[ur])){var co=ur;for(++ur;ur<Be&&$.test(ke[ur]);++ur);xr.push(new ne(0,co,ur))}else{var ai=ur,Ei=xr.length,xi=Te=="rtl"?1:0;for(++ur;ur<Be&&ke[ur]!="L";++ur);for(var Or=ai;Or<ur;)if(ee.test(ke[Or])){ai<Or&&(xr.splice(Ei,0,new ne(1,ai,Or)),Ei+=xi);var Bi=Or;for(++Or;Or<ur&&ee.test(ke[Or]);++Or);xr.splice(Ei,0,new ne(2,Bi,Or)),Ei+=xi,ai=Or}else++Or;ai<ur&&xr.splice(Ei,0,new ne(1,ai,ur))}return Te=="ltr"&&(xr[0].level==1&&(ti=le.match(/^\s+/))&&(xr[0].from=ti[0].length,xr.unshift(new ne(0,0,ti[0].length))),k(xr).level==1&&(ti=le.match(/\s+$/))&&(k(xr).to-=ti[0].length,xr.push(new ne(0,Be-ti[0].length,Be)))),Te=="rtl"?xr.reverse():xr}}();function ht(e,t){var u=e.order;return u==null&&(u=e.order=gt(e.text,t)),u}var Ie=[],Re=function(e,t,u){if(e.addEventListener)e.addEventListener(t,u,!1);else if(e.attachEvent)e.attachEvent("on"+t,u);else{var l=e._handlers||(e._handlers={});l[t]=(l[t]||Ie).concat(u)}};function $e(e,t){return e._handlers&&e._handlers[t]||Ie}function Ze(e,t,u){if(e.removeEventListener)e.removeEventListener(t,u,!1);else if(e.detachEvent)e.detachEvent("on"+t,u);else{var l=e._handlers,y=l&&l[t];if(y){var j=se(y,u);j>-1&&(l[t]=y.slice(0,j).concat(y.slice(j+1)))}}}function ue(e,t){var u=$e(e,t);if(!u.length)return;for(var l=Array.prototype.slice.call(arguments,2),y=0;y<u.length;++y)u[y].apply(null,l)}function q(e,t,u){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),ue(e,u||t.type,e,t),he(t)||t.codemirrorIgnore}function te(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var u=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),l=0;l<t.length;++l)se(u,t[l])==-1&&u.push(t[l])}function ae(e,t){return $e(e,t).length>0}function ce(e){e.prototype.on=function(t,u){Re(this,t,u)},e.prototype.off=function(t,u){Ze(this,t,u)}}function ie(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function oe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function he(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ge(e){ie(e),oe(e)}function _e(e){return e.target||e.srcElement}function Oe(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),r&&e.ctrlKey&&t==1&&(t=3),t}var Ge=function(){if(K&&W<9)return!1;var e=p("div");return"draggable"in e||"dragDrop"in e}(),et;function ct(e){if(et==null){var t=p("span","\u200B");m(e,p("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(et=t.offsetWidth<=1&&t.offsetHeight>2&&!(K&&W<8))}var u=et?p("span","\u200B"):p("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return u.setAttribute("cm-text",""),u}var st;function nt(e){if(st!=null)return st;var t=m(e,document.createTextNode("A\u062EA")),u=E(t,0,1).getBoundingClientRect(),l=E(t,1,2).getBoundingClientRect();return b(e),!u||u.left==u.right?!1:st=l.right-u.right<3}var We=`
b`.split(/\n/).length!=3?function(e){for(var t=0,u=[],l=e.length;t<=l;){var y=e.indexOf(`
`,t);y==-1&&(y=e.length);var j=e.slice(t,e.charAt(y-1)=="\r"?y-1:y),$=j.indexOf("\r");$!=-1?(u.push(j.slice(0,$)),t+=$+1):(u.push(j),t=y+1)}return u}:function(e){return e.split(/\r\n?|\n/)},Ve=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(u){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Ne=function(){var e=p("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),pe=null;function xe(e){if(pe!=null)return pe;var t=m(e,p("span","x")),u=t.getBoundingClientRect(),l=E(t,0,1).getBoundingClientRect();return pe=Math.abs(u.left-l.left)>1}var Xe={},je={};function it(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Xe[e]=t}function ot(e,t){je[e]=t}function Ke(e){if(typeof e=="string"&&je.hasOwnProperty(e))e=je[e];else if(e&&typeof e.name=="string"&&je.hasOwnProperty(e.name)){var t=je[e.name];typeof t=="string"&&(t={name:t}),e=X(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ke("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ke("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Je(e,t){t=Ke(t);var u=Xe[t.name];if(!u)return Je(e,"text/plain");var l=u(e,t);if(Qe.hasOwnProperty(t.name)){var y=Qe[t.name];for(var j in y){if(!y.hasOwnProperty(j))continue;l.hasOwnProperty(j)&&(l["_"+j]=l[j]),l[j]=y[j]}}if(l.name=t.name,t.helperType&&(l.helperType=t.helperType),t.modeProps)for(var $ in t.modeProps)l[$]=t.modeProps[$];return l}var Qe={};function pt(e,t){var u=Qe.hasOwnProperty(e)?Qe[e]:Qe[e]={};S(t,u)}function dt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var u={};for(var l in t){var y=t[l];y instanceof Array&&(y=y.concat([])),u[l]=y}return u}function Vt(e,t){for(var u;e.innerMode&&!(u=e.innerMode(t),!u||u.mode==e);)t=u.state,e=u.mode;return u||{mode:e,state:t}}function rn(e,t,u){return e.startState?e.startState(t,u):!0}var an=function(e,t,u){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=u};an.prototype.eol=function(){return this.pos>=this.string.length},an.prototype.sol=function(){return this.pos==this.lineStart},an.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},an.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},an.prototype.eat=function(e){var t=this.string.charAt(this.pos),u;if(typeof e=="string"?u=t==e:u=t&&(e.test?e.test(t):e(t)),u)return++this.pos,t},an.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},an.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},an.prototype.skipToEnd=function(){this.pos=this.string.length},an.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},an.prototype.backUp=function(e){this.pos-=e},an.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=G(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?G(this.string,this.lineStart,this.tabSize):0)},an.prototype.indentation=function(){return G(this.string,null,this.tabSize)-(this.lineStart?G(this.string,this.lineStart,this.tabSize):0)},an.prototype.match=function(e,t,u){if(typeof e=="string"){var l=function($){return u?$.toLowerCase():$},y=this.string.substr(this.pos,e.length);if(l(y)==l(e))return t!==!1&&(this.pos+=e.length),!0}else{var j=this.string.slice(this.pos).match(e);return j&&j.index>0?null:(j&&t!==!1&&(this.pos+=j[0].length),j)}},an.prototype.current=function(){return this.string.slice(this.start,this.pos)},an.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},an.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},an.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ft(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 u=e;!u.lines;)for(var l=0;;++l){var y=u.children[l],j=y.chunkSize();if(t<j){u=y;break}t-=j}return u.lines[t]}function Wt(e,t,u){var l=[],y=t.line;return e.iter(t.line,u.line+1,function(j){var $=j.text;y==u.line&&($=$.slice(0,u.ch)),y==t.line&&($=$.slice(t.ch)),l.push($),++y}),l}function Xt(e,t,u){var l=[];return e.iter(t,u,function(y){l.push(y.text)}),l}function Ot(e,t){var u=t-e.height;if(u)for(var l=e;l;l=l.parent)l.height+=u}function Mt(e){if(e.parent==null)return null;for(var t=e.parent,u=se(t.lines,e),l=t.parent;l;t=l,l=l.parent)for(var y=0;!(l.children[y]==t);++y)u+=l.children[y].chunkSize();return u+t.first}function Ft(e,t){var u=e.first;e:do{for(var l=0;l<e.children.length;++l){var y=e.children[l],j=y.height;if(t<j){e=y;continue e}t-=j,u+=y.chunkSize()}return u}while(!e.lines);for(var $=0;$<e.lines.length;++$){var ee=e.lines[$],ne=ee.height;if(t<ne)break;t-=ne}return u+$}function On(e,t){return t>=e.first&&t<e.first+e.size}function vn(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function rt(e,t,u){if(u===void 0&&(u=null),!(this instanceof rt))return new rt(e,t,u);this.line=e,this.ch=t,this.sticky=u}function vt(e,t){return e.line-t.line||e.ch-t.ch}function zn(e,t){return e.sticky==t.sticky&&vt(e,t)==0}function Tr(e){return rt(e.line,e.ch)}function vr(e,t){return vt(e,t)<0?t:e}function Fr(e,t){return vt(e,t)<0?e:t}function Wn(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Dt(e,t){if(t.line<e.first)return rt(e.first,0);var u=e.first+e.size-1;return t.line>u?rt(u,ft(e,u).text.length):ze(t,ft(e,t.line).text.length)}function ze(e,t){var u=e.ch;return u==null||u>t?rt(e.line,t):u<0?rt(e.line,0):e}function Fe(e,t){for(var u=[],l=0;l<t.length;l++)u[l]=Dt(e,t[l]);return u}var Pt=function(e,t){this.state=e,this.lookAhead=t},Yt=function(e,t,u,l){this.state=t,this.doc=e,this.line=u,this.maxLookAhead=l||0,this.baseTokens=null,this.baseTokenPos=1};Yt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Yt.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}},Yt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Yt.fromSaved=function(e,t,u){return t instanceof Pt?new Yt(e,dt(e.mode,t.state),u,t.lookAhead):new Yt(e,dt(e.mode,t),u)},Yt.prototype.save=function(e){var t=e!==!1?dt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Pt(t,this.maxLookAhead):t};function Tn(e,t,u,l){var y=[e.state.modeGen],j={};yt(e,t.text,e.doc.mode,u,function(le,Te){return y.push(le,Te)},j,l);for(var $=u.state,ee=function(le){u.baseTokens=y;var Te=e.state.overlays[le],Ce=1,Be=0;u.state=!0,yt(e,t.text,Te.mode,u,function(ke,qe){for(var at=Ce;Be<ke;){var mt=y[Ce];mt>ke&&y.splice(Ce,1,ke,y[Ce+1],mt),Ce+=2,Be=Math.min(ke,mt)}if(!qe)return;if(Te.opaque)y.splice(at,Ce-at,ke,"overlay "+qe),Ce=at+2;else for(;at<Ce;at+=2){var bt=y[at+1];y[at+1]=(bt?bt+" ":"")+"overlay "+qe}},j),u.state=$,u.baseTokens=null,u.baseTokenPos=1},ne=0;ne<e.state.overlays.length;++ne)ee(ne);return{styles:y,classes:j.bgClass||j.textClass?j:null}}function yn(e,t,u){if(!t.styles||t.styles[0]!=e.state.modeGen){var l=cn(e,Mt(t)),y=t.text.length>e.options.maxHighlightLength&&dt(e.doc.mode,l.state),j=Tn(e,t,l);y&&(l.state=y),t.stateAfter=l.save(!y),t.styles=j.styles,j.classes?t.styleClasses=j.classes:t.styleClasses&&(t.styleClasses=null),u===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function cn(e,t,u){var l=e.doc,y=e.display;if(!l.mode.startState)return new Yt(l,!0,t);var j=mn(e,t,u),$=j>l.first&&ft(l,j-1).stateAfter,ee=$?Yt.fromSaved(l,$,j):new Yt(l,rn(l.mode),j);return l.iter(j,t,function(ne){$t(e,ne.text,ee);var le=ee.line;ne.stateAfter=le==t-1||le%5==0||le>=y.viewFrom&&le<y.viewTo?ee.save():null,ee.nextLine()}),u&&(l.modeFrontier=ee.line),ee}function $t(e,t,u,l){var y=e.doc.mode,j=new an(t,e.options.tabSize,u);for(j.start=j.pos=l||0,t==""&&It(y,u.state);!j.eol();)Nt(y,j,u.state),j.start=j.pos}function It(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var u=Vt(e,t);if(u.mode.blankLine)return u.mode.blankLine(u.state)}function Nt(e,t,u,l){for(var y=0;y<10;y++){l&&(l[0]=Vt(e,u).mode);var j=e.token(t,u);if(t.pos>t.start)return j}throw new Error("Mode "+e.name+" failed to advance stream.")}var Ht=function(e,t,u){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=u};function kt(e,t,u,l){var y=e.doc,j=y.mode,$;t=Dt(y,t);var ee=ft(y,t.line),ne=cn(e,t.line,u),le=new an(ee.text,e.options.tabSize,ne),Te;for(l&&(Te=[]);(l||le.pos<t.ch)&&!le.eol();)le.start=le.pos,$=Nt(j,le,ne.state),l&&Te.push(new Ht(le,$,dt(y.mode,ne.state)));return l?Te:new Ht(le,$,ne.state)}function on(e,t){if(e)for(;;){var u=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!u)break;e=e.slice(0,u.index)+e.slice(u.index+u[0].length);var l=u[1]?"bgClass":"textClass";t[l]==null?t[l]=u[2]:new RegExp("(?:^|\\s)"+u[2]+"(?:$|\\s)").test(t[l])||(t[l]+=" "+u[2])}return e}function yt(e,t,u,l,y,j,$){var ee=u.flattenSpans;ee==null&&(ee=e.options.flattenSpans);var ne=0,le=null,Te=new an(t,e.options.tabSize,l),Ce,Be=e.options.addModeClass&&[null];for(t==""&&on(It(u,l.state),j);!Te.eol();){if(Te.pos>e.options.maxHighlightLength?(ee=!1,$&&$t(e,t,l,Te.pos),Te.pos=t.length,Ce=null):Ce=on(Nt(u,Te,l.state,Be),j),Be){var ke=Be[0].name;ke&&(Ce="m-"+(Ce?ke+" "+Ce:ke))}if(!ee||le!=Ce){for(;ne<Te.start;)ne=Math.min(Te.start,ne+5e3),y(ne,le);le=Ce}Te.start=Te.pos}for(;ne<Te.pos;){var qe=Math.min(Te.pos,ne+5e3);y(qe,le),ne=qe}}function mn(e,t,u){for(var l,y,j=e.doc,$=u?-1:t-(e.doc.mode.innerMode?1e3:100),ee=t;ee>$;--ee){if(ee<=j.first)return j.first;var ne=ft(j,ee-1),le=ne.stateAfter;if(le&&(!u||ee+(le instanceof Pt?le.lookAhead:0)<=j.modeFrontier))return ee;var Te=G(ne.text,null,e.options.tabSize);(y==null||l>Te)&&(y=ee-1,l=Te)}return y}function tn(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var u=e.first,l=t-1;l>u;l--){var y=ft(e,l).stateAfter;if(y&&(!(y instanceof Pt)||l+y.lookAhead<t)){u=l+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,u)}var kn=!1,jt=!1;function Nn(){kn=!0}function jn(){jt=!0}function Ln(e,t,u){this.marker=e,this.from=t,this.to=u}function Sn(e,t){if(e)for(var u=0;u<e.length;++u){var l=e[u];if(l.marker==t)return l}}function Mn(e,t){for(var u,l=0;l<e.length;++l)e[l]!=t&&(u||(u=[])).push(e[l]);return u}function ir(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function cr(e,t,u){var l;if(e)for(var y=0;y<e.length;++y){var j=e[y],$=j.marker,ee=j.from==null||($.inclusiveLeft?j.from<=t:j.from<t);if(ee||j.from==t&&$.type=="bookmark"&&(!u||!j.marker.insertLeft)){var ne=j.to==null||($.inclusiveRight?j.to>=t:j.to>t);(l||(l=[])).push(new Ln($,j.from,ne?null:j.to))}}return l}function Yn(e,t,u){var l;if(e)for(var y=0;y<e.length;++y){var j=e[y],$=j.marker,ee=j.to==null||($.inclusiveRight?j.to>=t:j.to>t);if(ee||j.from==t&&$.type=="bookmark"&&(!u||j.marker.insertLeft)){var ne=j.from==null||($.inclusiveLeft?j.from<=t:j.from<t);(l||(l=[])).push(new Ln($,ne?null:j.from-t,j.to==null?null:j.to-t))}}return l}function An(e,t){if(t.full)return null;var u=On(e,t.from.line)&&ft(e,t.from.line).markedSpans,l=On(e,t.to.line)&&ft(e,t.to.line).markedSpans;if(!u&&!l)return null;var y=t.from.ch,j=t.to.ch,$=vt(t.from,t.to)==0,ee=cr(u,y,$),ne=Yn(l,j,$),le=t.text.length==1,Te=k(t.text).length+(le?y:0);if(ee)for(var Ce=0;Ce<ee.length;++Ce){var Be=ee[Ce];if(Be.to==null){var ke=Sn(ne,Be.marker);ke?le&&(Be.to=ke.to==null?null:ke.to+Te):Be.to=y}}if(ne)for(var qe=0;qe<ne.length;++qe){var at=ne[qe];if(at.to!=null&&(at.to+=Te),at.from==null){var mt=Sn(ee,at.marker);mt||(at.from=Te,le&&(ee||(ee=[])).push(at))}else at.from+=Te,le&&(ee||(ee=[])).push(at)}ee&&(ee=dr(ee)),ne&&ne!=ee&&(ne=dr(ne));var bt=[ee];if(!le){var Tt=t.text.length-2,_t;if(Tt>0&&ee)for(var St=0;St<ee.length;++St)ee[St].to==null&&(_t||(_t=[])).push(new Ln(ee[St].marker,null,null));for(var zt=0;zt<Tt;++zt)bt.push(_t);bt.push(ne)}return bt}function dr(e){for(var t=0;t<e.length;++t){var u=e[t];u.from!=null&&u.from==u.to&&u.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function gn(e,t,u){var l=null;if(e.iter(t.line,u.line+1,function(ke){if(ke.markedSpans)for(var qe=0;qe<ke.markedSpans.length;++qe){var at=ke.markedSpans[qe].marker;at.readOnly&&(!l||se(l,at)==-1)&&(l||(l=[])).push(at)}}),!l)return null;for(var y=[{from:t,to:u}],j=0;j<l.length;++j)for(var $=l[j],ee=$.find(0),ne=0;ne<y.length;++ne){var le=y[ne];if(vt(le.to,ee.from)<0||vt(le.from,ee.to)>0)continue;var Te=[ne,1],Ce=vt(le.from,ee.from),Be=vt(le.to,ee.to);(Ce<0||!$.inclusiveLeft&&!Ce)&&Te.push({from:le.from,to:ee.from}),(Be>0||!$.inclusiveRight&&!Be)&&Te.push({from:ee.to,to:le.to}),y.splice.apply(y,Te),ne+=Te.length-3}return y}function bn(e){var t=e.markedSpans;if(!t)return;for(var u=0;u<t.length;++u)t[u].marker.detachLine(e);e.markedSpans=null}function _n(e,t){if(!t)return;for(var u=0;u<t.length;++u)t[u].marker.attachLine(e);e.markedSpans=t}function Jt(e){return e.inclusiveLeft?-1:0}function wt(e){return e.inclusiveRight?1:0}function Kt(e,t){var u=e.lines.length-t.lines.length;if(u!=0)return u;var l=e.find(),y=t.find(),j=vt(l.from,y.from)||Jt(e)-Jt(t);if(j)return-j;var $=vt(l.to,y.to)||wt(e)-wt(t);return $||t.id-e.id}function xt(e,t){var u=jt&&e.markedSpans,l;if(u)for(var y=void 0,j=0;j<u.length;++j)y=u[j],y.marker.collapsed&&(t?y.from:y.to)==null&&(!l||Kt(l,y.marker)<0)&&(l=y.marker);return l}function sn(e){return xt(e,!0)}function Bt(e){return xt(e,!1)}function ar(e,t){var u=jt&&e.markedSpans,l;if(u)for(var y=0;y<u.length;++y){var j=u[y];j.marker.collapsed&&(j.from==null||j.from<t)&&(j.to==null||j.to>t)&&(!l||Kt(l,j.marker)<0)&&(l=j.marker)}return l}function Un(e,t,u,l,y){var j=ft(e,t),$=jt&&j.markedSpans;if($)for(var ee=0;ee<$.length;++ee){var ne=$[ee];if(!ne.marker.collapsed)continue;var le=ne.marker.find(0),Te=vt(le.from,u)||Jt(ne.marker)-Jt(y),Ce=vt(le.to,l)||wt(ne.marker)-wt(y);if(Te>=0&&Ce<=0||Te<=0&&Ce>=0)continue;if(Te<=0&&(ne.marker.inclusiveRight&&y.inclusiveLeft?vt(le.to,u)>=0:vt(le.to,u)>0)||Te>=0&&(ne.marker.inclusiveRight&&y.inclusiveLeft?vt(le.from,l)<=0:vt(le.from,l)<0))return!0}}function hr(e){for(var t;t=sn(e);)e=t.find(-1,!0).line;return e}function Zr(e){for(var t;t=Bt(e);)e=t.find(1,!0).line;return e}function Pr(e){for(var t,u;t=Bt(e);)e=t.find(1,!0).line,(u||(u=[])).push(e);return u}function zr(e,t){var u=ft(e,t),l=hr(u);return u==l?t:Mt(l)}function kr(e,t){if(t>e.lastLine())return t;var u=ft(e,t),l;if(!Ar(e,u))return t;for(;l=Bt(u);)u=l.find(1,!0).line;return Mt(u)+1}function Ar(e,t){var u=jt&&t.markedSpans;if(u)for(var l=void 0,y=0;y<u.length;++y){if(l=u[y],!l.marker.collapsed)continue;if(l.from==null)return!0;if(l.marker.widgetNode)continue;if(l.from==0&&l.marker.inclusiveLeft&&Kr(e,t,l))return!0}}function Kr(e,t,u){if(u.to==null){var l=u.marker.find(1,!0);return Kr(e,l.line,Sn(l.line.markedSpans,u.marker))}if(u.marker.inclusiveRight&&u.to==t.text.length)return!0;for(var y=void 0,j=0;j<t.markedSpans.length;++j)if(y=t.markedSpans[j],y.marker.collapsed&&!y.marker.widgetNode&&y.from==u.to&&(y.to==null||y.to!=u.from)&&(y.marker.inclusiveLeft||u.marker.inclusiveRight)&&Kr(e,t,y))return!0}function Hn(e){e=hr(e);for(var t=0,u=e.parent,l=0;l<u.lines.length;++l){var y=u.lines[l];if(y==e)break;t+=y.height}for(var j=u.parent;j;u=j,j=u.parent)for(var $=0;$<j.children.length;++$){var ee=j.children[$];if(ee==u)break;t+=ee.height}return t}function Rt(e){if(e.height==0)return 0;for(var t=e.text.length,u,l=e;u=sn(l);){var y=u.find(0,!0);l=y.from.line,t+=y.from.ch-y.to.ch}for(l=e;u=Bt(l);){var j=u.find(0,!0);t-=l.text.length-j.from.ch,l=j.to.line,t+=l.text.length-j.to.ch}return t}function Vr(e){var t=e.display,u=e.doc;t.maxLine=ft(u,u.first),t.maxLineLength=Rt(t.maxLine),t.maxLineChanged=!0,u.iter(function(l){var y=Rt(l);y>t.maxLineLength&&(t.maxLineLength=y,t.maxLine=l)})}var yr=function(e,t,u){this.text=e,_n(this,t),this.height=u?u(this):1};yr.prototype.lineNo=function(){return Mt(this)},ce(yr);function ni(e,t,u,l){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),bn(e),_n(e,u);var y=l?l(e):1;y!=e.height&&Ot(e,y)}function Ct(e){e.parent=null,bn(e)}var Gt={},Lt={};function Zt(e,t){if(!e||/^\s*$/.test(e))return null;var u=t.addModeClass?Lt:Gt;return u[e]||(u[e]=e.replace(/\S+/g,"cm-$&"))}function qt(e,t){var u=C("span",null,null,n?"padding-right: .1px":null),l={pre:C("pre",[u],"CodeMirror-line"),content:u,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var y=0;y<=(t.rest?t.rest.length:0);y++){var j=y?t.rest[y-1]:t.line,$=void 0;l.pos=0,l.addToken=ln,nt(e.display.measure)&&($=ht(j,e.doc.direction))&&(l.addToken=tr(l.addToken,$)),l.map=[];var ee=t!=e.display.externalMeasured&&Mt(j);br(j,l,yn(e,j,ee)),j.styleClasses&&(j.styleClasses.bgClass&&(l.bgClass=R(j.styleClasses.bgClass,l.bgClass||"")),j.styleClasses.textClass&&(l.textClass=R(j.styleClasses.textClass,l.textClass||""))),l.map.length==0&&l.map.push(0,0,l.content.appendChild(ct(e.display.measure))),y==0?(t.measure.map=l.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(l.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(n){var ne=l.content.lastChild;(/\bcm-tab\b/.test(ne.className)||ne.querySelector&&ne.querySelector(".cm-tab"))&&(l.content.className="cm-tab-wrap-hack")}return ue(e,"renderLine",e,t.line,l.pre),l.pre.className&&(l.textClass=R(l.pre.className,l.textClass||"")),l}function wn(e){var t=p("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ln(e,t,u,l,y,j,$){if(!t)return;var ee=e.splitSpaces?Fn(t,e.trailingSpace):t,ne=e.cm.state.specialChars,le=!1,Te;if(!ne.test(t))e.col+=t.length,Te=document.createTextNode(ee),e.map.push(e.pos,e.pos+t.length,Te),K&&W<9&&(le=!0),e.pos+=t.length;else{Te=document.createDocumentFragment();for(var Ce=0;;){ne.lastIndex=Ce;var Be=ne.exec(t),ke=Be?Be.index-Ce:t.length-Ce;if(ke){var qe=document.createTextNode(ee.slice(Ce,Ce+ke));K&&W<9?Te.appendChild(p("span",[qe])):Te.appendChild(qe),e.map.push(e.pos,e.pos+ke,qe),e.col+=ke,e.pos+=ke}if(!Be)break;Ce+=ke+1;var at=void 0;if(Be[0]==" "){var mt=e.cm.options.tabSize,bt=mt-e.col%mt;at=Te.appendChild(p("span",Y(bt),"cm-tab")),at.setAttribute("role","presentation"),at.setAttribute("cm-text"," "),e.col+=bt}else Be[0]=="\r"||Be[0]==`
`?(at=Te.appendChild(p("span",Be[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),at.setAttribute("cm-text",Be[0]),e.col+=1):(at=e.cm.options.specialCharPlaceholder(Be[0]),at.setAttribute("cm-text",Be[0]),K&&W<9?Te.appendChild(p("span",[at])):Te.appendChild(at),e.col+=1);e.map.push(e.pos,e.pos+1,at),e.pos++}}if(e.trailingSpace=ee.charCodeAt(t.length-1)==32,u||l||y||le||j||$){var Tt=u||"";l&&(Tt+=l),y&&(Tt+=y);var _t=p("span",[Te],Tt,j);if($)for(var St in $)$.hasOwnProperty(St)&&St!="style"&&St!="class"&&_t.setAttribute(St,$[St]);return e.content.appendChild(_t)}e.content.appendChild(Te)}function Fn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var u=t,l="",y=0;y<e.length;y++){var j=e.charAt(y);j==" "&&u&&(y==e.length-1||e.charCodeAt(y+1)==32)&&(j="\xA0"),l+=j,u=j==" "}return l}function tr(e,t){return function(u,l,y,j,$,ee,ne){y=y?y+" cm-force-border":"cm-force-border";for(var le=u.pos,Te=le+l.length;;){for(var Ce=void 0,Be=0;Be<t.length&&!(Ce=t[Be],Ce.to>le&&Ce.from<=le);Be++);if(Ce.to>=Te)return e(u,l,y,j,$,ee,ne);e(u,l.slice(0,Ce.to-le),y,j,null,ee,ne),j=null,l=l.slice(Ce.to-le),le=Ce.to}}}function Qt(e,t,u,l){var y=!l&&u.widgetNode;y&&e.map.push(e.pos,e.pos+t,y),!l&&e.cm.display.input.needsContentAttribute&&(y||(y=e.content.appendChild(document.createElement("span"))),y.setAttribute("cm-marker",u.id)),y&&(e.cm.display.input.setUneditable(y),e.content.appendChild(y)),e.pos+=t,e.trailingSpace=!1}function br(e,t,u){var l=e.markedSpans,y=e.text,j=0;if(!l){for(var $=1;$<u.length;$+=2)t.addToken(t,y.slice(j,j=u[$]),Zt(u[$+1],t.cm.options));return}for(var ee=y.length,ne=0,le=1,Te="",Ce,Be,ke=0,qe,at,mt,bt,Tt;;){if(ke==ne){qe=at=mt=Be="",Tt=null,bt=null,ke=Infinity;for(var _t=[],St=void 0,zt=0;zt<l.length;++zt){var Ut=l[zt],un=Ut.marker;if(un.type=="bookmark"&&Ut.from==ne&&un.widgetNode)_t.push(un);else if(Ut.from<=ne&&(Ut.to==null||Ut.to>ne||un.collapsed&&Ut.to==ne&&Ut.from==ne)){if(Ut.to!=null&&Ut.to!=ne&&ke>Ut.to&&(ke=Ut.to,at=""),un.className&&(qe+=" "+un.className),un.css&&(Be=(Be?Be+";":"")+un.css),un.startStyle&&Ut.from==ne&&(mt+=" "+un.startStyle),un.endStyle&&Ut.to==ke&&(St||(St=[])).push(un.endStyle,Ut.to),un.title&&((Tt||(Tt={})).title=un.title),un.attributes)for(var Pn in un.attributes)(Tt||(Tt={}))[Pn]=un.attributes[Pn];un.collapsed&&(!bt||Kt(bt.marker,un)<0)&&(bt=Ut)}else Ut.from>ne&&ke>Ut.from&&(ke=Ut.from)}if(St)for(var lr=0;lr<St.length;lr+=2)St[lr+1]==ke&&(at+=" "+St[lr]);if(!bt||bt.from==ne)for(var Kn=0;Kn<_t.length;++Kn)Qt(t,0,_t[Kn]);if(bt&&(bt.from||0)==ne){if(Qt(t,(bt.to==null?ee+1:bt.to)-ne,bt.marker,bt.from==null),bt.to==null)return;bt.to==ne&&(bt=!1)}}if(ne>=ee)break;for(var Ur=Math.min(ee,ke);;){if(Te){var Ir=ne+Te.length;if(!bt){var qn=Ir>Ur?Te.slice(0,Ur-ne):Te;t.addToken(t,qn,Ce?Ce+qe:qe,mt,ne+qn.length==ke?at:"",Be,Tt)}if(Ir>=Ur){Te=Te.slice(Ur-ne),ne=Ur;break}ne=Ir,mt=""}Te=y.slice(j,j=u[le++]),Ce=Zt(u[le++],t.cm.options)}}}function En(e,t,u){this.line=t,this.rest=Pr(t),this.size=this.rest?Mt(k(this.rest))-u+1:1,this.node=this.text=null,this.hidden=Ar(e,t)}function $n(e,t,u){for(var l=[],y,j=t;j<u;j=y){var $=new En(e.doc,ft(e.doc,j),j);y=j+$.size,l.push($)}return l}var Jn=null;function fr(e){Jn?Jn.ops.push(e):e.ownsGroup=Jn={ops:[e],delayedCallbacks:[]}}function Wi(e){var t=e.delayedCallbacks,u=0;do{for(;u<t.length;u++)t[u].call(null);for(var l=0;l<e.ops.length;l++){var y=e.ops[l];if(y.cursorActivityHandlers)for(;y.cursorActivityCalled<y.cursorActivityHandlers.length;)y.cursorActivityHandlers[y.cursorActivityCalled++].call(null,y.cm)}}while(u<t.length)}function xn(e,t){var u=e.ownsGroup;if(!u)return;try{Wi(u)}finally{Jn=null,t(u)}}var dn=null;function fn(e,t){var u=$e(e,t);if(!u.length)return;var l=Array.prototype.slice.call(arguments,2),y;Jn?y=Jn.delayedCallbacks:dn?y=dn:(y=dn=[],setTimeout(pr,0));for(var j=function(ee){y.push(function(){return u[ee].apply(null,l)})},$=0;$<u.length;++$)j($)}function pr(){var e=dn;dn=null;for(var t=0;t<e.length;++t)e[t]()}function Qr(e,t,u,l){for(var y=0;y<t.changes.length;y++){var j=t.changes[y];j=="text"?nn(e,t):j=="gutter"?en(e,t,u,l):j=="class"?At(e,t):j=="widget"&&Et(e,t,l)}t.changes=null}function qr(e){return e.node==e.text&&(e.node=p("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),K&&W<8&&(e.node.style.zIndex=2)),e.node}function ri(e,t){var u=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(u&&(u+=" CodeMirror-linebackground"),t.background)u?t.background.className=u:(t.background.parentNode.removeChild(t.background),t.background=null);else if(u){var l=qr(t);t.background=l.insertBefore(p("div",null,u),l.firstChild),e.display.input.setUneditable(t.background)}}function Ti(e,t){var u=e.display.externalMeasured;return u&&u.line==t.line?(e.display.externalMeasured=null,t.measure=u.measure,u.built):qt(e,t)}function nn(e,t){var u=t.text.className,l=Ti(e,t);t.text==t.node&&(t.node=l.pre),t.text.parentNode.replaceChild(l.pre,t.text),t.text=l.pre,l.bgClass!=t.bgClass||l.textClass!=t.textClass?(t.bgClass=l.bgClass,t.textClass=l.textClass,At(e,t)):u&&(t.text.className=u)}function At(e,t){ri(e,t),t.line.wrapClass?qr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var u=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=u||""}function en(e,t,u,l){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var y=qr(t);t.gutterBackground=p("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px; width: "+l.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),y.insertBefore(t.gutterBackground,t.text)}var j=t.line.gutterMarkers;if(e.options.lineNumbers||j){var $=qr(t),ee=t.gutter=p("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px");if(e.display.input.setUneditable(ee),$.insertBefore(ee,t.text),t.line.gutterClass&&(ee.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!j||!j["CodeMirror-linenumbers"])&&(t.lineNumber=ee.appendChild(p("div",vn(e.options,u),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+l.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),j)for(var ne=0;ne<e.display.gutterSpecs.length;++ne){var le=e.display.gutterSpecs[ne].className,Te=j.hasOwnProperty(le)&&j[le];Te&&ee.appendChild(p("div",[Te],"CodeMirror-gutter-elt","left: "+l.gutterLeft[le]+"px; width: "+l.gutterWidth[le]+"px"))}}}function Et(e,t,u){t.alignable&&(t.alignable=null);for(var l=A("CodeMirror-linewidget"),y=t.node.firstChild,j=void 0;y;y=j)j=y.nextSibling,l.test(y.className)&&t.node.removeChild(y);In(e,t,u)}function hn(e,t,u,l){var y=Ti(e,t);return t.text=t.node=y.pre,y.bgClass&&(t.bgClass=y.bgClass),y.textClass&&(t.textClass=y.textClass),At(e,t),en(e,t,u,l),In(e,t,l),t.node}function In(e,t,u){if(Zn(e,t.line,t,u,!0),t.rest)for(var l=0;l<t.rest.length;l++)Zn(e,t.rest[l],t,u,!1)}function Zn(e,t,u,l,y){if(!t.widgets)return;for(var j=qr(u),$=0,ee=t.widgets;$<ee.length;++$){var ne=ee[$],le=p("div",[ne.node],"CodeMirror-linewidget"+(ne.className?" "+ne.className:""));ne.handleMouseEvents||le.setAttribute("cm-ignore-events","true"),wr(ne,le,u,l),e.display.input.setUneditable(le),y&&ne.above?j.insertBefore(le,u.gutter||u.text):j.appendChild(le),fn(ne,"redraw")}}function wr(e,t,u,l){if(e.noHScroll){(u.alignable||(u.alignable=[])).push(t);var y=l.wrapperWidth;t.style.left=l.fixedPos+"px",e.coverGutter||(y-=l.gutterTotalWidth,t.style.paddingLeft=l.gutterTotalWidth+"px"),t.style.width=y+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-l.gutterTotalWidth+"px"))}function Qn(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!v(document.body,e.node)){var u="position: relative;";e.coverGutter&&(u+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(u+="width: "+t.display.wrapper.clientWidth+"px;"),m(t.display.measure,p("div",[e.node],null,u))}return e.height=e.node.parentNode.offsetHeight}function pn(e,t){for(var u=_e(t);u!=e.wrapper;u=u.parentNode)if(!u||u.nodeType==1&&u.getAttribute("cm-ignore-events")=="true"||u.parentNode==e.sizer&&u!=e.mover)return!0}function Dn(e){return e.lineSpace.offsetTop}function Xr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function jr(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=m(e.measure,p("pre","x","CodeMirror-line-like")),u=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,l={left:parseInt(u.paddingLeft),right:parseInt(u.paddingRight)};return!isNaN(l.left)&&!isNaN(l.right)&&(e.cachedPaddingH=l),l}function Vn(e){return fe-e.display.nativeBarWidth}function mr(e){return e.display.scroller.clientWidth-Vn(e)-e.display.barWidth}function Sr(e){return e.display.scroller.clientHeight-Vn(e)-e.display.barHeight}function nr(e,t,u){var l=e.options.lineWrapping,y=l&&mr(e);if(!t.measure.heights||l&&t.measure.width!=y){var j=t.measure.heights=[];if(l){t.measure.width=y;for(var $=t.text.firstChild.getClientRects(),ee=0;ee<$.length-1;ee++){var ne=$[ee],le=$[ee+1];Math.abs(ne.bottom-le.bottom)>2&&j.push((ne.bottom+le.top)/2-u.top)}}j.push(u.bottom-u.top)}}function Gr(e,t,u){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var l=0;l<e.rest.length;l++)if(e.rest[l]==t)return{map:e.measure.maps[l],cache:e.measure.caches[l]};for(var y=0;y<e.rest.length;y++)if(Mt(e.rest[y])>u)return{map:e.measure.maps[y],cache:e.measure.caches[y],before:!0}}function wi(e,t){t=hr(t);var u=Mt(t),l=e.display.externalMeasured=new En(e.doc,t,u);l.lineN=u;var y=l.built=qt(e,l);return l.text=y.pre,m(e.display.lineMeasure,y.pre),l}function Br(e,t,u,l){return ei(e,_r(e,t),u,l)}function ca(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[gi(e,t)];var u=e.display.externalMeasured;if(u&&t>=u.lineN&&t<u.lineN+u.size)return u}function _r(e,t){var u=Mt(t),l=ca(e,u);l&&!l.text?l=null:l&&l.changes&&(Qr(e,l,u,Ua(e)),e.curOp.forceUpdate=!0),l||(l=wi(e,t));var y=Gr(l,t,u);return{line:t,view:l,rect:null,map:y.map,cache:y.cache,before:y.before,hasHeights:!1}}function ei(e,t,u,l,y){t.before&&(u=-1);var j=u+(l||""),$;return t.cache.hasOwnProperty(j)?$=t.cache[j]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(nr(e,t.view,t.rect),t.hasHeights=!0),$=Ws(e,t,u,l),$.bogus||(t.cache[j]=$)),{left:$.left,right:$.right,top:y?$.rtop:$.top,bottom:y?$.rbottom:$.bottom}}var fo={left:0,right:0,top:0,bottom:0};function po(e,t,u){for(var l,y,j,$,ee,ne,le=0;le<e.length;le+=3)if(ee=e[le],ne=e[le+1],t<ee?(y=0,j=1,$="left"):t<ne?(y=t-ee,j=y+1):(le==e.length-3||t==ne&&e[le+3]>t)&&(j=ne-ee,y=j-1,t>=ne&&($="right")),y!=null){if(l=e[le+2],ee==ne&&u==(l.insertLeft?"left":"right")&&($=u),u=="left"&&y==0)for(;le&&e[le-2]==e[le-3]&&e[le-1].insertLeft;)l=e[(le-=3)+2],$="left";if(u=="right"&&y==ne-ee)for(;le<e.length-3&&e[le+3]==e[le+4]&&!e[le+5].insertLeft;)l=e[(le+=3)+2],$="right";break}return{node:l,start:y,end:j,collapse:$,coverStart:ee,coverEnd:ne}}function Bs(e,t){var u=fo;if(t=="left")for(var l=0;l<e.length&&!((u=e[l]).left!=u.right);l++);else for(var y=e.length-1;y>=0&&!((u=e[y]).left!=u.right);y--);return u}function Ws(e,t,u,l){var y=po(t.map,u,l),j=y.node,$=y.start,ee=y.end,ne=y.collapse,le;if(j.nodeType==3){for(var Te=0;Te<4;Te++){for(;$&&Le(t.line.text.charAt(y.coverStart+$));)--$;for(;y.coverStart+ee<y.coverEnd&&Le(t.line.text.charAt(y.coverStart+ee));)++ee;if(K&&W<9&&$==0&&ee==y.coverEnd-y.coverStart?le=j.parentNode.getBoundingClientRect():le=Bs(E(j,$,ee).getClientRects(),l),le.left||le.right||$==0)break;ee=$,$=$-1,ne="right"}K&&W<11&&(le=Hs(e.display.measure,le))}else{$>0&&(ne=l="right");var Ce;e.options.lineWrapping&&(Ce=j.getClientRects()).length>1?le=Ce[l=="right"?Ce.length-1:0]:le=j.getBoundingClientRect()}if(K&&W<9&&!$&&(!le||!le.left&&!le.right)){var Be=j.parentNode.getClientRects()[0];Be?le={left:Be.left,right:Be.left+Ci(e.display),top:Be.top,bottom:Be.bottom}:le=fo}for(var ke=le.top-t.rect.top,qe=le.bottom-t.rect.top,at=(ke+qe)/2,mt=t.view.measure.heights,bt=0;bt<mt.length-1&&!(at<mt[bt]);bt++);var Tt=bt?mt[bt-1]:0,_t=mt[bt],St={left:(ne=="right"?le.right:le.left)-t.rect.left,right:(ne=="left"?le.left:le.right)-t.rect.left,top:Tt,bottom:_t};return!le.left&&!le.right&&(St.bogus=!0),e.options.singleCursorHeightPerLine||(St.rtop=ke,St.rbottom=qe),St}function Hs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!xe(e))return t;var u=screen.logicalXDPI/screen.deviceXDPI,l=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*u,right:t.right*u,top:t.top*l,bottom:t.bottom*l}}function mo(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function go(e){e.display.externalMeasure=null,b(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)mo(e.display.view[t])}function Hi(e){go(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function vo(){return g&&i?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function yo(){return g&&i?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Da(e){var t=0;if(e.widgets)for(var u=0;u<e.widgets.length;++u)e.widgets[u].above&&(t+=Qn(e.widgets[u]));return t}function da(e,t,u,l,y){if(!y){var j=Da(t);u.top+=j,u.bottom+=j}if(l=="line")return u;l||(l="local");var $=Hn(t);if(l=="local"?$+=Dn(e.display):$-=e.display.viewOffset,l=="page"||l=="window"){var ee=e.display.lineSpace.getBoundingClientRect();$+=ee.top+(l=="window"?0:yo());var ne=ee.left+(l=="window"?0:vo());u.left+=ne,u.right+=ne}return u.top+=$,u.bottom+=$,u}function bo(e,t,u){if(u=="div")return t;var l=t.left,y=t.top;if(u=="page")l-=vo(),y-=yo();else if(u=="local"||!u){var j=e.display.sizer.getBoundingClientRect();l+=j.left,y+=j.top}var $=e.display.lineSpace.getBoundingClientRect();return{left:l-$.left,top:y-$.top}}function Ma(e,t,u,l,y){return l||(l=ft(e.doc,t.line)),da(e,l,Br(e,l,t.ch,y),u)}function Yr(e,t,u,l,y,j){l=l||ft(e.doc,t.line),y||(y=_r(e,l));function $(qe,at){var mt=ei(e,y,qe,at?"right":"left",j);return at?mt.left=mt.right:mt.right=mt.left,da(e,l,mt,u)}var ee=ht(l,e.doc.direction),ne=t.ch,le=t.sticky;if(ne>=l.text.length?(ne=l.text.length,le="before"):ne<=0&&(ne=0,le="after"),!ee)return $(le=="before"?ne-1:ne,le=="before");function Te(qe,at,mt){var bt=ee[at],Tt=bt.level==1;return $(mt?qe-1:qe,Tt!=mt)}var Ce=lt(ee,ne,le),Be=ut,ke=Te(ne,Ce,le=="before");return Be!=null&&(ke.other=Te(ne,Be,le!="before")),ke}function _o(e,t){var u=0;t=Dt(e.doc,t),e.options.lineWrapping||(u=Ci(e.display)*t.ch);var l=ft(e.doc,t.line),y=Hn(l)+Dn(e.display);return{left:u,right:u,top:y,bottom:y+l.height}}function Pa(e,t,u,l,y){var j=rt(e,t,u);return j.xRel=y,l&&(j.outside=l),j}function ka(e,t,u){var l=e.doc;if(u+=e.display.viewOffset,u<0)return Pa(l.first,0,null,-1,-1);var y=Ft(l,u),j=l.first+l.size-1;if(y>j)return Pa(l.first+l.size-1,ft(l,j).text.length,null,1,1);t<0&&(t=0);for(var $=ft(l,y);;){var ee=Ks(e,$,y,t,u),ne=ar($,ee.ch+(ee.xRel>0||ee.outside>0?1:0));if(!ne)return ee;var le=ne.find(1);if(le.line==y)return le;$=ft(l,y=le.line)}}function Eo(e,t,u,l){l-=Da(t);var y=t.text.length,j=Ye(function($){return ei(e,u,$-1).bottom<=l},y,0);return y=Ye(function($){return ei(e,u,$).top>l},j,y),{begin:j,end:y}}function xo(e,t,u,l){u||(u=_r(e,t));var y=da(e,t,ei(e,u,l),"line").top;return Eo(e,t,u,y)}function Na(e,t,u,l){return e.bottom<=u?!1:e.top>u?!0:(l?e.left:e.right)>t}function Ks(e,t,u,l,y){y-=Hn(t);var j=_r(e,t),$=Da(t),ee=0,ne=t.text.length,le=!0,Te=ht(t,e.doc.direction);if(Te){var Ce=(e.options.lineWrapping?zs:Gs)(e,t,u,j,Te,l,y);le=Ce.level!=1,ee=le?Ce.from:Ce.to-1,ne=le?Ce.to:Ce.from-1}var Be=null,ke=null,qe=Ye(function(zt){var Ut=ei(e,j,zt);return Ut.top+=$,Ut.bottom+=$,Na(Ut,l,y,!1)?(Ut.top<=y&&Ut.left<=l&&(Be=zt,ke=Ut),!0):!1},ee,ne),at,mt,bt=!1;if(ke){var Tt=l-ke.left<ke.right-l,_t=Tt==le;qe=Be+(_t?0:1),mt=_t?"after":"before",at=Tt?ke.left:ke.right}else{!le&&(qe==ne||qe==ee)&&qe++,mt=qe==0?"after":qe==t.text.length?"before":ei(e,j,qe-(le?1:0)).bottom+$<=y==le?"after":"before";var St=Yr(e,rt(u,qe,mt),"line",t,j);at=St.left,bt=y<St.top?-1:y>=St.bottom?1:0}return qe=Pe(t.text,qe,1),Pa(u,qe,mt,bt,l-at)}function Gs(e,t,u,l,y,j,$){var ee=Ye(function(Ce){var Be=y[Ce],ke=Be.level!=1;return Na(Yr(e,rt(u,ke?Be.to:Be.from,ke?"before":"after"),"line",t,l),j,$,!0)},0,y.length-1),ne=y[ee];if(ee>0){var le=ne.level!=1,Te=Yr(e,rt(u,le?ne.from:ne.to,le?"after":"before"),"line",t,l);Na(Te,j,$,!0)&&Te.top>$&&(ne=y[ee-1])}return ne}function zs(e,t,u,l,y,j,$){var ee=Eo(e,t,l,$),ne=ee.begin,le=ee.end;/\s/.test(t.text.charAt(le-1))&&le--;for(var Te=null,Ce=null,Be=0;Be<y.length;Be++){var ke=y[Be];if(ke.from>=le||ke.to<=ne)continue;var qe=ke.level!=1,at=ei(e,l,qe?Math.min(le,ke.to)-1:Math.max(ne,ke.from)).right,mt=at<j?j-at+1e9:at-j;(!Te||Ce>mt)&&(Te=ke,Ce=mt)}return Te||(Te=y[y.length-1]),Te.from<ne&&(Te={from:ne,to:Te.to,level:Te.level}),Te.to>le&&(Te={from:Te.from,to:le,level:Te.level}),Te}var pi;function Si(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(pi==null){pi=p("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)pi.appendChild(document.createTextNode("x")),pi.appendChild(p("br"));pi.appendChild(document.createTextNode("x"))}m(e.measure,pi);var u=pi.offsetHeight/50;return u>3&&(e.cachedTextHeight=u),b(e.measure),u||1}function Ci(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=p("span","xxxxxxxxxx"),u=p("pre",[t],"CodeMirror-line-like");m(e.measure,u);var l=t.getBoundingClientRect(),y=(l.right-l.left)/10;return y>2&&(e.cachedCharWidth=y),y||10}function Ua(e){for(var t=e.display,u={},l={},y=t.gutters.clientLeft,j=t.gutters.firstChild,$=0;j;j=j.nextSibling,++$){var ee=e.display.gutterSpecs[$].className;u[ee]=j.offsetLeft+j.clientLeft+y,l[ee]=j.clientWidth}return{fixedPos:Fa(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:u,gutterWidth:l,wrapperWidth:t.wrapper.clientWidth}}function Fa(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function To(e){var t=Si(e.display),u=e.options.lineWrapping,l=u&&Math.max(5,e.display.scroller.clientWidth/Ci(e.display)-3);return function(y){if(Ar(e.doc,y))return 0;var j=0;if(y.widgets)for(var $=0;$<y.widgets.length;$++)y.widgets[$].height&&(j+=y.widgets[$].height);return u?j+(Math.ceil(y.text.length/l)||1)*t:j+t}}function ja(e){var t=e.doc,u=To(e);t.iter(function(l){var y=u(l);y!=l.height&&Ot(l,y)})}function mi(e,t,u,l){var y=e.display;if(!u&&_e(t).getAttribute("cm-not-content")=="true")return null;var j,$,ee=y.lineSpace.getBoundingClientRect();try{j=t.clientX-ee.left,$=t.clientY-ee.top}catch(Ce){return null}var ne=ka(e,j,$),le;if(l&&ne.xRel>0&&(le=ft(e.doc,ne.line).text).length==ne.ch){var Te=G(le,le.length,e.options.tabSize)-le.length;ne=rt(ne.line,Math.max(0,Math.round((j-jr(e.display).left)/Ci(e.display))-Te))}return ne}function gi(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var u=e.display.view,l=0;l<u.length;l++)if(t-=u[l].size,t<0)return l}function Rr(e,t,u,l){t==null&&(t=e.doc.first),u==null&&(u=e.doc.first+e.doc.size),l||(l=0);var y=e.display;if(l&&u<y.viewTo&&(y.updateLineNumbers==null||y.updateLineNumbers>t)&&(y.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=y.viewTo)jt&&zr(e.doc,t)<y.viewTo&&si(e);else if(u<=y.viewFrom)jt&&kr(e.doc,u+l)>y.viewFrom?si(e):(y.viewFrom+=l,y.viewTo+=l);else if(t<=y.viewFrom&&u>=y.viewTo)si(e);else if(t<=y.viewFrom){var j=ha(e,u,u+l,1);j?(y.view=y.view.slice(j.index),y.viewFrom=j.lineN,y.viewTo+=l):si(e)}else if(u>=y.viewTo){var $=ha(e,t,t,-1);$?(y.view=y.view.slice(0,$.index),y.viewTo=$.lineN):si(e)}else{var ee=ha(e,t,t,-1),ne=ha(e,u,u+l,1);ee&&ne?(y.view=y.view.slice(0,ee.index).concat($n(e,ee.lineN,ne.lineN)).concat(y.view.slice(ne.index)),y.viewTo+=l):si(e)}var le=y.externalMeasured;le&&(u<le.lineN?le.lineN+=l:t<le.lineN+le.size&&(y.externalMeasured=null))}function oi(e,t,u){e.curOp.viewChanged=!0;var l=e.display,y=e.display.externalMeasured;if(y&&t>=y.lineN&&t<y.lineN+y.size&&(l.externalMeasured=null),t<l.viewFrom||t>=l.viewTo)return;var j=l.view[gi(e,t)];if(j.node==null)return;var $=j.changes||(j.changes=[]);se($,u)==-1&&$.push(u)}function si(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function ha(e,t,u,l){var y=gi(e,t),j,$=e.display.view;if(!jt||u==e.doc.first+e.doc.size)return{index:y,lineN:u};for(var ee=e.display.viewFrom,ne=0;ne<y;ne++)ee+=$[ne].size;if(ee!=t){if(l>0){if(y==$.length-1)return null;j=ee+$[y].size-t,y++}else j=ee-t;t+=j,u+=j}for(;zr(e.doc,u)!=u;){if(y==(l<0?0:$.length-1))return null;u+=l*$[y-(l<0?1:0)].size,y+=l}return{index:y,lineN:u}}function Vs(e,t,u){var l=e.display,y=l.view;y.length==0||t>=l.viewTo||u<=l.viewFrom?(l.view=$n(e,t,u),l.viewFrom=t):(l.viewFrom>t?l.view=$n(e,t,l.viewFrom).concat(l.view):l.viewFrom<t&&(l.view=l.view.slice(gi(e,t))),l.viewFrom=t,l.viewTo<u?l.view=l.view.concat($n(e,l.viewTo,u)):l.viewTo>u&&(l.view=l.view.slice(0,gi(e,u)))),l.viewTo=u}function wo(e){for(var t=e.display.view,u=0,l=0;l<t.length;l++){var y=t[l];!y.hidden&&(!y.node||y.changes)&&++u}return u}function Ki(e){e.display.input.showSelection(e.display.input.prepareSelection())}function So(e,t){t===void 0&&(t=!0);for(var u=e.doc,l={},y=l.cursors=document.createDocumentFragment(),j=l.selection=document.createDocumentFragment(),$=0;$<u.sel.ranges.length;$++){if(!t&&$==u.sel.primIndex)continue;var ee=u.sel.ranges[$];if(ee.from().line>=e.display.viewTo||ee.to().line<e.display.viewFrom)continue;var ne=ee.empty();(ne||e.options.showCursorWhenSelecting)&&Co(e,ee.head,y),ne||Xs(e,ee,j)}return l}function Co(e,t,u){var l=Yr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),y=u.appendChild(p("div","\xA0","CodeMirror-cursor"));if(y.style.left=l.left+"px",y.style.top=l.top+"px",y.style.height=Math.max(0,l.bottom-l.top)*e.options.cursorHeight+"px",l.other){var j=u.appendChild(p("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));j.style.display="",j.style.left=l.other.left+"px",j.style.top=l.other.top+"px",j.style.height=(l.other.bottom-l.other.top)*.85+"px"}}function fa(e,t){return e.top-t.top||e.left-t.left}function Xs(e,t,u){var l=e.display,y=e.doc,j=document.createDocumentFragment(),$=jr(e.display),ee=$.left,ne=Math.max(l.sizerWidth,mr(e)-l.sizer.offsetLeft)-$.right,le=y.direction=="ltr";function Te(_t,St,zt,Ut){St<0&&(St=0),St=Math.round(St),Ut=Math.round(Ut),j.appendChild(p("div",null,"CodeMirror-selected","position: absolute; left: "+_t+`px;
top: `+St+"px; width: "+(zt==null?ne-_t:zt)+`px;
height: `+(Ut-St)+"px"))}function Ce(_t,St,zt){var Ut=ft(y,_t),un=Ut.text.length,Pn,lr;function Kn(qn,Dr){return Ma(e,rt(_t,qn),"div",Ut,Dr)}function Ur(qn,Dr,gr){var rr=xo(e,Ut,null,qn),er=Dr=="ltr"==(gr=="after")?"left":"right",Gn=gr=="after"?rr.begin:rr.end-(/\s/.test(Ut.text.charAt(rr.end-1))?2:1);return Kn(Gn,er)[er]}var Ir=ht(Ut,y.direction);return tt(Ir,St||0,zt==null?un:zt,function(qn,Dr,gr,rr){var er=gr=="ltr",Gn=Kn(qn,er?"left":"right"),Mr=Kn(Dr-1,er?"right":"left"),ji=St==null&&qn==0,fi=zt==null&&Dr==un,xr=rr==0,ti=!Ir||rr==Ir.length-1;if(Mr.top-Gn.top<=3){var ur=(le?ji:fi)&&xr,co=(le?fi:ji)&&ti,ai=ur?ee:(er?Gn:Mr).left,Ei=co?ne:(er?Mr:Gn).right;Te(ai,Gn.top,Ei-ai,Gn.bottom)}else{var xi,Or,Bi,ho;er?(xi=le&&ji&&xr?ee:Gn.left,Or=le?ne:Ur(qn,gr,"before"),Bi=le?ee:Ur(Dr,gr,"after"),ho=le&&fi&&ti?ne:Mr.right):(xi=le?Ur(qn,gr,"before"):ee,Or=!le&&ji&&xr?ne:Gn.right,Bi=!le&&fi&&ti?ee:Mr.left,ho=le?Ur(Dr,gr,"after"):ne),Te(xi,Gn.top,Or-xi,Gn.bottom),Gn.bottom<Mr.top&&Te(ee,Gn.bottom,null,Mr.top),Te(Bi,Mr.top,ho-Bi,Mr.bottom)}(!Pn||fa(Gn,Pn)<0)&&(Pn=Gn),fa(Mr,Pn)<0&&(Pn=Mr),(!lr||fa(Gn,lr)<0)&&(lr=Gn),fa(Mr,lr)<0&&(lr=Mr)}),{start:Pn,end:lr}}var Be=t.from(),ke=t.to();if(Be.line==ke.line)Ce(Be.line,Be.ch,ke.ch);else{var qe=ft(y,Be.line),at=ft(y,ke.line),mt=hr(qe)==hr(at),bt=Ce(Be.line,Be.ch,mt?qe.text.length+1:null).end,Tt=Ce(ke.line,mt?0:null,ke.ch).start;mt&&(bt.top<Tt.top-2?(Te(bt.right,bt.top,null,bt.bottom),Te(ee,Tt.top,Tt.left,Tt.bottom)):Te(bt.right,bt.top,Tt.left-bt.right,bt.bottom)),bt.bottom<Tt.top&&Te(ee,bt.bottom,null,Tt.top)}u.appendChild(j)}function Ba(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var u=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Oi(e),t.cursorDiv.style.visibility=(u=!u)?"":"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,Oi(e))},100)}function Wa(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(ue(e,"focus",e,t),e.state.focused=!0,F(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),n&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ba(e)}function Oi(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(ue(e,"blur",e,t),e.state.focused=!1,_(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,u=t.lineDiv.offsetTop,l=0;l<t.view.length;l++){var y=t.view[l],j=e.options.lineWrapping,$=void 0,ee=0;if(y.hidden)continue;if(K&&W<8){var ne=y.node.offsetTop+y.node.offsetHeight;$=ne-u,u=ne}else{var le=y.node.getBoundingClientRect();$=le.bottom-le.top,!j&&y.text.firstChild&&(ee=y.text.firstChild.getBoundingClientRect().right-le.left-1)}var Te=y.line.height-$;if((Te>.005||Te<-.005)&&(Ot(y.line,$),Ro(y.line),y.rest))for(var Ce=0;Ce<y.rest.length;Ce++)Ro(y.rest[Ce]);if(ee>e.display.sizerWidth){var Be=Math.ceil(ee/Ci(e.display));Be>e.display.maxLineLength&&(e.display.maxLineLength=Be,e.display.maxLine=y.line,e.display.maxLineChanged=!0)}}}function Ro(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var u=e.widgets[t],l=u.node.parentNode;l&&(u.height=l.offsetHeight)}}function ma(e,t,u){var l=u&&u.top!=null?Math.max(0,u.top):e.scroller.scrollTop;l=Math.floor(l-Dn(e));var y=u&&u.bottom!=null?u.bottom:l+e.wrapper.clientHeight,j=Ft(t,l),$=Ft(t,y);if(u&&u.ensure){var ee=u.ensure.from.line,ne=u.ensure.to.line;ee<j?(j=ee,$=Ft(t,Hn(ft(t,ee))+e.wrapper.clientHeight)):Math.min(ne,t.lastLine())>=$&&(j=Ft(t,Hn(ft(t,ne))-e.wrapper.clientHeight),$=ne)}return{from:j,to:Math.max($,j+1)}}function Ys(e,t){if(q(e,"scrollCursorIntoView"))return;var u=e.display,l=u.sizer.getBoundingClientRect(),y=null;if(t.top+l.top<0?y=!0:t.bottom+l.top>(window.innerHeight||document.documentElement.clientHeight)&&(y=!1),y!=null&&!s){var j=p("div","\u200B",null,`position: absolute;
top: `+(t.top-u.viewOffset-Dn(e.display))+`px;
height: `+(t.bottom-t.top+Vn(e)+u.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(j),j.scrollIntoView(y),e.display.lineSpace.removeChild(j)}}function $s(e,t,u,l){l==null&&(l=0);var y;!e.options.lineWrapping&&t==u&&(t=t.ch?rt(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,u=t.sticky=="before"?rt(t.line,t.ch+1,"before"):t);for(var j=0;j<5;j++){var $=!1,ee=Yr(e,t),ne=!u||u==t?ee:Yr(e,u);y={left:Math.min(ee.left,ne.left),top:Math.min(ee.top,ne.top)-l,right:Math.max(ee.left,ne.left),bottom:Math.max(ee.bottom,ne.bottom)+l};var le=Ha(e,y),Te=e.doc.scrollTop,Ce=e.doc.scrollLeft;if(le.scrollTop!=null&&(zi(e,le.scrollTop),Math.abs(e.doc.scrollTop-Te)>1&&($=!0)),le.scrollLeft!=null&&(vi(e,le.scrollLeft),Math.abs(e.doc.scrollLeft-Ce)>1&&($=!0)),!$)break}return y}function Js(e,t){var u=Ha(e,t);u.scrollTop!=null&&zi(e,u.scrollTop),u.scrollLeft!=null&&vi(e,u.scrollLeft)}function Ha(e,t){var u=e.display,l=Si(e.display);t.top<0&&(t.top=0);var y=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:u.scroller.scrollTop,j=Sr(e),$={};t.bottom-t.top>j&&(t.bottom=t.top+j);var ee=e.doc.height+Xr(u),ne=t.top<l,le=t.bottom>ee-l;if(t.top<y)$.scrollTop=ne?0:t.top;else if(t.bottom>y+j){var Te=Math.min(t.top,(le?ee:t.bottom)-j);Te!=y&&($.scrollTop=Te)}var Ce=e.options.fixedGutter?0:u.gutters.offsetWidth,Be=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:u.scroller.scrollLeft-Ce,ke=mr(e)-u.gutters.offsetWidth,qe=t.right-t.left>ke;return qe&&(t.right=t.left+ke),t.left<10?$.scrollLeft=0:t.left<Be?$.scrollLeft=Math.max(0,t.left+Ce-(qe?0:10)):t.right>ke+Be-3&&($.scrollLeft=t.right+(qe?0:10)-ke),$}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 Ai(e){ga(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Gi(e,t,u){(t!=null||u!=null)&&ga(e),t!=null&&(e.curOp.scrollLeft=t),u!=null&&(e.curOp.scrollTop=u)}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 u=_o(e,t.from),l=_o(e,t.to);Lo(e,u,l,t.margin)}}function Lo(e,t,u,l){var y=Ha(e,{left:Math.min(t.left,u.left),top:Math.min(t.top,u.top)-l,right:Math.max(t.right,u.right),bottom:Math.max(t.bottom,u.bottom)+l});Gi(e,y.scrollLeft,y.scrollTop)}function zi(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;D||za(e,{top:t}),Io(e,t,!0),D&&za(e),Yi(e,100)}function Io(e,t,u){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!u)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function vi(e,t,u,l){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(u?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!l)return;e.doc.scrollLeft=t,No(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Vi(e){var t=e.display,u=t.gutters.offsetWidth,l=Math.round(e.doc.height+Xr(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?u:0,docHeight:l,scrollHeight:l+Vn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:u}}var yi=function(e,t,u){this.cm=u;var l=this.vert=p("div",[p("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),y=this.horiz=p("div",[p("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");l.tabIndex=y.tabIndex=-1,e(l),e(y),Re(l,"scroll",function(){l.clientHeight&&t(l.scrollTop,"vertical")}),Re(y,"scroll",function(){y.clientWidth&&t(y.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,K&&W<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};yi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,u=e.scrollHeight>e.clientHeight+1,l=e.nativeBarWidth;if(u){this.vert.style.display="block",this.vert.style.bottom=t?l+"px":"0";var y=e.viewHeight-(t?l:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+y)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=u?l+"px":"0",this.horiz.style.left=e.barLeft+"px";var j=e.viewWidth-e.barLeft-(u?l:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+j)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(l==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:u?l:0,bottom:t?l:0}},yi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},yi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},yi.prototype.zeroWidthHack=function(){var e=r&&!c?"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},yi.prototype.enableZeroWidthBar=function(e,t,u){e.style.pointerEvents="auto";function l(){var y=e.getBoundingClientRect(),j=u=="vert"?document.elementFromPoint(y.right-1,(y.top+y.bottom)/2):document.elementFromPoint((y.right+y.left)/2,y.bottom-1);j!=e?e.style.pointerEvents="none":t.set(1e3,l)}t.set(1e3,l)},yi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Xi=function(){};Xi.prototype.update=function(){return{bottom:0,right:0}},Xi.prototype.setScrollLeft=function(){},Xi.prototype.setScrollTop=function(){},Xi.prototype.clear=function(){};function Ri(e,t){t||(t=Vi(e));var u=e.display.barWidth,l=e.display.barHeight;Do(e,t);for(var y=0;y<4&&u!=e.display.barWidth||l!=e.display.barHeight;y++)u!=e.display.barWidth&&e.options.lineWrapping&&pa(e),Do(e,Vi(e)),u=e.display.barWidth,l=e.display.barHeight}function Do(e,t){var u=e.display,l=u.scrollbars.update(t);u.sizer.style.paddingRight=(u.barWidth=l.right)+"px",u.sizer.style.paddingBottom=(u.barHeight=l.bottom)+"px",u.heightForcer.style.borderBottom=l.bottom+"px solid transparent",l.right&&l.bottom?(u.scrollbarFiller.style.display="block",u.scrollbarFiller.style.height=l.bottom+"px",u.scrollbarFiller.style.width=l.right+"px"):u.scrollbarFiller.style.display="",l.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(u.gutterFiller.style.display="block",u.gutterFiller.style.height=l.bottom+"px",u.gutterFiller.style.width=t.gutterWidth+"px"):u.gutterFiller.style.display=""}var Mo={native:yi,null:Xi};function Po(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&_(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),Re(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,u){u=="horizontal"?vi(e,t):zi(e,t)},e),e.display.scrollbars.addClass&&F(e.display.wrapper,e.display.scrollbars.addClass)}var Qs=0;function bi(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},fr(e.curOp)}function _i(e){var t=e.curOp;t&&xn(t,function(u){for(var l=0;l<u.ops.length;l++)u.ops[l].cm.curOp=null;qs(u)})}function qs(e){for(var t=e.ops,u=0;u<t.length;u++)el(t[u]);for(var l=0;l<t.length;l++)tl(t[l]);for(var y=0;y<t.length;y++)nl(t[y]);for(var j=0;j<t.length;j++)rl(t[j]);for(var $=0;$<t.length;$++)il(t[$])}function el(e){var t=e.cm,u=t.display;ol(t),e.updateMaxLine&&Vr(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<u.viewFrom||e.scrollToPos.to.line>=u.viewTo)||u.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,u=t.display;e.updatedDisplay&&pa(t),e.barMeasure=Vi(t),u.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Br(t,u.maxLine,u.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(u.scroller.clientWidth,u.sizer.offsetLeft+e.adjustWidthTo+Vn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,u.sizer.offsetLeft+e.adjustWidthTo-mr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=u.input.prepareSelection())}function rl(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&vi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var u=e.focus&&e.focus==P();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,u),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Ri(t,e.barMeasure),e.updatedDisplay&&Xa(t,e.barMeasure),e.selectionChanged&&Ba(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),u&&Oo(e.cm)}function il(e){var t=e.cm,u=t.display,l=t.doc;if(e.updatedDisplay&&ko(t,e.update),u.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(u.wheelStartX=u.wheelStartY=null),e.scrollTop!=null&&Io(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&vi(t,e.scrollLeft,!0,!0),e.scrollToPos){var y=$s(t,Dt(l,e.scrollToPos.from),Dt(l,e.scrollToPos.to),e.scrollToPos.margin);Ys(t,y)}var j=e.maybeHiddenMarkers,$=e.maybeUnhiddenMarkers;if(j)for(var ee=0;ee<j.length;++ee)j[ee].lines.length||ue(j[ee],"hide");if($)for(var ne=0;ne<$.length;++ne)$[ne].lines.length&&ue($[ne],"unhide");u.wrapper.offsetHeight&&(l.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&ue(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Nr(e,t){if(e.curOp)return t();bi(e);try{return t()}finally{_i(e)}}function or(e,t){return function(){if(e.curOp)return t.apply(e,arguments);bi(e);try{return t.apply(e,arguments)}finally{_i(e)}}}function Cr(e){return function(){if(this.curOp)return e.apply(this,arguments);bi(this);try{return e.apply(this,arguments)}finally{_i(this)}}}function sr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);bi(t);try{return e.apply(this,arguments)}finally{_i(t)}}}function Yi(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,U(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var u=+new Date+e.options.workTime,l=cn(e,t.highlightFrontier),y=[];t.iter(l.line,Math.min(t.first+t.size,e.display.viewTo+500),function(j){if(l.line>=e.display.viewFrom){var $=j.styles,ee=j.text.length>e.options.maxHighlightLength?dt(t.mode,l.state):null,ne=Tn(e,j,l,!0);ee&&(l.state=ee),j.styles=ne.styles;var le=j.styleClasses,Te=ne.classes;Te?j.styleClasses=Te:le&&(j.styleClasses=null);for(var Ce=!$||$.length!=j.styles.length||le!=Te&&(!le||!Te||le.bgClass!=Te.bgClass||le.textClass!=Te.textClass),Be=0;!Ce&&Be<$.length;++Be)Ce=$[Be]!=j.styles[Be];Ce&&y.push(l.line),j.stateAfter=l.save(),l.nextLine()}else j.text.length<=e.options.maxHighlightLength&&$t(e,j.text,l),j.stateAfter=l.line%5==0?l.save():null,l.nextLine();if(+new Date>u)return Yi(e,e.options.workDelay),!0}),t.highlightFrontier=l.line,t.modeFrontier=Math.max(t.modeFrontier,l.line),y.length&&Nr(e,function(){for(var j=0;j<y.length;j++)oi(e,y[j],"text")})}var va=function(e,t,u){var l=e.display;this.viewport=t,this.visible=ma(l,e.doc,t),this.editorIsHidden=!l.wrapper.offsetWidth,this.wrapperHeight=l.wrapper.clientHeight,this.wrapperWidth=l.wrapper.clientWidth,this.oldDisplayWidth=mr(e),this.force=u,this.dims=Ua(e),this.events=[]};va.prototype.signal=function(e,t){ae(e,t)&&this.events.push(arguments)},va.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ue.apply(null,this.events[e])};function ol(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Vn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Vn(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=P();if(!t||!v(e.display.lineDiv,t))return null;var u={activeElt:t};if(window.getSelection){var l=window.getSelection();l.anchorNode&&l.extend&&v(e.display.lineDiv,l.anchorNode)&&(u.anchorNode=l.anchorNode,u.anchorOffset=l.anchorOffset,u.focusNode=l.focusNode,u.focusOffset=l.focusOffset)}return u}function ll(e){if(!e||!e.activeElt||e.activeElt==P())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&v(document.body,e.anchorNode)&&v(document.body,e.focusNode)){var t=window.getSelection(),u=document.createRange();u.setEnd(e.anchorNode,e.anchorOffset),u.collapse(!1),t.removeAllRanges(),t.addRange(u),t.extend(e.focusNode,e.focusOffset)}}function Ga(e,t){var u=e.display,l=e.doc;if(t.editorIsHidden)return si(e),!1;if(!t.force&&t.visible.from>=u.viewFrom&&t.visible.to<=u.viewTo&&(u.updateLineNumbers==null||u.updateLineNumbers>=u.viewTo)&&u.renderedView==u.view&&wo(e)==0)return!1;Uo(e)&&(si(e),t.dims=Ua(e));var y=l.first+l.size,j=Math.max(t.visible.from-e.options.viewportMargin,l.first),$=Math.min(y,t.visible.to+e.options.viewportMargin);u.viewFrom<j&&j-u.viewFrom<20&&(j=Math.max(l.first,u.viewFrom)),u.viewTo>$&&u.viewTo-$<20&&($=Math.min(y,u.viewTo)),jt&&(j=zr(e.doc,j),$=kr(e.doc,$));var ee=j!=u.viewFrom||$!=u.viewTo||u.lastWrapHeight!=t.wrapperHeight||u.lastWrapWidth!=t.wrapperWidth;Vs(e,j,$),u.viewOffset=Hn(ft(e.doc,u.viewFrom)),e.display.mover.style.top=u.viewOffset+"px";var ne=wo(e);if(!ee&&ne==0&&!t.force&&u.renderedView==u.view&&(u.updateLineNumbers==null||u.updateLineNumbers>=u.viewTo))return!1;var le=sl(e);return ne>4&&(u.lineDiv.style.display="none"),ul(e,u.updateLineNumbers,t.dims),ne>4&&(u.lineDiv.style.display=""),u.renderedView=u.view,ll(le),b(u.cursorDiv),b(u.selectionDiv),u.gutters.style.height=u.sizer.style.minHeight=0,ee&&(u.lastWrapHeight=t.wrapperHeight,u.lastWrapWidth=t.wrapperWidth,Yi(e,400)),u.updateLineNumbers=null,!0}function ko(e,t){for(var u=t.viewport,l=!0;;l=!1){if(!l||!e.options.lineWrapping||t.oldDisplayWidth==mr(e)){if(u&&u.top!=null&&(u={top:Math.min(e.doc.height+Xr(e.display)-Sr(e),u.top)}),t.visible=ma(e.display,e.doc,u),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else l&&(t.visible=ma(e.display,e.doc,u));if(!Ga(e,t))break;pa(e);var y=Vi(e);Ki(e),Ri(e,y),Xa(e,y),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 u=new va(e,t);if(Ga(e,u)){pa(e),ko(e,u);var l=Vi(e);Ki(e),Ri(e,l),Xa(e,l),u.finish()}}function ul(e,t,u){var l=e.display,y=e.options.lineNumbers,j=l.lineDiv,$=j.firstChild;function ee(qe){var at=qe.nextSibling;return n&&r&&e.display.currentWheelTarget==qe?qe.style.display="none":qe.parentNode.removeChild(qe),at}for(var ne=l.view,le=l.viewFrom,Te=0;Te<ne.length;Te++){var Ce=ne[Te];if(!Ce.hidden)if(!Ce.node||Ce.node.parentNode!=j){var Be=hn(e,Ce,le,u);j.insertBefore(Be,$)}else{for(;$!=Ce.node;)$=ee($);var ke=y&&t!=null&&t<=le&&Ce.lineNumber;Ce.changes&&(se(Ce.changes,"gutter")>-1&&(ke=!1),Qr(e,Ce,le,u)),ke&&(b(Ce.lineNumber),Ce.lineNumber.appendChild(document.createTextNode(vn(e.options,le)))),$=Ce.node.nextSibling}le+=Ce.size}for(;$;)$=ee($)}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+Vn(e)+"px"}function No(e){var t=e.display,u=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var l=Fa(t)-t.scroller.scrollLeft+e.doc.scrollLeft,y=t.gutters.offsetWidth,j=l+"px",$=0;$<u.length;$++)if(!u[$].hidden){e.options.fixedGutter&&(u[$].gutter&&(u[$].gutter.style.left=j),u[$].gutterBackground&&(u[$].gutterBackground.style.left=j));var ee=u[$].alignable;if(ee)for(var ne=0;ne<ee.length;ne++)ee[ne].style.left=j}e.options.fixedGutter&&(t.gutters.style.left=l+y+"px")}function Uo(e){if(!e.options.lineNumbers)return!1;var t=e.doc,u=vn(e.options,t.first+t.size-1),l=e.display;if(u.length!=l.lineNumChars){var y=l.measure.appendChild(p("div",[p("div",u)],"CodeMirror-linenumber CodeMirror-gutter-elt")),j=y.firstChild.offsetWidth,$=y.offsetWidth-j;return l.lineGutter.style.width="",l.lineNumInnerWidth=Math.max(j,l.lineGutter.offsetWidth-$)+1,l.lineNumWidth=l.lineNumInnerWidth+$,l.lineNumChars=l.lineNumInnerWidth?u.length:-1,l.lineGutter.style.width=l.lineNumWidth+"px",Va(e.display),!0}return!1}function Ya(e,t){for(var u=[],l=!1,y=0;y<e.length;y++){var j=e[y],$=null;if(typeof j!="string"&&($=j.style,j=j.className),j=="CodeMirror-linenumbers")if(t)l=!0;else continue;u.push({className:j,style:$})}return t&&!l&&u.push({className:"CodeMirror-linenumbers",style:null}),u}function Fo(e){var t=e.gutters,u=e.gutterSpecs;b(t),e.lineGutter=null;for(var l=0;l<u.length;++l){var y=u[l],j=y.className,$=y.style,ee=t.appendChild(p("div",null,"CodeMirror-gutter "+j));$&&(ee.style.cssText=$),j=="CodeMirror-linenumbers"&&(e.lineGutter=ee,ee.style.width=(e.lineNumWidth||1)+"px")}t.style.display=u.length?"":"none",Va(e)}function $i(e){Fo(e.display),Rr(e),No(e)}function cl(e,t,u,l){var y=this;this.input=u,y.scrollbarFiller=p("div",null,"CodeMirror-scrollbar-filler"),y.scrollbarFiller.setAttribute("cm-not-content","true"),y.gutterFiller=p("div",null,"CodeMirror-gutter-filler"),y.gutterFiller.setAttribute("cm-not-content","true"),y.lineDiv=C("div",null,"CodeMirror-code"),y.selectionDiv=p("div",null,null,"position: relative; z-index: 1"),y.cursorDiv=p("div",null,"CodeMirror-cursors"),y.measure=p("div",null,"CodeMirror-measure"),y.lineMeasure=p("div",null,"CodeMirror-measure"),y.lineSpace=C("div",[y.measure,y.lineMeasure,y.selectionDiv,y.cursorDiv,y.lineDiv],null,"position: relative; outline: none");var j=C("div",[y.lineSpace],"CodeMirror-lines");y.mover=p("div",[j],null,"position: relative"),y.sizer=p("div",[y.mover],"CodeMirror-sizer"),y.sizerWidth=null,y.heightForcer=p("div",null,null,"position: absolute; height: "+fe+"px; width: 1px;"),y.gutters=p("div",null,"CodeMirror-gutters"),y.lineGutter=null,y.scroller=p("div",[y.sizer,y.heightForcer,y.gutters],"CodeMirror-scroll"),y.scroller.setAttribute("tabIndex","-1"),y.wrapper=p("div",[y.scrollbarFiller,y.gutterFiller,y.scroller],"CodeMirror"),K&&W<8&&(y.gutters.style.zIndex=-1,y.scroller.style.paddingRight=0),!n&&!(D&&a)&&(y.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(y.wrapper):e(y.wrapper)),y.viewFrom=y.viewTo=t.first,y.reportedViewFrom=y.reportedViewTo=t.first,y.view=[],y.renderedView=null,y.externalMeasured=null,y.viewOffset=0,y.lastWrapHeight=y.lastWrapWidth=0,y.updateLineNumbers=null,y.nativeBarWidth=y.barHeight=y.barWidth=0,y.scrollbarsClipped=!1,y.lineNumWidth=y.lineNumInnerWidth=y.lineNumChars=null,y.alignWidgets=!1,y.cachedCharWidth=y.cachedTextHeight=y.cachedPaddingH=null,y.maxLine=null,y.maxLineLength=0,y.maxLineChanged=!1,y.wheelDX=y.wheelDY=y.wheelStartX=y.wheelStartY=null,y.shift=!1,y.selForContextMenu=null,y.activeTouch=null,y.gutterSpecs=Ya(l.gutters,l.lineNumbers),Fo(y),u.init(y)}var ya=0,Wr=null;K?Wr=-.53:D?Wr=15:g?Wr=-.7:h&&(Wr=-1/3);function jo(e){var t=e.wheelDeltaX,u=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),u==null&&e.detail&&e.axis==e.VERTICAL_AXIS?u=e.detail:u==null&&(u=e.wheelDelta),{x:t,y:u}}function dl(e){var t=jo(e);return t.x*=Wr,t.y*=Wr,t}function Bo(e,t){var u=jo(t),l=u.x,y=u.y,j=e.display,$=j.scroller,ee=$.scrollWidth>$.clientWidth,ne=$.scrollHeight>$.clientHeight;if(!(l&&ee||y&&ne))return;if(y&&r&&n){e:for(var le=t.target,Te=j.view;le!=$;le=le.parentNode)for(var Ce=0;Ce<Te.length;Ce++)if(Te[Ce].node==le){e.display.currentWheelTarget=le;break e}}if(l&&!D&&!f&&Wr!=null){y&&ne&&zi(e,Math.max(0,$.scrollTop+y*Wr)),vi(e,Math.max(0,$.scrollLeft+l*Wr)),(!y||y&&ne)&&ie(t),j.wheelStartX=null;return}if(y&&Wr!=null){var Be=y*Wr,ke=e.doc.scrollTop,qe=ke+j.wrapper.clientHeight;Be<0?ke=Math.max(0,ke+Be-50):qe=Math.min(e.doc.height,qe+Be+50),za(e,{top:ke,bottom:qe})}ya<20&&(j.wheelStartX==null?(j.wheelStartX=$.scrollLeft,j.wheelStartY=$.scrollTop,j.wheelDX=l,j.wheelDY=y,setTimeout(function(){if(j.wheelStartX==null)return;var at=$.scrollLeft-j.wheelStartX,mt=$.scrollTop-j.wheelStartY,bt=mt&&j.wheelDY&&mt/j.wheelDY||at&&j.wheelDX&&at/j.wheelDX;if(j.wheelStartX=j.wheelStartY=null,!bt)return;Wr=(Wr*ya+bt)/(ya+1),++ya},200)):(j.wheelDX+=l,j.wheelDY+=y))}var Hr=function(e,t){this.ranges=e,this.primIndex=t};Hr.prototype.primary=function(){return this.ranges[this.primIndex]},Hr.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var u=this.ranges[t],l=e.ranges[t];if(!zn(u.anchor,l.anchor)||!zn(u.head,l.head))return!1}return!0},Hr.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Cn(Tr(this.ranges[t].anchor),Tr(this.ranges[t].head));return new Hr(e,this.primIndex)},Hr.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Hr.prototype.contains=function(e,t){t||(t=e);for(var u=0;u<this.ranges.length;u++){var l=this.ranges[u];if(vt(t,l.from())>=0&&vt(e,l.to())<=0)return u}return-1};var Cn=function(e,t){this.anchor=e,this.head=t};Cn.prototype.from=function(){return Fr(this.anchor,this.head)},Cn.prototype.to=function(){return vr(this.anchor,this.head)},Cn.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function $r(e,t,u){var l=e&&e.options.selectionsMayTouch,y=t[u];t.sort(function(Be,ke){return vt(Be.from(),ke.from())}),u=se(t,y);for(var j=1;j<t.length;j++){var $=t[j],ee=t[j-1],ne=vt(ee.to(),$.from());if(l&&!$.empty()?ne>0:ne>=0){var le=Fr(ee.from(),$.from()),Te=vr(ee.to(),$.to()),Ce=ee.empty()?$.from()==$.head:ee.from()==ee.head;j<=u&&--u,t.splice(--j,2,new Cn(Ce?Te:le,Ce?le:Te))}}return new Hr(t,u)}function li(e,t){return new Hr([new Cn(e,t||e)],0)}function ui(e){return e.text?rt(e.from.line+e.text.length-1,k(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Wo(e,t){if(vt(e,t.from)<0)return e;if(vt(e,t.to)<=0)return ui(t);var u=e.line+t.text.length-(t.to.line-t.from.line)-1,l=e.ch;return e.line==t.to.line&&(l+=ui(t).ch-t.to.ch),rt(u,l)}function $a(e,t){for(var u=[],l=0;l<e.sel.ranges.length;l++){var y=e.sel.ranges[l];u.push(new Cn(Wo(y.anchor,t),Wo(y.head,t)))}return $r(e.cm,u,e.sel.primIndex)}function Ho(e,t,u){return e.line==t.line?rt(u.line,e.ch-t.ch+u.ch):rt(u.line+(e.line-t.line),e.ch)}function hl(e,t,u){for(var l=[],y=rt(e.first,0),j=y,$=0;$<t.length;$++){var ee=t[$],ne=Ho(ee.from,y,j),le=Ho(ui(ee),y,j);if(y=ee.to,j=le,u=="around"){var Te=e.sel.ranges[$],Ce=vt(Te.head,Te.anchor)<0;l[$]=new Cn(Ce?le:ne,Ce?ne:le)}else l[$]=new Cn(ne,ne)}return new Hr(l,e.sel.primIndex)}function Ja(e){e.doc.mode=Je(e.options,e.doc.modeOption),Ji(e)}function Ji(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Yi(e,100),e.state.modeGen++,e.curOp&&Rr(e)}function Ko(e,t){return t.from.ch==0&&t.to.ch==0&&k(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Za(e,t,u,l){function y(Tt){return u?u[Tt]:null}function j(Tt,_t,St){ni(Tt,_t,St,l),fn(Tt,"change",Tt,t)}function $(Tt,_t){for(var St=[],zt=Tt;zt<_t;++zt)St.push(new yr(le[zt],y(zt),l));return St}var ee=t.from,ne=t.to,le=t.text,Te=ft(e,ee.line),Ce=ft(e,ne.line),Be=k(le),ke=y(le.length-1),qe=ne.line-ee.line;if(t.full)e.insert(0,$(0,le.length)),e.remove(le.length,e.size-le.length);else if(Ko(e,t)){var at=$(0,le.length-1);j(Ce,Ce.text,ke),qe&&e.remove(ee.line,qe),at.length&&e.insert(ee.line,at)}else if(Te==Ce)if(le.length==1)j(Te,Te.text.slice(0,ee.ch)+Be+Te.text.slice(ne.ch),ke);else{var mt=$(1,le.length-1);mt.push(new yr(Be+Te.text.slice(ne.ch),ke,l)),j(Te,Te.text.slice(0,ee.ch)+le[0],y(0)),e.insert(ee.line+1,mt)}else if(le.length==1)j(Te,Te.text.slice(0,ee.ch)+le[0]+Ce.text.slice(ne.ch),y(0)),e.remove(ee.line+1,qe);else{j(Te,Te.text.slice(0,ee.ch)+le[0],y(0)),j(Ce,Be+Ce.text.slice(ne.ch),ke);var bt=$(1,le.length-1);qe>1&&e.remove(ee.line+1,qe-1),e.insert(ee.line+1,bt)}fn(e,"change",e,t)}function ci(e,t,u){function l(y,j,$){if(y.linked)for(var ee=0;ee<y.linked.length;++ee){var ne=y.linked[ee];if(ne.doc==j)continue;var le=$&&ne.sharedHist;if(u&&!le)continue;t(ne.doc,le),l(ne.doc,y,le)}}l(e,null,!0)}function Go(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,ja(e),Ja(e),zo(e),e.options.lineWrapping||Vr(e),e.options.mode=t.modeOption,Rr(e)}function zo(e){(e.doc.direction=="rtl"?F:_)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Nr(e,function(){zo(e),Rr(e)})}function ba(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Qa(e,t){var u={from:Tr(t.from),to:ui(t),text:Wt(e,t.from,t.to)};return Yo(e,u,t.from.line,t.to.line+1),ci(e,function(l){return Yo(l,u,t.from.line,t.to.line+1)},!0),u}function Vo(e){for(;e.length;){var t=k(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Vo(e.done),k(e.done);if(e.done.length&&!k(e.done).ranges)return k(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),k(e.done)}function Xo(e,t,u,l){var y=e.history;y.undone.length=0;var j=+new Date,$,ee;if((y.lastOp==l||y.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&y.lastModTime>j-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&($=pl(y,y.lastOp==l)))ee=k($.changes),vt(t.from,t.to)==0&&vt(t.from,ee.to)==0?ee.to=ui(t):$.changes.push(Qa(e,t));else{var ne=k(y.done);for((!ne||!ne.ranges)&&_a(e.sel,y.done),$={changes:[Qa(e,t)],generation:y.generation},y.done.push($);y.done.length>y.undoDepth;)y.done.shift(),y.done[0].ranges||y.done.shift()}y.done.push(u),y.generation=++y.maxGeneration,y.lastModTime=y.lastSelTime=j,y.lastOp=y.lastSelOp=l,y.lastOrigin=y.lastSelOrigin=t.origin,ee||ue(e,"historyAdded")}function ml(e,t,u,l){var y=t.charAt(0);return y=="*"||y=="+"&&u.ranges.length==l.ranges.length&&u.somethingSelected()==l.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,u,l){var y=e.history,j=l&&l.origin;u==y.lastSelOp||j&&y.lastSelOrigin==j&&(y.lastModTime==y.lastSelTime&&y.lastOrigin==j||ml(e,j,k(y.done),t))?y.done[y.done.length-1]=t:_a(t,y.done),y.lastSelTime=+new Date,y.lastSelOrigin=j,y.lastSelOp=u,l&&l.clearRedo!==!1&&Vo(y.undone)}function _a(e,t){var u=k(t);u&&u.ranges&&u.equals(e)||t.push(e)}function Yo(e,t,u,l){var y=t["spans_"+e.id],j=0;e.iter(Math.max(e.first,u),Math.min(e.first+e.size,l),function($){$.markedSpans&&((y||(y=t["spans_"+e.id]={}))[j]=$.markedSpans),++j})}function vl(e){if(!e)return null;for(var t,u=0;u<e.length;++u)e[u].marker.explicitlyCleared?t||(t=e.slice(0,u)):t&&t.push(e[u]);return t?t.length?t:null:e}function yl(e,t){var u=t["spans_"+e.id];if(!u)return null;for(var l=[],y=0;y<t.text.length;++y)l.push(vl(u[y]));return l}function $o(e,t){var u=yl(e,t),l=An(e,t);if(!u)return l;if(!l)return u;for(var y=0;y<u.length;++y){var j=u[y],$=l[y];if(j&&$){e:for(var ee=0;ee<$.length;++ee){for(var ne=$[ee],le=0;le<j.length;++le)if(j[le].marker==ne.marker)continue e;j.push(ne)}}else $&&(u[y]=$)}return u}function Li(e,t,u){for(var l=[],y=0;y<e.length;++y){var j=e[y];if(j.ranges){l.push(u?Hr.prototype.deepCopy.call(j):j);continue}var $=j.changes,ee=[];l.push({changes:ee});for(var ne=0;ne<$.length;++ne){var le=$[ne],Te=void 0;if(ee.push({from:le.from,to:le.to,text:le.text}),t)for(var Ce in le)(Te=Ce.match(/^spans_(\d+)$/))&&(se(t,Number(Te[1]))>-1&&(k(ee)[Ce]=le[Ce],delete le[Ce]))}}return l}function qa(e,t,u,l){if(l){var y=e.anchor;if(u){var j=vt(t,y)<0;j!=vt(u,y)<0?(y=t,t=u):j!=vt(t,u)<0&&(t=u)}return new Cn(y,t)}else return new Cn(u||t,t)}function Ea(e,t,u,l,y){y==null&&(y=e.cm&&(e.cm.display.shift||e.extend)),Er(e,new Hr([qa(e.sel.primary(),t,u,y)],0),l)}function Jo(e,t,u){for(var l=[],y=e.cm&&(e.cm.display.shift||e.extend),j=0;j<e.sel.ranges.length;j++)l[j]=qa(e.sel.ranges[j],t[j],null,y);var $=$r(e.cm,l,e.sel.primIndex);Er(e,$,u)}function eo(e,t,u,l){var y=e.sel.ranges.slice(0);y[t]=u,Er(e,$r(e.cm,y,e.sel.primIndex),l)}function Zo(e,t,u,l){Er(e,li(t,u),l)}function bl(e,t,u){var l={ranges:t.ranges,update:function(y){this.ranges=[];for(var j=0;j<y.length;j++)this.ranges[j]=new Cn(Dt(e,y[j].anchor),Dt(e,y[j].head))},origin:u&&u.origin};return ue(e,"beforeSelectionChange",e,l),e.cm&&ue(e.cm,"beforeSelectionChange",e.cm,l),l.ranges!=t.ranges?$r(e.cm,l.ranges,l.ranges.length-1):t}function Qo(e,t,u){var l=e.history.done,y=k(l);y&&y.ranges?(l[l.length-1]=t,xa(e,t,u)):Er(e,t,u)}function Er(e,t,u){xa(e,t,u),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,u)}function xa(e,t,u){(ae(e,"beforeSelectionChange")||e.cm&&ae(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,u));var l=u&&u.bias||(vt(t.primary().head,e.sel.primary().head)<0?-1:1);qo(e,ts(e,t,l,!0)),!(u&&u.scroll===!1)&&e.cm&&Ai(e.cm)}function qo(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,te(e.cm)),fn(e,"cursorActivity",e)}function es(e){qo(e,ts(e,e.sel,null,!1))}function ts(e,t,u,l){for(var y,j=0;j<t.ranges.length;j++){var $=t.ranges[j],ee=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[j],ne=Ta(e,$.anchor,ee&&ee.anchor,u,l),le=Ta(e,$.head,ee&&ee.head,u,l);(y||ne!=$.anchor||le!=$.head)&&(y||(y=t.ranges.slice(0,j)),y[j]=new Cn(ne,le))}return y?$r(e.cm,y,t.primIndex):t}function Ii(e,t,u,l,y){var j=ft(e,t.line);if(j.markedSpans)for(var $=0;$<j.markedSpans.length;++$){var ee=j.markedSpans[$],ne=ee.marker,le="selectLeft"in ne?!ne.selectLeft:ne.inclusiveLeft,Te="selectRight"in ne?!ne.selectRight:ne.inclusiveRight;if((ee.from==null||(le?ee.from<=t.ch:ee.from<t.ch))&&(ee.to==null||(Te?ee.to>=t.ch:ee.to>t.ch))){if(y&&(ue(ne,"beforeCursorEnter"),ne.explicitlyCleared))if(j.markedSpans){--$;continue}else break;if(!ne.atomic)continue;if(u){var Ce=ne.find(l<0?1:-1),Be=void 0;if((l<0?Te:le)&&(Ce=ns(e,Ce,-l,Ce&&Ce.line==t.line?j:null)),Ce&&Ce.line==t.line&&(Be=vt(Ce,u))&&(l<0?Be<0:Be>0))return Ii(e,Ce,t,l,y)}var ke=ne.find(l<0?-1:1);return(l<0?le:Te)&&(ke=ns(e,ke,l,ke.line==t.line?j:null)),ke?Ii(e,ke,t,l,y):null}}return t}function Ta(e,t,u,l,y){var j=l||1,$=Ii(e,t,u,j,y)||!y&&Ii(e,t,u,j,!0)||Ii(e,t,u,-j,y)||!y&&Ii(e,t,u,-j,!0);return $||(e.cantEdit=!0,rt(e.first,0))}function ns(e,t,u,l){return u<0&&t.ch==0?t.line>e.first?Dt(e,rt(t.line-1)):null:u>0&&t.ch==(l||ft(e,t.line)).text.length?t.line<e.first+e.size-1?rt(t.line+1,0):null:new rt(t.line,t.ch+u)}function rs(e){e.setSelection(rt(e.firstLine(),0),rt(e.lastLine()),be)}function is(e,t,u){var l={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return l.canceled=!0}};return u&&(l.update=function(y,j,$,ee){y&&(l.from=Dt(e,y)),j&&(l.to=Dt(e,j)),$&&(l.text=$),ee!==void 0&&(l.origin=ee)}),ue(e,"beforeChange",e,l),e.cm&&ue(e.cm,"beforeChange",e.cm,l),l.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:l.from,to:l.to,text:l.text,origin:l.origin}}function Di(e,t,u){if(e.cm){if(!e.cm.curOp)return or(e.cm,Di)(e,t,u);if(e.cm.state.suppressEdits)return}if((ae(e,"beforeChange")||e.cm&&ae(e.cm,"beforeChange"))&&(t=is(e,t,!0),!t))return;var l=kn&&!u&&gn(e,t.from,t.to);if(l)for(var y=l.length-1;y>=0;--y)as(e,{from:l[y].from,to:l[y].to,text:y?[""]:t.text,origin:t.origin});else as(e,t)}function as(e,t){if(t.text.length==1&&t.text[0]==""&&vt(t.from,t.to)==0)return;var u=$a(e,t);Xo(e,t,u,e.cm?e.cm.curOp.id:NaN),Zi(e,t,u,An(e,t));var l=[];ci(e,function(y,j){!j&&se(l,y.history)==-1&&(us(y.history,t),l.push(y.history)),Zi(y,t,null,An(y,t))})}function wa(e,t,u){var l=e.cm&&e.cm.state.suppressEdits;if(l&&!u)return;for(var y=e.history,j,$=e.sel,ee=t=="undo"?y.done:y.undone,ne=t=="undo"?y.undone:y.done,le=0;le<ee.length&&!(j=ee[le],u?j.ranges&&!j.equals(e.sel):!j.ranges);le++);if(le==ee.length)return;for(y.lastOrigin=y.lastSelOrigin=null;;)if(j=ee.pop(),j.ranges){if(_a(j,ne),u&&!j.equals(e.sel)){Er(e,j,{clearRedo:!1});return}$=j}else if(l){ee.push(j);return}else break;var Te=[];_a($,ne),ne.push({changes:Te,generation:y.generation}),y.generation=j.generation||++y.maxGeneration;for(var Ce=ae(e,"beforeChange")||e.cm&&ae(e.cm,"beforeChange"),Be=function(at){var mt=j.changes[at];if(mt.origin=t,Ce&&!is(e,mt,!1))return ee.length=0,{};Te.push(Qa(e,mt));var bt=at?$a(e,mt):k(ee);Zi(e,mt,bt,$o(e,mt)),!at&&e.cm&&e.cm.scrollIntoView({from:mt.from,to:ui(mt)});var Tt=[];ci(e,function(_t,St){!St&&se(Tt,_t.history)==-1&&(us(_t.history,mt),Tt.push(_t.history)),Zi(_t,mt,null,$o(_t,mt))})},ke=j.changes.length-1;ke>=0;--ke){var qe=Be(ke);if(qe)return qe.v}}function os(e,t){if(t==0)return;if(e.first+=t,e.sel=new Hr(B(e.sel.ranges,function(y){return new Cn(rt(y.anchor.line+t,y.anchor.ch),rt(y.head.line+t,y.head.ch))}),e.sel.primIndex),e.cm){Rr(e.cm,e.first,e.first-t,t);for(var u=e.cm.display,l=u.viewFrom;l<u.viewTo;l++)oi(e.cm,l,"gutter")}}function Zi(e,t,u,l){if(e.cm&&!e.cm.curOp)return or(e.cm,Zi)(e,t,u,l);if(t.to.line<e.first){os(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var y=t.text.length-1-(e.first-t.from.line);os(e,y),t={from:rt(e.first,0),to:rt(t.to.line+y,t.to.ch),text:[k(t.text)],origin:t.origin}}var j=e.lastLine();t.to.line>j&&(t={from:t.from,to:rt(j,ft(e,j).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Wt(e,t.from,t.to),u||(u=$a(e,t)),e.cm?_l(e.cm,t,l):Za(e,t,l),xa(e,u,be),e.cantEdit&&Ta(e,rt(e.firstLine(),0))&&(e.cantEdit=!1)}function _l(e,t,u){var l=e.doc,y=e.display,j=t.from,$=t.to,ee=!1,ne=j.line;e.options.lineWrapping||(ne=Mt(hr(ft(l,j.line))),l.iter(ne,$.line+1,function(ke){if(ke==y.maxLine)return ee=!0,!0})),l.sel.contains(t.from,t.to)>-1&&te(e),Za(l,t,u,To(e)),e.options.lineWrapping||(l.iter(ne,j.line+t.text.length,function(ke){var qe=Rt(ke);qe>y.maxLineLength&&(y.maxLine=ke,y.maxLineLength=qe,y.maxLineChanged=!0,ee=!1)}),ee&&(e.curOp.updateMaxLine=!0)),tn(l,j.line),Yi(e,400);var le=t.text.length-($.line-j.line)-1;t.full?Rr(e):j.line==$.line&&t.text.length==1&&!Ko(e.doc,t)?oi(e,j.line,"text"):Rr(e,j.line,$.line+1,le);var Te=ae(e,"changes"),Ce=ae(e,"change");if(Ce||Te){var Be={from:j,to:$,text:t.text,removed:t.removed,origin:t.origin};Ce&&fn(e,"change",e,Be),Te&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Be)}e.display.selForContextMenu=null}function Mi(e,t,u,l,y){var j;l||(l=u),vt(l,u)<0&&(j=[l,u],u=j[0],l=j[1]),typeof t=="string"&&(t=e.splitLines(t)),Di(e,{from:u,to:l,text:t,origin:y})}function ss(e,t,u,l){u<e.line?e.line+=l:t<e.line&&(e.line=t,e.ch=0)}function ls(e,t,u,l){for(var y=0;y<e.length;++y){var j=e[y],$=!0;if(j.ranges){j.copied||(j=e[y]=j.deepCopy(),j.copied=!0);for(var ee=0;ee<j.ranges.length;ee++)ss(j.ranges[ee].anchor,t,u,l),ss(j.ranges[ee].head,t,u,l);continue}for(var ne=0;ne<j.changes.length;++ne){var le=j.changes[ne];if(u<le.from.line)le.from=rt(le.from.line+l,le.from.ch),le.to=rt(le.to.line+l,le.to.ch);else if(t<=le.to.line){$=!1;break}}$||(e.splice(0,y+1),y=0)}}function us(e,t){var u=t.from.line,l=t.to.line,y=t.text.length-(l-u)-1;ls(e.done,u,l,y),ls(e.undone,u,l,y)}function Qi(e,t,u,l){var y=t,j=t;return typeof t=="number"?j=ft(e,Wn(e,t)):y=Mt(t),y==null?null:(l(j,y)&&e.cm&&oi(e.cm,y,u),j)}function qi(e){this.lines=e,this.parent=null;for(var t=0,u=0;u<e.length;++u)e[u].parent=this,t+=e[u].height;this.height=t}qi.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var u=e,l=e+t;u<l;++u){var y=this.lines[u];this.height-=y.height,Ct(y),fn(y,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,u){this.height+=u,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var l=0;l<t.length;++l)t[l].parent=this},iterN:function(e,t,u){for(var l=e+t;e<l;++e)if(u(this.lines[e]))return!0}};function ea(e){this.children=e;for(var t=0,u=0,l=0;l<e.length;++l){var y=e[l];t+=y.chunkSize(),u+=y.height,y.parent=this}this.size=t,this.height=u,this.parent=null}ea.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var u=0;u<this.children.length;++u){var l=this.children[u],y=l.chunkSize();if(e<y){var j=Math.min(t,y-e),$=l.height;if(l.removeInner(e,j),this.height-=$-l.height,y==j&&(this.children.splice(u--,1),l.parent=null),(t-=j)==0)break;e=0}else e-=y}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof qi))){var ee=[];this.collapse(ee),this.children=[new qi(ee)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,u){this.size+=t.length,this.height+=u;for(var l=0;l<this.children.length;++l){var y=this.children[l],j=y.chunkSize();if(e<=j){if(y.insertInner(e,t,u),y.lines&&y.lines.length>50){for(var $=y.lines.length%25+25,ee=$;ee<y.lines.length;){var ne=new qi(y.lines.slice(ee,ee+=25));y.height-=ne.height,this.children.splice(++l,0,ne),ne.parent=this}y.lines=y.lines.slice(0,$),this.maybeSpill()}break}e-=j}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),u=new ea(t);if(e.parent){e.size-=u.size,e.height-=u.height;var y=se(e.parent.children,e);e.parent.children.splice(y+1,0,u)}else{var l=new ea(e.children);l.parent=e,e.children=[l,u],e=l}u.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,u){for(var l=0;l<this.children.length;++l){var y=this.children[l],j=y.chunkSize();if(e<j){var $=Math.min(t,j-e);if(y.iterN(e,$,u))return!0;if((t-=$)==0)break;e=0}else e-=j}}};var ta=function(e,t,u){if(u)for(var l in u)u.hasOwnProperty(l)&&(this[l]=u[l]);this.doc=e,this.node=t};ta.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,u=this.line,l=Mt(u);if(l==null||!t)return;for(var y=0;y<t.length;++y)t[y]==this&&t.splice(y--,1);t.length||(u.widgets=null);var j=Qn(this);Ot(u,Math.max(0,u.height-j)),e&&(Nr(e,function(){cs(e,u,-j),oi(e,l,"widget")}),fn(e,"lineWidgetCleared",e,this,l))},ta.prototype.changed=function(){var e=this,t=this.height,u=this.doc.cm,l=this.line;this.height=null;var y=Qn(this)-t;if(!y)return;Ar(this.doc,l)||Ot(l,l.height+y),u&&Nr(u,function(){u.curOp.forceUpdate=!0,cs(u,l,y),fn(u,"lineWidgetChanged",u,e,Mt(l))})},ce(ta);function cs(e,t,u){Hn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ka(e,u)}function El(e,t,u,l){var y=new ta(e,u,l),j=e.cm;return j&&y.noHScroll&&(j.display.alignWidgets=!0),Qi(e,t,"widget",function($){var ee=$.widgets||($.widgets=[]);if(y.insertAt==null?ee.push(y):ee.splice(Math.min(ee.length-1,Math.max(0,y.insertAt)),0,y),y.line=$,j&&!Ar(e,$)){var ne=Hn($)<e.scrollTop;Ot($,$.height+Qn(y)),ne&&Ka(j,y.height),j.curOp.forceUpdate=!0}return!0}),j&&fn(j,"lineWidgetAdded",j,y,typeof t=="number"?t:Mt(t)),y}var ds=0,di=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ds};di.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&bi(e),ae(this,"clear")){var u=this.find();u&&fn(this,"clear",u.from,u.to)}for(var l=null,y=null,j=0;j<this.lines.length;++j){var $=this.lines[j],ee=Sn($.markedSpans,this);e&&!this.collapsed?oi(e,Mt($),"text"):e&&(ee.to!=null&&(y=Mt($)),ee.from!=null&&(l=Mt($))),$.markedSpans=Mn($.markedSpans,ee),ee.from==null&&this.collapsed&&!Ar(this.doc,$)&&e&&Ot($,Si(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var ne=0;ne<this.lines.length;++ne){var le=hr(this.lines[ne]),Te=Rt(le);Te>e.display.maxLineLength&&(e.display.maxLine=le,e.display.maxLineLength=Te,e.display.maxLineChanged=!0)}l!=null&&e&&this.collapsed&&Rr(e,l,y+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&es(e.doc)),e&&fn(e,"markerCleared",e,this,l,y),t&&_i(e),this.parent&&this.parent.clear()},di.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var u,l,y=0;y<this.lines.length;++y){var j=this.lines[y],$=Sn(j.markedSpans,this);if($.from!=null&&(u=rt(t?j:Mt(j),$.from),e==-1))return u;if($.to!=null&&(l=rt(t?j:Mt(j),$.to),e==1))return l}return u&&{from:u,to:l}},di.prototype.changed=function(){var e=this,t=this.find(-1,!0),u=this,l=this.doc.cm;if(!t||!l)return;Nr(l,function(){var y=t.line,j=Mt(t.line),$=ca(l,j);if($&&(mo($),l.curOp.selectionChanged=l.curOp.forceUpdate=!0),l.curOp.updateMaxLine=!0,!Ar(u.doc,y)&&u.height!=null){var ee=u.height;u.height=null;var ne=Qn(u)-ee;ne&&Ot(y,y.height+ne)}fn(l,"markerChanged",l,e)})},di.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||se(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},di.prototype.detachLine=function(e){if(this.lines.splice(se(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ce(di);function Pi(e,t,u,l,y){if(l&&l.shared)return xl(e,t,u,l,y);if(e.cm&&!e.cm.curOp)return or(e.cm,Pi)(e,t,u,l,y);var j=new di(e,y),$=vt(t,u);if(l&&S(l,j,!1),$>0||$==0&&j.clearWhenEmpty!==!1)return j;if(j.replacedWith&&(j.collapsed=!0,j.widgetNode=C("span",[j.replacedWith],"CodeMirror-widget"),l.handleMouseEvents||j.widgetNode.setAttribute("cm-ignore-events","true"),l.insertLeft&&(j.widgetNode.insertLeft=!0)),j.collapsed){if(Un(e,t.line,t,u,j)||t.line!=u.line&&Un(e,u.line,t,u,j))throw new Error("Inserting collapsed marker partially overlapping an existing one");jn()}j.addToHistory&&Xo(e,{from:t,to:u,origin:"markText"},e.sel,NaN);var ee=t.line,ne=e.cm,le;if(e.iter(ee,u.line+1,function(Ce){ne&&j.collapsed&&!ne.options.lineWrapping&&hr(Ce)==ne.display.maxLine&&(le=!0),j.collapsed&&ee!=t.line&&Ot(Ce,0),ir(Ce,new Ln(j,ee==t.line?t.ch:null,ee==u.line?u.ch:null)),++ee}),j.collapsed&&e.iter(t.line,u.line+1,function(Ce){Ar(e,Ce)&&Ot(Ce,0)}),j.clearOnEnter&&Re(j,"beforeCursorEnter",function(){return j.clear()}),j.readOnly&&(Nn(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),j.collapsed&&(j.id=++ds,j.atomic=!0),ne){if(le&&(ne.curOp.updateMaxLine=!0),j.collapsed)Rr(ne,t.line,u.line+1);else if(j.className||j.startStyle||j.endStyle||j.css||j.attributes||j.title)for(var Te=t.line;Te<=u.line;Te++)oi(ne,Te,"text");j.atomic&&es(ne.doc),fn(ne,"markerAdded",ne,j)}return j}var na=function(e,t){this.markers=e,this.primary=t;for(var u=0;u<e.length;++u)e[u].parent=this};na.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();fn(this,"clear")},na.prototype.find=function(e,t){return this.primary.find(e,t)},ce(na);function xl(e,t,u,l,y){l=S(l),l.shared=!1;var j=[Pi(e,t,u,l,y)],$=j[0],ee=l.widgetNode;return ci(e,function(ne){ee&&(l.widgetNode=ee.cloneNode(!0)),j.push(Pi(ne,Dt(ne,t),Dt(ne,u),l,y));for(var le=0;le<ne.linked.length;++le)if(ne.linked[le].isParent)return;$=k(j)}),new na(j,$)}function hs(e){return e.findMarks(rt(e.first,0),e.clipPos(rt(e.lastLine())),function(t){return t.parent})}function Tl(e,t){for(var u=0;u<t.length;u++){var l=t[u],y=l.find(),j=e.clipPos(y.from),$=e.clipPos(y.to);if(vt(j,$)){var ee=Pi(e,j,$,l.primary,l.primary.type);l.markers.push(ee),ee.parent=l}}}function wl(e){for(var t=function(l){var y=e[l],j=[y.primary.doc];ci(y.primary.doc,function(ne){return j.push(ne)});for(var $=0;$<y.markers.length;$++){var ee=y.markers[$];se(j,ee.doc)==-1&&(ee.parent=null,y.markers.splice($--,1))}},u=0;u<e.length;u++)t(u)}var Sl=0,Lr=function(e,t,u,l,y){if(!(this instanceof Lr))return new Lr(e,t,u,l,y);u==null&&(u=0),ea.call(this,[new qi([new yr("",null)])]),this.first=u,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=u;var j=rt(u,0);this.sel=li(j),this.history=new ba(null),this.id=++Sl,this.modeOption=t,this.lineSep=l,this.direction=y=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Za(this,{from:j,to:j,text:e}),Er(this,li(j),be)};Lr.prototype=X(ea.prototype,{constructor:Lr,iter:function(e,t,u){u?this.iterN(e-this.first,t-e,u):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var u=0,l=0;l<t.length;++l)u+=t[l].height;this.insertInner(e-this.first,t,u)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Xt(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:sr(function(e){var t=rt(this.first,0),u=this.first+this.size-1;Di(this,{from:t,to:rt(u,ft(this,u).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Gi(this.cm,0,0),Er(this,li(t),be)}),replaceRange:function(e,t,u,l){t=Dt(this,t),u=u?Dt(this,u):t,Mi(this,e,t,u,l)},getRange:function(e,t,u){var l=Wt(this,Dt(this,e),Dt(this,t));return u===!1?l:l.join(u||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(On(this,e))return ft(this,e)},getLineNumber:function(e){return Mt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=ft(this,e)),hr(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Dt(this,e)},getCursor:function(e){var t=this.sel.primary(),u;return e==null||e=="head"?u=t.head:e=="anchor"?u=t.anchor:e=="end"||e=="to"||e===!1?u=t.to():u=t.from(),u},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:sr(function(e,t,u){Zo(this,Dt(this,typeof e=="number"?rt(e,t||0):e),null,u)}),setSelection:sr(function(e,t,u){Zo(this,Dt(this,e),Dt(this,t||e),u)}),extendSelection:sr(function(e,t,u){Ea(this,Dt(this,e),t&&Dt(this,t),u)}),extendSelections:sr(function(e,t){Jo(this,Fe(this,e),t)}),extendSelectionsBy:sr(function(e,t){var u=B(this.sel.ranges,e);Jo(this,Fe(this,u),t)}),setSelections:sr(function(e,t,u){if(!e.length)return;for(var l=[],y=0;y<e.length;y++)l[y]=new Cn(Dt(this,e[y].anchor),Dt(this,e[y].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Er(this,$r(this.cm,l,t),u)}),addSelection:sr(function(e,t,u){var l=this.sel.ranges.slice(0);l.push(new Cn(Dt(this,e),Dt(this,t||e))),Er(this,$r(this.cm,l,l.length-1),u)}),getSelection:function(e){for(var t=this.sel.ranges,u,l=0;l<t.length;l++){var y=Wt(this,t[l].from(),t[l].to());u=u?u.concat(y):y}return e===!1?u:u.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],u=this.sel.ranges,l=0;l<u.length;l++){var y=Wt(this,u[l].from(),u[l].to());e!==!1&&(y=y.join(e||this.lineSeparator())),t[l]=y}return t},replaceSelection:function(e,t,u){for(var l=[],y=0;y<this.sel.ranges.length;y++)l[y]=e;this.replaceSelections(l,t,u||"+input")},replaceSelections:sr(function(e,t,u){for(var l=[],y=this.sel,j=0;j<y.ranges.length;j++){var $=y.ranges[j];l[j]={from:$.from(),to:$.to(),text:this.splitLines(e[j]),origin:u}}for(var ee=t&&t!="end"&&hl(this,l,t),ne=l.length-1;ne>=0;ne--)Di(this,l[ne]);ee?Qo(this,ee):this.cm&&Ai(this.cm)}),undo:sr(function(){wa(this,"undo")}),redo:sr(function(){wa(this,"redo")}),undoSelection:sr(function(){wa(this,"undo",!0)}),redoSelection:sr(function(){wa(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,u=0,l=0;l<e.done.length;l++)e.done[l].ranges||++t;for(var y=0;y<e.undone.length;y++)e.undone[y].ranges||++u;return{undo:t,redo:u}},clearHistory:function(){var e=this;this.history=new ba(this.history.maxGeneration),ci(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Li(this.history.done),undone:Li(this.history.undone)}},setHistory:function(e){var t=this.history=new ba(this.history.maxGeneration);t.done=Li(e.done.slice(0),null,!0),t.undone=Li(e.undone.slice(0),null,!0)},setGutterMarker:sr(function(e,t,u){return Qi(this,e,"gutter",function(l){var y=l.gutterMarkers||(l.gutterMarkers={});return y[t]=u,!u&&me(y)&&(l.gutterMarkers=null),!0})}),clearGutter:sr(function(e){var t=this;this.iter(function(u){u.gutterMarkers&&u.gutterMarkers[e]&&Qi(t,u,"gutter",function(){return u.gutterMarkers[e]=null,me(u.gutterMarkers)&&(u.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!On(this,e))return null;if(t=e,e=ft(this,e),!e)return null}else if(t=Mt(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:sr(function(e,t,u){return Qi(this,e,t=="gutter"?"gutter":"class",function(l){var y=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!l[y])l[y]=u;else{if(A(u).test(l[y]))return!1;l[y]+=" "+u}return!0})}),removeLineClass:sr(function(e,t,u){return Qi(this,e,t=="gutter"?"gutter":"class",function(l){var y=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",j=l[y];if(j)if(u==null)l[y]=null;else{var $=j.match(A(u));if(!$)return!1;var ee=$.index+$[0].length;l[y]=j.slice(0,$.index)+(!$.index||ee==j.length?"":" ")+j.slice(ee)||null}else return!1;return!0})}),addLineWidget:sr(function(e,t,u){return El(this,e,t,u)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,u){return Pi(this,Dt(this,e),Dt(this,t),u,u&&u.type||"range")},setBookmark:function(e,t){var u={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=Dt(this,e),Pi(this,e,e,u,"bookmark")},findMarksAt:function(e){e=Dt(this,e);var t=[],u=ft(this,e.line).markedSpans;if(u)for(var l=0;l<u.length;++l){var y=u[l];(y.from==null||y.from<=e.ch)&&(y.to==null||y.to>=e.ch)&&t.push(y.marker.parent||y.marker)}return t},findMarks:function(e,t,u){e=Dt(this,e),t=Dt(this,t);var l=[],y=e.line;return this.iter(e.line,t.line+1,function(j){var $=j.markedSpans;if($)for(var ee=0;ee<$.length;ee++){var ne=$[ee];!(ne.to!=null&&y==e.line&&e.ch>=ne.to||ne.from==null&&y!=e.line||ne.from!=null&&y==t.line&&ne.from>=t.ch)&&(!u||u(ne.marker))&&l.push(ne.marker.parent||ne.marker)}++y}),l},getAllMarks:function(){var e=[];return this.iter(function(t){var u=t.markedSpans;if(u)for(var l=0;l<u.length;++l)u[l].from!=null&&e.push(u[l].marker)}),e},posFromIndex:function(e){var t,u=this.first,l=this.lineSeparator().length;return this.iter(function(y){var j=y.text.length+l;if(j>e)return t=e,!0;e-=j,++u}),Dt(this,rt(u,t))},indexFromPos:function(e){e=Dt(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var u=this.lineSeparator().length;return this.iter(this.first,e.line,function(l){t+=l.text.length+u}),t},copy:function(e){var t=new Lr(Xt(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,u=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<u&&(u=e.to);var l=new Lr(Xt(this,t,u),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(l.history=this.history),(this.linked||(this.linked=[])).push({doc:l,sharedHist:e.sharedHist}),l.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Tl(l,hs(this)),l},unlinkDoc:function(e){if(e instanceof Bn&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var u=this.linked[t];if(u.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),wl(hs(this));break}if(e.history==this.history){var l=[e.id];ci(e,function(y){return l.push(y.id)},!0),e.history=new ba(null),e.history.done=Li(this.history.done,l),e.history.undone=Li(this.history.undone,l)}},iterLinkedDocs:function(e){ci(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):We(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:sr(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&fl(this.cm)})}),Lr.prototype.eachLine=Lr.prototype.iter;var fs=0;function Cl(e){var t=this;if(ps(t),q(t,e)||pn(t.display,e))return;ie(e),K&&(fs=+new Date);var u=mi(t,e,!0),l=e.dataTransfer.files;if(!u||t.isReadOnly())return;if(l&&l.length&&window.FileReader&&window.File)for(var y=l.length,j=Array(y),$=0,ee=function(){++$==y&&or(t,function(){u=Dt(t.doc,u);var ke={from:u,to:u,text:t.doc.splitLines(j.filter(function(qe){return qe!=null}).join(t.doc.lineSeparator())),origin:"paste"};Di(t.doc,ke),Qo(t.doc,li(Dt(t.doc,u),Dt(t.doc,ui(ke))))})()},ne=function(ke,qe){if(t.options.allowDropFileTypes&&se(t.options.allowDropFileTypes,ke.type)==-1){ee();return}var at=new FileReader;at.onerror=function(){return ee()},at.onload=function(){var mt=at.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(mt)){ee();return}j[qe]=mt,ee()},at.readAsText(ke)},le=0;le<l.length;le++)ne(l[le],le);else{if(t.state.draggingText&&t.doc.sel.contains(u)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var Te=e.dataTransfer.getData("Text");if(Te){var Ce;if(t.state.draggingText&&!t.state.draggingText.copy&&(Ce=t.listSelections()),xa(t.doc,li(u,u)),Ce)for(var Be=0;Be<Ce.length;++Be)Mi(t.doc,"",Ce[Be].anchor,Ce[Be].head,"drag");t.replaceSelection(Te,"around","paste"),t.display.input.focus()}}catch(ke){}}}function Ol(e,t){if(K&&(!e.state.draggingText||+new Date-fs<100)){ge(t);return}if(q(e,t)||pn(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!h){var u=p("img",null,null,"position: fixed; left: 0; top: 0;");u.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",f&&(u.width=u.height=1,e.display.wrapper.appendChild(u),u._top=u.offsetTop),t.dataTransfer.setDragImage(u,0,0),f&&u.parentNode.removeChild(u)}}function Al(e,t){var u=mi(e,t);if(!u)return;var l=document.createDocumentFragment();Co(e,u,l),e.display.dragCursor||(e.display.dragCursor=p("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),m(e.display.dragCursor,l)}function ps(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ms(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),u=[],l=0;l<t.length;l++){var y=t[l].CodeMirror;y&&u.push(y)}u.length&&u[0].operation(function(){for(var j=0;j<u.length;j++)e(u[j])})}var gs=!1;function Rl(){if(gs)return;Ll(),gs=!0}function Ll(){var e;Re(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ms(Il)},100))}),Re(window,"blur",function(){return ms(Oi)})}function Il(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var hi={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},ra=0;ra<10;ra++)hi[ra+48]=hi[ra+96]=String(ra);for(var Sa=65;Sa<=90;Sa++)hi[Sa]=String.fromCharCode(Sa);for(var ia=1;ia<=12;ia++)hi[ia+111]=hi[ia+63235]="F"+ia;var ii={};ii.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},ii.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},ii.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},ii.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},ii.default=r?ii.macDefault:ii.pcDefault;function Dl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var u,l,y,j,$=0;$<t.length-1;$++){var ee=t[$];if(/^(cmd|meta|m)$/i.test(ee))j=!0;else if(/^a(lt)?$/i.test(ee))u=!0;else if(/^(c|ctrl|control)$/i.test(ee))l=!0;else if(/^s(hift)?$/i.test(ee))y=!0;else throw new Error("Unrecognized modifier name: "+ee)}return u&&(e="Alt-"+e),l&&(e="Ctrl-"+e),j&&(e="Cmd-"+e),y&&(e="Shift-"+e),e}function Ml(e){var t={};for(var u in e)if(e.hasOwnProperty(u)){var l=e[u];if(/^(name|fallthrough|(de|at)tach)$/.test(u))continue;if(l=="..."){delete e[u];continue}for(var y=B(u.split(" "),Dl),j=0;j<y.length;j++){var $=void 0,ee=void 0;j==y.length-1?(ee=y.join(" "),$=l):(ee=y.slice(0,j+1).join(" "),$="...");var ne=t[ee];if(!ne)t[ee]=$;else if(ne!=$)throw new Error("Inconsistent bindings for "+ee)}delete e[u]}for(var le in t)e[le]=t[le];return e}function ki(e,t,u,l){t=Ca(t);var y=t.call?t.call(e,l):t[e];if(y===!1)return"nothing";if(y==="...")return"multi";if(y!=null&&u(y))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return ki(e,t.fallthrough,u,l);for(var j=0;j<t.fallthrough.length;j++){var $=ki(e,t.fallthrough[j],u,l);if($)return $}}}function vs(e){var t=typeof e=="string"?e:hi[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function ys(e,t,u){var l=e;return t.altKey&&l!="Alt"&&(e="Alt-"+e),(x?t.metaKey:t.ctrlKey)&&l!="Ctrl"&&(e="Ctrl-"+e),(x?t.ctrlKey:t.metaKey)&&l!="Mod"&&(e="Cmd-"+e),!u&&t.shiftKey&&l!="Shift"&&(e="Shift-"+e),e}function bs(e,t){if(f&&e.keyCode==34&&e.char)return!1;var u=hi[e.keyCode];return u==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(u=e.code),ys(u,e,t))}function Ca(e){return typeof e=="string"?ii[e]:e}function Ni(e,t){for(var u=e.doc.sel.ranges,l=[],y=0;y<u.length;y++){for(var j=t(u[y]);l.length&&vt(j.from,k(l).to)<=0;){var $=l.pop();if(vt($.from,j.from)<0){j.from=$.from;break}}l.push(j)}Nr(e,function(){for(var ee=l.length-1;ee>=0;ee--)Mi(e.doc,"",l[ee].from,l[ee].to,"+delete");Ai(e)})}function to(e,t,u){var l=Pe(e.text,t+u,u);return l<0||l>e.text.length?null:l}function no(e,t,u){var l=to(e,t.ch,u);return l==null?null:new rt(t.line,l,u<0?"after":"before")}function ro(e,t,u,l,y){if(e){t.doc.direction=="rtl"&&(y=-y);var j=ht(u,t.doc.direction);if(j){var $=y<0?k(j):j[0],ee=y<0==($.level==1),ne=ee?"after":"before",le;if($.level>0||t.doc.direction=="rtl"){var Te=_r(t,u);le=y<0?u.text.length-1:0;var Ce=ei(t,Te,le).top;le=Ye(function(Be){return ei(t,Te,Be).top==Ce},y<0==($.level==1)?$.from:$.to-1,le),ne=="before"&&(le=to(u,le,1))}else le=y<0?$.to:$.from;return new rt(l,le,ne)}}return new rt(l,y<0?u.text.length:0,y<0?"before":"after")}function Pl(e,t,u,l){var y=ht(t,e.doc.direction);if(!y)return no(t,u,l);u.ch>=t.text.length?(u.ch=t.text.length,u.sticky="before"):u.ch<=0&&(u.ch=0,u.sticky="after");var j=lt(y,u.ch,u.sticky),$=y[j];if(e.doc.direction=="ltr"&&$.level%2==0&&(l>0?$.to>u.ch:$.from<u.ch))return no(t,u,l);var ee=function(bt,Tt){return to(t,bt instanceof rt?bt.ch:bt,Tt)},ne,le=function(bt){return e.options.lineWrapping?(ne=ne||_r(e,t),xo(e,t,ne,bt)):{begin:0,end:t.text.length}},Te=le(u.sticky=="before"?ee(u,-1):u.ch);if(e.doc.direction=="rtl"||$.level==1){var Ce=$.level==1==l<0,Be=ee(u,Ce?1:-1);if(Be!=null&&(Ce?Be<=$.to&&Be<=Te.end:Be>=$.from&&Be>=Te.begin)){var ke=Ce?"before":"after";return new rt(u.line,Be,ke)}}var qe=function(bt,Tt,_t){for(var St=function(Pn,lr){return lr?new rt(u.line,ee(Pn,1),"before"):new rt(u.line,Pn,"after")};bt>=0&&bt<y.length;bt+=Tt){var zt=y[bt],Ut=Tt>0==(zt.level!=1),un=Ut?_t.begin:ee(_t.end,-1);if(zt.from<=un&&un<zt.to)return St(un,Ut);if(un=Ut?zt.from:ee(zt.to,-1),_t.begin<=un&&un<_t.end)return St(un,Ut)}},at=qe(j+l,l,Te);if(at)return at;var mt=l>0?Te.end:ee(Te.begin,-1);return mt!=null&&!(l>0&&mt==t.text.length)&&(at=qe(l>0?0:y.length-1,l,le(mt)),at)?at:null}var aa={selectAll:rs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),be)},killLine:function(e){return Ni(e,function(t){if(t.empty()){var u=ft(e.doc,t.head.line).text.length;return t.head.ch==u&&t.head.line<e.lastLine()?{from:t.head,to:rt(t.head.line+1,0)}:{from:t.head,to:rt(t.head.line,u)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Ni(e,function(t){return{from:rt(t.from().line,0),to:Dt(e.doc,rt(t.to().line+1,0))}})},delLineLeft:function(e){return Ni(e,function(t){return{from:rt(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Ni(e,function(t){var u=e.charCoords(t.head,"div").top+5,l=e.coordsChar({left:0,top:u},"div");return{from:l,to:t.from()}})},delWrappedLineRight:function(e){return Ni(e,function(t){var u=e.charCoords(t.head,"div").top+5,l=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:u},"div");return{from:t.from(),to:l}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(rt(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(rt(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return _s(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Es(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return kl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var u=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:u},"div")},Ae)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var u=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:u},"div")},Ae)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var u=e.cursorCoords(t.head,"div").top+5,l=e.coordsChar({left:0,top:u},"div");return l.ch<e.getLine(l.line).search(/\S/)?Es(e,t.head):l},Ae)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],u=e.listSelections(),l=e.options.tabSize,y=0;y<u.length;y++){var j=u[y].from(),$=G(e.getLine(j.line),j.ch,l);t.push(Y(l-$%l))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Nr(e,function(){for(var t=e.listSelections(),u=[],l=0;l<t.length;l++){if(!t[l].empty())continue;var y=t[l].head,j=ft(e.doc,y.line).text;if(j){if(y.ch==j.length&&(y=new rt(y.line,y.ch-1)),y.ch>0)y=new rt(y.line,y.ch+1),e.replaceRange(j.charAt(y.ch-1)+j.charAt(y.ch-2),rt(y.line,y.ch-2),y,"+transpose");else if(y.line>e.doc.first){var $=ft(e.doc,y.line-1).text;$&&(y=new rt(y.line,1),e.replaceRange(j.charAt(0)+e.doc.lineSeparator()+$.charAt($.length-1),rt(y.line-1,$.length-1),y,"+transpose"))}}u.push(new Cn(y,y))}e.setSelections(u)})},newlineAndIndent:function(e){return Nr(e,function(){for(var t=e.listSelections(),u=t.length-1;u>=0;u--)e.replaceRange(e.doc.lineSeparator(),t[u].anchor,t[u].head,"+input");t=e.listSelections();for(var l=0;l<t.length;l++)e.indentLine(t[l].from().line,null,!0);Ai(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function _s(e,t){var u=ft(e.doc,t),l=hr(u);return l!=u&&(t=Mt(l)),ro(!0,e,l,t,1)}function kl(e,t){var u=ft(e.doc,t),l=Zr(u);return l!=u&&(t=Mt(l)),ro(!0,e,u,t,-1)}function Es(e,t){var u=_s(e,t.line),l=ft(e.doc,u.line),y=ht(l,e.doc.direction);if(!y||y[0].level==0){var j=Math.max(u.ch,l.text.search(/\S/)),$=t.line==u.line&&t.ch<=j&&t.ch;return rt(u.line,$?0:j,u.sticky)}return u}function Oa(e,t,u){if(typeof t=="string"&&(t=aa[t],!t))return!1;e.display.input.ensurePolled();var l=e.display.shift,y=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),u&&(e.display.shift=!1),y=t(e)!=we}finally{e.display.shift=l,e.state.suppressEdits=!1}return y}function Nl(e,t,u){for(var l=0;l<e.state.keyMaps.length;l++){var y=ki(t,e.state.keyMaps[l],u,e);if(y)return y}return e.options.extraKeys&&ki(t,e.options.extraKeys,u,e)||ki(t,e.options.keyMap,u,e)}var Ul=new Q;function oa(e,t,u,l){var y=e.state.keySeq;if(y){if(vs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==y&&(e.state.keySeq=null,e.display.input.reset())}),xs(e,y+" "+t,u,l))return!0}return xs(e,t,u,l)}function xs(e,t,u,l){var y=Nl(e,t,l);return y=="multi"&&(e.state.keySeq=t),y=="handled"&&fn(e,"keyHandled",e,t,u),(y=="handled"||y=="multi")&&(ie(u),Ba(e)),!!y}function Ts(e,t){var u=bs(t,!0);return u?t.shiftKey&&!e.state.keySeq?oa(e,"Shift-"+u,t,function(l){return Oa(e,l,!0)})||oa(e,u,t,function(l){if(typeof l=="string"?/^go[A-Z]/.test(l):l.motion)return Oa(e,l)}):oa(e,u,t,function(l){return Oa(e,l)}):!1}function Fl(e,t,u){return oa(e,"'"+u+"'",t,function(l){return Oa(e,l,!0)})}var io=null;function ws(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=P(),q(t,e))return;K&&W<11&&e.keyCode==27&&(e.returnValue=!1);var u=e.keyCode;t.display.shift=u==16||e.shiftKey;var l=Ts(t,e);f&&(io=l?u:null,!l&&u==88&&!Ne&&(r?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),D&&!r&&!l&&u==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),u==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&jl(t)}function jl(e){var t=e.display.lineDiv;F(t,"CodeMirror-crosshair");function u(l){(l.keyCode==18||!l.altKey)&&(_(t,"CodeMirror-crosshair"),Ze(document,"keyup",u),Ze(document,"mouseover",u))}Re(document,"keyup",u),Re(document,"mouseover",u)}function Ss(e){e.keyCode==16&&(this.doc.sel.shift=!1),q(this,e)}function Cs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(pn(t.display,e)||q(t,e)||e.ctrlKey&&!e.altKey||r&&e.metaKey)return;var u=e.keyCode,l=e.charCode;if(f&&u==io){io=null,ie(e);return}if(f&&(!e.which||e.which<10)&&Ts(t,e))return;var y=String.fromCharCode(l==null?u:l);if(y=="\b")return;if(Fl(t,e,y))return;t.display.input.onKeyPress(e)}var Bl=400,ao=function(e,t,u){this.time=e,this.pos=t,this.button=u};ao.prototype.compare=function(e,t,u){return this.time+Bl>e&&vt(t,this.pos)==0&&u==this.button};var sa,la;function Wl(e,t){var u=+new Date;return la&&la.compare(u,e,t)?(sa=la=null,"triple"):sa&&sa.compare(u,e,t)?(la=new ao(u,e,t),sa=null,"double"):(sa=new ao(u,e,t),la=null,"single")}function Os(e){var t=this,u=t.display;if(q(t,e)||u.activeTouch&&u.input.supportsTouch())return;if(u.input.ensurePolled(),u.shift=e.shiftKey,pn(u,e)){n||(u.scroller.draggable=!1,setTimeout(function(){return u.scroller.draggable=!0},100));return}if(oo(t,e))return;var l=mi(t,e),y=Oe(e),j=l?Wl(l,y):"single";if(window.focus(),y==1&&t.state.selectingText&&t.state.selectingText(e),l&&Hl(t,y,l,j,e))return;y==1?l?Gl(t,l,j,e):_e(e)==u.scroller&&ie(e):y==2?(l&&Ea(t.doc,l),setTimeout(function(){return u.input.focus()},20)):y==3&&(L?t.display.input.onContextMenu(e):Ao(t))}function Hl(e,t,u,l,y){var j="Click";return l=="double"?j="Double"+j:l=="triple"&&(j="Triple"+j),j=(t==1?"Left":t==2?"Middle":"Right")+j,oa(e,ys(j,y),y,function($){if(typeof $=="string"&&($=aa[$]),!$)return!1;var ee=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),ee=$(e,u)!=we}finally{e.state.suppressEdits=!1}return ee})}function Kl(e,t,u){var l=e.getOption("configureMouse"),y=l?l(e,t,u):{};if(y.unit==null){var j=o?u.shiftKey&&u.metaKey:u.altKey;y.unit=j?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(y.extend==null||e.doc.extend)&&(y.extend=e.doc.extend||u.shiftKey),y.addNew==null&&(y.addNew=r?u.metaKey:u.ctrlKey),y.moveOnDrag==null&&(y.moveOnDrag=!(r?u.altKey:u.ctrlKey)),y}function Gl(e,t,u,l){K?setTimeout(U(Oo,e),0):e.curOp.focus=P();var y=Kl(e,u,l),j=e.doc.sel,$;e.options.dragDrop&&Ge&&!e.isReadOnly()&&u=="single"&&($=j.contains(t))>-1&&(vt(($=j.ranges[$]).from(),t)<0||t.xRel>0)&&(vt($.to(),t)>0||t.xRel<0)?zl(e,l,t,y):Vl(e,l,t,y)}function zl(e,t,u,l){var y=e.display,j=!1,$=or(e,function(le){n&&(y.scroller.draggable=!1),e.state.draggingText=!1,Ze(y.wrapper.ownerDocument,"mouseup",$),Ze(y.wrapper.ownerDocument,"mousemove",ee),Ze(y.scroller,"dragstart",ne),Ze(y.scroller,"drop",$),j||(ie(le),l.addNew||Ea(e.doc,u,null,null,l.extend),n&&!h||K&&W==9?setTimeout(function(){y.wrapper.ownerDocument.body.focus({preventScroll:!0}),y.input.focus()},20):y.input.focus())}),ee=function(le){j=j||Math.abs(t.clientX-le.clientX)+Math.abs(t.clientY-le.clientY)>=10},ne=function(){return j=!0};n&&(y.scroller.draggable=!0),e.state.draggingText=$,$.copy=!l.moveOnDrag,y.scroller.dragDrop&&y.scroller.dragDrop(),Re(y.wrapper.ownerDocument,"mouseup",$),Re(y.wrapper.ownerDocument,"mousemove",ee),Re(y.scroller,"dragstart",ne),Re(y.scroller,"drop",$),Ao(e),setTimeout(function(){return y.input.focus()},20)}function As(e,t,u){if(u=="char")return new Cn(t,t);if(u=="word")return e.findWordAt(t);if(u=="line")return new Cn(rt(t.line,0),Dt(e.doc,rt(t.line+1,0)));var l=u(e,t);return new Cn(l.from,l.to)}function Vl(e,t,u,l){var y=e.display,j=e.doc;ie(t);var $,ee,ne=j.sel,le=ne.ranges;if(l.addNew&&!l.extend?(ee=j.sel.contains(u),ee>-1?$=le[ee]:$=new Cn(u,u)):($=j.sel.primary(),ee=j.sel.primIndex),l.unit=="rectangle")l.addNew||($=new Cn(u,u)),u=mi(e,t,!0,!0),ee=-1;else{var Te=As(e,u,l.unit);l.extend?$=qa($,Te.anchor,Te.head,l.extend):$=Te}l.addNew?ee==-1?(ee=le.length,Er(j,$r(e,le.concat([$]),ee),{scroll:!1,origin:"*mouse"})):le.length>1&&le[ee].empty()&&l.unit=="char"&&!l.extend?(Er(j,$r(e,le.slice(0,ee).concat(le.slice(ee+1)),0),{scroll:!1,origin:"*mouse"}),ne=j.sel):eo(j,ee,$,Se):(ee=0,Er(j,new Hr([$],0),Se),ne=j.sel);var Ce=u;function Be(_t){if(vt(Ce,_t)==0)return;if(Ce=_t,l.unit=="rectangle"){for(var St=[],zt=e.options.tabSize,Ut=G(ft(j,u.line).text,u.ch,zt),un=G(ft(j,_t.line).text,_t.ch,zt),Pn=Math.min(Ut,un),lr=Math.max(Ut,un),Kn=Math.min(u.line,_t.line),Ur=Math.min(e.lastLine(),Math.max(u.line,_t.line));Kn<=Ur;Kn++){var Ir=ft(j,Kn).text,qn=De(Ir,Pn,zt);Pn==lr?St.push(new Cn(rt(Kn,qn),rt(Kn,qn))):Ir.length>qn&&St.push(new Cn(rt(Kn,qn),rt(Kn,De(Ir,lr,zt))))}St.length||St.push(new Cn(u,u)),Er(j,$r(e,ne.ranges.slice(0,ee).concat(St),ee),{origin:"*mouse",scroll:!1}),e.scrollIntoView(_t)}else{var Dr=$,gr=As(e,_t,l.unit),rr=Dr.anchor,er;vt(gr.anchor,rr)>0?(er=gr.head,rr=Fr(Dr.from(),gr.anchor)):(er=gr.anchor,rr=vr(Dr.to(),gr.head));var Gn=ne.ranges.slice(0);Gn[ee]=Xl(e,new Cn(Dt(j,rr),er)),Er(j,$r(e,Gn,ee),Se)}}var ke=y.wrapper.getBoundingClientRect(),qe=0;function at(_t){var St=++qe,zt=mi(e,_t,!0,l.unit=="rectangle");if(!zt)return;if(vt(zt,Ce)!=0){e.curOp.focus=P(),Be(zt);var Ut=ma(y,j);(zt.line>=Ut.to||zt.line<Ut.from)&&setTimeout(or(e,function(){qe==St&&at(_t)}),150)}else{var un=_t.clientY<ke.top?-20:_t.clientY>ke.bottom?20:0;un&&setTimeout(or(e,function(){if(qe!=St)return;y.scroller.scrollTop+=un,at(_t)}),50)}}function mt(_t){e.state.selectingText=!1,qe=Infinity,_t&&(ie(_t),y.input.focus()),Ze(y.wrapper.ownerDocument,"mousemove",bt),Ze(y.wrapper.ownerDocument,"mouseup",Tt),j.history.lastSelOrigin=null}var bt=or(e,function(_t){_t.buttons===0||!Oe(_t)?mt(_t):at(_t)}),Tt=or(e,mt);e.state.selectingText=Tt,Re(y.wrapper.ownerDocument,"mousemove",bt),Re(y.wrapper.ownerDocument,"mouseup",Tt)}function Xl(e,t){var u=t.anchor,l=t.head,y=ft(e.doc,u.line);if(vt(u,l)==0&&u.sticky==l.sticky)return t;var j=ht(y);if(!j)return t;var $=lt(j,u.ch,u.sticky),ee=j[$];if(ee.from!=u.ch&&ee.to!=u.ch)return t;var ne=$+(ee.from==u.ch==(ee.level!=1)?0:1);if(ne==0||ne==j.length)return t;var le;if(l.line!=u.line)le=(l.line-u.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Te=lt(j,l.ch,l.sticky),Ce=Te-$||(l.ch-u.ch)*(ee.level==1?-1:1);Te==ne-1||Te==ne?le=Ce<0:le=Ce>0}var Be=j[ne+(le?-1:0)],ke=le==(Be.level==1),qe=ke?Be.from:Be.to,at=ke?"after":"before";return u.ch==qe&&u.sticky==at?t:new Cn(new rt(u.line,qe,at),l)}function Rs(e,t,u,l){var y,j;if(t.touches)y=t.touches[0].clientX,j=t.touches[0].clientY;else try{y=t.clientX,j=t.clientY}catch(Be){return!1}if(y>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;l&&ie(t);var $=e.display,ee=$.lineDiv.getBoundingClientRect();if(j>ee.bottom||!ae(e,u))return he(t);j-=ee.top-$.viewOffset;for(var ne=0;ne<e.display.gutterSpecs.length;++ne){var le=$.gutters.childNodes[ne];if(le&&le.getBoundingClientRect().right>=y){var Te=Ft(e.doc,j),Ce=e.display.gutterSpecs[ne];return ue(e,u,e,Te,Ce.className,t),he(t)}}}function oo(e,t){return Rs(e,t,"gutterClick",!0)}function Ls(e,t){if(pn(e.display,t)||Yl(e,t))return;if(q(e,t,"contextmenu"))return;L||e.display.input.onContextMenu(t)}function Yl(e,t){return ae(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-"),Hi(e)}var Ui={toString:function(){return"CodeMirror.Init"}},Ds={},Aa={};function $l(e){var t=e.optionHandlers;function u(l,y,j,$){e.defaults[l]=y,j&&(t[l]=$?function(ee,ne,le){le!=Ui&&j(ee,ne,le)}:j)}e.defineOption=u,e.Init=Ui,u("value","",function(l,y){return l.setValue(y)},!0),u("mode",null,function(l,y){l.doc.modeOption=y,Ja(l)},!0),u("indentUnit",2,Ja,!0),u("indentWithTabs",!1),u("smartIndent",!0),u("tabSize",4,function(l){Ji(l),Hi(l),Rr(l)},!0),u("lineSeparator",null,function(l,y){if(l.doc.lineSep=y,!y)return;var j=[],$=l.doc.first;l.doc.iter(function(ne){for(var le=0;;){var Te=ne.text.indexOf(y,le);if(Te==-1)break;le=Te+y.length,j.push(rt($,Te))}$++});for(var ee=j.length-1;ee>=0;ee--)Mi(l.doc,y,j[ee],rt(j[ee].line,j[ee].ch+y.length))}),u("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(l,y,j){l.state.specialChars=new RegExp(y.source+(y.test(" ")?"":"| "),"g"),j!=Ui&&l.refresh()}),u("specialCharPlaceholder",wn,function(l){return l.refresh()},!0),u("electricChars",!0),u("inputStyle",a?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),u("spellcheck",!1,function(l,y){return l.getInputField().spellcheck=y},!0),u("autocorrect",!1,function(l,y){return l.getInputField().autocorrect=y},!0),u("autocapitalize",!1,function(l,y){return l.getInputField().autocapitalize=y},!0),u("rtlMoveVisually",!T),u("wholeLineUpdateBefore",!0),u("theme","default",function(l){Is(l),$i(l)},!0),u("keyMap","default",function(l,y,j){var $=Ca(y),ee=j!=Ui&&Ca(j);ee&&ee.detach&&ee.detach(l,$),$.attach&&$.attach(l,ee||null)}),u("extraKeys",null),u("configureMouse",null),u("lineWrapping",!1,Zl,!0),u("gutters",[],function(l,y){l.display.gutterSpecs=Ya(y,l.options.lineNumbers),$i(l)},!0),u("fixedGutter",!0,function(l,y){l.display.gutters.style.left=y?Fa(l.display)+"px":"0",l.refresh()},!0),u("coverGutterNextToScrollbar",!1,function(l){return Ri(l)},!0),u("scrollbarStyle","native",function(l){Po(l),Ri(l),l.display.scrollbars.setScrollTop(l.doc.scrollTop),l.display.scrollbars.setScrollLeft(l.doc.scrollLeft)},!0),u("lineNumbers",!1,function(l,y){l.display.gutterSpecs=Ya(l.options.gutters,y),$i(l)},!0),u("firstLineNumber",1,$i,!0),u("lineNumberFormatter",function(l){return l},$i,!0),u("showCursorWhenSelecting",!1,Ki,!0),u("resetSelectionOnContextMenu",!0),u("lineWiseCopyCut",!0),u("pasteLinesPerSelection",!0),u("selectionsMayTouch",!1),u("readOnly",!1,function(l,y){y=="nocursor"&&(Oi(l),l.display.input.blur()),l.display.input.readOnlyChanged(y)}),u("screenReaderLabel",null,function(l,y){y=y===""?null:y,l.display.input.screenReaderLabelChanged(y)}),u("disableInput",!1,function(l,y){y||l.display.input.reset()},!0),u("dragDrop",!0,Jl),u("allowDropFileTypes",null),u("cursorBlinkRate",530),u("cursorScrollMargin",0),u("cursorHeight",1,Ki,!0),u("singleCursorHeightPerLine",!0,Ki,!0),u("workTime",100),u("workDelay",100),u("flattenSpans",!0,Ji,!0),u("addModeClass",!1,Ji,!0),u("pollInterval",100),u("undoDepth",200,function(l,y){return l.doc.history.undoDepth=y}),u("historyEventDelay",1250),u("viewportMargin",10,function(l){return l.refresh()},!0),u("maxHighlightLength",1e4,Ji,!0),u("moveInputWithCursor",!0,function(l,y){y||l.display.input.resetPosition()}),u("tabindex",null,function(l,y){return l.display.input.getField().tabIndex=y||""}),u("autofocus",null),u("direction","ltr",function(l,y){return l.doc.setDirection(y)},!0),u("phrases",null)}function Jl(e,t,u){var l=u&&u!=Ui;if(!t!=!l){var y=e.display.dragFunctions,j=t?Re:Ze;j(e.display.scroller,"dragstart",y.start),j(e.display.scroller,"dragenter",y.enter),j(e.display.scroller,"dragover",y.over),j(e.display.scroller,"dragleave",y.leave),j(e.display.scroller,"drop",y.drop)}}function Zl(e){e.options.lineWrapping?(F(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(_(e.display.wrapper,"CodeMirror-wrap"),Vr(e)),ja(e),Rr(e),Hi(e),setTimeout(function(){return Ri(e)},100)}function Bn(e,t){var u=this;if(!(this instanceof Bn))return new Bn(e,t);this.options=t=t?S(t):{},S(Ds,t,!1);var l=t.value;typeof l=="string"?l=new Lr(l,t.mode,null,t.lineSeparator,t.direction):t.mode&&(l.modeOption=t.mode),this.doc=l;var y=new Bn.inputStyles[t.inputStyle](this),j=this.display=new cl(e,l,y,t);j.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&&j.input.focus(),K&&W<11&&setTimeout(function(){return u.display.input.reset(!0)},20),Ql(this),Rl(),bi(this),this.curOp.forceUpdate=!0,Go(this,l),t.autofocus&&!a||this.hasFocus()?setTimeout(function(){u.hasFocus()&&!u.state.focused&&Wa(u)},20):Oi(this);for(var $ in Aa)Aa.hasOwnProperty($)&&Aa[$](this,t[$],Ui);Uo(this),t.finishInit&&t.finishInit(this);for(var ee=0;ee<so.length;++ee)so[ee](this);_i(this),n&&t.lineWrapping&&getComputedStyle(j.lineDiv).textRendering=="optimizelegibility"&&(j.lineDiv.style.textRendering="auto")}Bn.defaults=Ds,Bn.optionHandlers=Aa;function Ql(e){var t=e.display;Re(t.scroller,"mousedown",or(e,Os)),K&&W<11?Re(t.scroller,"dblclick",or(e,function(ne){if(q(e,ne))return;var le=mi(e,ne);if(!le||oo(e,ne)||pn(e.display,ne))return;ie(ne);var Te=e.findWordAt(le);Ea(e.doc,Te.anchor,Te.head)})):Re(t.scroller,"dblclick",function(ne){return q(e,ne)||ie(ne)}),Re(t.scroller,"contextmenu",function(ne){return Ls(e,ne)}),Re(t.input.getField(),"contextmenu",function(ne){t.scroller.contains(ne.target)||Ls(e,ne)});var u,l={end:0};function y(){t.activeTouch&&(u=setTimeout(function(){return t.activeTouch=null},1e3),l=t.activeTouch,l.end=+new Date)}function j(ne){if(ne.touches.length!=1)return!1;var le=ne.touches[0];return le.radiusX<=1&&le.radiusY<=1}function $(ne,le){if(le.left==null)return!0;var Te=le.left-ne.left,Ce=le.top-ne.top;return Te*Te+Ce*Ce>20*20}Re(t.scroller,"touchstart",function(ne){if(!q(e,ne)&&!j(ne)&&!oo(e,ne)){t.input.ensurePolled(),clearTimeout(u);var le=+new Date;t.activeTouch={start:le,moved:!1,prev:le-l.end<=300?l:null},ne.touches.length==1&&(t.activeTouch.left=ne.touches[0].pageX,t.activeTouch.top=ne.touches[0].pageY)}}),Re(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Re(t.scroller,"touchend",function(ne){var le=t.activeTouch;if(le&&!pn(t,ne)&&le.left!=null&&!le.moved&&new Date-le.start<300){var Te=e.coordsChar(t.activeTouch,"page"),Ce;!le.prev||$(le,le.prev)?Ce=new Cn(Te,Te):!le.prev.prev||$(le,le.prev.prev)?Ce=e.findWordAt(Te):Ce=new Cn(rt(Te.line,0),Dt(e.doc,rt(Te.line+1,0))),e.setSelection(Ce.anchor,Ce.head),e.focus(),ie(ne)}y()}),Re(t.scroller,"touchcancel",y),Re(t.scroller,"scroll",function(){t.scroller.clientHeight&&(zi(e,t.scroller.scrollTop),vi(e,t.scroller.scrollLeft,!0),ue(e,"scroll",e))}),Re(t.scroller,"mousewheel",function(ne){return Bo(e,ne)}),Re(t.scroller,"DOMMouseScroll",function(ne){return Bo(e,ne)}),Re(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(ne){q(e,ne)||ge(ne)},over:function(ne){q(e,ne)||(Al(e,ne),ge(ne))},start:function(ne){return Ol(e,ne)},drop:or(e,Cl),leave:function(ne){q(e,ne)||ps(e)}};var ee=t.input.getField();Re(ee,"keyup",function(ne){return Ss.call(e,ne)}),Re(ee,"keydown",or(e,ws)),Re(ee,"keypress",or(e,Cs)),Re(ee,"focus",function(ne){return Wa(e,ne)}),Re(ee,"blur",function(ne){return Oi(e,ne)})}var so=[];Bn.defineInitHook=function(e){return so.push(e)};function ua(e,t,u,l){var y=e.doc,j;u==null&&(u="add"),u=="smart"&&(y.mode.indent?j=cn(e,t).state:u="prev");var $=e.options.tabSize,ee=ft(y,t),ne=G(ee.text,null,$);ee.stateAfter&&(ee.stateAfter=null);var le=ee.text.match(/^\s*/)[0],Te;if(!l&&!/\S/.test(ee.text))Te=0,u="not";else if(u=="smart"&&(Te=y.mode.indent(j,ee.text.slice(le.length),ee.text),Te==we||Te>150)){if(!l)return;u="prev"}u=="prev"?t>y.first?Te=G(ft(y,t-1).text,null,$):Te=0:u=="add"?Te=ne+e.options.indentUnit:u=="subtract"?Te=ne-e.options.indentUnit:typeof u=="number"&&(Te=ne+u),Te=Math.max(0,Te);var Ce="",Be=0;if(e.options.indentWithTabs)for(var ke=Math.floor(Te/$);ke;--ke)Be+=$,Ce+=" ";if(Be<Te&&(Ce+=Y(Te-Be)),Ce!=le)return Mi(y,Ce,rt(t,0),rt(t,le.length),"+input"),ee.stateAfter=null,!0;for(var qe=0;qe<y.sel.ranges.length;qe++){var at=y.sel.ranges[qe];if(at.head.line==t&&at.head.ch<le.length){var mt=rt(t,le.length);eo(y,qe,new Cn(mt,mt));break}}}var Jr=null;function Ra(e){Jr=e}function lo(e,t,u,l,y){var j=e.doc;e.display.shift=!1,l||(l=j.sel);var $=+new Date-200,ee=y=="paste"||e.state.pasteIncoming>$,ne=We(t),le=null;if(ee&&l.ranges.length>1)if(Jr&&Jr.text.join(`
`)==t){if(l.ranges.length%Jr.text.length==0){le=[];for(var Te=0;Te<Jr.text.length;Te++)le.push(j.splitLines(Jr.text[Te]))}}else ne.length==l.ranges.length&&e.options.pasteLinesPerSelection&&(le=B(ne,function(bt){return[bt]}));for(var Ce=e.curOp.updateInput,Be=l.ranges.length-1;Be>=0;Be--){var ke=l.ranges[Be],qe=ke.from(),at=ke.to();ke.empty()&&(u&&u>0?qe=rt(qe.line,qe.ch-u):e.state.overwrite&&!ee?at=rt(at.line,Math.min(ft(j,at.line).text.length,at.ch+k(ne).length)):ee&&Jr&&Jr.lineWise&&Jr.text.join(`
`)==ne.join(`
`)&&(qe=at=rt(qe.line,0)));var mt={from:qe,to:at,text:le?le[Be%le.length]:ne,origin:y||(ee?"paste":e.state.cutIncoming>$?"cut":"+input")};Di(e.doc,mt),fn(e,"inputRead",e,mt)}t&&!ee&&Ps(e,t),Ai(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ce),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ms(e,t){var u=e.clipboardData&&e.clipboardData.getData("Text");if(u)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Nr(t,function(){return lo(t,u,0,null,"paste")}),!0}function Ps(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var u=e.doc.sel,l=u.ranges.length-1;l>=0;l--){var y=u.ranges[l];if(y.head.ch>100||l&&u.ranges[l-1].head.line==y.head.line)continue;var j=e.getModeAt(y.head),$=!1;if(j.electricChars){for(var ee=0;ee<j.electricChars.length;ee++)if(t.indexOf(j.electricChars.charAt(ee))>-1){$=ua(e,y.head.line,"smart");break}}else j.electricInput&&(j.electricInput.test(ft(e.doc,y.head.line).text.slice(0,y.head.ch))&&($=ua(e,y.head.line,"smart")));$&&fn(e,"electricInput",e,y.head.line)}}function ks(e){for(var t=[],u=[],l=0;l<e.doc.sel.ranges.length;l++){var y=e.doc.sel.ranges[l].head.line,j={anchor:rt(y,0),head:rt(y+1,0)};u.push(j),t.push(e.getRange(j.anchor,j.head))}return{text:t,ranges:u}}function Ns(e,t,u,l){e.setAttribute("autocorrect",u?"":"off"),e.setAttribute("autocapitalize",l?"":"off"),e.setAttribute("spellcheck",!!t)}function Us(){var e=p("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=p("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return n?e.style.width="1000px":e.setAttribute("wrap","off"),d&&(e.style.border="1px solid black"),Ns(e),t}function ql(e){var t=e.optionHandlers,u=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(l,y){var j=this.options,$=j[l];if(j[l]==y&&l!="mode")return;j[l]=y,t.hasOwnProperty(l)&&or(this,t[l])(this,y,$),ue(this,"optionChange",this,l)},getOption:function(l){return this.options[l]},getDoc:function(){return this.doc},addKeyMap:function(l,y){this.state.keyMaps[y?"push":"unshift"](Ca(l))},removeKeyMap:function(l){for(var y=this.state.keyMaps,j=0;j<y.length;++j)if(y[j]==l||y[j].name==l)return y.splice(j,1),!0},addOverlay:Cr(function(l,y){var j=l.token?l:e.getMode(this.options,l);if(j.startState)throw new Error("Overlays may not be stateful.");Z(this.state.overlays,{mode:j,modeSpec:l,opaque:y&&y.opaque,priority:y&&y.priority||0},function($){return $.priority}),this.state.modeGen++,Rr(this)}),removeOverlay:Cr(function(l){for(var y=this.state.overlays,j=0;j<y.length;++j){var $=y[j].modeSpec;if($==l||typeof l=="string"&&$.name==l){y.splice(j,1),this.state.modeGen++,Rr(this);return}}}),indentLine:Cr(function(l,y,j){typeof y!="string"&&typeof y!="number"&&(y==null?y=this.options.smartIndent?"smart":"prev":y=y?"add":"subtract"),On(this.doc,l)&&ua(this,l,y,j)}),indentSelection:Cr(function(l){for(var y=this.doc.sel.ranges,j=-1,$=0;$<y.length;$++){var ee=y[$];if(ee.empty())ee.head.line>j&&(ua(this,ee.head.line,l,!0),j=ee.head.line,$==this.doc.sel.primIndex&&Ai(this));else{var ne=ee.from(),le=ee.to(),Te=Math.max(j,ne.line);j=Math.min(this.lastLine(),le.line-(le.ch?0:1))+1;for(var Ce=Te;Ce<j;++Ce)ua(this,Ce,l);var Be=this.doc.sel.ranges;ne.ch==0&&y.length==Be.length&&Be[$].from().ch>0&&eo(this.doc,$,new Cn(ne,Be[$].to()),be)}}}),getTokenAt:function(l,y){return kt(this,l,y)},getLineTokens:function(l,y){return kt(this,rt(l),y,!0)},getTokenTypeAt:function(l){l=Dt(this.doc,l);var y=yn(this,ft(this.doc,l.line)),j=0,$=(y.length-1)/2,ee=l.ch,ne;if(ee==0)ne=y[2];else for(;;){var le=j+$>>1;if((le?y[le*2-1]:0)>=ee)$=le;else if(y[le*2+1]<ee)j=le+1;else{ne=y[le*2+2];break}}var Te=ne?ne.indexOf("overlay "):-1;return Te<0?ne:Te==0?null:ne.slice(0,Te-1)},getModeAt:function(l){var y=this.doc.mode;return y.innerMode?e.innerMode(y,this.getTokenAt(l).state).mode:y},getHelper:function(l,y){return this.getHelpers(l,y)[0]},getHelpers:function(l,y){var j=[];if(!u.hasOwnProperty(y))return j;var $=u[y],ee=this.getModeAt(l);if(typeof ee[y]=="string")$[ee[y]]&&j.push($[ee[y]]);else if(ee[y])for(var ne=0;ne<ee[y].length;ne++){var le=$[ee[y][ne]];le&&j.push(le)}else ee.helperType&&$[ee.helperType]?j.push($[ee.helperType]):$[ee.name]&&j.push($[ee.name]);for(var Te=0;Te<$._global.length;Te++){var Ce=$._global[Te];Ce.pred(ee,this)&&se(j,Ce.val)==-1&&j.push(Ce.val)}return j},getStateAfter:function(l,y){var j=this.doc;return l=Wn(j,l==null?j.first+j.size-1:l),cn(this,l+1,y).state},cursorCoords:function(l,y){var j,$=this.doc.sel.primary();return l==null?j=$.head:typeof l=="object"?j=Dt(this.doc,l):j=l?$.from():$.to(),Yr(this,j,y||"page")},charCoords:function(l,y){return Ma(this,Dt(this.doc,l),y||"page")},coordsChar:function(l,y){return l=bo(this,l,y||"page"),ka(this,l.left,l.top)},lineAtHeight:function(l,y){return l=bo(this,{top:l,left:0},y||"page").top,Ft(this.doc,l+this.display.viewOffset)},heightAtLine:function(l,y,j){var $=!1,ee;if(typeof l=="number"){var ne=this.doc.first+this.doc.size-1;l<this.doc.first?l=this.doc.first:l>ne&&(l=ne,$=!0),ee=ft(this.doc,l)}else ee=l;return da(this,ee,{top:0,left:0},y||"page",j||$).top+($?this.doc.height-Hn(ee):0)},defaultTextHeight:function(){return Si(this.display)},defaultCharWidth:function(){return Ci(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(l,y,j,$,ee){var ne=this.display;l=Yr(this,Dt(this.doc,l));var le=l.bottom,Te=l.left;if(y.style.position="absolute",y.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(y),ne.sizer.appendChild(y),$=="over")le=l.top;else if($=="above"||$=="near"){var Ce=Math.max(ne.wrapper.clientHeight,this.doc.height),Be=Math.max(ne.sizer.clientWidth,ne.lineSpace.clientWidth);($=="above"||l.bottom+y.offsetHeight>Ce)&&l.top>y.offsetHeight?le=l.top-y.offsetHeight:l.bottom+y.offsetHeight<=Ce&&(le=l.bottom),Te+y.offsetWidth>Be&&(Te=Be-y.offsetWidth)}y.style.top=le+"px",y.style.left=y.style.right="",ee=="right"?(Te=ne.sizer.clientWidth-y.offsetWidth,y.style.right="0px"):(ee=="left"?Te=0:ee=="middle"&&(Te=(ne.sizer.clientWidth-y.offsetWidth)/2),y.style.left=Te+"px"),j&&Js(this,{left:Te,top:le,right:Te+y.offsetWidth,bottom:le+y.offsetHeight})},triggerOnKeyDown:Cr(ws),triggerOnKeyPress:Cr(Cs),triggerOnKeyUp:Ss,triggerOnMouseDown:Cr(Os),execCommand:function(l){if(aa.hasOwnProperty(l))return aa[l].call(null,this)},triggerElectric:Cr(function(l){Ps(this,l)}),findPosH:function(l,y,j,$){var ee=1;y<0&&(ee=-1,y=-y);for(var ne=Dt(this.doc,l),le=0;le<y&&!(ne=uo(this.doc,ne,ee,j,$),ne.hitSide);++le);return ne},moveH:Cr(function(l,y){var j=this;this.extendSelectionsBy(function($){return j.display.shift||j.doc.extend||$.empty()?uo(j.doc,$.head,l,y,j.options.rtlMoveVisually):l<0?$.from():$.to()},Ae)}),deleteH:Cr(function(l,y){var j=this.doc.sel,$=this.doc;j.somethingSelected()?$.replaceSelection("",null,"+delete"):Ni(this,function(ee){var ne=uo($,ee.head,l,y,!1);return l<0?{from:ne,to:ee.head}:{from:ee.head,to:ne}})}),findPosV:function(l,y,j,$){var ee=1,ne=$;y<0&&(ee=-1,y=-y);for(var le=Dt(this.doc,l),Te=0;Te<y;++Te){var Ce=Yr(this,le,"div");if(ne==null?ne=Ce.left:Ce.left=ne,le=Fs(this,Ce,ee,j),le.hitSide)break}return le},moveV:Cr(function(l,y){var j=this,$=this.doc,ee=[],ne=!this.display.shift&&!$.extend&&$.sel.somethingSelected();if($.extendSelectionsBy(function(Te){if(ne)return l<0?Te.from():Te.to();var Ce=Yr(j,Te.head,"div");Te.goalColumn!=null&&(Ce.left=Te.goalColumn),ee.push(Ce.left);var Be=Fs(j,Ce,l,y);return y=="page"&&Te==$.sel.primary()&&Ka(j,Ma(j,Be,"div").top-Ce.top),Be},Ae),ee.length)for(var le=0;le<$.sel.ranges.length;le++)$.sel.ranges[le].goalColumn=ee[le]}),findWordAt:function(l){var y=this.doc,j=ft(y,l.line).text,$=l.ch,ee=l.ch;if(j){var ne=this.getHelper(l,"wordChars");(l.sticky=="before"||ee==j.length)&&$?--$:++ee;for(var le=j.charAt($),Te=He(le,ne)?function(Ce){return He(Ce,ne)}:/\s/.test(le)?function(Ce){return/\s/.test(Ce)}:function(Ce){return!/\s/.test(Ce)&&!He(Ce)};$>0&&Te(j.charAt($-1));)--$;for(;ee<j.length&&Te(j.charAt(ee));)++ee}return new Cn(rt(l.line,$),rt(l.line,ee))},toggleOverwrite:function(l){if(l!=null&&l==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?F(this.display.cursorDiv,"CodeMirror-overwrite"):_(this.display.cursorDiv,"CodeMirror-overwrite"),ue(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==P()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Cr(function(l,y){Gi(this,l,y)}),getScrollInfo:function(){var l=this.display.scroller;return{left:l.scrollLeft,top:l.scrollTop,height:l.scrollHeight-Vn(this)-this.display.barHeight,width:l.scrollWidth-Vn(this)-this.display.barWidth,clientHeight:Sr(this),clientWidth:mr(this)}},scrollIntoView:Cr(function(l,y){l==null?(l={from:this.doc.sel.primary().head,to:null},y==null&&(y=this.options.cursorScrollMargin)):typeof l=="number"?l={from:rt(l,0),to:null}:l.from==null&&(l={from:l,to:null}),l.to||(l.to=l.from),l.margin=y||0,l.from.line!=null?Zs(this,l):Lo(this,l.from,l.to,l.margin)}),setSize:Cr(function(l,y){var j=this,$=function(ne){return typeof ne=="number"||/^\d+$/.test(String(ne))?ne+"px":ne};l!=null&&(this.display.wrapper.style.width=$(l)),y!=null&&(this.display.wrapper.style.height=$(y)),this.options.lineWrapping&&go(this);var ee=this.display.viewFrom;this.doc.iter(ee,this.display.viewTo,function(ne){if(ne.widgets){for(var le=0;le<ne.widgets.length;le++)if(ne.widgets[le].noHScroll){oi(j,ee,"widget");break}}++ee}),this.curOp.forceUpdate=!0,ue(this,"refresh",this)}),operation:function(l){return Nr(this,l)},startOperation:function(){return bi(this)},endOperation:function(){return _i(this)},refresh:Cr(function(){var l=this.display.cachedTextHeight;Rr(this),this.curOp.forceUpdate=!0,Hi(this),Gi(this,this.doc.scrollLeft,this.doc.scrollTop),Va(this.display),(l==null||Math.abs(l-Si(this.display))>.5||this.options.lineWrapping)&&ja(this),ue(this,"refresh",this)}),swapDoc:Cr(function(l){var y=this.doc;return y.cm=null,this.state.selectingText&&this.state.selectingText(),Go(this,l),Hi(this),this.display.input.reset(),Gi(this,l.scrollLeft,l.scrollTop),this.curOp.forceScroll=!0,fn(this,"swapDoc",this,y),y}),phrase:function(l){var y=this.options.phrases;return y&&Object.prototype.hasOwnProperty.call(y,l)?y[l]:l},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(l,y,j){u.hasOwnProperty(l)||(u[l]=e[l]={_global:[]}),u[l][y]=j},e.registerGlobalHelper=function(l,y,j,$){e.registerHelper(l,y,$),u[l]._global.push({pred:j,val:$})}}function uo(e,t,u,l,y){var j=t,$=u,ee=ft(e,t.line),ne=y&&e.direction=="rtl"?-u:u;function le(){var Tt=t.line+ne;return Tt<e.first||Tt>=e.first+e.size?!1:(t=new rt(Tt,t.ch,t.sticky),ee=ft(e,Tt))}function Te(Tt){var _t;if(l=="codepoint"){var St=ee.text.charCodeAt(t.ch+(l>0?0:-1));isNaN(St)?_t=null:_t=new rt(t.line,Math.max(0,Math.min(ee.text.length,t.ch+u*(St>=55296&&St<56320?2:1))),-u)}else y?_t=Pl(e.cm,ee,t,u):_t=no(ee,t,u);if(_t==null)if(!Tt&&le())t=ro(y,e.cm,ee,t.line,ne);else return!1;else t=_t;return!0}if(l=="char"||l=="codepoint")Te();else if(l=="column")Te(!0);else if(l=="word"||l=="group")for(var Ce=null,Be=l=="group",ke=e.cm&&e.cm.getHelper(t,"wordChars"),qe=!0;!(u<0&&!Te(!qe));qe=!1){var at=ee.text.charAt(t.ch)||`
`,mt=He(at,ke)?"w":Be&&at==`
`?"n":!Be||/\s/.test(at)?null:"p";if(Be&&!qe&&!mt&&(mt="s"),Ce&&Ce!=mt){u<0&&(u=1,Te(),t.sticky="after");break}if(mt&&(Ce=mt),u>0&&!Te(!qe))break}var bt=Ta(e,t,j,$,!0);return zn(j,bt)&&(bt.hitSide=!0),bt}function Fs(e,t,u,l){var y=e.doc,j=t.left,$;if(l=="page"){var ee=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),ne=Math.max(ee-.5*Si(e.display),3);$=(u>0?t.bottom:t.top)+u*ne}else l=="line"&&($=u>0?t.bottom+3:t.top-3);for(var le;!(le=ka(e,j,$),!le.outside);){if(u<0?$<=0:$>=y.height){le.hitSide=!0;break}$+=u*5}return le}var Rn=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};Rn.prototype.init=function(e){var t=this,u=this,l=u.cm,y=u.div=e.lineDiv;Ns(y,l.options.spellcheck,l.options.autocorrect,l.options.autocapitalize);function j(ee){for(var ne=ee.target;ne;ne=ne.parentNode){if(ne==y)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(ne.className))break}return!1}Re(y,"paste",function(ee){if(!j(ee)||q(l,ee)||Ms(ee,l))return;W<=11&&setTimeout(or(l,function(){return t.updateFromDOM()}),20)}),Re(y,"compositionstart",function(ee){t.composing={data:ee.data,done:!1}}),Re(y,"compositionupdate",function(ee){t.composing||(t.composing={data:ee.data,done:!1})}),Re(y,"compositionend",function(ee){t.composing&&(ee.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Re(y,"touchstart",function(){return u.forceCompositionEnd()}),Re(y,"input",function(){t.composing||t.readFromDOMSoon()});function $(ee){if(!j(ee)||q(l,ee))return;if(l.somethingSelected())Ra({lineWise:!1,text:l.getSelections()}),ee.type=="cut"&&l.replaceSelection("",null,"cut");else if(l.options.lineWiseCopyCut){var ne=ks(l);Ra({lineWise:!0,text:ne.text}),ee.type=="cut"&&l.operation(function(){l.setSelections(ne.ranges,0,be),l.replaceSelection("",null,"cut")})}else return;if(ee.clipboardData){ee.clipboardData.clearData();var le=Jr.text.join(`
`);if(ee.clipboardData.setData("Text",le),ee.clipboardData.getData("Text")==le){ee.preventDefault();return}}var Te=Us(),Ce=Te.firstChild;l.display.lineSpace.insertBefore(Te,l.display.lineSpace.firstChild),Ce.value=Jr.text.join(`
`);var Be=document.activeElement;H(Ce),setTimeout(function(){l.display.lineSpace.removeChild(Te),Be.focus(),Be==y&&u.showPrimarySelection()},50)}Re(y,"copy",$),Re(y,"cut",$)},Rn.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Rn.prototype.prepareSelection=function(){var e=So(this.cm,!1);return e.focus=document.activeElement==this.div,e},Rn.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Rn.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Rn.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,u=t.doc.sel.primary(),l=u.from(),y=u.to();if(t.display.viewTo==t.display.viewFrom||l.line>=t.display.viewTo||y.line<t.display.viewFrom){e.removeAllRanges();return}var j=La(t,e.anchorNode,e.anchorOffset),$=La(t,e.focusNode,e.focusOffset);if(j&&!j.bad&&$&&!$.bad&&vt(Fr(j,$),l)==0&&vt(vr(j,$),y)==0)return;var ee=t.display.view,ne=l.line>=t.display.viewFrom&&js(t,l)||{node:ee[0].measure.map[2],offset:0},le=y.line<t.display.viewTo&&js(t,y);if(!le){var Te=ee[ee.length-1].measure,Ce=Te.maps?Te.maps[Te.maps.length-1]:Te.map;le={node:Ce[Ce.length-1],offset:Ce[Ce.length-2]-Ce[Ce.length-3]}}if(!ne||!le){e.removeAllRanges();return}var Be=e.rangeCount&&e.getRangeAt(0),ke;try{ke=E(ne.node,ne.offset,le.offset,le.node)}catch(qe){}ke&&(!D&&t.state.focused?(e.collapse(ne.node,ne.offset),ke.collapsed||(e.removeAllRanges(),e.addRange(ke))):(e.removeAllRanges(),e.addRange(ke)),Be&&e.anchorNode==null?e.addRange(Be):D&&this.startGracePeriod()),this.rememberSelection()},Rn.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Rn.prototype.showMultipleSelections=function(e){m(this.cm.display.cursorDiv,e.cursors),m(this.cm.display.selectionDiv,e.selection)},Rn.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Rn.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return v(this.div,t)},Rn.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Rn.prototype.blur=function(){this.div.blur()},Rn.prototype.getField=function(){return this.div},Rn.prototype.supportsTouch=function(){return!0},Rn.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Nr(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},Rn.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Rn.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(i&&g&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var u=La(t,e.anchorNode,e.anchorOffset),l=La(t,e.focusNode,e.focusOffset);u&&l&&Nr(t,function(){Er(t.doc,li(u,l),be),(u.bad||l.bad)&&(t.curOp.selectionChanged=!0)})},Rn.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,u=e.doc.sel.primary(),l=u.from(),y=u.to();if(l.ch==0&&l.line>e.firstLine()&&(l=rt(l.line-1,ft(e.doc,l.line-1).length)),y.ch==ft(e.doc,y.line).text.length&&y.line<e.lastLine()&&(y=rt(y.line+1,0)),l.line<t.viewFrom||y.line>t.viewTo-1)return!1;var j,$,ee;l.line==t.viewFrom||(j=gi(e,l.line))==0?($=Mt(t.view[0].line),ee=t.view[0].node):($=Mt(t.view[j].line),ee=t.view[j-1].node.nextSibling);var ne=gi(e,y.line),le,Te;if(ne==t.view.length-1?(le=t.viewTo-1,Te=t.lineDiv.lastChild):(le=Mt(t.view[ne+1].line)-1,Te=t.view[ne+1].node.previousSibling),!ee)return!1;for(var Ce=e.doc.splitLines(tu(e,ee,Te,$,le)),Be=Wt(e.doc,rt($,0),rt(le,ft(e.doc,le).text.length));Ce.length>1&&Be.length>1;)if(k(Ce)==k(Be))Ce.pop(),Be.pop(),le--;else if(Ce[0]==Be[0])Ce.shift(),Be.shift(),$++;else break;for(var ke=0,qe=0,at=Ce[0],mt=Be[0],bt=Math.min(at.length,mt.length);ke<bt&&at.charCodeAt(ke)==mt.charCodeAt(ke);)++ke;for(var Tt=k(Ce),_t=k(Be),St=Math.min(Tt.length-(Ce.length==1?ke:0),_t.length-(Be.length==1?ke:0));qe<St&&Tt.charCodeAt(Tt.length-qe-1)==_t.charCodeAt(_t.length-qe-1);)++qe;if(Ce.length==1&&Be.length==1&&$==l.line)for(;ke&&ke>l.ch&&Tt.charCodeAt(Tt.length-qe-1)==_t.charCodeAt(_t.length-qe-1);)ke--,qe++;Ce[Ce.length-1]=Tt.slice(0,Tt.length-qe).replace(/^\u200b+/,""),Ce[0]=Ce[0].slice(ke).replace(/\u200b+$/,"");var zt=rt($,ke),Ut=rt(le,Be.length?k(Be).length-qe:0);if(Ce.length>1||Ce[0]||vt(zt,Ut))return Mi(e.doc,Ce,zt,Ut,"+input"),!0},Rn.prototype.ensurePolled=function(){this.forceCompositionEnd()},Rn.prototype.reset=function(){this.forceCompositionEnd()},Rn.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Rn.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)},Rn.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Nr(this.cm,function(){return Rr(e.cm)})},Rn.prototype.setUneditable=function(e){e.contentEditable="false"},Rn.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||or(this.cm,lo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Rn.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Rn.prototype.onContextMenu=function(){},Rn.prototype.resetPosition=function(){},Rn.prototype.needsContentAttribute=!0;function js(e,t){var u=ca(e,t.line);if(!u||u.hidden)return null;var l=ft(e.doc,t.line),y=Gr(u,l,t.line),j=ht(l,e.doc.direction),$="left";if(j){var ee=lt(j,t.ch);$=ee%2?"right":"left"}var ne=po(y.map,t.ch,$);return ne.offset=ne.collapse=="right"?ne.end:ne.start,ne}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Fi(e,t){return t&&(e.bad=!0),e}function tu(e,t,u,l,y){var j="",$=!1,ee=e.doc.lineSeparator(),ne=!1;function le(ke){return function(qe){return qe.id==ke}}function Te(){$&&(j+=ee,ne&&(j+=ee),$=ne=!1)}function Ce(ke){ke&&(Te(),j+=ke)}function Be(ke){if(ke.nodeType==1){var qe=ke.getAttribute("cm-text");if(qe){Ce(qe);return}var at=ke.getAttribute("cm-marker"),mt;if(at){var bt=e.findMarks(rt(l,0),rt(y+1,0),le(+at));bt.length&&(mt=bt[0].find(0))&&Ce(Wt(e.doc,mt.from,mt.to).join(ee));return}if(ke.getAttribute("contenteditable")=="false")return;var Tt=/^(pre|div|p|li|table|br)$/i.test(ke.nodeName);if(!/^br$/i.test(ke.nodeName)&&ke.textContent.length==0)return;Tt&&Te();for(var _t=0;_t<ke.childNodes.length;_t++)Be(ke.childNodes[_t]);/^(pre|p)$/i.test(ke.nodeName)&&(ne=!0),Tt&&($=!0)}else ke.nodeType==3&&Ce(ke.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Be(t),t==u);)t=t.nextSibling,ne=!1;return j}function La(e,t,u){var l;if(t==e.display.lineDiv){if(l=e.display.lineDiv.childNodes[u],!l)return Fi(e.clipPos(rt(e.display.viewTo-1)),!0);t=null,u=0}else for(l=t;;l=l.parentNode){if(!l||l==e.display.lineDiv)return null;if(l.parentNode&&l.parentNode==e.display.lineDiv)break}for(var y=0;y<e.display.view.length;y++){var j=e.display.view[y];if(j.node==l)return nu(j,t,u)}}function nu(e,t,u){var l=e.text.firstChild,y=!1;if(!t||!v(l,t))return Fi(rt(Mt(e.line),0),!0);if(t==l&&(y=!0,t=l.childNodes[u],u=0,!t)){var j=e.rest?k(e.rest):e.line;return Fi(rt(Mt(j),j.text.length),y)}var $=t.nodeType==3?t:null,ee=t;for(!$&&t.childNodes.length==1&&t.firstChild.nodeType==3&&($=t.firstChild,u&&(u=$.nodeValue.length));ee.parentNode!=l;)ee=ee.parentNode;var ne=e.measure,le=ne.maps;function Te(mt,bt,Tt){for(var _t=-1;_t<(le?le.length:0);_t++)for(var St=_t<0?ne.map:le[_t],zt=0;zt<St.length;zt+=3){var Ut=St[zt+2];if(Ut==mt||Ut==bt){var un=Mt(_t<0?e.line:e.rest[_t]),Pn=St[zt]+Tt;return(Tt<0||Ut!=mt)&&(Pn=St[zt+(Tt?1:0)]),rt(un,Pn)}}}var Ce=Te($,ee,u);if(Ce)return Fi(Ce,y);for(var Be=ee.nextSibling,ke=$?$.nodeValue.length-u:0;Be;Be=Be.nextSibling){if(Ce=Te(Be,Be.firstChild,0),Ce)return Fi(rt(Ce.line,Ce.ch-ke),y);ke+=Be.textContent.length}for(var qe=ee.previousSibling,at=u;qe;qe=qe.previousSibling){if(Ce=Te(qe,qe.firstChild,-1),Ce)return Fi(rt(Ce.line,Ce.ch+at),y);at+=qe.textContent.length}}var Xn=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Q,this.hasSelection=!1,this.composing=null};Xn.prototype.init=function(e){var t=this,u=this,l=this.cm;this.createField(e);var y=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),d&&(y.style.width="0px"),Re(y,"input",function(){K&&W>=9&&t.hasSelection&&(t.hasSelection=null),u.poll()}),Re(y,"paste",function($){if(q(l,$)||Ms($,l))return;l.state.pasteIncoming=+new Date,u.fastPoll()});function j($){if(q(l,$))return;if(l.somethingSelected())Ra({lineWise:!1,text:l.getSelections()});else if(l.options.lineWiseCopyCut){var ee=ks(l);Ra({lineWise:!0,text:ee.text}),$.type=="cut"?l.setSelections(ee.ranges,null,be):(u.prevInput="",y.value=ee.text.join(`
`),H(y))}else return;$.type=="cut"&&(l.state.cutIncoming=+new Date)}Re(y,"cut",j),Re(y,"copy",j),Re(e.scroller,"paste",function($){if(pn(e,$)||q(l,$))return;if(!y.dispatchEvent){l.state.pasteIncoming=+new Date,u.focus();return}var ee=new Event("paste");ee.clipboardData=$.clipboardData,y.dispatchEvent(ee)}),Re(e.lineSpace,"selectstart",function($){pn(e,$)||ie($)}),Re(y,"compositionstart",function(){var $=l.getCursor("from");u.composing&&u.composing.range.clear(),u.composing={start:$,range:l.markText($,l.getCursor("to"),{className:"CodeMirror-composing"})}}),Re(y,"compositionend",function(){u.composing&&(u.poll(),u.composing.range.clear(),u.composing=null)})},Xn.prototype.createField=function(e){this.wrapper=Us(),this.textarea=this.wrapper.firstChild},Xn.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Xn.prototype.prepareSelection=function(){var e=this.cm,t=e.display,u=e.doc,l=So(e);if(e.options.moveInputWithCursor){var y=Yr(e,u.sel.primary().head,"div"),j=t.wrapper.getBoundingClientRect(),$=t.lineDiv.getBoundingClientRect();l.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,y.top+$.top-j.top)),l.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,y.left+$.left-j.left))}return l},Xn.prototype.showSelection=function(e){var t=this.cm,u=t.display;m(u.cursorDiv,e.cursors),m(u.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Xn.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var u=t.getSelection();this.textarea.value=u,t.state.focused&&H(this.textarea),K&&W>=9&&(this.hasSelection=u)}else e||(this.prevInput=this.textarea.value="",K&&W>=9&&(this.hasSelection=null))},Xn.prototype.getField=function(){return this.textarea},Xn.prototype.supportsTouch=function(){return!1},Xn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!a||P()!=this.textarea))try{this.textarea.focus()}catch(e){}},Xn.prototype.blur=function(){this.textarea.blur()},Xn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Xn.prototype.receivedFocus=function(){this.slowPoll()},Xn.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()})},Xn.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function u(){var l=t.poll();!l&&!e?(e=!0,t.polling.set(60,u)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,u)},Xn.prototype.poll=function(){var e=this,t=this.cm,u=this.textarea,l=this.prevInput;if(this.contextMenuPending||!t.state.focused||Ve(u)&&!l&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var y=u.value;if(y==l&&!t.somethingSelected())return!1;if(K&&W>=9&&this.hasSelection===y||r&&/[\uf700-\uf7ff]/.test(y))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var j=y.charCodeAt(0);if(j==8203&&!l&&(l="\u200B"),j==8666)return this.reset(),this.cm.execCommand("undo")}for(var $=0,ee=Math.min(l.length,y.length);$<ee&&l.charCodeAt($)==y.charCodeAt($);)++$;return Nr(t,function(){lo(t,y.slice($),l.length-$,null,e.composing?"*compose":null),y.length>1e3||y.indexOf(`
`)>-1?u.value=e.prevInput="":e.prevInput=y,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Xn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Xn.prototype.onKeyPress=function(){K&&W>=9&&(this.hasSelection=null),this.fastPoll()},Xn.prototype.onContextMenu=function(e){var t=this,u=t.cm,l=u.display,y=t.textarea;t.contextMenuPending&&t.contextMenuPending();var j=mi(u,e),$=l.scroller.scrollTop;if(!j||f)return;var ee=u.options.resetSelectionOnContextMenu;ee&&u.doc.sel.contains(j)==-1&&or(u,Er)(u.doc,li(j),be);var ne=y.style.cssText,le=t.wrapper.style.cssText,Te=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",y.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-Te.top-5)+"px; left: "+(e.clientX-Te.left-5)+`px;
z-index: 1000; background: `+(K?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ce;n&&(Ce=window.scrollY),l.input.focus(),n&&window.scrollTo(null,Ce),l.input.reset(),u.somethingSelected()||(y.value=t.prevInput=" "),t.contextMenuPending=ke,l.selForContextMenu=u.doc.sel,clearTimeout(l.detectingSelectAll);function Be(){if(y.selectionStart!=null){var at=u.somethingSelected(),mt="\u200B"+(at?y.value:"");y.value="\u21DA",y.value=mt,t.prevInput=at?"":"\u200B",y.selectionStart=1,y.selectionEnd=mt.length,l.selForContextMenu=u.doc.sel}}function ke(){if(t.contextMenuPending!=ke)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=le,y.style.cssText=ne,K&&W<9&&l.scrollbars.setScrollTop(l.scroller.scrollTop=$),y.selectionStart!=null){(!K||K&&W<9)&&Be();var at=0,mt=function(){l.selForContextMenu==u.doc.sel&&y.selectionStart==0&&y.selectionEnd>0&&t.prevInput=="\u200B"?or(u,rs)(u):at++<10?l.detectingSelectAll=setTimeout(mt,500):(l.selForContextMenu=null,l.input.reset())};l.detectingSelectAll=setTimeout(mt,200)}}if(K&&W>=9&&Be(),L){ge(e);var qe=function(){Ze(window,"mouseup",qe),setTimeout(ke,20)};Re(window,"mouseup",qe)}else setTimeout(ke,50)},Xn.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Xn.prototype.setUneditable=function(){},Xn.prototype.needsContentAttribute=!1;function ru(e,t){if(t=t?S(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 u=P();t.autofocus=u==e||e.getAttribute("autofocus")!=null&&u==document.body}function l(){e.value=ee.getValue()}var y;if(e.form&&(Re(e.form,"submit",l),!t.leaveSubmitMethodAlone)){var j=e.form;y=j.submit;try{var $=j.submit=function(){l(),j.submit=y,j.submit(),j.submit=$}}catch(ne){}}t.finishInit=function(ne){ne.save=l,ne.getTextArea=function(){return e},ne.toTextArea=function(){ne.toTextArea=isNaN,l(),e.parentNode.removeChild(ne.getWrapperElement()),e.style.display="",e.form&&(Ze(e.form,"submit",l),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=y))}},e.style.display="none";var ee=Bn(function(ne){return e.parentNode.insertBefore(ne,e.nextSibling)},t);return ee}function iu(e){e.off=Ze,e.on=Re,e.wheelEventPixels=dl,e.Doc=Lr,e.splitLines=We,e.countColumn=G,e.findColumn=De,e.isWordChar=Me,e.Pass=we,e.signal=ue,e.Line=yr,e.changeEnd=ui,e.scrollbarModel=Mo,e.Pos=rt,e.cmpPos=vt,e.modes=Xe,e.mimeModes=je,e.resolveMode=Ke,e.getMode=Je,e.modeExtensions=Qe,e.extendMode=pt,e.copyState=dt,e.startState=rn,e.innerMode=Vt,e.commands=aa,e.keyMap=ii,e.keyName=bs,e.isModifierKey=vs,e.lookupKey=ki,e.normalizeKeyMap=Ml,e.StringStream=an,e.SharedTextMarker=na,e.TextMarker=di,e.LineWidget=ta,e.e_preventDefault=ie,e.e_stopPropagation=oe,e.e_stop=ge,e.addClass=F,e.contains=v,e.rmClass=_,e.keyNames=hi}$l(Bn),ql(Bn);var au="iter insert remove copy getEditor constructor".split(" ");for(var Ia in Lr.prototype)Lr.prototype.hasOwnProperty(Ia)&&se(au,Ia)<0&&(Bn.prototype[Ia]=function(e){return function(){return e.apply(this.doc,arguments)}}(Lr.prototype[Ia]));return ce(Lr),Bn.inputStyles={textarea:Xn,contenteditable:Rn},Bn.defineMode=function(e){!Bn.defaults.mode&&e!="null"&&(Bn.defaults.mode=e),it.apply(this,arguments)},Bn.defineMIME=ot,Bn.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Bn.defineMIME("text/plain","null"),Bn.defineExtension=function(e,t){Bn.prototype[e]=t},Bn.defineDocExtension=function(e,t){Lr.prototype[e]=t},Bn.fromTextArea=ru,iu(Bn),Bn.version="5.58.2",Bn})},WaYH:function(Ue,de,M){"use strict";var J=M("rePB"),z=M("Ff2n"),D=M("VTBJ"),V=M("1OyB"),N=M("vuIU"),O=M("JX7q"),K=M("Ji7U"),W=M("LK+K"),n=M("q1tI"),I=M("TSYQ"),g=M.n(I),f=M("sboe"),h=M("OZM5"),c=function(L){var A=L.prefixCls,_=L.level,b=L.isStart,m=L.isEnd;if(!_)return null;for(var p="".concat(A,"-indent-unit"),C=[],E=0;E<_;E+=1){var v;C.push(n.createElement("span",{key:E,className:g()(p,(v={},Object(J.a)(v,"".concat(p,"-start"),b[E+1]),Object(J.a)(v,"".concat(p,"-end"),m[E+1]),Object(J.a)(v,"".concat(p,"-end-first-level"),!E&&m[0]),v))}))}return n.createElement("span",{"aria-hidden":"true",className:"".concat(A,"-indent")},C)},s=c,d=M("815F"),i="open",a="close",r="---",o=function(x){Object(K.a)(A,x);var L=Object(W.a)(A);function A(){var _;return Object(V.a)(this,A),_=L.apply(this,arguments),_.state={dragNodeHighlight:!1},_.onSelectorClick=function(b){var m=_.props.context.onNodeClick;m(b,Object(d.b)(_.props)),_.isSelectable()?_.onSelect(b):_.onCheck(b)},_.onSelectorDoubleClick=function(b){var m=_.props.context.onNodeDoubleClick;m(b,Object(d.b)(_.props))},_.onSelect=function(b){if(_.isDisabled())return;var m=_.props.context.onNodeSelect;b.preventDefault(),m(b,Object(d.b)(_.props))},_.onCheck=function(b){if(_.isDisabled())return;var m=_.props,p=m.disableCheckbox,C=m.checked,E=_.props.context.onNodeCheck;if(!_.isCheckable()||p)return;b.preventDefault();var v=!C;E(b,Object(d.b)(_.props),v)},_.onMouseEnter=function(b){var m=_.props.context.onNodeMouseEnter;m(b,Object(d.b)(_.props))},_.onMouseLeave=function(b){var m=_.props.context.onNodeMouseLeave;m(b,Object(d.b)(_.props))},_.onContextMenu=function(b){var m=_.props.context.onNodeContextMenu;m(b,Object(d.b)(_.props))},_.onDragStart=function(b){var m=_.props.context.onNodeDragStart;b.stopPropagation(),_.setState({dragNodeHighlight:!0}),m(b,Object(O.a)(_));try{b.dataTransfer.setData("text/plain","")}catch(p){}},_.onDragEnter=function(b){var m=_.props.context.onNodeDragEnter;b.preventDefault(),b.stopPropagation(),m(b,Object(O.a)(_))},_.onDragOver=function(b){var m=_.props.context.onNodeDragOver;b.preventDefault(),b.stopPropagation(),m(b,Object(O.a)(_))},_.onDragLeave=function(b){var m=_.props.context.onNodeDragLeave;b.stopPropagation(),m(b,Object(O.a)(_))},_.onDragEnd=function(b){var m=_.props.context.onNodeDragEnd;b.stopPropagation(),_.setState({dragNodeHighlight:!1}),m(b,Object(O.a)(_))},_.onDrop=function(b){var m=_.props.context.onNodeDrop;b.preventDefault(),b.stopPropagation(),_.setState({dragNodeHighlight:!1}),m(b,Object(O.a)(_))},_.onExpand=function(b){var m=_.props.context.onNodeExpand;m(b,Object(d.b)(_.props))},_.setSelectHandle=function(b){_.selectHandle=b},_.getNodeState=function(){var b=_.props.expanded;return _.isLeaf()?null:b?i:a},_.hasChildren=function(){var b=_.props.eventKey,m=_.props.context.keyEntities,p=m[b]||{},C=p.children;return!!(C||[]).length},_.isLeaf=function(){var b=_.props,m=b.isLeaf,p=b.loaded,C=_.props.context.loadData,E=_.hasChildren();return m===!1?!1:m||!C&&!E||C&&p&&!E},_.isDisabled=function(){var b=_.props.disabled,m=_.props.context.disabled;return!!(m||b)},_.isCheckable=function(){var b=_.props.checkable,m=_.props.context.checkable;return!m||b===!1?!1:m},_.syncLoadData=function(b){var m=b.expanded,p=b.loading,C=b.loaded,E=_.props.context,v=E.loadData,P=E.onNodeLoad;if(p)return;v&&m&&!_.isLeaf()&&(!_.hasChildren()&&!C&&P(Object(d.b)(_.props)))},_.renderSwitcher=function(){var b=_.props,m=b.expanded,p=b.switcherIcon,C=_.props.context,E=C.prefixCls,v=C.switcherIcon,P=p||v;if(_.isLeaf())return n.createElement("span",{className:g()("".concat(E,"-switcher"),"".concat(E,"-switcher-noop"))},typeof P=="function"?P(Object(D.a)(Object(D.a)({},_.props),{},{isLeaf:!0})):P);var F=g()("".concat(E,"-switcher"),"".concat(E,"-switcher_").concat(m?i:a));return n.createElement("span",{onClick:_.onExpand,className:F},typeof P=="function"?P(Object(D.a)(Object(D.a)({},_.props),{},{isLeaf:!1})):P)},_.renderCheckbox=function(){var b=_.props,m=b.checked,p=b.halfChecked,C=b.disableCheckbox,E=_.props.context.prefixCls,v=_.isDisabled(),P=_.isCheckable();if(!P)return null;var F=typeof P!="boolean"?P:null;return n.createElement("span",{className:g()("".concat(E,"-checkbox"),m&&"".concat(E,"-checkbox-checked"),!m&&p&&"".concat(E,"-checkbox-indeterminate"),(v||C)&&"".concat(E,"-checkbox-disabled")),onClick:_.onCheck},F)},_.renderIcon=function(){var b=_.props.loading,m=_.props.context.prefixCls;return n.createElement("span",{className:g()("".concat(m,"-iconEle"),"".concat(m,"-icon__").concat(_.getNodeState()||"docu"),b&&"".concat(m,"-icon_loading"))})},_.renderSelector=function(){var b=_.state.dragNodeHighlight,m=_.props,p=m.title,C=m.selected,E=m.icon,v=m.loading,P=m.data,F=_.props.context,R=F.prefixCls,H=F.showIcon,U=F.icon,S=F.draggable,G=F.loadData,Q=F.titleRender,se=_.isDisabled(),fe="".concat(R,"-node-content-wrapper"),we;if(H){var be=E||U;we=be?n.createElement("span",{className:g()("".concat(R,"-iconEle"),"".concat(R,"-icon__customize"))},typeof be=="function"?be(_.props):be):_.renderIcon()}else G&&v&&(we=_.renderIcon());var Se;typeof p=="function"?Se=p(P):Q?Se=Q(P):Se=p;var Ae=n.createElement("span",{className:"".concat(R,"-title")},Se);return n.createElement("span",{ref:_.setSelectHandle,title:typeof p=="string"?p:"",className:g()("".concat(fe),"".concat(fe,"-").concat(_.getNodeState()||"normal"),!se&&(C||b)&&"".concat(R,"-node-selected"),!se&&S&&"draggable"),draggable:!se&&S||void 0,"aria-grabbed":!se&&S||void 0,onMouseEnter:_.onMouseEnter,onMouseLeave:_.onMouseLeave,onContextMenu:_.onContextMenu,onClick:_.onSelectorClick,onDoubleClick:_.onSelectorDoubleClick,onDragStart:S?_.onDragStart:void 0},we,Ae)},_}return Object(N.a)(A,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var b=this.props.selectable,m=this.props.context.selectable;return typeof b=="boolean"?b:m}},{key:"render",value:function(){var b,m=this.props,p=m.eventKey,C=m.className,E=m.style,v=m.dragOver,P=m.dragOverGapTop,F=m.dragOverGapBottom,R=m.isLeaf,H=m.isStart,U=m.isEnd,S=m.expanded,G=m.selected,Q=m.checked,se=m.halfChecked,fe=m.loading,we=m.domRef,be=m.active,Se=m.onMouseMove,Ae=Object(z.a)(m,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),De=this.props.context,ve=De.prefixCls,Y=De.filterTreeNode,k=De.draggable,B=De.keyEntities,Z=this.isDisabled(),re=Object(h.f)(Ae),X=B[p]||{},ye=X.level,Me=U[U.length-1];return n.createElement("div",Object.assign({ref:we,className:g()(C,"".concat(ve,"-treenode"),(b={},Object(J.a)(b,"".concat(ve,"-treenode-disabled"),Z),Object(J.a)(b,"".concat(ve,"-treenode-switcher-").concat(S?"open":"close"),!R),Object(J.a)(b,"".concat(ve,"-treenode-checkbox-checked"),Q),Object(J.a)(b,"".concat(ve,"-treenode-checkbox-indeterminate"),se),Object(J.a)(b,"".concat(ve,"-treenode-selected"),G),Object(J.a)(b,"".concat(ve,"-treenode-loading"),fe),Object(J.a)(b,"".concat(ve,"-treenode-active"),be),Object(J.a)(b,"".concat(ve,"-treenode-leaf-last"),Me),Object(J.a)(b,"drag-over",!Z&&v),Object(J.a)(b,"drag-over-gap-top",!Z&&P),Object(J.a)(b,"drag-over-gap-bottom",!Z&&F),Object(J.a)(b,"filter-node",Y&&Y(Object(d.b)(this.props))),b)),style:E,onDragEnter:k?this.onDragEnter:void 0,onDragOver:k?this.onDragOver:void 0,onDragLeave:k?this.onDragLeave:void 0,onDrop:k?this.onDrop:void 0,onDragEnd:k?this.onDragEnd:void 0,onMouseMove:Se},re),n.createElement(s,{prefixCls:ve,level:ye,isStart:H,isEnd:U}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),A}(n.Component),T=function(L){return n.createElement(f.a.Consumer,null,function(A){return n.createElement(o,Object.assign({},L,{context:A}))})};T.displayName="TreeNode",T.defaultProps={title:r},T.isTreeNode=1;var w=de.a=T},XIdC:function(Ue,de,M){"use strict";var J=M("rePB"),z=M("ODXe"),D=M("Ff2n"),V=M("q1tI"),N=M.n(V),O=M("TSYQ"),K=M.n(O),W=M("6cGi"),n=M("4IlW"),I=V.forwardRef(function(g,f){var h,c=g.prefixCls,s=c===void 0?"rc-switch":c,d=g.className,i=g.checked,a=g.defaultChecked,r=g.disabled,o=g.loadingIcon,T=g.checkedChildren,w=g.unCheckedChildren,x=g.onClick,L=g.onChange,A=g.onKeyDown,_=Object(D.a)(g,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),b=Object(W.a)(!1,{value:i,defaultValue:a}),m=Object(z.a)(b,2),p=m[0],C=m[1];function E(R,H){var U=p;return r||(U=R,C(U),L==null||L(U,H)),U}function v(R){R.which===n.a.LEFT?E(!1,R):R.which===n.a.RIGHT&&E(!0,R),A==null||A(R)}function P(R){var H=E(!p,R);x==null||x(H,R)}var F=K()(s,d,(h={},Object(J.a)(h,"".concat(s,"-checked"),p),Object(J.a)(h,"".concat(s,"-disabled"),r),h));return V.createElement("button",Object.assign({},_,{type:"button",role:"switch","aria-checked":p,disabled:r,className:F,ref:f,onKeyDown:v,onClick:P}),o,V.createElement("span",{className:"".concat(s,"-inner")},p?T:w))});I.displayName="Switch",de.a=I},Y1PL:function(Ue,de,M){"use strict";M.r(de),M.d(de,"ResizableTextArea",function(){return se});var J=M("wx14"),z=M("1OyB"),D=M("vuIU"),V=M("Ji7U"),N=M("LK+K"),O=M("q1tI"),K=M("VTBJ"),W=M("rePB"),n=M("Zm9Q"),I=M("Kwbf"),g=M("c+Xe"),f=M("m+aA"),h=M("bdgK"),c=new Map;function s(be){be.forEach(function(Se){var Ae,De=Se.target;(Ae=c.get(De))===null||Ae===void 0||Ae.forEach(function(ve){return ve(De)})})}var d=new h.default(s),i=null,a=null;function r(be,Se){c.has(be)||(c.set(be,new Set),d.observe(be)),c.get(be).add(Se)}function o(be,Se){c.has(be)&&(c.get(be).delete(Se),c.get(be).size||(d.unobserve(be),c.delete(be)))}var T=function(be){Object(V.a)(Ae,be);var Se=Object(N.a)(Ae);function Ae(){return Object(z.a)(this,Ae),Se.apply(this,arguments)}return Object(D.a)(Ae,[{key:"render",value:function(){return this.props.children}}]),Ae}(O.Component),w=O.createContext(null);function x(be){var Se=be.children,Ae=be.onBatchResize,De=O.useRef(0),ve=O.useRef([]),Y=O.useContext(w),k=O.useCallback(function(B,Z,re){De.current+=1;var X=De.current;ve.current.push({size:B,element:Z,data:re}),Promise.resolve().then(function(){X===De.current&&(Ae==null||Ae(ve.current),ve.current=[])}),Y==null||Y(B,Z,re)},[Ae,Y]);return O.createElement(w.Provider,{value:k},Se)}function L(be){var Se=be.children,Ae=be.disabled,De=O.useRef(null),ve=O.useRef(null),Y=O.useContext(w),k=O.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),B=O.isValidElement(Se)&&Object(g.c)(Se),Z=B?Se.ref:null,re=O.useMemo(function(){return Object(g.a)(Z,De)},[Z,De]),X=O.useRef(be);X.current=be;var ye=O.useCallback(function(Me){var He=X.current,me=He.onResize,Ee=He.data,Le=Me.getBoundingClientRect(),Pe=Le.width,Ye=Le.height,tt=Me.offsetWidth,ut=Me.offsetHeight,lt=Math.floor(Pe),gt=Math.floor(Ye);if(k.current.width!==lt||k.current.height!==gt||k.current.offsetWidth!==tt||k.current.offsetHeight!==ut){var ht={width:lt,height:gt,offsetWidth:tt,offsetHeight:ut};k.current=ht;var Ie=tt===Math.round(Pe)?Pe:tt,Re=ut===Math.round(Ye)?Ye:ut,$e=Object(K.a)(Object(K.a)({},ht),{},{offsetWidth:Ie,offsetHeight:Re});Y==null||Y($e,Me,Ee),me&&Promise.resolve().then(function(){me($e,Me)})}},[]);return O.useEffect(function(){var Me=Object(f.a)(De.current)||Object(f.a)(ve.current);return Me&&!Ae&&r(Me,ye),function(){return o(Me,ye)}},[De.current,Ae]),O.createElement(T,{ref:ve},B?O.cloneElement(Se,{ref:re}):Se)}var A="rc-observer-key";function _(be){var Se=be.children,Ae=Object(n.a)(Se);return Ae.map(function(De,ve){var Y=(De==null?void 0:De.key)||"".concat(A,"-").concat(ve);return O.createElement(L,Object(J.a)({},be,{key:Y}),De)})}_.Collection=x;var b=_,m=M("bT9E"),p=M("TSYQ"),C=M.n(p),E=`
min-height:0 !important;
max-height:none !important;
height:0 !important;
visibility:hidden !important;
overflow:hidden !important;
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important
`,v=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],P={},F;function R(be){var Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ae=be.getAttribute("id")||be.getAttribute("data-reactid")||be.getAttribute("name");if(Se&&P[Ae])return P[Ae];var De=window.getComputedStyle(be),ve=De.getPropertyValue("box-sizing")||De.getPropertyValue("-moz-box-sizing")||De.getPropertyValue("-webkit-box-sizing"),Y=parseFloat(De.getPropertyValue("padding-bottom"))+parseFloat(De.getPropertyValue("padding-top")),k=parseFloat(De.getPropertyValue("border-bottom-width"))+parseFloat(De.getPropertyValue("border-top-width")),B=v.map(function(re){return"".concat(re,":").concat(De.getPropertyValue(re))}).join(";"),Z={sizingStyle:B,paddingSize:Y,borderSize:k,boxSizing:ve};return Se&&Ae&&(P[Ae]=Z),Z}function H(be){var Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ae=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,De=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;F||(F=document.createElement("textarea"),F.setAttribute("tab-index","-1"),F.setAttribute("aria-hidden","true"),document.body.appendChild(F)),be.getAttribute("wrap")?F.setAttribute("wrap",be.getAttribute("wrap")):F.removeAttribute("wrap");var ve=R(be,Se),Y=ve.paddingSize,k=ve.borderSize,B=ve.boxSizing,Z=ve.sizingStyle;F.setAttribute("style","".concat(Z,";").concat(E)),F.value=be.value||be.placeholder||"";var re=Number.MIN_SAFE_INTEGER,X=Number.MAX_SAFE_INTEGER,ye=F.scrollHeight,Me;if(B==="border-box"?ye+=k:B==="content-box"&&(ye-=Y),Ae!==null||De!==null){F.value=" ";var He=F.scrollHeight-Y;Ae!==null&&(re=He*Ae,B==="border-box"&&(re=re+Y+k),ye=Math.max(re,ye)),De!==null&&(X=He*De,B==="border-box"&&(X=X+Y+k),Me=ye>X?"":"hidden",ye=Math.min(X,ye))}return{height:ye,minHeight:re,maxHeight:X,overflowY:Me,resize:"none"}}var U=M("Gytx"),S=M.n(U),G;(function(be){be[be.NONE=0]="NONE",be[be.RESIZING=1]="RESIZING",be[be.RESIZED=2]="RESIZED"})(G||(G={}));var Q=function(be){Object(V.a)(Ae,be);var Se=Object(N.a)(Ae);function Ae(De){var ve;return Object(z.a)(this,Ae),ve=Se.call(this,De),ve.nextFrameActionId=void 0,ve.resizeFrameId=void 0,ve.textArea=void 0,ve.saveTextArea=function(Y){ve.textArea=Y},ve.handleResize=function(Y){var k=ve.state.resizeStatus,B=ve.props,Z=B.autoSize,re=B.onResize;if(k!==G.NONE)return;typeof re=="function"&&re(Y),Z&&ve.resizeOnNextFrame()},ve.resizeOnNextFrame=function(){cancelAnimationFrame(ve.nextFrameActionId),ve.nextFrameActionId=requestAnimationFrame(ve.resizeTextarea)},ve.resizeTextarea=function(){var Y=ve.props.autoSize;if(!Y||!ve.textArea)return;var k=Y.minRows,B=Y.maxRows,Z=H(ve.textArea,!1,k,B);ve.setState({textareaStyles:Z,resizeStatus:G.RESIZING},function(){cancelAnimationFrame(ve.resizeFrameId),ve.resizeFrameId=requestAnimationFrame(function(){ve.setState({resizeStatus:G.RESIZED},function(){ve.resizeFrameId=requestAnimationFrame(function(){ve.setState({resizeStatus:G.NONE}),ve.fixFirefoxAutoScroll()})})})})},ve.renderTextArea=function(){var Y=ve.props,k=Y.prefixCls,B=k===void 0?"rc-textarea":k,Z=Y.autoSize,re=Y.onResize,X=Y.className,ye=Y.disabled,Me=ve.state,He=Me.textareaStyles,me=Me.resizeStatus,Ee=Object(m.a)(ve.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Le=C()(B,X,Object(W.a)({},"".concat(B,"-disabled"),ye));"value"in Ee&&(Ee.value=Ee.value||"");var Pe=Object(K.a)(Object(K.a)(Object(K.a)({},ve.props.style),He),me===G.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return O.createElement(b,{onResize:ve.handleResize,disabled:!(Z||re)},O.createElement("textarea",Object(J.a)({},Ee,{className:Le,style:Pe,ref:ve.saveTextArea})))},ve.state={textareaStyles:{},resizeStatus:G.NONE},ve}return Object(D.a)(Ae,[{key:"componentDidUpdate",value:function(ve){(ve.value!==this.props.value||!S()(ve.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 ve=this.textArea.selectionStart,Y=this.textArea.selectionEnd;this.textArea.setSelectionRange(ve,Y)}}catch(k){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Ae}(O.Component),se=Q,fe=function(be){Object(V.a)(Ae,be);var Se=Object(N.a)(Ae);function Ae(De){var ve;Object(z.a)(this,Ae),ve=Se.call(this,De),ve.resizableTextArea=void 0,ve.focus=function(){ve.resizableTextArea.textArea.focus()},ve.saveTextArea=function(k){ve.resizableTextArea=k},ve.handleChange=function(k){var B=ve.props.onChange;ve.setValue(k.target.value,function(){ve.resizableTextArea.resizeTextarea()}),B&&B(k)},ve.handleKeyDown=function(k){var B=ve.props,Z=B.onPressEnter,re=B.onKeyDown;k.keyCode===13&&Z&&Z(k),re&&re(k)};var Y=typeof De.value=="undefined"||De.value===null?De.defaultValue:De.value;return ve.state={value:Y},ve}return Object(D.a)(Ae,[{key:"setValue",value:function(ve,Y){"value"in this.props||this.setState({value:ve},Y)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return O.createElement(se,Object(J.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ve){return"value"in ve?{value:ve.value}:null}}]),Ae}(O.Component),we=de.default=fe},ZD9Y:function(Ue,de,M){"use strict";var J=M("BoS7"),z=M("Sdc0"),D=M("OaEy"),V=M("2fM7"),N=M("q1tI"),O=M.n(N),K=M("lOMy"),W=M.n(K),n=V.a.Option;de.a=function(I){var g=I.onFontSizeChange,f=I.cmFontSize,h=I.cmCodeMode,c=I.onCodeModeChange,s=I.onTabToSpace,d=I.className,i=d===void 0?"":d,a=I.tabToSpace,r=I.children;return O.a.createElement("div",{className:"tpi-code-setting ".concat(i)},O.a.createElement("h3",null,"\u4EE3\u7801\u683C\u5F0F"),O.a.createElement("section",null,O.a.createElement("div",{className:"file-item"},O.a.createElement("b",null,"\u663E\u793A\u6A21\u5F0F"),O.a.createElement(V.a,{bordered:!1,size:"small",value:h,onChange:c},O.a.createElement(n,{value:"vs"},"\u767D\u8272\u80CC\u666F"),O.a.createElement(n,{value:"vs-dark"},"\u9ED1\u8272\u80CC\u666F"))),O.a.createElement("div",{className:"file-item"},O.a.createElement("b",null,"\u5B57\u4F53\u5927\u5C0F"),O.a.createElement(V.a,{bordered:!1,size:"small",value:f,onChange:g},O.a.createElement(n,{value:12},"12px"),O.a.createElement(n,{value:14},"14px"),O.a.createElement(n,{value:16},"16px"),O.a.createElement(n,{value:18},"18px"),O.a.createElement(n,{value:20},"20px"),O.a.createElement(n,{value:22},"22px"))),O.a.createElement("div",{className:"file-item"},O.a.createElement("b",null,"Tab\u8F6C\u6362"),O.a.createElement(z.a,{checked:a,onChange:s}))),O.a.createElement("h3",null,"\u5FEB\u6377\u952E"),O.a.createElement("section",null,O.a.createElement("div",{className:"file-item"},O.a.createElement("b",null,"\u4FDD\u5B58\u4EE3\u7801"),O.a.createElement("span",null,"Ctrl + S")),O.a.createElement("div",{className:"file-item"},O.a.createElement("b",null,"\u5524\u51FA\u5FEB\u6377\u952E\u5217\u8868"),O.a.createElement("span",null,"F1 / Alt + F1")),O.a.createElement("div",{className:"file-item"},O.a.createElement("b",null,"\u5DE6\u53F3\u7F29\u8FDB"),O.a.createElement("span",null,"Ctrl + ]/[")),O.a.createElement("div",{className:"file-item"},O.a.createElement("b",null,"\u8DF3\u5230\u5339\u914D\u7684\u62EC\u53F7"),O.a.createElement("span",null,"Ctrl + Shift + \\")),O.a.createElement("div",{className:"file-item"},O.a.createElement("b",null,"\u8F6C\u5230\u884C\u9996"),O.a.createElement("span",null,"Home")),O.a.createElement("div",{className:"file-item"},O.a.createElement("b",null,"\u8F6C\u5230\u884C\u5C3E"),O.a.createElement("span",null,"End"))),r)}},ZW9T:function(Ue,de,M){"use strict";M.d(de,"a",function(){return U});var J=M("k1fw"),z=M("oBTY"),D=M("miYZ"),V=M("tsqr"),N=M("rAM+"),O=M("tJVT"),K=M("PpiC"),W=M("q1tI"),n=M.n(W),I=M("bdgK"),g=M("9og8"),f=M("WmNS"),h=M.n(f),c={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"]},d={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","friend","gcnew","generic","goto","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:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
`)},{label:"if",content:["if () {"," $0","}"].join(`
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
`)},{label:"include <vector>",content:["#include <vector>"].join(`
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
`)},{label:"include <map>",content:["#include <map>"].join(`
`)},{label:"include <string>",content:["#include <string>"].join(`
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
`)}]},i={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
`)}]},a=M("5VLF"),r=M.n(a),o={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"]}},T=function(G,Q){return Q.map(function(se){return{label:se,kind:G.languages.CompletionItemKind.Keyword,insertText:se}})},w=function(G){return Object.keys(o.tables).map(function(Q){return{label:Q,kind:G.languages.CompletionItemKind.Variable,insertText:Q}})},x=function(G,Q){var se=o.tables[G];return se?se.map(function(fe){return{label:fe,kind:Q.languages.CompletionItemKind.Field,insertText:fe}}):[]};function L(S,G,Q,se,fe){var we=G.getWordUntilPosition(Q),be={startLineNumber:Q.lineNumber,endLineNumber:Q.lineNumber,startColumn:we.startColumn,endColumn:we.endColumn},Se=se.map(function(Ae){return{label:Ae,kind:S.languages.CompletionItemKind.Keyword,insertText:Ae,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:be}});return fe.map(function(Ae){Se.push(Object(J.a)(Object(J.a)({},Ae),{},{range:be}))}),Se}var A=function(S){o.languages.map(function(fe){return S.languages.registerDocumentFormattingEditProvider(fe,{provideDocumentFormattingEdits:function(be,Se,Ae){return Object(g.a)(h.a.mark(function De(){var ve;return h.a.wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return ve=r()(be.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}),k.abrupt("return",[{range:be.getFullModelRange(),text:ve}]);case 2:case"end":return k.stop()}},De)}))()}}),fe});var G=d.quickKey.map(function(fe){return{label:fe.label,kind:S.languages.CompletionItemKind.Method,insertText:fe.content,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),Q=i.quickKey.map(function(fe){return{label:fe.label,kind:S.languages.CompletionItemKind.Method,insertText:fe.content,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),se=s.quickKey.map(function(fe){return{label:fe.label,kind:S.languages.CompletionItemKind.Method,insertText:fe.content,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet}});S.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(we,be){var Se=we.getWordUntilPosition(be),Ae={startLineNumber:be.lineNumber,endLineNumber:be.lineNumber,startColumn:Se.startColumn,endColumn:Se.endColumn},De=we.getLineContent(be.lineNumber).substring(Se.startColumn-2,Se.endColumn);return{suggestions:[].concat(Object(z.a)(d.keywords.map(function(ve){return{label:ve,kind:S.languages.CompletionItemKind.Function,documentation:ve,insertText:ve,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})),Object(z.a)(d.quickKey.map(function(ve){return{label:ve.label,kind:S.languages.CompletionItemKind.Function,documentation:ve.content,insertText:De.startsWith("#")?ve.content.replace(/#/,""):ve.content,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})))}}}),S.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(we,be){var Se=we.getWordUntilPosition(be),Ae={startLineNumber:be.lineNumber,endLineNumber:be.lineNumber,startColumn:Se.startColumn,endColumn:Se.endColumn};return{suggestions:Object(z.a)(c.keywords.map(function(De){return{label:De,kind:S.languages.CompletionItemKind.Function,documentation:De,insertText:De,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}}))}}}),S.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(we,be){var Se=we.getWordUntilPosition(be),Ae={startLineNumber:be.lineNumber,endLineNumber:be.lineNumber,startColumn:Se.startColumn,endColumn:Se.endColumn},De=we.getLineContent(be.lineNumber).substring(Se.startColumn-2,Se.endColumn);return{suggestions:[].concat(Object(z.a)(s.keywords.map(function(ve){return{label:ve,kind:S.languages.CompletionItemKind.Function,documentation:ve,insertText:ve,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})),Object(z.a)(s.quickKey.map(function(ve){return{label:ve.label,kind:S.languages.CompletionItemKind.Function,documentation:ve.content,insertText:De.startsWith("#")?ve.content.replace(/#/,""):ve.content,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})))}}}),S.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(we,be){var Se=we.getWordUntilPosition(be),Ae={startLineNumber:be.lineNumber,endLineNumber:be.lineNumber,startColumn:Se.startColumn,endColumn:Se.endColumn},De=we.getLineContent(be.lineNumber).substring(Se.startColumn-2,Se.endColumn);return{suggestions:[].concat(Object(z.a)(i.keywords.map(function(ve){return{label:ve,kind:S.languages.CompletionItemKind.Function,documentation:ve,insertText:ve,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})),Object(z.a)(i.quickKey.map(function(ve){return{label:ve.label,kind:S.languages.CompletionItemKind.Function,documentation:ve.content,insertText:De.startsWith("#")?ve.content.replace(/#/,""):ve.content,insertTextRules:S.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})))}}})},_="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",b=M("fjLI"),m=M("LvDl"),p=M("+ua5");function C(S){return/^\d+$/.test(S)?"".concat(S,"px"):S}function E(){}var v=!1,P={"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 F(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],G=S;if(Array.isArray(S)){for(var Q=0;Q<S.length;Q++){var se=P[S[Q]];if(se)return se}return G[0]}return P[G]||G}var R=null,H=de.b=function(S){var G=S.width,Q=G===void 0?"100%":G,se=S.height,fe=se===void 0?"100%":se,we=S.value,be=S.language,Se=be===void 0?"javascript":be,Ae=S.style,De=Ae===void 0?{}:Ae,ve=S.options,Y=ve===void 0?{}:ve,k=S.overrideServices,B=k===void 0?{}:k,Z=S.theme,re=Z===void 0?"vs-dark":Z,X=S.onEditBlur,ye=S.onSave,Me=S.autoHeight,He=Me===void 0?!1:Me,me=S.forbidCopy,Ee=me===void 0?!1:me,Le=S.onChange,Pe=Le===void 0?E:Le,Ye=S.editorDidMount,tt=Ye===void 0?E:Ye,ut=S.onFocus,lt=ut===void 0?E:ut,gt=S.filename,ht=gt===void 0?"educoder.txt":gt,Ie=S.errorLine,Re=S.errorContent,$e=Re===void 0?"":Re,Ze=Object(K.a)(S,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),ue=Object(W.useRef)(),q=Object(W.useRef)({}),te=Object(W.useRef)(),ae=Object(W.useRef)(),ce=Object(W.useRef)(!1),ie=Object(W.useRef)(),oe=Object(W.useState)(!1),he=Object(O.a)(oe,2),ge=he[0],_e=he[1];function Oe(){var Qe;return ue.current&&(Qe=new I.default(function(pt){var dt=Object(N.a)(pt),Vt;try{for(dt.s();!(Vt=dt.n()).done;){var rn=Vt.value;(rn.target.offsetHeight>0||rn.target.offsetWidth>0)&&q.current.instance.layout()}}catch(an){dt.e(an)}finally{dt.f()}}),Qe.observe(ue.current)),Qe}function Ge(){V.b.warn(decodeURIComponent(_))}var et=function(){var pt=q.current.instance;if(we!=null&&pt&&ge){var dt=pt.getModel();dt&&we!==dt.getValue()&&(v=!0,dt.setValue(we),pt.layout(),v=!1)}};Object(W.useEffect)(function(){ae.current&&clearTimeout(ae.current),ae.current=setTimeout(function(){et()},500)},[we,ge,q.current]),Object(W.useEffect)(function(){if(Ie&&q.current&&q.current.instance){var Qe=q.current.instance;Qe.changeViewZones(function(dt){var Vt=document.createElement("div");Vt.style.padding="10px 20px",Vt.style.width="calc(100% - 20px)",Vt.className="my-error-line-wrp",Vt.innerHTML=$e,dt.addZone({afterLineNumber:Ie||11,heightInLines:3,domNode:Vt})});var pt={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}};Qe.addOverlayWidget(pt),Qe.revealPositionInCenter({lineNumber:20,column:1})}},[Ie,q.current,ge]);function ct(){var Qe=q.current.instance;if(Qe){var pt=Qe.getSelection(),dt=q.current.pastePos||{},Vt=new R.Range(dt.startLineNumber||pt.endLineNumber,dt.startColumn||pt.endColumn,dt.endLineNumber||pt.endLineNumber,dt.endColumn||pt.endColumn);setTimeout(function(){Qe.executeEdits("",[{range:Vt,text:""}])},300)}}function st(Qe){(window.navigator.platform.match("Mac")?Qe.metaKey:Qe.ctrlKey)&&Qe.keyCode==83&&(Qe.preventDefault(),ye())}var nt=function(){if(He&&q.current.instance){var pt=q.current.instance.getContentHeight();Ke(pt<fe?fe:pt)}else Ke(fe)};function We(Qe){var pt=document.createEvent("MouseEvents");pt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Qe.dispatchEvent(pt)}function Ve(Qe,pt){var dt=window.URL||window.webkitURL||window,Vt=new Blob([pt]),rn=document.createElementNS("http://www.w3.org/1999/xhtml","a");rn.href=dt.createObjectURL(Vt),rn.download=Qe,We(rn)}Object(W.useEffect)(function(){nt()},[nt]),Object(W.useEffect)(function(){ue.current&&!ge&&Promise.all([M.e(18),M.e(29)]).then(M.t.bind(null,"M/lh",7)).then(function(Qe){try{R=Qe,q.current.instance=R.editor.create(ue.current,{value:we,language:F(Se),theme:re,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},B);var pt=q.current.instance,dt=b.d._menuItems,Vt=Object(z.a)(dt).find(function(Xt){return Xt[0]._debugName=="EditorContext"}),rn=Vt[1],an=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],ft=function(Ot,Mt){var Ft=Ot._first;do{var On,vn,rt=Mt.includes((On=Ft.element)===null||On===void 0||((vn=On.command)===null||vn===void 0)?void 0:vn.id);rt&&Ot._remove(Ft)}while(Ft=Ft.next)};if(tt(pt,R),setTimeout(function(){nt(),q.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Ve(ht||"educoder.txt",pt.getValue())}}),pt.getDomNode().addEventListener("input",function(){te.current.autoFormat&&pt.getAction("editor.action.formatDocument").run()})},500),q.current.subscription=pt.onDidChangeModelContent(function(Xt){ce.current?clearTimeout(ie.current):(nt(),Pe(pt.getValue(),Xt)),ie.current=setTimeout(function(){ce.current=!1},500)}),window.Monaco||A(R,F(Se)),Ee&&(ft(rn,an),ue.current.classList.add("noCopyPaste"),pt.onKeyDown(function(Xt){var Ot=Xt.keyCode,Mt=Xt.ctrlKey,Ft=Xt.metaKey;(Ot===33||Ot===52)&&(Ft||Mt)&&(Ge(),Xt.preventDefault())})),window.Monaco=R,X&&pt.onDidBlurEditorWidget(function(){X(pt.getValue())}),lt&&pt.onDidFocusEditorText(function(){lt(pt.getValue())}),Ee){pt.addCommand(R.KeyMod.CtrlCmd|R.KeyCode.KEY_V,function(){return Ge(),null}),pt.onDidPaste(function(Xt){q.current.pastePos=Xt});try{window.addEventListener("paste",ct)}catch(Xt){}}var Wt=Oe();return _e(!0),function(){var Xt=q.current.instance;Xt.dispose();var Ot=Xt.getModel();Ot&&Ot.dispose(),q.current.subscription&&q.current.subscription.dispose(),Ee&&window.removeEventListener("paste",ct),Wt.unobserve(ue.current)}}catch(Xt){}})},[]),Object(W.useEffect)(function(){var Qe=q.current.instance;if(Qe&&ge)return document.addEventListener("keydown",st,!1),function(){document.removeEventListener("keydown",st)}},[ye,ge]),Object(W.useEffect)(function(){var Qe=q.current.instance;if(Qe&&ge){var pt=F(Se);R.editor.setModelLanguage(Qe.getModel(),pt),console.log("language:",Se,Qe.getModel(),pt)}},[Se,ge]),Object(W.useEffect)(function(){var Qe=q.current.instance;Qe&&ge&&R.editor.setTheme(re)},[re,ge]),Object(W.useEffect)(function(){var Qe=q.current.instance;te.current=Y,Qe&&ge&&(Qe.updateOptions(Object(J.a)({},Y)),setTimeout(function(){Qe.getModel().updateOptions(Object(J.a)({},Y))},200))},[JSON.stringify(Y),ge]),Object(W.useEffect)(function(){var Qe=q.current.instance;Qe&&ge&&Qe.layout()},[Q,fe,ge]);var Ne=Object(W.useState)(C(Q)),pe=Object(O.a)(Ne,2),xe=pe[0],Xe=pe[1],je=Object(W.useState)(C(fe)),it=Object(O.a)(je,2),ot=it[0],Ke=it[1],Je=Object(J.a)(Object(J.a)({},De),{},{width:xe,height:ot});return n.a.createElement("div",{className:"my-monaco-editor",ref:ue,style:Je})};function U(S){var G=S.width,Q=G===void 0?"100%":G,se=S.height,fe=se===void 0?"100%":se,we=S.original,be=S.modified,Se=S.language,Ae=S.options,De=Ae===void 0?{}:Ae,ve=Object(W.useRef)(),Y=Object(W.useState)(null),k=Object(O.a)(Y,2),B=k[0],Z=k[1];function re(He){var me;return ve.current&&(me=new I.default(function(Ee){var Le=Object(N.a)(Ee),Pe;try{for(Le.s();!(Pe=Le.n()).done;){var Ye=Pe.value;(Ye.target.offsetHeight>0||Ye.target.offsetWidth>0)&&He.layout()}}catch(tt){Le.e(tt)}finally{Le.f()}}),me.observe(ve.current)),me}Object(W.useEffect)(function(){ve.current&&Promise.all([M.e(18),M.e(29)]).then(M.t.bind(null,"M/lh",7)).then(function(He){R=He;var me=R.editor.createDiffEditor(ve.current,Object(J.a)(Object(J.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},De),{},{wordWrap:!0}));Z(me);var Ee=re(me);return function(){me.dispose();var Le=me.getModel();Le&&Le.dispose(),Ee.unobserve(ve.current)}})},[]),Object(W.useEffect)(function(){B&&B.setModel({original:R.editor.createModel(we,Se),modified:R.editor.createModel(be,Se)})},[we,be,Se,B]);var X=C(Q),ye=C(fe),Me={width:X,height:ye};return n.a.createElement("div",{className:"my-diff-editor",ref:ve,style:Me})}},a4uL:function(Ue,de,M){},bCnd:function(Ue,de,M){"use strict";M.d(de,"b",function(){return V}),M.d(de,"a",function(){return N});var J=M("je13"),z=M.n(J),D=!1;function V(O,K){var W=z.a.get("__ec");W||(W={}),W[O]=K,z.a.set("__ec",W)}function N(O,K){var W=z.a.get("__ec");return W?W[O]===void 0?K:W[O]:K}},bT9E:function(Ue,de,M){"use strict";M.d(de,"a",function(){return z});var J=M("VTBJ");function z(D,V){var N=Object(J.a)({},D);return Array.isArray(V)&&V.forEach(function(O){delete N[O]}),N}},biw7:function(Ue,de,M){"use strict";var J=M("q1tI"),z=M.n(J),D=J.createContext(null);de.a=D},c5Ni:function(Ue,de,M){},cDPC:function(Ue,de,M){"use strict";var J=M("tJVT"),z=M("q1tI"),D=M.n(z),V=M("i3hx"),N=M.n(V);de.a=function(O){var K=O.defaultX,W=K===void 0?"40%":K,n=O.leftChild,I=O.rightChild,g=O.className,f=O.hideResize,h=f===void 0?!1:f,c=Object(z.useState)(W),s=Object(J.a)(c,2),d=s[0],i=s[1],a=Object(z.useRef)();function r(){a.current=!0}Object(z.useEffect)(function(){function w(L){a.current&&i(L.pageX)}function x(){a.current=!1}return window.addEventListener("mousemove",w),window.addEventListener("mouseup",x),function(){window.removeEventListener("mousemove",w),window.removeEventListener("mouseup",x)}},[]);var o=typeof d=="number"&&d!==.01?"".concat(d,"px"):W,T="calc(100% - ".concat(h?"0px":"4px"," - ").concat(o,")");return D.a.createElement("div",{className:"split-panel-container ".concat(g)},D.a.createElement("section",{style:{width:o,display:d===.01?"none":""}},n),D.a.createElement("section",{className:"resize-x-bar",onMouseDown:r},D.a.createElement("a",{className:"btn-resize"},D.a.createElement("svg",{width:"16",height:"13",viewBox:"0 0 16 13"},D.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"})))),D.a.createElement("section",{style:{width:T}},I))}},dejd:function(Ue,de,M){},dmUQ:function(Ue,de,M){"use strict";var J=M("Ff2n"),z=M("rePB"),D=M("1OyB"),V=M("vuIU"),N=M("Ji7U"),O=M("md7G"),K=M("foSv"),W=M("q1tI"),n=M.n(W),I=M("TSYQ"),g=M.n(I),f=M("4IlW");function h(m,p){var C=Object.keys(m);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(m);p&&(E=E.filter(function(v){return Object.getOwnPropertyDescriptor(m,v).enumerable})),C.push.apply(C,E)}return C}function c(m){for(var p=1;p<arguments.length;p++){var C=arguments[p]!=null?arguments[p]:{};p%2?h(Object(C),!0).forEach(function(E){Object(z.a)(m,E,C[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(C)):h(Object(C)).forEach(function(E){Object.defineProperty(m,E,Object.getOwnPropertyDescriptor(C,E))})}return m}function s(m){var p=d();return function(){var E=Object(K.a)(m),v;if(p){var P=Object(K.a)(this).constructor;v=Reflect.construct(E,arguments,P)}else v=E.apply(this,arguments);return Object(O.a)(this,v)}}function d(){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(m){return!1}}function i(){}function a(m){m.preventDefault()}var r=function(p){return p.replace(/[^\w.-]+/g,"")},o=200,T=600,w=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,x=function(p){return p!=null},L=function(p,C){return C===p||typeof C=="number"&&typeof p=="number"&&isNaN(C)&&isNaN(p)},A=function(m){Object(N.a)(C,m);var p=s(C);function C(E){var v;Object(D.a)(this,C),v=p.call(this,E),v.onKeyDown=function(R){var H=v.props,U=H.onKeyDown,S=H.onPressEnter;if(R.keyCode===f.a.UP){var G=v.getRatio(R);v.up(R,G,null),v.stop()}else if(R.keyCode===f.a.DOWN){var Q=v.getRatio(R);v.down(R,Q,null),v.stop()}else R.keyCode===f.a.ENTER&&S&&S(R);if(v.recordCursorPosition(),v.lastKeyCode=R.keyCode,U){for(var se=arguments.length,fe=new Array(se>1?se-1:0),we=1;we<se;we++)fe[we-1]=arguments[we];U.apply(void 0,[R].concat(fe))}},v.onKeyUp=function(R){var H=v.props.onKeyUp;if(v.stop(),v.recordCursorPosition(),H){for(var U=arguments.length,S=new Array(U>1?U-1:0),G=1;G<U;G++)S[G-1]=arguments[G];H.apply(void 0,[R].concat(S))}},v.onChange=function(R){var H=v.props.onChange;v.state.focused&&(v.inputting=!0),v.rawInput=v.props.parser(v.getValueFromEvent(R)),v.setState({inputValue:v.rawInput}),H(v.toNumber(v.rawInput))},v.onMouseUp=function(){var R=v.props.onMouseUp;v.recordCursorPosition(),R&&R.apply(void 0,arguments)},v.onFocus=function(){var R;v.setState({focused:!0}),(R=v.props).onFocus.apply(R,arguments)},v.onBlur=function(){var R=v.props.onBlur;v.inputting=!1,v.setState({focused:!1});var H=v.getCurrentValidValue(v.state.inputValue),U=v.setValue(H,i);if(R){var S=v.input.value,G=v.getInputDisplayValue({focus:!1,value:U});v.input.value=G&&Number(G),R.apply(void 0,arguments),v.input.value=S}},v.getRatio=function(R){var H=1;return R.metaKey||R.ctrlKey?H=.1:R.shiftKey&&(H=10),H},v.getFullNum=function(R){return isNaN(R)?R:/e/i.test(String(R))?Number(R).toFixed(18).replace(/\.?0+$/,""):R},v.getPrecision=function(R){if(x(v.props.precision))return v.props.precision;var H=String(R);if(H.indexOf("e-")>=0)return parseInt(H.slice(H.indexOf("e-")+2),10);var U=0;return H.indexOf(".")>=0&&(U=H.length-H.indexOf(".")-1),U},v.getInputDisplayValue=function(R){var H=R||v.state,U=H.focused,S=H.inputValue,G=H.value,Q;U?Q=S:Q=v.toPrecisionAsStep(G),Q==null&&(Q="");var se=v.formatWrapper(Q);return x(v.props.decimalSeparator)&&(se=se.toString().replace(".",v.props.decimalSeparator)),se},v.recordCursorPosition=function(){try{v.cursorStart=v.input.selectionStart,v.cursorEnd=v.input.selectionEnd,v.currentValue=v.input.value,v.cursorBefore=v.input.value.substring(0,v.cursorStart),v.cursorAfter=v.input.value.substring(v.cursorEnd)}catch(R){}},v.restoreByAfter=function(R){if(R===void 0)return!1;var H=v.input.value,U=H.lastIndexOf(R);if(U===-1)return!1;var S=v.cursorBefore.length;return v.lastKeyCode===f.a.DELETE&&v.cursorBefore.charAt(S-1)===R[0]?(v.fixCaret(S,S),!0):U+R.length===H.length?(v.fixCaret(U,U),!0):!1},v.partRestoreByAfter=function(R){return R===void 0?!1:Array.prototype.some.call(R,function(H,U){var S=R.substring(U);return v.restoreByAfter(S)})},v.isNotCompleteNumber=function(R){return isNaN(R)||R===""||R===null||R&&R.toString().indexOf(".")===R.toString().length-1},v.stop=function(){v.autoStepTimer&&clearTimeout(v.autoStepTimer)},v.down=function(R,H,U){v.pressingUpOrDown=!0,v.step("down",R,H,U)},v.up=function(R,H,U){v.pressingUpOrDown=!0,v.step("up",R,H,U)},v.saveInput=function(R){v.input=R};var P=E.value;P===void 0&&(P=E.defaultValue),v.state={focused:E.autoFocus};var F=v.getValidValue(v.toNumber(P));return v.state=c(c({},v.state),{},{inputValue:v.toPrecisionAsStep(F),value:F}),v}return Object(V.a)(C,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(v){var P=this.props,F=P.value,R=P.onChange,H=P.max,U=P.min,S=this.state.focused;if(v){if(!L(v.value,F)||!L(v.max,H)||!L(v.min,U)){var G=S?F:this.getValidValue(F),Q;this.pressingUpOrDown?Q=G:this.inputting?Q=this.rawInput:Q=this.toPrecisionAsStep(G),this.setState({value:G,inputValue:Q})}var se="value"in this.props?F:this.state.value;"max"in this.props&&v.max!==H&&typeof se=="number"&&se>H&&R&&R(H),"min"in this.props&&v.min!==U&&typeof se=="number"&&se<U&&R&&R(U)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var fe=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===f.a.BACKSPACE?fe=this.cursorStart-1:this.lastKeyCode===f.a.DELETE&&(fe=this.cursorStart):fe=this.input.value.length,this.fixCaret(fe,fe)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case f.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case f.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(we){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(v){var P=v;return P===""?P="":this.isNotCompleteNumber(parseFloat(P))?P=this.state.value:P=this.getValidValue(P),this.toNumber(P)}},{key:"getValueFromEvent",value:function(v){var P=v.target.value.trim().replace(/。/g,".");return x(this.props.decimalSeparator)&&(P=P.replace(this.props.decimalSeparator,".")),P}},{key:"getValidValue",value:function(v){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,R=parseFloat(v);return isNaN(R)?v:(R<P&&(R=P),R>F&&(R=F),R)}},{key:"setValue",value:function(v,P){var F=this.props.precision,R=this.isNotCompleteNumber(parseFloat(v))?null:parseFloat(v),H=this.state.value,U=H===void 0?null:H,S=this.state.inputValue,G=S===void 0?null:S,Q=typeof R=="number"?R.toFixed(F):"".concat(R),se=R!==U||Q!=="".concat(G);return"value"in this.props?(G=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:G},P)):this.setState({value:R,inputValue:this.toPrecisionAsStep(v)},P),se&&this.props.onChange(R),R}},{key:"getMaxPrecision",value:function(v){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.props,R=F.precision,H=F.step;if(x(R))return R;var U=this.getPrecision(P),S=this.getPrecision(H),G=this.getPrecision(v);return v?Math.max(G,U+S):U+S}},{key:"getPrecisionFactor",value:function(v){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.getMaxPrecision(v,P);return Math.pow(10,F)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(v){return this.props.formatter?this.props.formatter(v):v}},{key:"toPrecisionAsStep",value:function(v){if(this.isNotCompleteNumber(v)||v==="")return v;var P=Math.abs(this.getMaxPrecision(v));return isNaN(P)?v.toString():Number(v).toFixed(P)}},{key:"toNumber",value:function(v){var P=this.props.precision,F=this.state.focused,R=v&&v.length>16&&F;return this.isNotCompleteNumber(v)||R?v:x(P)?Math.round(v*Math.pow(10,P))/Math.pow(10,P):Number(v)}},{key:"upStep",value:function(v,P){var F=this.props.step,R=this.getPrecisionFactor(v,P),H=Math.abs(this.getMaxPrecision(v,P)),U=((R*v+R*F*P)/R).toFixed(H);return this.toNumber(U)}},{key:"downStep",value:function(v,P){var F=this.props.step,R=this.getPrecisionFactor(v,P),H=Math.abs(this.getMaxPrecision(v,P)),U=((R*v-R*F*P)/R).toFixed(H);return this.toNumber(U)}},{key:"step",value:function(v,P){var F=this,R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,H=arguments.length>3?arguments[3]:void 0;this.stop(),P&&(P.persist(),P.preventDefault());var U=this.props;if(U.disabled)return;var S=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(S))return;var G=this["".concat(v,"Step")](S,R),Q=G>U.max||G<U.min;if(G>U.max?G=U.max:G<U.min&&(G=U.min),this.setValue(G,null),this.setState({focused:!0},function(){F.pressingUpOrDown=!1}),Q)return;this.autoStepTimer=setTimeout(function(){F[v](P,R,!0)},H?o:T)}},{key:"fixCaret",value:function(v,P){if(v===void 0||P===void 0||!this.input||!this.input.value)return;try{var F=this.input.selectionStart,R=this.input.selectionEnd;(v!==F||P!==R)&&this.input.setSelectionRange(v,P)}catch(H){}}},{key:"render",value:function(){var v,P=this.props,F=P.prefixCls,R=P.disabled,H=P.readOnly,U=P.useTouch,S=P.autoComplete,G=P.upHandler,Q=P.downHandler,se=P.className,fe=P.max,we=P.min,be=P.style,Se=P.title,Ae=P.onMouseEnter,De=P.onMouseLeave,ve=P.onMouseOver,Y=P.onMouseOut,k=P.required,B=P.onClick,Z=P.tabIndex,re=P.type,X=P.placeholder,ye=P.id,Me=P.inputMode,He=P.pattern,me=P.step,Ee=P.maxLength,Le=P.autoFocus,Pe=P.name,Ye=P.onPaste,tt=P.onInput,ut=Object(J.a)(P,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),lt=this.state,gt=lt.value,ht=lt.focused,Ie=g()(F,(v={},Object(z.a)(v,se,!!se),Object(z.a)(v,"".concat(F,"-disabled"),R),Object(z.a)(v,"".concat(F,"-focused"),ht),v)),Re={};Object.keys(ut).forEach(function(ge){(ge.substr(0,5)==="data-"||ge.substr(0,5)==="aria-"||ge==="role")&&(Re[ge]=ut[ge])});var $e=!H&&!R,Ze=this.getInputDisplayValue(null),ue=(gt||gt===0)&&(isNaN(gt)||Number(gt)>=fe),q=(gt||gt===0)&&(isNaN(gt)||Number(gt)<=we),te=ue||R||H,ae=q||R||H,ce=g()("".concat(F,"-handler"),"".concat(F,"-handler-up"),Object(z.a)({},"".concat(F,"-handler-up-disabled"),te)),ie=g()("".concat(F,"-handler"),"".concat(F,"-handler-down"),Object(z.a)({},"".concat(F,"-handler-down-disabled"),ae)),oe=U?{onTouchStart:te?i:this.up,onTouchEnd:this.stop}:{onMouseDown:te?i:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},he=U?{onTouchStart:ae?i:this.down,onTouchEnd:this.stop}:{onMouseDown:ae?i:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return n.a.createElement("div",{className:Ie,style:be,title:Se,onMouseEnter:Ae,onMouseLeave:De,onMouseOver:ve,onMouseOut:Y,onFocus:function(){return null},onBlur:function(){return null}},n.a.createElement("div",{className:"".concat(F,"-handler-wrap")},n.a.createElement("span",Object.assign({unselectable:"on"},oe,{role:"button","aria-label":"Increase Value","aria-disabled":te,className:ce}),G||n.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-up-inner"),onClick:a})),n.a.createElement("span",Object.assign({unselectable:"on"},he,{role:"button","aria-label":"Decrease Value","aria-disabled":ae,className:ie}),Q||n.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-down-inner"),onClick:a}))),n.a.createElement("div",{className:"".concat(F,"-input-wrap")},n.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":we,"aria-valuemax":fe,"aria-valuenow":gt,required:k,type:re,placeholder:X,onPaste:Ye,onClick:B,onMouseUp:this.onMouseUp,className:"".concat(F,"-input"),tabIndex:Z,autoComplete:S,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:$e?this.onKeyDown:i,onKeyUp:$e?this.onKeyUp:i,autoFocus:Le,maxLength:Ee,readOnly:H,disabled:R,max:fe,min:we,step:me,name:Pe,title:Se,id:ye,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(Ze),pattern:He,inputMode:Me,onInput:tt},Re))))}}]),C}(n.a.Component);A.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:w,min:-w,step:1,style:{},onChange:i,onKeyDown:i,onPressEnter:i,onFocus:i,onBlur:i,parser:r,required:!1,autoComplete:"off"};var _=A,b=de.a=_},fcSX:function(Ue,de,M){"use strict";var J=M("Ff2n"),z=M("1OyB"),D=M("vuIU"),V=M("Ji7U"),N=M("md7G"),O=M("foSv"),K=M("1W/9"),W=M("q1tI"),n=M("rePB"),I=M("JX7q"),g=M("TSYQ"),f=M.n(g),h=M("qx4F"),c=M("4IlW");function s(R){return Array.isArray(R)?R:[R]}var d={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},i=Object.keys(d).filter(function(R){if(typeof document=="undefined")return!1;var H=document.getElementsByTagName("html")[0];return R in(H?H.style:{})})[0],a=d[i];function r(R,H,U,S){R.addEventListener?R.addEventListener(H,U,S):R.attachEvent&&R.attachEvent("on".concat(H),U)}function o(R,H,U,S){R.removeEventListener?R.removeEventListener(H,U,S):R.attachEvent&&R.detachEvent("on".concat(H),U)}function T(R,H){var U=typeof R=="function"?R(H):R;return Array.isArray(U)?U.length===2?U:[U[0],U[1]]:[U]}var w=function(H){return!isNaN(parseFloat(H))&&isFinite(H)},x=!(typeof window!="undefined"&&window.document&&window.document.createElement),L=function R(H,U,S,G){if(!U||U===document||U instanceof Document)return!1;if(U===H.parentNode)return!0;var Q=Math.max(Math.abs(S),Math.abs(G))===Math.abs(G),se=Math.max(Math.abs(S),Math.abs(G))===Math.abs(S),fe=U.scrollHeight-U.clientHeight,we=U.scrollWidth-U.clientWidth,be=document.defaultView.getComputedStyle(U),Se=be.overflowY==="auto"||be.overflowY==="scroll",Ae=be.overflowX==="auto"||be.overflowX==="scroll",De=fe&&Se,ve=we&&Ae;return Q&&(!De||De&&(U.scrollTop>=fe&&G<0||U.scrollTop<=0&&G>0))||se&&(!ve||ve&&(U.scrollLeft>=we&&S<0||U.scrollLeft<=0&&S>0))?R(H,U.parentNode,S,G):!1};function A(R){var H=_();return function(){var S=Object(O.a)(R),G;if(H){var Q=Object(O.a)(this).constructor;G=Reflect.construct(S,arguments,Q)}else G=S.apply(this,arguments);return Object(N.a)(this,G)}}function _(){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(R){return!1}}var b={},m=function(R){Object(V.a)(U,R);var H=A(U);function U(S){var G;return Object(z.a)(this,U),G=H.call(this,S),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 se=Q.currentTarget,fe=Q.changedTouches[0].clientX-G.startPos.x,we=Q.changedTouches[0].clientY-G.startPos.y;(se===G.maskDom||se===G.handlerDom||se===G.contentDom&&L(se,Q.target,fe,we))&&Q.cancelable&&Q.preventDefault()},G.transitionEnd=function(Q){var se=Q.target;o(se,a,G.transitionEnd),se.style.transition=""},G.onKeyDown=function(Q){if(Q.keyCode===c.a.ESC){var se=G.props.onClose;Q.stopPropagation(),se&&se(Q)}},G.onWrapperTransitionEnd=function(Q){var se=G.props,fe=se.open,we=se.afterVisibleChange;Q.target===G.contentWrapper&&Q.propertyName.match(/transform$/)&&(G.dom.style.transition="",!fe&&G.getCurrentDrawerSome()&&(document.body.style.overflowX="",G.maskDom&&(G.maskDom.style.left="",G.maskDom.style.width="")),we&&we(!!fe))},G.openLevelTransition=function(){var Q=G.props,se=Q.open,fe=Q.width,we=Q.height,be=G.getHorizontalBoolAndPlacementName(),Se=be.isHorizontal,Ae=be.placementName,De=G.contentDom?G.contentDom.getBoundingClientRect()[Se?"width":"height"]:0,ve=(Se?fe:we)||De;G.setLevelAndScrolling(se,Ae,ve)},G.setLevelTransform=function(Q,se,fe,we){var be=G.props,Se=be.placement,Ae=be.levelMove,De=be.duration,ve=be.ease,Y=be.showMask;G.levelDom.forEach(function(k){k.style.transition="transform ".concat(De," ").concat(ve),r(k,a,G.transitionEnd);var B=Q?fe:0;if(Ae){var Z=T(Ae,{target:k,open:Q});B=Q?Z[0]:Z[1]||0}var re=typeof B=="number"?"".concat(B,"px"):B,X=Se==="left"||Se==="top"?re:"-".concat(re);X=Y&&Se==="right"&&we?"calc(".concat(X," + ").concat(we,"px)"):X,k.style.transform=B?"".concat(se,"(").concat(X,")"):""})},G.setLevelAndScrolling=function(Q,se,fe){var we=G.props.onChange;if(!x){var be=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(h.a)(!0):0;G.setLevelTransform(Q,se,fe,be),G.toggleScrollingToDrawerAndBody(be)}we&&we(Q)},G.toggleScrollingToDrawerAndBody=function(Q){var se=G.props,fe=se.getOpenCount,we=se.getContainer,be=se.showMask,Se=se.open,Ae=we&&we(),De=fe&&fe();if(Ae&&Ae.parentNode===document.body&&be){var ve=["touchstart"],Y=[document.body,G.maskDom,G.handlerDom,G.contentDom];Se&&document.body.style.overflow!=="hidden"?(Q&&G.addScrollingEffect(Q),De===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",Y.forEach(function(k,B){if(!k)return;r(k,ve[B]||"touchmove",B?G.removeMoveHandler:G.removeStartHandler,G.passive)})):G.getCurrentDrawerSome()&&(De||(document.body.style.overflow=""),document.body.style.touchAction="",Q&&G.remScrollingEffect(Q),Y.forEach(function(k,B){if(!k)return;o(k,ve[B]||"touchmove",B?G.removeMoveHandler:G.removeStartHandler,G.passive)}))}},G.addScrollingEffect=function(Q){var se=G.props,fe=se.placement,we=se.duration,be=se.ease,Se=se.getOpenCount,Ae=se.switchScrollingEffect,De=Se&&Se();De===1&&Ae();var ve="width ".concat(we," ").concat(be),Y="transform ".concat(we," ").concat(be);G.dom.style.transition="none";switch(fe){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(Y,",").concat(ve),G.dom.style.width="",G.dom.style.transform="")})},G.remScrollingEffect=function(Q){var se=G.props,fe=se.placement,we=se.duration,be=se.ease,Se=se.getOpenCount,Ae=se.switchScrollingEffect,De=Se&&Se();De||Ae(!0),i&&(document.body.style.overflowX="hidden"),G.dom.style.transition="none";var ve,Y="width ".concat(we," ").concat(be),k="transform ".concat(we," ").concat(be);switch(fe){case"left":{G.dom.style.width="100%",Y="width 0s ".concat(be," ").concat(we);break}case"right":{G.dom.style.transform="translateX(".concat(Q,"px)"),G.dom.style.width="100%",Y="width 0s ".concat(be," ").concat(we),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)",ve="height 0s ".concat(be," ").concat(we);break}default:break}clearTimeout(G.timeout),G.timeout=setTimeout(function(){G.dom&&(G.dom.style.transition="".concat(k,",").concat(ve?"".concat(ve,","):"").concat(Y),G.dom.style.transform="",G.dom.style.width="",G.dom.style.height="")})},G.getCurrentDrawerSome=function(){return!Object.keys(b).some(function(Q){return b[Q]})},G.getLevelDom=function(Q){var se=Q.level,fe=Q.getContainer;if(x)return;var we=fe&&fe(),be=we?we.parentNode:null;if(G.levelDom=[],se==="all"){var Se=be?Array.prototype.slice.call(be.children):[];Se.forEach(function(Ae){Ae.nodeName!=="SCRIPT"&&Ae.nodeName!=="STYLE"&&Ae.nodeName!=="LINK"&&Ae!==we&&G.levelDom.push(Ae)})}else se&&s(se).forEach(function(Ae){document.querySelectorAll(Ae).forEach(function(De){G.levelDom.push(De)})})},G.getHorizontalBoolAndPlacementName=function(){var Q=G.props.placement,se=Q==="left"||Q==="right",fe="translate".concat(se?"X":"Y");return{isHorizontal:se,placementName:fe}},G.state={_self:Object(I.a)(G)},G}return Object(D.a)(U,[{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(Se){}this.passive=Q?{passive:!1}:!1}var se=this.props,fe=se.open,we=se.getContainer,be=we&&we();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),fe&&(be&&be.parentNode===document.body&&(b[this.drawerId]=fe),this.openLevelTransition(),this.forceUpdate(function(){G.domFocus()}))}},{key:"componentDidUpdate",value:function(G){var Q=this.props,se=Q.open,fe=Q.getContainer,we=fe&&fe();se!==G.open&&(se&&this.domFocus(),we&&we.parentNode===document.body&&(b[this.drawerId]=!!se),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var G=this.props,Q=G.getOpenCount,se=G.open,fe=G.switchScrollingEffect,we=typeof Q=="function"&&Q();delete b[this.drawerId],se&&(this.setLevelTransform(!1),document.body.style.touchAction=""),we||(document.body.style.overflow="",fe(!0))}},{key:"render",value:function(){var G,Q=this,se=this.props,fe=se.className,we=se.children,be=se.style,Se=se.width,Ae=se.height,De=se.defaultOpen,ve=se.open,Y=se.prefixCls,k=se.placement,B=se.level,Z=se.levelMove,re=se.ease,X=se.duration,ye=se.getContainer,Me=se.handler,He=se.onChange,me=se.afterVisibleChange,Ee=se.showMask,Le=se.maskClosable,Pe=se.maskStyle,Ye=se.onClose,tt=se.onHandleClick,ut=se.keyboard,lt=se.getOpenCount,gt=se.switchScrollingEffect,ht=Object(J.a)(se,["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"]),Ie=this.dom?ve:!1,Re=f()(Y,(G={},Object(n.a)(G,"".concat(Y,"-").concat(k),!0),Object(n.a)(G,"".concat(Y,"-open"),Ie),Object(n.a)(G,fe||"",!!fe),Object(n.a)(G,"no-mask",!Ee),G)),$e=this.getHorizontalBoolAndPlacementName(),Ze=$e.placementName,ue=k==="left"||k==="top"?"-100%":"100%",q=Ie?"":"".concat(Ze,"(").concat(ue,")"),te=Me&&W.cloneElement(Me,{onClick:function(ce){Me.props.onClick&&Me.props.onClick(),tt&&tt(ce)},ref:function(ce){Q.handlerDom=ce}});return W.createElement("div",Object.assign({},ht,{tabIndex:-1,className:Re,style:be,ref:function(ce){Q.dom=ce},onKeyDown:Ie&&ut?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),Ee&&W.createElement("div",{className:"".concat(Y,"-mask"),onClick:Le?Ye:void 0,style:Pe,ref:function(ce){Q.maskDom=ce}}),W.createElement("div",{className:"".concat(Y,"-content-wrapper"),style:{transform:q,msTransform:q,width:w(Se)?"".concat(Se,"px"):Se,height:w(Ae)?"".concat(Ae,"px"):Ae},ref:function(ce){Q.contentWrapper=ce}},W.createElement("div",{className:"".concat(Y,"-content"),ref:function(ce){Q.contentDom=ce},onTouchStart:Ie&&Ee?this.removeStartHandler:void 0,onTouchMove:Ie&&Ee?this.removeMoveHandler:void 0},we),te))}}],[{key:"getDerivedStateFromProps",value:function(G,Q){var se=Q.prevProps,fe=Q._self,we={prevProps:G};if(se!==void 0){var be=G.placement,Se=G.level;be!==se.placement&&(fe.contentDom=null),Se!==se.level&&fe.getLevelDom(G)}return we}}]),U}(W.Component);m.defaultProps={switchScrollingEffect:function(){}};var p=m;function C(R){var H=E();return function(){var S=Object(O.a)(R),G;if(H){var Q=Object(O.a)(this).constructor;G=Reflect.construct(S,arguments,Q)}else G=S.apply(this,arguments);return Object(N.a)(this,G)}}function E(){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(R){return!1}}var v=function(R){Object(V.a)(U,R);var H=C(U);function U(S){var G;Object(z.a)(this,U),G=H.call(this,S),G.onHandleClick=function(se){var fe=G.props,we=fe.onHandleClick,be=fe.open;if(we&&we(se),typeof be=="undefined"){var Se=G.state.open;G.setState({open:!Se})}},G.onClose=function(se){var fe=G.props,we=fe.onClose,be=fe.open;we&&we(se),typeof be=="undefined"&&G.setState({open:!1})};var Q=typeof S.open!="undefined"?S.open:!!S.defaultOpen;return G.state={open:Q},"onMaskClick"in S&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),G}return Object(D.a)(U,[{key:"render",value:function(){var G=this,Q=this.props,se=Q.defaultOpen,fe=Q.getContainer,we=Q.wrapperClassName,be=Q.forceRender,Se=Q.handler,Ae=Object(J.a)(Q,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),De=this.state.open;if(!fe)return W.createElement("div",{className:we,ref:function(k){G.dom=k}},W.createElement(p,Object.assign({},Ae,{open:De,handler:Se,getContainer:function(){return G.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var ve=!!Se||be;return W.createElement(K.a,{visible:De,forceRender:ve,getContainer:fe,wrapperClassName:we},function(Y){var k=Y.visible,B=Y.afterClose,Z=Object(J.a)(Y,["visible","afterClose"]);return W.createElement(p,Object.assign({},Ae,Z,{open:k!==void 0?k:De,afterVisibleChange:B!==void 0?B:Ae.afterVisibleChange,handler:Se,onClose:G.onClose,onHandleClick:G.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(G,Q){var se=Q.prevProps,fe={prevProps:G};return typeof se!="undefined"&&G.open!==se.open&&(fe.open=G.open),fe}}]),U}(W.Component);v.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:W.createElement("div",{className:"drawer-handle"},W.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var P=v,F=de.a=P},fcyK:function(Ue,de,M){},fjLI:function(Ue,de,M){"use strict";M.d(de,"f",function(){return h}),M.d(de,"b",function(){return c}),M.d(de,"a",function(){return s}),M.d(de,"d",function(){return d}),M.d(de,"e",function(){return i}),M.d(de,"c",function(){return a});var J=M("8HAY"),z=M("Vhoy"),D=M("MI8n"),V=M("JYp7"),N=M("pmY6"),O=M("24hK"),K=M("nnTU"),W=M("T8No"),n=M("Cg/j"),I=M("t9D7"),g=function(r,o,T,w){var x=arguments.length,L=x<3?o:w===null?w=Object.getOwnPropertyDescriptor(o,T):w,A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(r,o,T,w);else for(var _=r.length-1;_>=0;_--)(A=r[_])&&(L=(x<3?A(L):x>3?A(o,T,L):A(o,T))||L);return x>3&&L&&Object.defineProperty(o,T,L),L},f=function(r,o){return function(T,w){o(T,w,r)}};function h(r){return r.command!==void 0}class c{constructor(r){this.id=c._idPool++,this._debugName=r}}c._idPool=0,c.CommandPalette=new c("CommandPalette"),c.EditorContext=new c("EditorContext"),c.SimpleEditorContext=new c("SimpleEditorContext"),c.EditorContextCopy=new c("EditorContextCopy"),c.EditorContextPeek=new c("EditorContextPeek"),c.MenubarEditMenu=new c("MenubarEditMenu"),c.MenubarCopy=new c("MenubarCopy"),c.MenubarGoMenu=new c("MenubarGoMenu"),c.MenubarSelectionMenu=new c("MenubarSelectionMenu"),c.InlineCompletionsActions=new c("InlineCompletionsActions");const s=Object(n.c)("menuService"),d=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new D.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:r=>r===c.CommandPalette}}addCommand(r){return this.addCommands(V.a.single(r))}addCommands(r){for(const o of r)this._commands.set(o.id,o);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(N.i)(()=>{let o=!1;for(const T of r)o=this._commands.delete(T.id)||o;o&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(r){return this._commands.get(r)}getCommands(){const r=new Map;return this._commands.forEach((o,T)=>r.set(T,o)),r}appendMenuItem(r,o){return this.appendMenuItems(V.a.single({id:r,item:o}))}appendMenuItems(r){const o=new Set,T=new O.a;for(const{id:w,item:x}of r){let L=this._menuItems.get(w);L||(L=new O.a,this._menuItems.set(w,L)),T.push(L.push(x)),o.add(w)}return this._onDidChangeMenu.fire(o),Object(N.i)(()=>{if(T.size>0){for(let w of T)w();this._onDidChangeMenu.fire(o),T.clear()}})}getMenuItems(r){let o;return this._menuItems.has(r)?o=[...this._menuItems.get(r)]:o=[],r===c.CommandPalette&&this._appendImplicitItems(o),o}_appendImplicitItems(r){const o=new Set;for(const T of r)h(T)&&(o.add(T.command.id),T.alt&&o.add(T.alt.id));this._commands.forEach((T,w)=>{o.has(w)||r.push({command:T})})}};class i extends J.e{constructor(r,o,T,w){super(`submenuitem.${r.submenu.id}`,typeof r.title=="string"?r.title:r.title.value,[],"submenu");this.item=r,this._menuService=o,this._contextKeyService=T,this._options=w}get actions(){const r=[],o=this._menuService.createMenu(this.item.submenu,this._contextKeyService),T=o.getActions(this._options);o.dispose();for(const[,w]of T)w.length>0&&(r.push(...w),r.push(new J.d));return r.length&&r.pop(),r}}let a=class r{constructor(o,T,w,x,L){var A,_;if(this._commandService=L,this.id=o.id,this.label=(w==null?void 0:w.renderShortTitle)&&o.shortTitle?typeof o.shortTitle=="string"?o.shortTitle:o.shortTitle.value:typeof o.title=="string"?o.title:o.title.value,this.tooltip=(_=typeof o.tooltip=="string"?o.tooltip:(A=o.tooltip)===null||A===void 0?void 0:A.value)!==null&&_!==void 0?_:"",this.enabled=!o.precondition||x.contextMatchesRules(o.precondition),this.checked=void 0,o.toggled){const b=o.toggled.condition?o.toggled:{condition:o.toggled};this.checked=x.contextMatchesRules(b.condition),this.checked&&b.tooltip&&(this.tooltip=typeof b.tooltip=="string"?b.tooltip:b.tooltip.value),b.title&&(this.label=typeof b.title=="string"?b.title:b.title.value)}this.item=o,this.alt=T?new r(T,void 0,w,x,L):void 0,this._options=w,I.d.isThemeIcon(o.icon)&&(this.class=z.a.asClassName(o.icon))}dispose(){}run(...o){var T,w;let x=[];return((T=this._options)===null||T===void 0?void 0:T.arg)&&(x=[...x,this._options.arg]),((w=this._options)===null||w===void 0?void 0:w.shouldForwardArgs)&&(x=[...x,...o]),this._commandService.executeCommand(this.id,...x)}};a=g([f(3,W.b),f(4,K.b)],a)},fyJ8:function(Ue,de,M){"use strict";var J=M("rePB"),z=M("VTBJ"),D=M("Ff2n"),V=M("U8pU"),N=M("q1tI"),O=M.n(N),K=M("TSYQ"),W=M.n(K),n=M("c+Xe"),I=M("sR1s");function g(d){return d&&Object(V.a)(d)==="object"&&!Array.isArray(d)&&!N.isValidElement(d)}function f(d){return typeof d=="string"?!0:Object(n.c)(d)}function h(d,i){var a,r=d.prefixCls,o=d.className,T=d.record,w=d.index,x=d.dataIndex,L=d.render,A=d.children,_=d.component,b=_===void 0?"td":_,m=d.colSpan,p=d.rowSpan,C=d.fixLeft,E=d.fixRight,v=d.firstFixLeft,P=d.lastFixLeft,F=d.firstFixRight,R=d.lastFixRight,H=d.appendNode,U=d.additionalProps,S=U===void 0?{}:U,G=d.ellipsis,Q=d.align,se=d.rowType,fe=d.isSticky,we="".concat(r,"-cell"),be,Se;if(A)Se=A;else{var Ae=Object(I.b)(T,x);if(Se=Ae,L){var De=L(Ae,T,w);g(De)?(Se=De.children,be=De.props):Se=De}}Object(V.a)(Se)==="object"&&!Array.isArray(Se)&&!N.isValidElement(Se)&&(Se=null),G&&(P||F)&&(Se=N.createElement("span",{className:"".concat(we,"-content")},Se));var ve=be||{},Y=ve.colSpan,k=ve.rowSpan,B=ve.style,Z=ve.className,re=Object(D.a)(ve,["colSpan","rowSpan","style","className"]),X=Y!==void 0?Y:m,ye=k!==void 0?k:p;if(X===0||ye===0)return null;var Me={},He=typeof C=="number",me=typeof E=="number";He&&(Me.position="sticky",Me.left=C),me&&(Me.position="sticky",Me.right=E);var Ee={};Q&&(Ee.textAlign=Q);var Le,Pe=G===!0?{showTitle:!0}:G;Pe&&(Pe.showTitle||se==="header")&&(typeof Se=="string"||typeof Se=="number"?Le=Se.toString():N.isValidElement(Se)&&typeof Se.props.children=="string"&&(Le=Se.props.children));var Ye=Object(z.a)(Object(z.a)(Object(z.a)({title:Le},re),S),{},{colSpan:X&&X!==1?X:null,rowSpan:ye&&ye!==1?ye:null,className:W()(we,o,(a={},Object(J.a)(a,"".concat(we,"-fix-left"),He),Object(J.a)(a,"".concat(we,"-fix-left-first"),v),Object(J.a)(a,"".concat(we,"-fix-left-last"),P),Object(J.a)(a,"".concat(we,"-fix-right"),me),Object(J.a)(a,"".concat(we,"-fix-right-first"),F),Object(J.a)(a,"".concat(we,"-fix-right-last"),R),Object(J.a)(a,"".concat(we,"-ellipsis"),G),Object(J.a)(a,"".concat(we,"-with-append"),H),Object(J.a)(a,"".concat(we,"-fix-sticky"),(He||me)&&fe),a),S.className,Z),style:Object(z.a)(Object(z.a)(Object(z.a)(Object(z.a)({},S.style),Ee),Me),B),ref:f(b)?i:null});return N.createElement(b,Object.assign({},Ye),H,Se)}var c=N.forwardRef(h);c.displayName="Cell";var s=N.memo(c,function(d,i){return i.shouldCellUpdate?!i.shouldCellUpdate(i.record,d.record):!1});de.a=s},gRFJ:function(Ue,de,M){Ue.exports=[M("rdUC"),M("ynwM"),M("RELg"),M("DlR+"),M("CrYA"),M("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(Ue){return Ue<10?"0"+Ue:Ue}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(Ue){return rx_escapable.lastIndex=0,rx_escapable.test(Ue)?'"'+Ue.replace(rx_escapable,function(de){var M=meta[de];return typeof M=="string"?M:"\\u"+("0000"+de.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+Ue+'"'}function str(Ue,de){var M,J,z,D,V=gap,N,O=de[Ue];O&&typeof O=="object"&&typeof O.toJSON=="function"&&(O=O.toJSON(Ue)),typeof rep=="function"&&(O=rep.call(de,Ue,O));switch(typeof O){case"string":return quote(O);case"number":return isFinite(O)?String(O):"null";case"boolean":case"null":return String(O);case"object":if(!O)return"null";if(gap+=indent,N=[],Object.prototype.toString.apply(O)==="[object Array]"){for(D=O.length,M=0;M<D;M+=1)N[M]=str(M,O)||"null";return z=N.length===0?"[]":gap?`[
`+gap+N.join(`,
`+gap)+`
`+V+"]":"["+N.join(",")+"]",gap=V,z}if(rep&&typeof rep=="object")for(D=rep.length,M=0;M<D;M+=1)typeof rep[M]=="string"&&(J=rep[M],z=str(J,O),z&&N.push(quote(J)+(gap?": ":":")+z));else for(J in O)Object.prototype.hasOwnProperty.call(O,J)&&(z=str(J,O),z&&N.push(quote(J)+(gap?": ":":")+z));return z=N.length===0?"{}":gap?`{
`+gap+N.join(`,
`+gap)+`
`+V+"}":"{"+N.join(",")+"}",gap=V,z}}typeof JSON.stringify!="function"&&(meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(Ue,de,M){var J;if(gap="",indent="",typeof M=="number")for(J=0;J<M;J+=1)indent+=" ";else typeof M=="string"&&(indent=M);if(rep=de,de&&typeof de!="function"&&(typeof de!="object"||typeof de.length!="number"))throw new Error("JSON.stringify");return str("",{"":Ue})}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){var j;function walk(Ue,de){var M,J,z=Ue[de];if(z&&typeof z=="object")for(M in z)Object.prototype.hasOwnProperty.call(z,M)&&(J=walk(z,M),J!==void 0?z[M]=J:delete z[M]);return reviver.call(Ue,de,z)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(Ue){return"\\u"+("0000"+Ue.charCodeAt(0).toString(16)).slice(-4)})),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}()},hW8S:function(Ue,de,M){"use strict";M.d(de,"a",function(){return V}),M.d(de,"c",function(){return N}),M.d(de,"b",function(){return O});var J=M("VTBJ"),z=M("Ff2n"),D=M("Kwbf"),V="RC_TABLE_INTERNAL_COL_DEFINE";function N(K){var W=K.expandable,n=Object(z.a)(K,["expandable"]);return"expandable"in K?Object(J.a)(Object(J.a)({},n),W):n}function O(K){return Object.keys(K).reduce(function(W,n){return(n.substr(0,5)==="data-"||n.substr(0,5)==="aria-")&&(W[n]=K[n]),W},{})}},i3hx:function(Ue,de,M){},ic2d:function(Ue,de,M){"use strict";M.d(de,"a",function(){return V});var J=M("FWmy"),z=M("746U");class D{constructor(){this.data=new Map}add(N,O){J.a(z.l(N)),J.a(z.k(O)),J.a(!this.data.has(N),"There is already an extension with this id"),this.data.set(N,O)}as(N){return this.data.get(N)||null}}const V=new D},je13:function(Ue,de,M){var J=M("5nXd"),z=M("gRFJ"),D=[M("uQRt")];Ue.exports=J.createStore(z,D)},kSUc:function(Ue,de,M){},"kaH+":function(Ue,de,M){"use strict";var J=M("+L6B"),z=M("2/Rp"),D=M("tJVT"),V=M("q1tI"),N=M.n(V),O=M("UZu5"),K=M.n(O),W=M("dhSg"),n=M("rLCj"),I=M("dF/Y"),g=M("4i/N");de.a=function(){var f=Object(V.useState)(""),h=Object(D.a)(f,2),c=h[0],s=h[1],d=Object(V.useState)(0),i=Object(D.a)(d,2),a=i[0],r=i[1],o=Object(V.useRef)("");Object(V.useEffect)(function(){var b=W.a.subscribe("preview-image",function(m){s(m),document.body.style.overflow="hidden"});return b},[]),Object(V.useEffect)(function(){return document.addEventListener("keydown",T),function(){document.removeEventListener("keydown",T)}},[]),Object(V.useEffect)(function(){o.current=c},[c]);function T(b){b.keyCode==27&&o.current&&w()}function w(){document.body.style.overflow="auto",s("")}function x(){r(a+90)}var L=Object(V.useRef)(),A=Object(V.useRef)(),_=function(m){(m.nativeEvent.target===L.current||m.nativeEvent.target===A.current)&&w()};return N.a.createElement(V.Fragment,null,c?N.a.createElement("div",{className:"image-preview-container",ref:L,onClick:_},N.a.createElement("div",{className:"button-group"},N.a.createElement(z.a,{onClick:x},"\u65CB\u8F6C",N.a.createElement(n.a,null)),N.a.createElement(z.a,{href:c},"\u4E0B\u8F7D",N.a.createElement(I.a,null)),N.a.createElement(z.a,{onClick:w},"\u5173\u95ED",N.a.createElement(g.a,null))),N.a.createElement("div",{className:"preview-wrp-group",ref:A},N.a.createElement("img",{className:"image-preview",src:c,alt:"\u9884\u89C8\u5927\u56FE",style:{transform:"rotate(".concat(a,"deg)")}}))):null)}},lOMy:function(Ue,de,M){},lZu9:function(Ue,de,M){(function(J){J(M("VrN/"),M("1eCo"),M("8EBN"))})(function(J){"use strict";J.defineMode("markdown",function(z,D){var V=J.getMode(z,"text/html"),N=V.name=="null";function O(U){if(J.findModeByName){var S=J.findModeByName(U);S&&(U=S.mime||S.mimes[0])}var G=J.getMode(z,U);return G.name=="null"?null:G}D.highlightFormatting===void 0&&(D.highlightFormatting=!1),D.maxBlockquoteDepth===void 0&&(D.maxBlockquoteDepth=0),D.taskLists===void 0&&(D.taskLists=!1),D.strikethrough===void 0&&(D.strikethrough=!1),D.emoji===void 0&&(D.emoji=!1),D.fencedCodeBlockHighlighting===void 0&&(D.fencedCodeBlockHighlighting=!0),D.fencedCodeBlockDefaultMode===void 0&&(D.fencedCodeBlockDefaultMode="text/plain"),D.xml===void 0&&(D.xml=!0),D.tokenTypeOverrides===void 0&&(D.tokenTypeOverrides={});var K={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var W in K)K.hasOwnProperty(W)&&D.tokenTypeOverrides[W]&&(K[W]=D.tokenTypeOverrides[W]);var n=/^([*\-_])(?:\s*\1){2,}\s*$/,I=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,g=/^\[(x| )\](?=\s)/i,f=D.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,h=/^ {0,3}(?:\={1,}|-{2,})\s*$/,c=/^[^#!\[\]*_\\<>` "'(~:]+/,s=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,d=/^\s*\[[^\]]+?\]:.*$/,i=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,a=" ";function r(U,S,G){return S.f=S.inline=G,G(U,S)}function o(U,S,G){return S.f=S.block=G,G(U,S)}function T(U){return!U||!/\S/.test(U.string)}function w(U){if(U.linkTitle=!1,U.linkHref=!1,U.linkText=!1,U.em=!1,U.strong=!1,U.strikethrough=!1,U.quote=0,U.indentedCode=!1,U.f==L){var S=N;if(!S){var G=J.innerMode(V,U.htmlState);S=G.mode.name=="xml"&&G.state.tagStart===null&&!G.state.context&&G.state.tokenize.isInText}S&&(U.f=m,U.block=x,U.htmlState=null)}return U.trailingSpace=0,U.trailingSpaceNewLine=!1,U.prevLine=U.thisLine,U.thisLine={stream:null},null}function x(U,S){var G=U.column()===S.indentation,Q=T(S.prevLine.stream),se=S.indentedCode,fe=S.prevLine.hr,we=S.list!==!1,be=(S.listStack[S.listStack.length-1]||0)+3;S.indentedCode=!1;var Se=S.indentation;if(S.indentationDiff===null&&(S.indentationDiff=S.indentation,we)){for(S.list=null;Se<S.listStack[S.listStack.length-1];)S.listStack.pop(),S.listStack.length?S.indentation=S.listStack[S.listStack.length-1]:S.list=!1;S.list!==!1&&(S.indentationDiff=Se-S.listStack[S.listStack.length-1])}var Ae=!Q&&!fe&&!S.prevLine.header&&(!we||!se)&&!S.prevLine.fencedCodeEnd,De=(S.list===!1||fe||Q)&&S.indentation<=be&&U.match(n),ve=null;if(S.indentationDiff>=4&&(se||S.prevLine.fencedCodeEnd||S.prevLine.header||Q))return U.skipToEnd(),S.indentedCode=!0,K.code;if(U.eatSpace())return null;if(G&&S.indentation<=be&&(ve=U.match(f))&&ve[1].length<=6)return S.quote=0,S.header=ve[1].length,S.thisLine.header=!0,D.highlightFormatting&&(S.formatting="header"),S.f=S.inline,_(S);if(S.indentation<=be&&U.eat(">"))return S.quote=G?1:S.quote+1,D.highlightFormatting&&(S.formatting="quote"),U.eatSpace(),_(S);if(!De&&!S.setext&&G&&S.indentation<=be&&(ve=U.match(I))){var Y=ve[1]?"ol":"ul";return S.indentation=Se+U.current().length,S.list=!0,S.quote=0,S.listStack.push(S.indentation),S.em=!1,S.strong=!1,S.code=!1,S.strikethrough=!1,D.taskLists&&U.match(g,!1)&&(S.taskList=!0),S.f=S.inline,D.highlightFormatting&&(S.formatting=["list","list-"+Y]),_(S)}else{if(G&&S.indentation<=be&&(ve=U.match(s,!0)))return S.quote=0,S.fencedEndRE=new RegExp(ve[1]+"+ *$"),S.localMode=D.fencedCodeBlockHighlighting&&O(ve[2]||D.fencedCodeBlockDefaultMode),S.localMode&&(S.localState=J.startState(S.localMode)),S.f=S.block=A,D.highlightFormatting&&(S.formatting="code-block"),S.code=-1,_(S);if(S.setext||(!Ae||!we)&&!S.quote&&S.list===!1&&!S.code&&!De&&!d.test(U.string)&&(ve=U.lookAhead(1))&&(ve=ve.match(h)))return S.setext?(S.header=S.setext,S.setext=0,U.skipToEnd(),D.highlightFormatting&&(S.formatting="header")):(S.header=ve[0].charAt(0)=="="?1:2,S.setext=S.header),S.thisLine.header=!0,S.f=S.inline,_(S);if(De)return U.skipToEnd(),S.hr=!0,S.thisLine.hr=!0,K.hr;if(U.peek()==="[")return r(U,S,P)}return r(U,S,S.inline)}function L(U,S){var G=V.token(U,S.htmlState);if(!N){var Q=J.innerMode(V,S.htmlState);(Q.mode.name=="xml"&&Q.state.tagStart===null&&!Q.state.context&&Q.state.tokenize.isInText||S.md_inside&&U.current().indexOf(">")>-1)&&(S.f=m,S.block=x,S.htmlState=null)}return G}function A(U,S){var G=S.listStack[S.listStack.length-1]||0,Q=S.indentation<G,se=G+3;if(S.fencedEndRE&&S.indentation<=se&&(Q||U.match(S.fencedEndRE))){D.highlightFormatting&&(S.formatting="code-block");var fe;return Q||(fe=_(S)),S.localMode=S.localState=null,S.block=x,S.f=m,S.fencedEndRE=null,S.code=0,S.thisLine.fencedCodeEnd=!0,Q?o(U,S,S.block):fe}else return S.localMode?S.localMode.token(U,S.localState):(U.skipToEnd(),K.code)}function _(U){var S=[];if(U.formatting){S.push(K.formatting),typeof U.formatting=="string"&&(U.formatting=[U.formatting]);for(var G=0;G<U.formatting.length;G++)S.push(K.formatting+"-"+U.formatting[G]),U.formatting[G]==="header"&&S.push(K.formatting+"-"+U.formatting[G]+"-"+U.header),U.formatting[G]==="quote"&&(!D.maxBlockquoteDepth||D.maxBlockquoteDepth>=U.quote?S.push(K.formatting+"-"+U.formatting[G]+"-"+U.quote):S.push("error"))}if(U.taskOpen)return S.push("meta"),S.length?S.join(" "):null;if(U.taskClosed)return S.push("property"),S.length?S.join(" "):null;if(U.linkHref?S.push(K.linkHref,"url"):(U.strong&&S.push(K.strong),U.em&&S.push(K.em),U.strikethrough&&S.push(K.strikethrough),U.emoji&&S.push(K.emoji),U.linkText&&S.push(K.linkText),U.code&&S.push(K.code),U.image&&S.push(K.image),U.imageAltText&&S.push(K.imageAltText,"link"),U.imageMarker&&S.push(K.imageMarker)),U.header&&S.push(K.header,K.header+"-"+U.header),U.quote&&(S.push(K.quote),!D.maxBlockquoteDepth||D.maxBlockquoteDepth>=U.quote?S.push(K.quote+"-"+U.quote):S.push(K.quote+"-"+D.maxBlockquoteDepth)),U.list!==!1){var Q=(U.listStack.length-1)%3;Q?Q===1?S.push(K.list2):S.push(K.list3):S.push(K.list1)}return U.trailingSpaceNewLine?S.push("trailing-space-new-line"):U.trailingSpace&&S.push("trailing-space-"+(U.trailingSpace%2?"a":"b")),S.length?S.join(" "):null}function b(U,S){return U.match(c,!0)?_(S):void 0}function m(U,S){var G=S.text(U,S);if(typeof G!="undefined")return G;if(S.list)return S.list=null,_(S);if(S.taskList){var Q=U.match(g,!0)[1]===" ";return Q?S.taskOpen=!0:S.taskClosed=!0,D.highlightFormatting&&(S.formatting="task"),S.taskList=!1,_(S)}if(S.taskOpen=!1,S.taskClosed=!1,S.header&&U.match(/^#+$/,!0))return D.highlightFormatting&&(S.formatting="header"),_(S);var se=U.next();if(S.linkTitle){S.linkTitle=!1;var fe=se;se==="("&&(fe=")"),fe=(fe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var we="^\\s*(?:[^"+fe+"\\\\]+|\\\\\\\\|\\\\.)"+fe;if(U.match(new RegExp(we),!0))return K.linkHref}if(se==="`"){var be=S.formatting;D.highlightFormatting&&(S.formatting="code"),U.eatWhile("`");var Se=U.current().length;if(S.code==0&&(!S.quote||Se==1))return S.code=Se,_(S);if(Se==S.code){var Ae=_(S);return S.code=0,Ae}else return S.formatting=be,_(S)}else if(S.code)return _(S);if(se==="\\"&&(U.next(),D.highlightFormatting)){var De=_(S),ve=K.formatting+"-escape";return De?De+" "+ve:ve}if(se==="!"&&U.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return S.imageMarker=!0,S.image=!0,D.highlightFormatting&&(S.formatting="image"),_(S);if(se==="["&&S.imageMarker&&U.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return S.imageMarker=!1,S.imageAltText=!0,D.highlightFormatting&&(S.formatting="image"),_(S);if(se==="]"&&S.imageAltText){D.highlightFormatting&&(S.formatting="image");var De=_(S);return S.imageAltText=!1,S.image=!1,S.inline=S.f=C,De}if(se==="["&&!S.image)return S.linkText&&U.match(/^.*?\]/)||(S.linkText=!0,D.highlightFormatting&&(S.formatting="link")),_(S);if(se==="]"&&S.linkText){D.highlightFormatting&&(S.formatting="link");var De=_(S);return S.linkText=!1,S.inline=S.f=U.match(/\(.*?\)| ?\[.*?\]/,!1)?C:m,De}if(se==="<"&&U.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){S.f=S.inline=p,D.highlightFormatting&&(S.formatting="link");var De=_(S);return De?De+=" ":De="",De+K.linkInline}if(se==="<"&&U.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){S.f=S.inline=p,D.highlightFormatting&&(S.formatting="link");var De=_(S);return De?De+=" ":De="",De+K.linkEmail}if(D.xml&&se==="<"&&U.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var Y=U.string.indexOf(">",U.pos);if(Y!=-1){var k=U.string.substring(U.start,Y);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(k)&&(S.md_inside=!0)}return U.backUp(1),S.htmlState=J.startState(V),o(U,S,L)}if(D.xml&&se==="<"&&U.match(/^\/\w*?>/))return S.md_inside=!1,"tag";if(se==="*"||se==="_"){for(var B=1,Z=U.pos==1?" ":U.string.charAt(U.pos-2);B<3&&U.eat(se);)B++;var re=U.peek()||" ",X=!/\s/.test(re)&&(!i.test(re)||/\s/.test(Z)||i.test(Z)),ye=!/\s/.test(Z)&&(!i.test(Z)||/\s/.test(re)||i.test(re)),Me=null,He=null;if(B%2&&(!S.em&&X&&(se==="*"||!ye||i.test(Z))?Me=!0:S.em==se&&ye&&(se==="*"||!X||i.test(re))&&(Me=!1)),B>1&&(!S.strong&&X&&(se==="*"||!ye||i.test(Z))?He=!0:S.strong==se&&ye&&(se==="*"||!X||i.test(re))&&(He=!1)),He!=null||Me!=null){D.highlightFormatting&&(S.formatting=Me==null?"strong":He==null?"em":"strong em"),Me===!0&&(S.em=se),He===!0&&(S.strong=se);var Ae=_(S);return Me===!1&&(S.em=!1),He===!1&&(S.strong=!1),Ae}}else if(se===" "&&(U.eat("*")||U.eat("_"))){if(U.peek()===" ")return _(S);U.backUp(1)}if(D.strikethrough){if(se==="~"&&U.eatWhile(se)){if(S.strikethrough){D.highlightFormatting&&(S.formatting="strikethrough");var Ae=_(S);return S.strikethrough=!1,Ae}else if(U.match(/^[^\s]/,!1))return S.strikethrough=!0,D.highlightFormatting&&(S.formatting="strikethrough"),_(S)}else if(se===" "&&U.match(/^~~/,!0)){if(U.peek()===" ")return _(S);U.backUp(2)}}if(D.emoji&&se===":"&&U.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){S.emoji=!0,D.highlightFormatting&&(S.formatting="emoji");var me=_(S);return S.emoji=!1,me}return se===" "&&(U.match(/^ +$/,!1)?S.trailingSpace++:S.trailingSpace&&(S.trailingSpaceNewLine=!0)),_(S)}function p(U,S){var G=U.next();if(G===">"){S.f=S.inline=m,D.highlightFormatting&&(S.formatting="link");var Q=_(S);return Q?Q+=" ":Q="",Q+K.linkInline}return U.match(/^[^>]+/,!0),K.linkInline}function C(U,S){if(U.eatSpace())return null;var G=U.next();return G==="("||G==="["?(S.f=S.inline=v(G==="("?")":"]"),D.highlightFormatting&&(S.formatting="link-string"),S.linkHref=!0,_(S)):"error"}var E={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function v(U){return function(S,G){var Q=S.next();if(Q===U){G.f=G.inline=m,D.highlightFormatting&&(G.formatting="link-string");var se=_(G);return G.linkHref=!1,se}return S.match(E[U]),G.linkHref=!0,_(G)}}function P(U,S){return U.match(/^([^\]\\]|\\.)*\]:/,!1)?(S.f=F,U.next(),D.highlightFormatting&&(S.formatting="link"),S.linkText=!0,_(S)):r(U,S,m)}function F(U,S){if(U.match(/^\]:/,!0)){S.f=S.inline=R,D.highlightFormatting&&(S.formatting="link");var G=_(S);return S.linkText=!1,G}return U.match(/^([^\]\\]|\\.)+/,!0),K.linkText}function R(U,S){return U.eatSpace()?null:(U.match(/^[^\s]+/,!0),U.peek()===void 0?S.linkTitle=!0:U.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),S.f=S.inline=m,K.linkHref+" url")}var H={startState:function(){return{f:x,prevLine:{stream:null},thisLine:{stream:null},block:x,htmlState:null,indentation:0,inline:m,text:b,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(U){return{f:U.f,prevLine:U.prevLine,thisLine:U.thisLine,block:U.block,htmlState:U.htmlState&&J.copyState(V,U.htmlState),indentation:U.indentation,localMode:U.localMode,localState:U.localMode?J.copyState(U.localMode,U.localState):null,inline:U.inline,text:U.text,formatting:!1,linkText:U.linkText,linkTitle:U.linkTitle,linkHref:U.linkHref,code:U.code,em:U.em,strong:U.strong,strikethrough:U.strikethrough,emoji:U.emoji,header:U.header,setext:U.setext,hr:U.hr,taskList:U.taskList,list:U.list,listStack:U.listStack.slice(0),quote:U.quote,indentedCode:U.indentedCode,trailingSpace:U.trailingSpace,trailingSpaceNewLine:U.trailingSpaceNewLine,md_inside:U.md_inside,fencedEndRE:U.fencedEndRE}},token:function(U,S){if(S.formatting=!1,U!=S.thisLine.stream){if(S.header=0,S.hr=!1,U.match(/^\s*$/,!0))return w(S),null;if(S.prevLine=S.thisLine,S.thisLine={stream:U},S.taskList=!1,S.trailingSpace=0,S.trailingSpaceNewLine=!1,!S.localState&&(S.f=S.block,S.f!=L)){var G=U.match(/^\s*/,!0)[0].replace(/\t/g,a).length;if(S.indentation=G,S.indentationDiff=null,G>0)return null}}return S.f(U,S)},innerMode:function(U){return U.block==L?{state:U.htmlState,mode:V}:U.localState?{state:U.localState,mode:U.localMode}:{state:U,mode:H}},indent:function(U,S,G){return U.block==L&&V.indent?V.indent(U.htmlState,S,G):U.localState&&U.localMode.indent?U.localMode.indent(U.localState,S,G):J.Pass},blankLine:w,getType:_,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return H},"xml"),J.defineMIME("text/markdown","markdown"),J.defineMIME("text/x-markdown","markdown")})},n6Qo:function(Ue,de,M){"use strict";M.d(de,"a",function(){return W});var J=M("q1tI"),z=M("biw7"),D=M("fyJ8");function V(n){var I=n.className,g=n.index,f=n.children,h=n.colSpan,c=n.rowSpan,s=J.useContext(z.a),d=s.prefixCls,i=s.fixedInfoList,a=i[g];return J.createElement(D.a,Object.assign({className:I,index:g,component:"td",prefixCls:d,record:null,dataIndex:null,render:function(){return{children:f,props:{colSpan:h,rowSpan:c}}}},a))}function N(n){return J.createElement("tr",Object.assign({},n))}function O(n){var I=n.children,g=J.useContext(z.a),f=g.prefixCls;return J.createElement("tfoot",{className:"".concat(f,"-summary")},I)}var K=de.b=O,W={Cell:V,Row:N}},nEHx:function(Ue,de,M){"use strict";M.d(de,"a",function(){return J});var J;(function(z){z.DARK="dark",z.LIGHT="light",z.HIGH_CONTRAST="hc"})(J||(J={}))},nWbc:function(Ue,de,M){},nnTU:function(Ue,de,M){"use strict";M.d(de,"b",function(){return K}),M.d(de,"a",function(){return W});var J=M("MI8n"),z=M("JYp7"),D=M("pmY6"),V=M("24hK"),N=M("746U"),O=M("Cg/j");const K=Object(O.c)("commandService"),W=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new J.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,I){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!I)throw new Error("invalid command");return this.registerCommand({id:n,handler:I})}if(n.description){const s=[];for(let i of n.description.args)s.push(i.constraint);const d=n.handler;n.handler=function(i,...a){return Object(N.o)(a,s),d(i,...a)}}const{id:g}=n;let f=this._commands.get(g);f||(f=new V.a,this._commands.set(g,f));let h=f.unshift(n),c=Object(D.i)(()=>{h();const s=this._commands.get(g);(s==null?void 0:s.isEmpty())&&this._commands.delete(g)});return this._onDidRegisterCommand.fire(g),c}registerCommandAlias(n,I){return W.registerCommand(n,(g,...f)=>g.get(K).executeCommand(I,...f))}getCommand(n){const I=this._commands.get(n);return!I||I.isEmpty()?void 0:z.a.first(I)}getCommands(){const n=new Map;for(const I of this._commands.keys()){const g=this.getCommand(I);g&&n.set(I,g)}return n}};W.registerCommand("noop",()=>{})},oFv4:function(Ue,de,M){Ue.exports=M.p+"static/internal.da228387.png"},osHv:function(Ue,de,M){(function(J){J(M("VrN/"))})(function(J){"use strict";var z=J.Pos;function D(i,a){return i.line-a.line||i.ch-a.ch}var V="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",N=V+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",O=new RegExp("<(/?)(["+V+"]["+N+"]*)","g");function K(i,a,r,o){this.line=a,this.ch=r,this.cm=i,this.text=i.getLine(a),this.min=o?Math.max(o.from,i.firstLine()):i.firstLine(),this.max=o?Math.min(o.to-1,i.lastLine()):i.lastLine()}function W(i,a){var r=i.cm.getTokenTypeAt(z(i.line,a));return r&&/\btag\b/.test(r)}function n(i){return i.line>=i.max?void 0:(i.ch=0,i.text=i.cm.getLine(++i.line),!0)}function I(i){return i.line<=i.min?void 0:(i.text=i.cm.getLine(--i.line),i.ch=i.text.length,!0)}function g(i){for(;;){var a=i.text.indexOf(">",i.ch);if(a==-1){if(n(i))continue;return}if(!W(i,a+1)){i.ch=a+1;continue}var r=i.text.lastIndexOf("/",a),o=r>-1&&!/\S/.test(i.text.slice(r+1,a));return i.ch=a+1,o?"selfClose":"regular"}}function f(i){for(;;){var a=i.ch?i.text.lastIndexOf("<",i.ch-1):-1;if(a==-1){if(I(i))continue;return}if(!W(i,a+1)){i.ch=a;continue}O.lastIndex=a,i.ch=a;var r=O.exec(i.text);if(r&&r.index==a)return r}}function h(i){for(;;){O.lastIndex=i.ch;var a=O.exec(i.text);if(!a){if(n(i))continue;return}if(!W(i,a.index+1)){i.ch=a.index+1;continue}return i.ch=a.index+a[0].length,a}}function c(i){for(;;){var a=i.ch?i.text.lastIndexOf(">",i.ch-1):-1;if(a==-1){if(I(i))continue;return}if(!W(i,a+1)){i.ch=a;continue}var r=i.text.lastIndexOf("/",a),o=r>-1&&!/\S/.test(i.text.slice(r+1,a));return i.ch=a+1,o?"selfClose":"regular"}}function s(i,a){for(var r=[];;){var o=h(i),T,w=i.line,x=i.ch-(o?o[0].length:0);if(!o||!(T=g(i)))return;if(T=="selfClose")continue;if(o[1]){for(var L=r.length-1;L>=0;--L)if(r[L]==o[2]){r.length=L;break}if(L<0&&(!a||a==o[2]))return{tag:o[2],from:z(w,x),to:z(i.line,i.ch)}}else r.push(o[2])}}function d(i,a){for(var r=[];;){var o=c(i);if(!o)return;if(o=="selfClose"){f(i);continue}var T=i.line,w=i.ch,x=f(i);if(!x)return;if(x[1])r.push(x[2]);else{for(var L=r.length-1;L>=0;--L)if(r[L]==x[2]){r.length=L;break}if(L<0&&(!a||a==x[2]))return{tag:x[2],from:z(i.line,i.ch),to:z(T,w)}}}}J.registerHelper("fold","xml",function(i,a){for(var r=new K(i,a.line,0);;){var o=h(r);if(!o||r.line!=a.line)return;var T=g(r);if(!T)return;if(!o[1]&&T!="selfClose"){var w=z(r.line,r.ch),x=s(r,o[2]);return x&&D(x.from,w)>0?{from:w,to:x.from}:null}}}),J.findMatchingTag=function(i,a,r){var o=new K(i,a.line,a.ch,r);if(o.text.indexOf(">")==-1&&o.text.indexOf("<")==-1)return;var T=g(o),w=T&&z(o.line,o.ch),x=T&&f(o);if(!T||!x||D(o,a)>0)return;var L={from:z(o.line,o.ch),to:w,tag:x[2]};return T=="selfClose"?{open:L,close:null,at:"open"}:x[1]?{open:d(o,x[2]),close:L,at:"close"}:(o=new K(i,w.line,w.ch,r),{open:L,close:s(o,x[2]),at:"open"})},J.findEnclosingTag=function(i,a,r,o){for(var T=new K(i,a.line,a.ch,r);;){var w=d(T,o);if(!w)break;var x=new K(i,a.line,a.ch,r),L=s(x,w.tag);if(L)return{open:w,close:L}}},J.scanForClosingTag=function(i,a,r,o){var T=new K(i,a.line,a.ch,o?{from:0,to:o}:null);return s(T,r)}})},"p/48":function(Ue,de,M){},p5ED:function(Ue,de,M){"use strict";var J=M("+L6B"),z=M("2/Rp"),D=M("5Dmo"),V=M("3S7+"),N=M("k1fw"),O=M("9og8"),K=M("tJVT"),W=M("WmNS"),n=M.n(W),I=M("q1tI"),g=M.n(I),f=M("vHTk"),h=M.n(f),c=M("yEEn"),s=M("ZW9T"),d=M("1vsH"),i=M("V0Rq"),a=M("m3rI");de.a=function(r){var o,T,w,x,L,A,_,b=r.editOffice,m=b===void 0?"view":b,p=r.data,C=r.theme,E=r.type,v=r.filename,P=r.monacoEditor,F=r.className,R=r.style,H=r.close,U=r.onClose,S=r.hasMask,G=r.disabledDownload,Q=Object(I.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),se=Object(K.a)(Q,2),fe=se[0],we=se[1],be=Object(I.useState)(""),Se=Object(K.a)(be,2),Ae=Se[0],De=Se[1],ve=Object(I.useState)(),Y=Object(K.a)(ve,2),k=Y[0],B=Y[1],Z=window.ENV==="build"?"/react/build":"",re=a.a.PROXY_SERVER||location.origin,X,ye=1024*1024,Me=10*ye,He=Object(I.useRef)();(o=p)!==null&&o!==void 0&&o.startsWith("/api")&&E!=="txt"&&(p=(a.a.API_SERVER||location.origin)+p),E==="office"&&(X=Object(d.T)(p).filesize,X>Me&&(E="other")),v&&P&&(P.filename=v),Object(I.useEffect)(function(){var Pe,Ye,tt=(Pe=document.cookie)===null||Pe===void 0||((Ye=Pe.replace(/\s/g,""))===null||Ye===void 0)?void 0:Ye.split(";");tt==null||tt.map(function(ut){var lt=ut.split("=");lt[0]==="_educoder_session"&&De(lt[1])})},[]),Object(I.useEffect)(function(){E==="office"&&me()},[E,p]);var me=function(){var Pe=Object(O.a)(n.a.mark(function Ye(){var tt,ut,lt;return n.a.wrap(function(ht){for(;;)switch(ht.prev=ht.next){case 0:return console.log("data:",p),tt=p,p.startsWith("http")||(tt=location.origin+tt),ut=new URL(tt).pathname.split("/").pop(),ht.next=6,Object(i.V)({attachment_id:ut});case 6:lt=ht.sent,B(lt);case 8:case"end":return ht.stop()}},Ye)}));return function(){return Pe.apply(this,arguments)}}(),Ee=function(){if(p.startsWith("http")||p.startsWith("blob:")){Le();return}Object(d.z)(v||"educoder",p,v)},Le=function(){Object(d.x)(v||"educoder",decodeURIComponent(p))};return g.a.createElement("div",{style:Object(N.a)({},R||{}),className:"".concat(S&&h.a.bgBlack," ").concat(E?h.a.wrp:"hide")},H&&g.a.createElement("div",{className:h.a.close,ref:He},!G&&g.a.createElement(V.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return He.current}},g.a.createElement("span",{onClick:Le},g.a.createElement("i",{className:"icon-quxiaozhiding"}))),g.a.createElement(V.a,{title:"\u5173\u95ED",getPopupContainer:function(){return He.current}},g.a.createElement("span",{className:"",onClick:U},g.a.createElement("i",{className:"icon-guanbi1"})))),g.a.createElement("div",{className:"".concat(h.a[F]," ").concat(F," ").concat(h.a.monaco," ").concat(E==="txt"?"show":"hide")},E==="txt"&&g.a.createElement(s.b,P)),E==="audio"&&g.a.createElement("audio",{src:"".concat(((T=p)===null||T===void 0?void 0:T.indexOf("http://"))>-1||((w=p)===null||w===void 0?void 0:w.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(p),autoPlay:!0}),E==="video"&&g.a.createElement(g.a.Fragment,null,((x=p)===null||x===void 0?void 0:x.indexOf("http"))>-1?g.a.createElement("video",{controls:!0,src:"".concat(p),autoPlay:!0}):g.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(p),autoPlay:!0})),E==="office"&&k&&g.a.createElement("iframe",{src:"".concat(Z,"/office.html?key=").concat(k.key,"&url=").concat(re+k.url,"&callbackUrl=").concat(re+k.callbackUrl,"&fileType=").concat(k.fileType,"&title=").concat(k.title,"&model=").concat(m,"&officeServer=").concat(a.a.OFFICE_SERVER,"&disabledDownload=").concat(!!G)}),E==="html"&&g.a.createElement("iframe",{src:p+"&disposition=inline"}),E==="pdf"&&g.a.createElement("iframe",{src:"".concat(Z,"/js/pdfview/index.html?url=").concat(p,"&disabledDownload=").concat(!!G)}),E==="image"&&g.a.createElement("img",{src:"".concat(((L=p)===null||L===void 0?void 0:L.indexOf("http://"))>-1||((A=p)===null||A===void 0?void 0:A.indexOf("https://"))>-1||(_=p)!==null&&_!==void 0&&_.startsWith("/api")?"":"data:image/png;base64,").concat(p)}),E==="other"&&g.a.createElement("div",null,g.a.createElement(z.a,{type:"primary",size:"large",onClick:Ee},g.a.createElement(c.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),E==="download"&&g.a.createElement(z.a,{type:"primary",size:"large",onClick:Ee},g.a.createElement(c.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Ue,de,M){},pPuO:function(Ue,de,M){Ue.exports={desc:"desc___2o_2w",info:"info___Uro3x","commit-info":"commit-info___o2-Ex"}},pmY6:function(Ue,de,M){"use strict";M.d(de,"h",function(){return I}),M.d(de,"g",function(){return f}),M.d(de,"f",function(){return h}),M.d(de,"e",function(){return c}),M.d(de,"i",function(){return s}),M.d(de,"b",function(){return d}),M.d(de,"a",function(){return i}),M.d(de,"d",function(){return a}),M.d(de,"c",function(){return r});var J=M("C/vA"),z=M("JYp7");const D=!1;let V=null;function N(o){V=o}if(D){const o="__is_disposable_tracked__";N(new class{trackDisposable(T){const w=new Error("Potentially leaked disposable").stack;setTimeout(()=>{T[o]||console.log(w)},3e3)}setParent(T,w){if(T&&T!==i.None)try{T[o]=!0}catch(x){}}markAsDisposed(T){if(T&&T!==i.None)try{T[o]=!0}catch(w){}}markAsSingleton(T){}})}function O(o){return V==null||V.trackDisposable(o),o}function K(o){V==null||V.markAsDisposed(o)}function W(o,T){V==null||V.setParent(o,T)}function n(o,T){if(!V)return;for(const w of o)V.setParent(w,T)}function I(o){return V==null||V.markAsSingleton(o),o}class g extends Error{constructor(o){super(`Encountered errors while disposing of store. Errors: [${o.join(", ")}]`);this.errors=o}}function f(o){return typeof o.dispose=="function"&&o.dispose.length===0}function h(o){if(z.a.is(o)){let T=[];for(const w of o)if(w)try{w.dispose()}catch(x){T.push(x)}if(T.length===1)throw T[0];if(T.length>1)throw new g(T);return Array.isArray(o)?[]:o}else if(o)return o.dispose(),o}function c(...o){const T=s(()=>h(o));return n(o,T),T}function s(o){const T=O({dispose:Object(J.a)(()=>{K(T),o()})});return T}class d{constructor(){this._toDispose=new Set,this._isDisposed=!1,O(this)}dispose(){if(this._isDisposed)return;K(this),this._isDisposed=!0,this.clear()}clear(){try{h(this._toDispose.values())}finally{this._toDispose.clear()}}add(o){if(!o)return o;if(o===this)throw new Error("Cannot register a disposable on itself!");return W(o,this),this._isDisposed?d.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(o),o}}d.DISABLE_DISPOSED_WARNING=!1;class i{constructor(){this._store=new d,O(this),W(this._store,this)}dispose(){K(this),this._store.dispose()}_register(o){if(o===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(o)}}i.None=Object.freeze({dispose(){}});class a{constructor(){this._isDisposed=!1,O(this)}get value(){return this._isDisposed?void 0:this._value}set value(o){var T;if(this._isDisposed||o===this._value)return;(T=this._value)===null||T===void 0||T.dispose(),o&&W(o,this),this._value=o}clear(){this.value=void 0}dispose(){var o;this._isDisposed=!0,K(this),(o=this._value)===null||o===void 0||o.dispose(),this._value=void 0}clearAndLeak(){const o=this._value;return this._value=void 0,o&&W(o,null),o}}class r{constructor(o){this.object=o}dispose(){}}},psGv:function(Ue,de,M){var J,z;(function(){var D;(function(){"use strict";var K=[,,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 d=this.__items.length-1;d>=0;d--)if(this.__items[d].match(s))return!0;return!1},f.prototype.set_indent=function(s,d){this.is_empty()&&(this.__indent_count=s||0,this.__alignment_count=d||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 d=s.lastIndexOf(`
`);d!==-1?this.__character_count=s.length-d: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 h(s,d){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)),d=d||"",s.indent_level>0&&(d=new Array(s.indent_level+1).join(this.__indent_string)),this.__base_string=d,this.__base_string_length=d.length}h.prototype.get_indent_size=function(s,d){var i=this.__base_string_length;return d=d||0,s<0&&(i=0),i+=s*this.__indent_size,i+=d,i},h.prototype.get_indent_string=function(s,d){var i=this.__base_string;return d=d||0,s<0&&(s=0,i=""),d+=s*this.__indent_size,this.__ensure_cache(d),i+=this.__cache[d],i},h.prototype.__ensure_cache=function(s){for(;s>=this.__cache.length;)this.__add_column()},h.prototype.__add_column=function(){var s=this.__cache.length,d=0,i="";this.__indent_size&&s>=this.__indent_size&&(d=Math.floor(s/this.__indent_size),s-=d*this.__indent_size,i=new Array(d+1).join(this.__indent_string)),s&&(i+=new Array(s+1).join(" ")),this.__cache.push(i)};function c(s,d){this.__indent_cache=new h(s,d),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()}c.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},c.prototype.get_line_number=function(){return this.__lines.length},c.prototype.get_indent_string=function(s,d){return this.__indent_cache.get_indent_string(s,d)},c.prototype.get_indent_size=function(s,d){return this.__indent_cache.get_indent_size(s,d)},c.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},c.prototype.add_new_line=function(s){return this.is_empty()||!s&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},c.prototype.get_code=function(s){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 i=this.__lines.join(`
`);return s!==`
`&&(i=i.replace(/[\n]/g,s)),i},c.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},c.prototype.set_indent=function(s,d){return s=s||0,d=d||0,this.next_line.set_indent(s,d),this.__lines.length>1?(this.current_line.set_indent(s,d),!0):(this.current_line.set_indent(),!1)},c.prototype.add_raw_token=function(s){for(var d=0;d<s.newlines;d++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(s.whitespace_before),this.current_line.push(s.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},c.prototype.add_token=function(s){this.__add_space_before_token(),this.current_line.push(s),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},c.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},c.prototype.remove_indent=function(s){for(var d=this.__lines.length;s<d;)this.__lines[s]._remove_indent(),s++;this.current_line._remove_wrap_indent()},c.prototype.trim=function(s){for(s=s===void 0?!1:s,this.current_line.trim();s&&this.__lines.length>1&&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},c.prototype.just_added_newline=function(){return this.current_line.is_empty()},c.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},c.prototype.ensure_empty_line_above=function(s,d){for(var i=this.__lines.length-2;i>=0;){var a=this.__lines[i];if(a.is_empty())break;if(a.item(0).indexOf(s)!==0&&a.item(-1)!==d){this.__lines.splice(i+1,0,new f(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},g.exports.Output=c},function(g){function f(h,c,s,d){this.type=h,this.text=c,this.comments_before=null,this.newlines=s||0,this.whitespace_before=d||"",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,d){this.raw_options=h(s,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"])}f.prototype._get_array=function(s,d){var i=this.raw_options[s],a=d||[];return typeof i=="object"?i!==null&&typeof i.concat=="function"&&(a=i.concat()):typeof i=="string"&&(a=i.split(/[^a-zA-Z0-9_\/\-]+/)),a},f.prototype._get_boolean=function(s,d){var i=this.raw_options[s],a=i===void 0?!!d:!!i;return a},f.prototype._get_characters=function(s,d){var i=this.raw_options[s],a=d||"";return typeof i=="string"&&(a=i.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),a},f.prototype._get_number=function(s,d){var i=this.raw_options[s];d=parseInt(d,10),isNaN(d)&&(d=0);var a=parseInt(i,10);return isNaN(a)&&(a=d),a},f.prototype._get_selection=function(s,d,i){var a=this._get_selection_list(s,d,i);if(a.length!==1)throw new Error("Invalid Option Value: The option '"+s+`' can only be one of the following values:
`+d+`
You passed in: '`+this.raw_options[s]+"'");return a[0]},f.prototype._get_selection_list=function(s,d,i){if(!d||d.length===0)throw new Error("Selection list cannot be empty.");if(i=i||[d[0]],!this._is_valid_selection(i,d))throw new Error("Invalid Default Value!");var a=this._get_array(s,i);if(!this._is_valid_selection(a,d))throw new Error("Invalid Option Value: The option '"+s+`' can contain only the following values:
`+d+`
You passed in: '`+this.raw_options[s]+"'");return a},f.prototype._is_valid_selection=function(s,d){return s.length&&d.length&&!s.some(function(i){return d.indexOf(i)===-1})};function h(s,d){var i={};s=c(s);var a;for(a in s)a!==d&&(i[a]=s[a]);if(d&&s[d])for(a in s[d])i[a]=s[d][a];return i}function c(s){var d={},i;for(i in s){var a=i.replace(/-/g,"_");d[a]=s[i]}return d}g.exports.Options=f,g.exports.normalizeOpts=c,g.exports.mergeOpts=h},,function(g){var f=RegExp.prototype.hasOwnProperty("sticky");function h(c){this.__input=c||"",this.__input_length=this.__input.length,this.__position=0}h.prototype.restart=function(){this.__position=0},h.prototype.back=function(){this.__position>0&&(this.__position-=1)},h.prototype.hasNext=function(){return this.__position<this.__input_length},h.prototype.next=function(){var c=null;return this.hasNext()&&(c=this.__input.charAt(this.__position),this.__position+=1),c},h.prototype.peek=function(c){var s=null;return c=c||0,c+=this.__position,c>=0&&c<this.__input_length&&(s=this.__input.charAt(c)),s},h.prototype.__match=function(c,s){c.lastIndex=s;var d=c.exec(this.__input);return d&&!(f&&c.sticky)&&(d.index!==s&&(d=null)),d},h.prototype.test=function(c,s){return s=s||0,s+=this.__position,s>=0&&s<this.__input_length?!!this.__match(c,s):!1},h.prototype.testChar=function(c,s){var d=this.peek(s);return c.lastIndex=0,d!==null&&c.test(d)},h.prototype.match=function(c){var s=this.__match(c,this.__position);return s?this.__position+=s[0].length:s=null,s},h.prototype.read=function(c,s,d){var i="",a;return c&&(a=this.match(c),a&&(i+=a[0])),s&&(a||!c)&&(i+=this.readUntil(s,d)),i},h.prototype.readUntil=function(c,s){var d="",i=this.__position;c.lastIndex=this.__position;var a=c.exec(this.__input);return a?(i=a.index,s&&(i+=a[0].length)):i=this.__input_length,d=this.__input.substring(this.__position,i),this.__position=i,d},h.prototype.readUntilAfter=function(c){return this.readUntil(c,!0)},h.prototype.get_regexp=function(c,s){var d=null,i="g";return s&&f&&(i="y"),typeof c=="string"&&c!==""?d=new RegExp(c,i):c&&(d=new RegExp(c.source,i)),d},h.prototype.get_literal_regexp=function(c){return RegExp(c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},h.prototype.peekUntilAfter=function(c){var s=this.__position,d=this.readUntilAfter(c);return this.__position=s,d},h.prototype.lookBack=function(c){var s=this.__position-1;return s>=c.length&&this.__input.substring(s-c.length,s).toLowerCase()===c},g.exports.InputScanner=h},function(g,f,h){var c=h(8).InputScanner,s=h(3).Token,d=h(10).TokenStream,i=h(11).WhitespacePattern,a={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},r=function(o,T){this._input=new c(o),this._options=T||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new i(this._input)};r.prototype.tokenize=function(){this._input.restart(),this.__tokens=new d,this._reset();for(var o,T=new s(a.START,""),w=null,x=[],L=new d;T.type!==a.EOF;){for(o=this._get_next_token(T,w);this._is_comment(o);)L.add(o),o=this._get_next_token(T,w);L.isEmpty()||(o.comments_before=L,L=new d),o.parent=w,this._is_opening(o)?(x.push(w),w=o):w&&this._is_closing(o,w)&&(o.opened=w,w.closed=o,w=x.pop(),o.parent=w),o.previous=T,T.next=o,this.__tokens.add(o),T=o}return this.__tokens},r.prototype._is_first_token=function(){return this.__tokens.isEmpty()},r.prototype._reset=function(){},r.prototype._get_next_token=function(o,T){this._readWhitespace();var w=this._input.read(/.+/g);return w?this._create_token(a.RAW,w):this._create_token(a.EOF,"")},r.prototype._is_comment=function(o){return!1},r.prototype._is_opening=function(o){return!1},r.prototype._is_closing=function(o,T){return!1},r.prototype._create_token=function(o,T){var w=new s(o,T,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return w},r.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},g.exports.Tokenizer=r,g.exports.TOKEN=a},function(g){function f(h){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=h}f.prototype.restart=function(){this.__position=0},f.prototype.isEmpty=function(){return this.__tokens_length===0},f.prototype.hasNext=function(){return this.__position<this.__tokens_length},f.prototype.next=function(){var h=null;return this.hasNext()&&(h=this.__tokens[this.__position],this.__position+=1),h},f.prototype.peek=function(h){var c=null;return h=h||0,h+=this.__position,h>=0&&h<this.__tokens_length&&(c=this.__tokens[h]),c},f.prototype.add=function(h){this.__parent_token&&(h.parent=this.__parent_token),this.__tokens.push(h),this.__tokens_length+=1},g.exports.TokenStream=f},function(g,f,h){var c=h(12).Pattern;function s(d,i){c.call(this,d,i),i?this._line_regexp=this._input.get_regexp(i._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}s.prototype=new c,s.prototype.__set_whitespace_patterns=function(d,i){d+="\\t ",i+="\\n\\r",this._match_pattern=this._input.get_regexp("["+d+i+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+i+"]")},s.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var d=this._input.read(this._match_pattern);if(d===" ")this.whitespace_before_token=" ";else if(d){var i=this.__split(this._newline_regexp,d);this.newline_count=i.length-1,this.whitespace_before_token=i[this.newline_count]}return d},s.prototype.matching=function(d,i){var a=this._create();return a.__set_whitespace_patterns(d,i),a._update(),a},s.prototype._create=function(){return new s(this._input,this)},s.prototype.__split=function(d,i){d.lastIndex=0;for(var a=0,r=[],o=d.exec(i);o;)r.push(i.substring(a,o.index)),a=o.index+o[0].length,o=d.exec(i);return a<i.length?r.push(i.substring(a,i.length)):r.push(""),r},g.exports.WhitespacePattern=s},function(g){function f(h,c){this._input=h,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,c&&(this._starting_pattern=this._input.get_regexp(c._starting_pattern,!0),this._match_pattern=this._input.get_regexp(c._match_pattern,!0),this._until_pattern=this._input.get_regexp(c._until_pattern),this._until_after=c._until_after)}f.prototype.read=function(){var h=this._input.read(this._starting_pattern);return(!this._starting_pattern||h)&&(h+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),h},f.prototype.read_match=function(){return this._input.match(this._match_pattern)},f.prototype.until_after=function(h){var c=this._create();return c._until_after=!0,c._until_pattern=this._input.get_regexp(h),c._update(),c},f.prototype.until=function(h){var c=this._create();return c._until_after=!1,c._until_pattern=this._input.get_regexp(h),c._update(),c},f.prototype.starting_with=function(h){var c=this._create();return c._starting_pattern=this._input.get_regexp(h,!0),c._update(),c},f.prototype.matching=function(h){var c=this._create();return c._match_pattern=this._input.get_regexp(h,!0),c._update(),c},f.prototype._create=function(){return new f(this._input,this)},f.prototype._update=function(){},g.exports.Pattern=f},function(g){function f(h,c){h=typeof h=="string"?h:h.source,c=typeof c=="string"?c:c.source,this.__directives_block_pattern=new RegExp(h+/ beautify( \w+[:]\w+)+ /.source+c,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(h+/\sbeautify\signore:end\s/.source+c,"g")}f.prototype.get_directives=function(h){if(!h.match(this.__directives_block_pattern))return null;var c={};this.__directive_pattern.lastIndex=0;for(var s=this.__directive_pattern.exec(h);s;)c[s[1]]=s[2],s=this.__directive_pattern.exec(h);return c},f.prototype.readIgnored=function(h){return h.readUntilAfter(this.__directives_end_ignore_pattern)},g.exports.Directives=f},function(g,f,h){var c=h(12).Pattern,s={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function d(i,a){c.call(this,i,a),this.__template_pattern=null,this._disabled=Object.assign({},s),this._excluded=Object.assign({},s),a&&(this.__template_pattern=this._input.get_regexp(a.__template_pattern),this._excluded=Object.assign(this._excluded,a._excluded),this._disabled=Object.assign(this._disabled,a._disabled));var r=new c(i);this.__patterns={handlebars_comment:r.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:r.starting_with(/{{{/).until_after(/}}}/),handlebars:r.starting_with(/{{/).until_after(/}}/),php:r.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),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 c,d.prototype._create=function(){return new d(this._input,this)},d.prototype._update=function(){this.__set_templated_pattern()},d.prototype.disable=function(i){var a=this._create();return a._disabled[i]=!0,a._update(),a},d.prototype.read_options=function(i){var a=this._create();for(var r in s)a._disabled[r]=i.templating.indexOf(r)===-1;return a._update(),a},d.prototype.exclude=function(i){var a=this._create();return a._excluded[i]=!0,a._update(),a},d.prototype.read=function(){var i="";this._match_pattern?i=this._input.read(this._starting_pattern):i=this._input.read(this._starting_pattern,this.__template_pattern);for(var a=this._read_template();a;)this._match_pattern?a+=this._input.read(this._match_pattern):a+=this._input.readUntil(this.__template_pattern),i+=a,a=this._read_template();return this._until_after&&(i+=this._input.readUntilAfter(this._until_pattern)),i},d.prototype.__set_templated_pattern=function(){var i=[];this._disabled.php||i.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||i.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||i.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(i.push(this.__patterns.django._starting_pattern.source),i.push(this.__patterns.django_value._starting_pattern.source),i.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||i.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&i.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+i.join("|")+")")},d.prototype._read_template=function(){var i="",a=this._input.peek();if(a==="<"){var r=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&r==="?"&&(i=i||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&r==="%"&&(i=i||this.__patterns.erb.read())}else a==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(i=i||this.__patterns.handlebars_comment.read(),i=i||this.__patterns.handlebars_unescaped.read(),i=i||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(i=i||this.__patterns.django_value.read()),this._excluded.django||(i=i||this.__patterns.django_comment.read(),i=i||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(i=i||this.__patterns.smarty_comment.read(),i=i||this.__patterns.smarty_literal.read(),i=i||this.__patterns.smarty.read()));return i},g.exports.TemplatablePattern=d},,,,function(g,f,h){var c=h(19).Beautifier,s=h(20).Options;function d(i,a,r,o){var T=new c(i,a,r,o);return T.beautify()}g.exports=d,g.exports.defaultOptions=function(){return new s}},function(g,f,h){var c=h(20).Options,s=h(2).Output,d=h(21).Tokenizer,i=h(21).TOKEN,a=/\r\n|[\r\n]/,r=/\r\n|[\r\n]/g,o=function(C,E){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=C.max_preserve_newlines,this.preserve_newlines=C.preserve_newlines,this._output=new s(C,E)};o.prototype.current_line_has_match=function(C){return this._output.current_line.has_match(C)},o.prototype.set_space_before_token=function(C,E){this._output.space_before_token=C,this._output.non_breaking_space=E},o.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},o.prototype.add_raw_token=function(C){this._output.add_raw_token(C)},o.prototype.print_preserved_newlines=function(C){var E=0;C.type!==i.TEXT&&C.previous.type!==i.TEXT&&(E=C.newlines?1:0),this.preserve_newlines&&(E=C.newlines<this.max_preserve_newlines+1?C.newlines:this.max_preserve_newlines+1);for(var v=0;v<E;v++)this.print_newline(v>0);return E!==0},o.prototype.traverse_whitespace=function(C){return C.whitespace_before||C.newlines?(this.print_preserved_newlines(C)||(this._output.space_before_token=!0),!0):!1},o.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},o.prototype.print_newline=function(C){this._output.add_new_line(C)},o.prototype.print_token=function(C){C.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(C.text))},o.prototype.indent=function(){this.indent_level++},o.prototype.get_full_indent=function(C){return C=this.indent_level+(C||0),C<1?"":this._output.get_indent_string(C)};var T=function(C){for(var E=null,v=C.next;v.type!==i.EOF&&C.closed!==v;){if(v.type===i.ATTRIBUTE&&v.text==="type"){v.next&&v.next.type===i.EQUALS&&v.next.next&&v.next.next.type===i.VALUE&&(E=v.next.next.text);break}v=v.next}return E},w=function(C,E){var v=null,P=null;return E.closed?(C==="script"?v="text/javascript":C==="style"&&(v="text/css"),v=T(E)||v,v.search("text/css")>-1?P="css":v.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?P="javascript":v.search(/(text|application|dojo)\/(x-)?(html)/)>-1?P="html":v.search(/test\/null/)>-1&&(P="null"),P):null};function x(C,E){return E.indexOf(C)!==-1}function L(C,E,v){this.parent=C||null,this.tag=E?E.tag_name:"",this.indent_level=v||0,this.parser_token=E||null}function A(C){this._printer=C,this._current_frame=null}A.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},A.prototype.record_tag=function(C){var E=new L(this._current_frame,C,this._printer.indent_level);this._current_frame=E},A.prototype._try_pop_frame=function(C){var E=null;return C&&(E=C.parser_token,this._printer.indent_level=C.indent_level,this._current_frame=C.parent),E},A.prototype._get_frame=function(C,E){for(var v=this._current_frame;v&&!(C.indexOf(v.tag)!==-1);){if(E&&E.indexOf(v.tag)!==-1){v=null;break}v=v.parent}return v},A.prototype.try_pop=function(C,E){var v=this._get_frame([C],E);return this._try_pop_frame(v)},A.prototype.indent_to_tag=function(C){var E=this._get_frame(C);E&&(this._printer.indent_level=E.indent_level)};function _(C,E,v,P){this._source_text=C||"",E=E||{},this._js_beautify=v,this._css_beautify=P,this._tag_stack=null;var F=new c(E,"html");this._options=F,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}_.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var C=this._source_text,E=this._options.eol;this._options.eol==="auto"&&(E=`
`,C&&a.test(C)&&(E=C.match(a)[0])),C=C.replace(r,`
`);var v=C.match(/^[\t ]*/)[0],P={text:"",type:""},F=new b,R=new o(this._options,v),H=new d(C,this._options).tokenize();this._tag_stack=new A(R);for(var U=null,S=H.next();S.type!==i.EOF;)S.type===i.TAG_OPEN||S.type===i.COMMENT?(U=this._handle_tag_open(R,S,F,P),F=U):S.type===i.ATTRIBUTE||S.type===i.EQUALS||S.type===i.VALUE||S.type===i.TEXT&&!F.tag_complete?U=this._handle_inside_tag(R,S,F,H):S.type===i.TAG_CLOSE?U=this._handle_tag_close(R,S,F):S.type===i.TEXT?U=this._handle_text(R,S,F):R.add_raw_token(S),P=U,S=H.next();var G=R._output.get_code(E);return G},_.prototype._handle_tag_close=function(C,E,v){var P={text:E.text,type:E.type};return C.alignment_size=0,v.tag_complete=!0,C.set_space_before_token(E.newlines||E.whitespace_before!=="",!0),v.is_unformatted?C.add_raw_token(E):(v.tag_start_char==="<"&&(C.set_space_before_token(E.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&v.has_wrapped_attrs&&C.print_newline(!1)),C.print_token(E)),v.indent_content&&!(v.is_unformatted||v.is_content_unformatted)&&(C.indent(),v.indent_content=!1),!v.is_inline_element&&!(v.is_unformatted||v.is_content_unformatted)&&C.set_wrap_point(),P},_.prototype._handle_inside_tag=function(C,E,v,P){var F=v.has_wrapped_attrs,R={text:E.text,type:E.type};if(C.set_space_before_token(E.newlines||E.whitespace_before!=="",!0),v.is_unformatted)C.add_raw_token(E);else if(v.tag_start_char==="{"&&E.type===i.TEXT)C.print_preserved_newlines(E)?(E.newlines=0,C.add_raw_token(E)):C.print_token(E);else{if(E.type===i.ATTRIBUTE?(C.set_space_before_token(!0),v.attr_count+=1):(E.type===i.EQUALS||E.type===i.VALUE&&E.previous.type===i.EQUALS)&&C.set_space_before_token(!1),E.type===i.ATTRIBUTE&&v.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(C.traverse_whitespace(E),F=F||E.newlines!==0),this._is_wrap_attributes_force)){var H=v.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&v.attr_count===1){var U=!0,S=0,G;do{if(G=P.peek(S),G.type===i.ATTRIBUTE){U=!1;break}S+=1}while(S<4&&G.type!==i.EOF&&G.type!==i.TAG_CLOSE);H=!U}H&&(C.print_newline(!1),F=!0)}C.print_token(E),F=F||C.previous_token_wrapped(),v.has_wrapped_attrs=F}return R},_.prototype._handle_text=function(C,E,v){var P={text:E.text,type:"TK_CONTENT"};return v.custom_beautifier_name?this._print_custom_beatifier_text(C,E,v):v.is_unformatted||v.is_content_unformatted?C.add_raw_token(E):(C.traverse_whitespace(E),C.print_token(E)),P},_.prototype._print_custom_beatifier_text=function(C,E,v){var P=this;if(E.text!==""){var F=E.text,R,H=1,U="",S="";v.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?R=this._js_beautify:v.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?R=this._css_beautify:v.custom_beautifier_name==="html"&&(R=function(be,Se){var Ae=new _(be,Se,P._js_beautify,P._css_beautify);return Ae.beautify()}),this._options.indent_scripts==="keep"?H=0:this._options.indent_scripts==="separate"&&(H=-C.indent_level);var G=C.get_full_indent(H);if(F=F.replace(/\n[ \t]*$/,""),v.custom_beautifier_name!=="html"&&F[0]==="<"&&F.match(/^(<!--|<!\[CDATA\[)/)){var Q=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(F);if(!Q){C.add_raw_token(E);return}U=G+Q[1]+`
`,F=Q[4],Q[5]&&(S=G+Q[5]),F=F.replace(/\n[ \t]*$/,""),(Q[2]||Q[3].indexOf(`
`)!==-1)&&(Q=Q[3].match(/[ \t]+$/),Q&&(E.whitespace_before=Q[0]))}if(F)if(R){var se=function(){this.eol=`
`};se.prototype=this._options.raw_options;var fe=new se;F=R(G+F,fe)}else{var we=E.whitespace_before;we&&(F=F.replace(new RegExp(`
(`+we+")?","g"),`
`)),F=G+F.replace(/\n/g,`
`+G)}U&&(F?F=U+F+`
`+S:F=U+S),C.print_newline(!1),F&&(E.text=F,E.whitespace_before="",E.newlines=0,C.add_raw_token(E),C.print_newline(!0))}},_.prototype._handle_tag_open=function(C,E,v,P){var F=this._get_tag_open_token(E);return(v.is_unformatted||v.is_content_unformatted)&&!v.is_empty_element&&E.type===i.TAG_OPEN&&E.text.indexOf("</")===0?(C.add_raw_token(E),F.start_tag_token=this._tag_stack.try_pop(F.tag_name)):(C.traverse_whitespace(E),this._set_tag_position(C,E,F,v,P),F.is_inline_element||C.set_wrap_point(),C.print_token(E)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(F.alignment_size=E.text.length+1),!F.tag_complete&&!F.is_unformatted&&(C.alignment_size=F.alignment_size),F};var b=function(C,E){if(this.parent=C||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!E)this.tag_complete=!0;else{var v;this.tag_start_char=E.text[0],this.text=E.text,this.tag_start_char==="<"?(v=E.text.match(/^<([^\s>]*)/),this.tag_check=v?v[1]:""):(v=E.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=v?v[1]:"",(E.text.startsWith("{{#>")||E.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&E.next!==null?this.tag_check=E.next.text.split(" ")[0]:this.tag_check=E.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),E.type===i.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||E.closed&&E.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)))}};_.prototype._get_tag_open_token=function(C){var E=new b(this._tag_stack.get_parser_token(),C);return E.alignment_size=this._options.wrap_attributes_indent_size,E.is_end_tag=E.is_end_tag||x(E.tag_check,this._options.void_elements),E.is_empty_element=E.tag_complete||E.is_start_tag&&E.is_end_tag,E.is_unformatted=!E.tag_complete&&x(E.tag_check,this._options.unformatted),E.is_content_unformatted=!E.is_empty_element&&x(E.tag_check,this._options.content_unformatted),E.is_inline_element=x(E.tag_name,this._options.inline)||E.tag_name.includes("-")||E.tag_start_char==="{",E},_.prototype._set_tag_position=function(C,E,v,P,F){if(v.is_empty_element||(v.is_end_tag?v.start_tag_token=this._tag_stack.try_pop(v.tag_name):(this._do_optional_end_element(v)&&(v.is_inline_element||C.print_newline(!1)),this._tag_stack.record_tag(v),(v.tag_name==="script"||v.tag_name==="style")&&!(v.is_unformatted||v.is_content_unformatted)&&(v.custom_beautifier_name=w(v.tag_check,E)))),x(v.tag_check,this._options.extra_liners)&&(C.print_newline(!1),C._output.just_added_blankline()||C.print_newline(!0)),v.is_empty_element){if(v.tag_start_char==="{"&&v.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),v.indent_content=!0;var R=C.current_line_has_match(/{{#if/);R||C.print_newline(!1)}v.tag_name==="!--"&&F.type===i.TAG_CLOSE&&P.is_end_tag&&v.text.indexOf(`
`)===-1||(v.is_inline_element||v.is_unformatted||C.print_newline(!1),this._calcluate_parent_multiline(C,v))}else if(v.is_end_tag){var H=!1;H=v.start_tag_token&&v.start_tag_token.multiline_content,H=H||!v.is_inline_element&&!(P.is_inline_element||P.is_unformatted)&&!(F.type===i.TAG_CLOSE&&v.start_tag_token===P)&&F.type!=="TK_CONTENT",(v.is_content_unformatted||v.is_unformatted)&&(H=!1),H&&C.print_newline(!1)}else v.indent_content=!v.custom_beautifier_name,v.tag_start_char==="<"&&(v.tag_name==="html"?v.indent_content=this._options.indent_inner_html:v.tag_name==="head"?v.indent_content=this._options.indent_head_inner_html:v.tag_name==="body"&&(v.indent_content=this._options.indent_body_inner_html)),!(v.is_inline_element||v.is_unformatted)&&(F.type!=="TK_CONTENT"||v.is_content_unformatted)&&C.print_newline(!1),this._calcluate_parent_multiline(C,v)},_.prototype._calcluate_parent_multiline=function(C,E){E.parent&&C._output.just_added_newline()&&!((E.is_inline_element||E.is_unformatted)&&E.parent.is_inline_element)&&(E.parent.multiline_content=!0)};var m=["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"],p=["a","audio","del","ins","map","noscript","video"];_.prototype._do_optional_end_element=function(C){var E=null;if(C.is_empty_element||!C.is_start_tag||!C.parent)return;if(C.tag_name==="body")E=E||this._tag_stack.try_pop("head");else if(C.tag_name==="li")E=E||this._tag_stack.try_pop("li",["ol","ul"]);else if(C.tag_name==="dd"||C.tag_name==="dt")E=E||this._tag_stack.try_pop("dt",["dl"]),E=E||this._tag_stack.try_pop("dd",["dl"]);else if(C.parent.tag_name==="p"&&m.indexOf(C.tag_name)!==-1){var v=C.parent.parent;(!v||p.indexOf(v.tag_name)===-1)&&(E=E||this._tag_stack.try_pop("p"))}else C.tag_name==="rp"||C.tag_name==="rt"?(E=E||this._tag_stack.try_pop("rt",["ruby","rtc"]),E=E||this._tag_stack.try_pop("rp",["ruby","rtc"])):C.tag_name==="optgroup"?E=E||this._tag_stack.try_pop("optgroup",["select"]):C.tag_name==="option"?E=E||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):C.tag_name==="colgroup"?E=E||this._tag_stack.try_pop("caption",["table"]):C.tag_name==="thead"?(E=E||this._tag_stack.try_pop("caption",["table"]),E=E||this._tag_stack.try_pop("colgroup",["table"])):C.tag_name==="tbody"||C.tag_name==="tfoot"?(E=E||this._tag_stack.try_pop("caption",["table"]),E=E||this._tag_stack.try_pop("colgroup",["table"]),E=E||this._tag_stack.try_pop("thead",["table"]),E=E||this._tag_stack.try_pop("tbody",["table"])):C.tag_name==="tr"?(E=E||this._tag_stack.try_pop("caption",["table"]),E=E||this._tag_stack.try_pop("colgroup",["table"]),E=E||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(C.tag_name==="th"||C.tag_name==="td")&&(E=E||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),E=E||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return C.parent=this._tag_stack.get_parser_token(),E},g.exports.Beautifier=_},function(g,f,h){var c=h(6).Options;function s(d){c.call(this,d,"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 c,g.exports.Options=s},function(g,f,h){var c=h(9).Tokenizer,s=h(9).TOKEN,d=h(13).Directives,i=h(14).TemplatablePattern,a=h(12).Pattern,r={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},o=new d(/<\!--/,/-->/),T=function(w,x){c.call(this,w,x),this._current_tag_name="";var L=new i(this._input).read_options(this._options),A=new a(this._input);if(this.__patterns={word:L.until(/[\n\r\t <]/),single_quote:L.until_after(/'/),double_quote:L.until_after(/"/),attribute:L.until(/[\n\r\t =>]|\/>/),element_name:L.until(/[\n\r\t >\/]/),handlebars_comment:A.starting_with(/{{!--/).until_after(/--}}/),handlebars:A.starting_with(/{{/).until_after(/}}/),handlebars_open:A.until(/[\n\r\t }]/),handlebars_raw_close:A.until(/}}/),comment:A.starting_with(/<!--/).until_after(/-->/),cdata:A.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:A.starting_with(/<!\[/).until_after(/]>/),processing:A.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 _=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=A.matching(_).until_after(_)}};T.prototype=new c,T.prototype._is_comment=function(w){return!1},T.prototype._is_opening=function(w){return w.type===r.TAG_OPEN},T.prototype._is_closing=function(w,x){return w.type===r.TAG_CLOSE&&x&&((w.text===">"||w.text==="/>")&&x.text[0]==="<"||w.text==="}}"&&x.text[0]==="{"&&x.text[1]==="{")},T.prototype._reset=function(){this._current_tag_name=""},T.prototype._get_next_token=function(w,x){var L=null;this._readWhitespace();var A=this._input.peek();return A===null?this._create_token(r.EOF,""):(L=L||this._read_open_handlebars(A,x),L=L||this._read_attribute(A,w,x),L=L||this._read_close(A,x),L=L||this._read_raw_content(A,w,x),L=L||this._read_content_word(A),L=L||this._read_comment_or_cdata(A),L=L||this._read_processing(A),L=L||this._read_open(A,x),L=L||this._create_token(r.UNKNOWN,this._input.next()),L)},T.prototype._read_comment_or_cdata=function(w){var x=null,L=null,A=null;if(w==="<"){var _=this._input.peek(1);_==="!"&&(L=this.__patterns.comment.read(),L?(A=o.get_directives(L),A&&A.ignore==="start"&&(L+=o.readIgnored(this._input))):L=this.__patterns.cdata.read()),L&&(x=this._create_token(r.COMMENT,L),x.directives=A)}return x},T.prototype._read_processing=function(w){var x=null,L=null,A=null;if(w==="<"){var _=this._input.peek(1);(_==="!"||_==="?")&&(L=this.__patterns.conditional_comment.read(),L=L||this.__patterns.processing.read()),L&&(x=this._create_token(r.COMMENT,L),x.directives=A)}return x},T.prototype._read_open=function(w,x){var L=null,A=null;return x||w==="<"&&(L=this._input.next(),this._input.peek()==="/"&&(L+=this._input.next()),L+=this.__patterns.element_name.read(),A=this._create_token(r.TAG_OPEN,L)),A},T.prototype._read_open_handlebars=function(w,x){var L=null,A=null;return x||this._options.indent_handlebars&&w==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(L=this.__patterns.handlebars_comment.read(),L=L||this.__patterns.handlebars.read(),A=this._create_token(r.COMMENT,L)):(L=this.__patterns.handlebars_open.read(),A=this._create_token(r.TAG_OPEN,L))),A},T.prototype._read_close=function(w,x){var L=null,A=null;return x&&(x.text[0]==="<"&&(w===">"||w==="/"&&this._input.peek(1)===">")?(L=this._input.next(),w==="/"&&(L+=this._input.next()),A=this._create_token(r.TAG_CLOSE,L)):x.text[0]==="{"&&w==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),A=this._create_token(r.TAG_CLOSE,"}}"))),A},T.prototype._read_attribute=function(w,x,L){var A=null,_="";if(L&&L.text[0]==="<")if(w==="=")A=this._create_token(r.EQUALS,this._input.next());else if(w==='"'||w==="'"){var b=this._input.next();w==='"'?b+=this.__patterns.double_quote.read():b+=this.__patterns.single_quote.read(),A=this._create_token(r.VALUE,b)}else _=this.__patterns.attribute.read(),_&&(x.type===r.EQUALS?A=this._create_token(r.VALUE,_):A=this._create_token(r.ATTRIBUTE,_));return A},T.prototype._is_content_unformatted=function(w){return this._options.void_elements.indexOf(w)===-1&&(this._options.content_unformatted.indexOf(w)!==-1||this._options.unformatted.indexOf(w)!==-1)},T.prototype._read_raw_content=function(w,x,L){var A="";if(L&&L.text[0]==="{")A=this.__patterns.handlebars_raw_close.read();else if(x.type===r.TAG_CLOSE&&x.opened.text[0]==="<"&&x.text[0]!=="/"){var _=x.opened.text.substr(1).toLowerCase();if(_==="script"||_==="style"){var b=this._read_comment_or_cdata(w);if(b)return b.type=r.TEXT,b;A=this._input.readUntil(new RegExp("</"+_+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(_)&&(A=this._input.readUntil(new RegExp("</"+_+"[\\n\\r\\t ]*?>","ig")))}return A?this._create_token(r.TEXT,A):null},T.prototype._read_content_word=function(w){var x="";if(this._options.unformatted_content_delimiter&&(w===this._options.unformatted_content_delimiter[0]&&(x=this.__patterns.unformatted_content_delimiter.read())),x||(x=this.__patterns.word.read()),x)return this._create_token(r.TEXT,x)},g.exports.Tokenizer=T,g.exports.TOKEN=r}],W={};function n(g){var f=W[g];if(f!==void 0)return f.exports;var h=W[g]={exports:{}};return K[g](h,h.exports,n),h.exports}var I=n(18);D=I})();var V=D;if(!0)!(J=[M,M("6UM0"),M("TXwP")],z=function(K){var W=M("6UM0"),n=M("TXwP");return{html_beautify:function(I,g){return V(I,g,W.js_beautify,n.css_beautify)}}}.apply(de,J),z!==void 0&&(Ue.exports=z));else var N,O})()},"qJ4+":function(Ue,de,M){},"rAM+":function(Ue,de,M){"use strict";M.d(de,"a",function(){return z});var J=M("Qw5x");function z(D,V){var N;if(typeof Symbol=="undefined"||D[Symbol.iterator]==null){if(Array.isArray(D)||(N=Object(J.a)(D))||V&&D&&typeof D.length=="number"){N&&(D=N);var O=0,K=function(){};return{s:K,n:function(){return O>=D.length?{done:!0}:{done:!1,value:D[O++]}},e:function(f){throw f},f:K}}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 W=!0,n=!1,I;return{s:function(){N=D[Symbol.iterator]()},n:function(){var f=N.next();return W=f.done,f},e:function(f){n=!0,I=f},f:function(){try{!W&&N.return!=null&&N.return()}finally{if(n)throw I}}}}},rUJ1:function(Ue,de){const M=/[&<>"']/,J=/[&<>"']/g,z=/[<>"']|&(?!#?\w+;)/,D=/[<>"']|&(?!#?\w+;)/g,V={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},N=A=>V[A];function O(A,_){if(_){if(M.test(A))return A.replace(J,N)}else if(z.test(A))return A.replace(D,N);return A}const K=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function W(A){return A.replace(K,(_,b)=>(b=b.toLowerCase(),b==="colon"?":":b.charAt(0)==="#"?b.charAt(1)==="x"?String.fromCharCode(parseInt(b.substring(2),16)):String.fromCharCode(+b.substring(1)):""))}const n=/(^|[^\[])\^/g;function I(A,_){A=A.source||A,_=_||"";const b={replace:(m,p)=>(p=p.source||p,p=p.replace(n,"$1"),A=A.replace(m,p),b),getRegex:()=>new RegExp(A,_)};return b}const g=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function h(A,_,b){if(A){let m;try{m=decodeURIComponent(W(b)).replace(g,"").toLowerCase()}catch(p){return null}if(m.indexOf("javascript:")===0||m.indexOf("vbscript:")===0||m.indexOf("data:")===0)return null}_&&!f.test(b)&&(b=a(_,b));try{b=encodeURI(b).replace(/%25/g,"%")}catch(m){return null}return b}const c={},s=/^[^:]+:\/*[^/]*$/,d=/^([^:]+:)[\s\S]*$/,i=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(A,_){c[" "+A]||(s.test(A)?c[" "+A]=A+"/":c[" "+A]=w(A,"/",!0)),A=c[" "+A];const b=A.indexOf(":")===-1;return _.substring(0,2)==="//"?b?_:A.replace(d,"$1")+_:_.charAt(0)==="/"?b?_:A.replace(i,"$1")+_:A+_}const r={exec:function(){}};function o(A){let _=1,b,m;for(;_<arguments.length;_++){b=arguments[_];for(m in b)Object.prototype.hasOwnProperty.call(b,m)&&(A[m]=b[m])}return A}function T(A,_){const b=A.replace(/\|/g,(C,E,v)=>{let P=!1,F=E;for(;--F>=0&&v[F]==="\\";)P=!P;return P?"|":" |"}),m=b.split(/ \|/);let p=0;if(m.length>_)m.splice(_);else for(;m.length<_;)m.push("");for(;p<m.length;p++)m[p]=m[p].trim().replace(/\\\|/g,"|");return m}function w(A,_,b){const m=A.length;if(m===0)return"";let p=0;for(;p<m;){const C=A.charAt(m-p-1);if(C===_&&!b)p++;else if(C!==_&&b)p++;else break}return A.substr(0,m-p)}function x(A,_){if(A.indexOf(_[1])===-1)return-1;const b=A.length;let m=0,p=0;for(;p<b;p++)if(A[p]==="\\")p++;else if(A[p]===_[0])m++;else if(A[p]===_[1]&&(m--,m<0))return p;return-1}function L(A){A&&A.sanitize&&!A.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}Ue.exports={escape:O,unescape:W,edit:I,cleanUrl:h,resolveUrl:a,noopTest:r,merge:o,splitCells:T,rtrim:w,findClosingBracket:x,checkSanitizeDeprecation:L}},rdUC:function(Ue,de,M){var J=M("MFOe"),z=J.Global;Ue.exports={name:"localStorage",read:V,write:N,each:O,remove:K,clearAll:W};function D(){return z.localStorage}function V(n){return D().getItem(n)}function N(n,I){return D().setItem(n,I)}function O(n){for(var I=D().length-1;I>=0;I--){var g=D().key(I);n(V(g),g)}}function K(n){return D().removeItem(n)}function W(){return D().clear()}},sR1s:function(Ue,de,M){"use strict";M.d(de,"b",function(){return V}),M.d(de,"a",function(){return N}),M.d(de,"c",function(){return O}),M.d(de,"d",function(){return K});var J=M("U8pU"),z="RC_TABLE_KEY";function D(W){return W==null?[]:Array.isArray(W)?W:[W]}function V(W,n){if(!n&&typeof n!="number")return W;for(var I=D(n),g=W,f=0;f<I.length;f+=1){if(!g)return null;var h=I[f];g=g[h]}return g}function N(W){var n=[],I={};return W.forEach(function(g){for(var f=g||{},h=f.key,c=f.dataIndex,s=h||D(c).join("-")||z;I[s];)s="".concat(s,"_next");I[s]=!0,n.push(s)}),n}function O(){var W={};function n(h,c){c&&Object.keys(c).forEach(function(s){var d=c[s];d&&Object(J.a)(d)==="object"?(h[s]=h[s]||{},n(h[s],d)):h[s]=d})}for(var I=arguments.length,g=new Array(I),f=0;f<I;f++)g[f]=arguments[f];return g.forEach(function(h){n(W,h)}),W}function K(W){return W!=null}},sboe:function(Ue,de,M){"use strict";M.d(de,"a",function(){return D});var J=M("q1tI"),z=M.n(J),D=J.createContext(null)},"t/PP":function(Ue,de,M){Ue.exports=M.p+"static/title.dd3b799f.svg"},t23M:function(Ue,de,M){"use strict";var J=M("VTBJ"),z=M("1OyB"),D=M("vuIU"),V=M("Ji7U"),N=M("LK+K"),O=M("q1tI"),K=M.n(O),W=M("m+aA"),n=M("Zm9Q"),I=M("Kwbf"),g=M("c+Xe"),f=M("bdgK"),h="rc-observer-key",c=function(s){Object(V.a)(i,s);var d=Object(N.a)(i);function i(){var a;return Object(z.a)(this,i),a=d.apply(this,arguments),a.resizeObserver=null,a.childNode=null,a.currentElement=null,a.state={width:0,height:0,offsetHeight:0,offsetWidth:0},a.onResize=function(r){var o=a.props.onResize,T=r[0].target,w=T.getBoundingClientRect(),x=w.width,L=w.height,A=T.offsetWidth,_=T.offsetHeight,b=Math.floor(x),m=Math.floor(L);if(a.state.width!==b||a.state.height!==m||a.state.offsetWidth!==A||a.state.offsetHeight!==_){var p={width:b,height:m,offsetWidth:A,offsetHeight:_};a.setState(p),o&&Promise.resolve().then(function(){o(Object(J.a)(Object(J.a)({},p),{},{offsetWidth:A,offsetHeight:_}))})}},a.setChildNode=function(r){a.childNode=r},a}return Object(D.a)(i,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var r=this.props.disabled;if(r){this.destroyObserver();return}var o=Object(W.a)(this.childNode||this),T=o!==this.currentElement;T&&(this.destroyObserver(),this.currentElement=o),!this.resizeObserver&&o&&(this.resizeObserver=new f.default(this.onResize),this.resizeObserver.observe(o))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var r=this.props.children,o=Object(n.a)(r);if(o.length>1)Object(I.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(o.length===0)return Object(I.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var T=o[0];if(O.isValidElement(T)&&Object(g.c)(T)){var w=T.ref;o[0]=O.cloneElement(T,{ref:Object(g.a)(w,this.setChildNode)})}return o.length===1?o[0]:o.map(function(x,L){return!O.isValidElement(x)||"key"in x&&x.key!==null?x:O.cloneElement(x,{key:"".concat(h,"-").concat(L)})})}}]),i}(O.Component);c.displayName="ResizeObserver",de.a=c},t9D7:function(Ue,de,M){"use strict";M.d(de,"b",function(){return K}),M.d(de,"g",function(){return n}),M.d(de,"d",function(){return I}),M.d(de,"e",function(){return g}),M.d(de,"a",function(){return f}),M.d(de,"f",function(){return s}),M.d(de,"c",function(){return d});var J=M("Vhoy"),z=M("MI8n"),D=M("pmY6"),V=M("Cg/j"),N=M("ic2d"),O=M("nEHx");const K=Object(V.c)("themeService");var W;(function(i){function a(r){return r&&typeof r=="object"&&typeof r.id=="string"}i.isThemeColor=a})(W||(W={}));function n(i){return{id:i}}var I;(function(i){function a(L){return L&&typeof L=="object"&&typeof L.id=="string"&&(typeof L.color=="undefined"||W.isThemeColor(L.color))}i.isThemeIcon=a;const r=new RegExp(`^\\$\\((${J.a.iconNameExpression}(?:${J.a.iconModifierExpression})?)\\)$`);function o(L){const A=r.exec(L);if(!A)return;let[,_]=A;return{id:_}}i.fromString=o;function T(L,A){let _=L.id;const b=_.lastIndexOf("~");return b!==-1&&(_=_.substring(0,b)),A&&(_=`${_}~${A}`),{id:_}}i.modify=T;function w(L,A){var _,b;return L.id===A.id&&((_=L.color)===null||_===void 0?void 0:_.id)===((b=A.color)===null||b===void 0?void 0:b.id)}i.isEqual=w;function x(L,A){return{id:L.id,color:A?n(A):void 0}}i.asThemeIcon=x,i.asClassNameArray=J.a.asClassNameArray,i.asClassName=J.a.asClassName,i.asCSSSelector=J.a.asCSSSelector})(I||(I={}));function g(i){switch(i){case O.a.DARK:return"vs-dark";case O.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const f={ThemingContribution:"base.contributions.theming"};class h{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new z.b}onColorThemeChange(i){return this.themingParticipants.push(i),this.onThemingParticipantAddedEmitter.fire(i),Object(D.i)(()=>{const a=this.themingParticipants.indexOf(i);this.themingParticipants.splice(a,1)})}getThemingParticipants(){return this.themingParticipants}}let c=new h;N.a.add(f.ThemingContribution,c);function s(i){return c.onColorThemeChange(i)}class d extends D.a{constructor(i){super();this.themeService=i,this.theme=i.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(a=>this.onThemeChange(a)))}onThemeChange(i){this.theme=i,this.updateStyles()}updateStyles(){}}},uD2n:function(Ue,de,M){Ue.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(Ue,de,M){Ue.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(Ue,de,M){Ue.exports=J;function J(){return M("gaXo"),{}}},ulZh:function(Ue,de,M){typeof window!="undefined"&&function(z,D){Ue.exports=D()}(this,function(){return function(J){var z={};function D(V){if(z[V])return z[V].exports;var N=z[V]={i:V,l:!1,exports:{}};return J[V].call(N.exports,N,N.exports,D),N.l=!0,N.exports}return D.m=J,D.c=z,D.d=function(V,N,O){D.o(V,N)||Object.defineProperty(V,N,{enumerable:!0,get:O})},D.r=function(V){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(V,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(V,"__esModule",{value:!0})},D.t=function(V,N){if(N&1&&(V=D(V)),N&8)return V;if(N&4&&typeof V=="object"&&V&&V.__esModule)return V;var O=Object.create(null);if(D.r(O),Object.defineProperty(O,"default",{enumerable:!0,value:V}),N&2&&typeof V!="string")for(var K in V)D.d(O,K,function(W){return V[W]}.bind(null,K));return O},D.n=function(V){var N=V&&V.__esModule?function(){return V.default}:function(){return V};return D.d(N,"a",N),N},D.o=function(V,N){return Object.prototype.hasOwnProperty.call(V,N)},D.p="/dist/",D(D.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(J,z,D){"use strict";var V=Object.prototype.hasOwnProperty,N="~";function O(){}Object.create&&(O.prototype=Object.create(null),new O().__proto__||(N=!1));function K(g,f,h){this.fn=g,this.context=f,this.once=h||!1}function W(g,f,h,c,s){if(typeof h!="function")throw new TypeError("The listener must be a function");var d=new K(h,c||g,s),i=N?N+f:f;return g._events[i]?g._events[i].fn?g._events[i]=[g._events[i],d]:g._events[i].push(d):(g._events[i]=d,g._eventsCount++),g}function n(g,f){--g._eventsCount===0?g._events=new O:delete g._events[f]}function I(){this._events=new O,this._eventsCount=0}I.prototype.eventNames=function(){var f=[],h,c;if(this._eventsCount===0)return f;for(c in h=this._events)V.call(h,c)&&f.push(N?c.slice(1):c);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(h)):f},I.prototype.listeners=function(f){var h=N?N+f:f,c=this._events[h];if(!c)return[];if(c.fn)return[c.fn];for(var s=0,d=c.length,i=new Array(d);s<d;s++)i[s]=c[s].fn;return i},I.prototype.listenerCount=function(f){var h=N?N+f:f,c=this._events[h];return c?c.fn?1:c.length:0},I.prototype.emit=function(f,h,c,s,d,i){var a=N?N+f:f;if(!this._events[a])return!1;var r=this._events[a],o=arguments.length,T,w;if(r.fn){r.once&&this.removeListener(f,r.fn,void 0,!0);switch(o){case 1:return r.fn.call(r.context),!0;case 2:return r.fn.call(r.context,h),!0;case 3:return r.fn.call(r.context,h,c),!0;case 4:return r.fn.call(r.context,h,c,s),!0;case 5:return r.fn.call(r.context,h,c,s,d),!0;case 6:return r.fn.call(r.context,h,c,s,d,i),!0}for(w=1,T=new Array(o-1);w<o;w++)T[w-1]=arguments[w];r.fn.apply(r.context,T)}else{var x=r.length,L;for(w=0;w<x;w++){r[w].once&&this.removeListener(f,r[w].fn,void 0,!0);switch(o){case 1:r[w].fn.call(r[w].context);break;case 2:r[w].fn.call(r[w].context,h);break;case 3:r[w].fn.call(r[w].context,h,c);break;case 4:r[w].fn.call(r[w].context,h,c,s);break;default:if(!T)for(L=1,T=new Array(o-1);L<o;L++)T[L-1]=arguments[L];r[w].fn.apply(r[w].context,T)}}}return!0},I.prototype.on=function(f,h,c){return W(this,f,h,c,!1)},I.prototype.once=function(f,h,c){return W(this,f,h,c,!0)},I.prototype.removeListener=function(f,h,c,s){var d=N?N+f:f;if(!this._events[d])return this;if(!h)return n(this,d),this;var i=this._events[d];if(i.fn)i.fn===h&&(!s||i.once)&&(!c||i.context===c)&&n(this,d);else{for(var a=0,r=[],o=i.length;a<o;a++)(i[a].fn!==h||s&&!i[a].once||c&&i[a].context!==c)&&r.push(i[a]);r.length?this._events[d]=r.length===1?r[0]:r:n(this,d)}return this},I.prototype.removeAllListeners=function(f){var h;return f?(h=N?N+f:f,this._events[h]&&n(this,h)):(this._events=new O,this._eventsCount=0),this},I.prototype.off=I.prototype.removeListener,I.prototype.addListener=I.prototype.on,I.prefixed=N,I.EventEmitter=I,J.exports=I},"./node_modules/url-toolkit/src/url-toolkit.js":function(J,z,D){(function(V){var N=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,O=/^([^\/?#]*)([^]*)$/,K=/(?:\/|^)\.(?=\/)/g,W=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,n={buildAbsoluteURL:function(I,g,f){if(f=f||{},I=I.trim(),g=g.trim(),!g){if(!f.alwaysNormalize)return I;var h=n.parseURL(I);if(!h)throw new Error("Error trying to parse base URL.");return h.path=n.normalizePath(h.path),n.buildURLFromParts(h)}var c=n.parseURL(g);if(!c)throw new Error("Error trying to parse relative URL.");if(c.scheme)return f.alwaysNormalize?(c.path=n.normalizePath(c.path),n.buildURLFromParts(c)):g;var s=n.parseURL(I);if(!s)throw new Error("Error trying to parse base URL.");if(!s.netLoc&&s.path&&s.path[0]!=="/"){var d=O.exec(s.path);s.netLoc=d[1],s.path=d[2]}s.netLoc&&!s.path&&(s.path="/");var i={scheme:s.scheme,netLoc:c.netLoc,path:null,params:c.params,query:c.query,fragment:c.fragment};if(!c.netLoc&&(i.netLoc=s.netLoc,c.path[0]!=="/"))if(!c.path)i.path=s.path,c.params||(i.params=s.params,c.query||(i.query=s.query));else{var a=s.path,r=a.substring(0,a.lastIndexOf("/")+1)+c.path;i.path=n.normalizePath(r)}return i.path===null&&(i.path=f.alwaysNormalize?n.normalizePath(c.path):c.path),n.buildURLFromParts(i)},parseURL:function(I){var g=N.exec(I);return g?{scheme:g[1]||"",netLoc:g[2]||"",path:g[3]||"",params:g[4]||"",query:g[5]||"",fragment:g[6]||""}:null},normalizePath:function(I){for(I=I.split("").reverse().join("").replace(K,"");I.length!==(I=I.replace(W,"")).length;);return I.split("").reverse().join("")},buildURLFromParts:function(I){return I.scheme+I.netLoc+I.path+I.params+I.query+I.fragment}};J.exports=n})(this)},"./node_modules/webworkify-webpack/index.js":function(J,z,D){function V(f){var h={};function c(d){if(h[d])return h[d].exports;var i=h[d]={i:d,l:!1,exports:{}};return f[d].call(i.exports,i,i.exports,c),i.l=!0,i.exports}c.m=f,c.c=h,c.i=function(d){return d},c.d=function(d,i,a){c.o(d,i)||Object.defineProperty(d,i,{configurable:!1,enumerable:!0,get:a})},c.r=function(d){Object.defineProperty(d,"__esModule",{value:!0})},c.n=function(d){var i=d&&d.__esModule?function(){return d.default}:function(){return d};return c.d(i,"a",i),i},c.o=function(d,i){return Object.prototype.hasOwnProperty.call(d,i)},c.p="/",c.oe=function(d){throw console.error(d),d};var s=c(c.s=ENTRY_MODULE);return s.default||s}var N="[\\.|\\-|\\+|\\w|/|@]+",O="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+N+").*?\\)";function K(f){return(f+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function W(f){return!isNaN(1*f)}function n(f,h,c){var s={};s[c]=[];var d=h.toString(),i=d.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!i)return s;for(var a=i[1],r=new RegExp("(\\\\n|\\W)"+K(a)+O,"g"),o;o=r.exec(d);){if(o[3]==="dll-reference")continue;s[c].push(o[3])}for(r=new RegExp("\\("+K(a)+'\\("(dll-reference\\s('+N+'))"\\)\\)'+O,"g");o=r.exec(d);)f[o[2]]||(s[c].push(o[1]),f[o[2]]=D(o[1]).m),s[o[2]]=s[o[2]]||[],s[o[2]].push(o[4]);for(var T=Object.keys(s),w=0;w<T.length;w++)for(var x=0;x<s[T[w]].length;x++)W(s[T[w]][x])&&(s[T[w]][x]=1*s[T[w]][x]);return s}function I(f){var h=Object.keys(f);return h.reduce(function(c,s){return c||f[s].length>0},!1)}function g(f,h){for(var c={main:[h]},s={main:[]},d={main:{}};I(c);)for(var i=Object.keys(c),a=0;a<i.length;a++){var r=i[a],o=c[r],T=o.pop();if(d[r]=d[r]||{},d[r][T]||!f[r][T])continue;d[r][T]=!0,s[r]=s[r]||[],s[r].push(T);for(var w=n(f,f[r][T],r),x=Object.keys(w),L=0;L<x.length;L++)c[x[L]]=c[x[L]]||[],c[x[L]]=c[x[L]].concat(w[x[L]])}return s}J.exports=function(f,h){h=h||{};var c={main:D.m},s=h.all?{main:Object.keys(c.main)}:g(c,f),d="";Object.keys(s).filter(function(T){return T!=="main"}).forEach(function(T){for(var w=0;s[T][w];)w++;s[T].push(w),c[T][w]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",d=d+"var "+T+" = ("+V.toString().replace("ENTRY_MODULE",JSON.stringify(w))+")({"+s[T].map(function(x){return""+JSON.stringify(x)+": "+c[T][x].toString()}).join(",")+`});
`}),d=d+"new (("+V.toString().replace("ENTRY_MODULE",JSON.stringify(f))+")({"+s.main.map(function(T){return""+JSON.stringify(T)+": "+c.main[T].toString()}).join(",")+"}))(self);";var i=new window.Blob([d],{type:"text/javascript"});if(h.bare)return i;var a=window.URL||window.webkitURL||window.mozURL||window.msURL,r=a.createObjectURL(i),o=new window.Worker(r);return o.objectURL=r,o}},"./src/config.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"hlsDefaultConfig",function(){return L}),D.d(z,"mergeConfig",function(){return _}),D.d(z,"enableStreamingMode",function(){return b});var V=D("./src/controller/abr-controller.ts"),N=D("./src/controller/audio-stream-controller.ts"),O=D("./src/controller/audio-track-controller.ts"),K=D("./src/controller/subtitle-stream-controller.ts"),W=D("./src/controller/subtitle-track-controller.ts"),n=D("./src/controller/buffer-controller.ts"),I=D("./src/controller/timeline-controller.ts"),g=D("./src/controller/cap-level-controller.ts"),f=D("./src/controller/fps-controller.ts"),h=D("./src/controller/eme-controller.ts"),c=D("./src/controller/cmcd-controller.ts"),s=D("./src/utils/xhr-loader.ts"),d=D("./src/utils/fetch-loader.ts"),i=D("./src/utils/cues.ts"),a=D("./src/utils/mediakeys-helper.ts"),r=D("./src/utils/logger.ts");function o(){return o=Object.assign||function(m){for(var p=1;p<arguments.length;p++){var C=arguments[p];for(var E in C)Object.prototype.hasOwnProperty.call(C,E)&&(m[E]=C[E])}return m},o.apply(this,arguments)}function T(m,p){var C=Object.keys(m);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(m);p&&(E=E.filter(function(v){return Object.getOwnPropertyDescriptor(m,v).enumerable})),C.push.apply(C,E)}return C}function w(m){for(var p=1;p<arguments.length;p++){var C=arguments[p]!=null?arguments[p]:{};p%2?T(Object(C),!0).forEach(function(E){x(m,E,C[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(C)):T(Object(C)).forEach(function(E){Object.defineProperty(m,E,Object.getOwnPropertyDescriptor(C,E))})}return m}function x(m,p,C){return p in m?Object.defineProperty(m,p,{value:C,enumerable:!0,configurable:!0,writable:!0}):m[p]=C,m}var L=w(w({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:s.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:V.default,bufferController:n.default,capLevelController:g.default,fpsController:f.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:a.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},A()),{},{subtitleStreamController:K.SubtitleStreamController,subtitleTrackController:W.default,timelineController:I.TimelineController,audioStreamController:N.default,audioTrackController:O.default,emeController:h.default,cmcdController:c.default});function A(){return{cueHandler:i.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function _(m,p){if((p.liveSyncDurationCount||p.liveMaxLatencyDurationCount)&&(p.liveSyncDuration||p.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(p.liveMaxLatencyDurationCount!==void 0&&(p.liveSyncDurationCount===void 0||p.liveMaxLatencyDurationCount<=p.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(p.liveMaxLatencyDuration!==void 0&&(p.liveSyncDuration===void 0||p.liveMaxLatencyDuration<=p.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return o({},m,p)}function b(m){var p=m.loader;if(p!==d.default&&p!==s.default)r.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),m.progressive=!1;else{var C=Object(d.fetchSupported)();C&&(m.loader=d.default,m.progressive=!0,m.enableSoftwareAES=!0,r.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(J,z,D){"use strict";D.r(z);var V=D("./src/polyfills/number.ts"),N=D("./src/utils/ewma-bandwidth-estimator.ts"),O=D("./src/events.ts"),K=D("./src/utils/buffer-helper.ts"),W=D("./src/errors.ts"),n=D("./src/types/loader.ts"),I=D("./src/utils/logger.ts");function g(c,s){for(var d=0;d<s.length;d++){var i=s[d];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(c,i.key,i)}}function f(c,s,d){return s&&g(c.prototype,s),d&&g(c,d),c}var h=function(){function c(d){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=d;var i=d.config;this.bwEstimator=new N.default(i.abrEwmaSlowVoD,i.abrEwmaFastVoD,i.abrEwmaDefaultEstimate),this.registerListeners()}var s=c.prototype;return s.registerListeners=function(){var i=this.hls;i.on(O.Events.FRAG_LOADING,this.onFragLoading,this),i.on(O.Events.FRAG_LOADED,this.onFragLoaded,this),i.on(O.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.on(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.on(O.Events.ERROR,this.onError,this)},s.unregisterListeners=function(){var i=this.hls;i.off(O.Events.FRAG_LOADING,this.onFragLoading,this),i.off(O.Events.FRAG_LOADED,this.onFragLoaded,this),i.off(O.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.off(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.off(O.Events.ERROR,this.onError,this)},s.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},s.onFragLoading=function(i,a){var r=a.frag;if(r.type===n.PlaylistLevelType.MAIN&&!this.timer){var o;this.fragCurrent=r,this.partCurrent=(o=a.part)!=null?o:null,this.timer=self.setInterval(this.onCheck,100)}},s.onLevelLoaded=function(i,a){var r=this.hls.config;a.details.live?this.bwEstimator.update(r.abrEwmaSlowLive,r.abrEwmaFastLive):this.bwEstimator.update(r.abrEwmaSlowVoD,r.abrEwmaFastVoD)},s._abandonRulesCheck=function(){var i=this.fragCurrent,a=this.partCurrent,r=this.hls,o=r.autoLevelEnabled,T=r.config,w=r.media;if(!i||!w)return;var x=a?a.stats:i.stats,L=a?a.duration:i.duration;if(x.aborted){I.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!o||w.paused||!w.playbackRate||!w.readyState)return;var A=performance.now()-x.loading.start,_=Math.abs(w.playbackRate);if(A<=500*L/_)return;var b=r.levels,m=r.minAutoLevel,p=b[i.level],C=x.total||Math.max(x.loaded,Math.round(L*p.maxBitrate/8)),E=Math.max(1,x.bwEstimate?x.bwEstimate/8:x.loaded*1e3/A),v=(C-x.loaded)/E,P=w.currentTime,F=(K.BufferHelper.bufferInfo(w,P,T.maxBufferHole).end-P)/_;if(F>=2*L/_||v<=F)return;var R=Number.POSITIVE_INFINITY,H;for(H=i.level-1;H>m;H--){var U=b[H].maxBitrate;if(R=L*U/(8*.8*E),R<F)break}if(R>=v)return;var S=this.bwEstimator.getEstimate();I.logger.warn("Fragment "+i.sn+(a?" part "+a.index:"")+" of level "+i.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+H+`
Current BW estimate: `+(Object(V.isFiniteNumber)(S)?(S/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+v.toFixed(3)+` s
Estimated load time for the next fragment: `+R.toFixed(3)+` s
Time to underbuffer: `+F.toFixed(3)+" s"),r.nextLoadLevel=H,this.bwEstimator.sample(A,x.loaded),this.clearTimer(),i.loader&&(this.fragCurrent=this.partCurrent=null,i.loader.abort()),r.trigger(O.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:a,stats:x})},s.onFragLoaded=function(i,a){var r=a.frag,o=a.part;if(r.type===n.PlaylistLevelType.MAIN&&Object(V.isFiniteNumber)(r.sn)){var T=o?o.stats:r.stats,w=o?o.duration:r.duration;if(this.clearTimer(),this.lastLoadedFragLevel=r.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var x=this.hls.levels[r.level],L=(x.loaded?x.loaded.bytes:0)+T.loaded,A=(x.loaded?x.loaded.duration:0)+w;x.loaded={bytes:L,duration:A},x.realBitrate=Math.round(8*L/A)}if(r.bitrateTest){var _={stats:T,frag:r,part:o,id:r.type};this.onFragBuffered(O.Events.FRAG_BUFFERED,_),r.bitrateTest=!1}}},s.onFragBuffered=function(i,a){var r=a.frag,o=a.part,T=o?o.stats:r.stats;if(T.aborted)return;if(r.type!==n.PlaylistLevelType.MAIN||r.sn==="initSegment")return;var w=T.parsing.end-T.loading.start;this.bwEstimator.sample(w,T.loaded),T.bwEstimate=this.bwEstimator.getEstimate(),r.bitrateTest?this.bitrateTestDelay=w/1e3:this.bitrateTestDelay=0},s.onError=function(i,a){switch(a.details){case W.ErrorDetails.FRAG_LOAD_ERROR:case W.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},s.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},s.getNextABRAutoLevel=function(){var i=this.fragCurrent,a=this.partCurrent,r=this.hls,o=r.maxAutoLevel,T=r.config,w=r.minAutoLevel,x=r.media,L=a?a.duration:i?i.duration:0,A=x?x.currentTime:0,_=x&&x.playbackRate!==0?Math.abs(x.playbackRate):1,b=this.bwEstimator?this.bwEstimator.getEstimate():T.abrEwmaDefaultEstimate,m=(K.BufferHelper.bufferInfo(x,A,T.maxBufferHole).end-A)/_,p=this.findBestLevel(b,w,o,m,T.abrBandWidthFactor,T.abrBandWidthUpFactor);if(p>=0)return p;I.logger.trace((m?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var C=L?Math.min(L,T.maxStarvationDelay):T.maxStarvationDelay,E=T.abrBandWidthFactor,v=T.abrBandWidthUpFactor;if(!m){var P=this.bitrateTestDelay;if(P){var F=L?Math.min(L,T.maxLoadingDelay):T.maxLoadingDelay;C=F-P,I.logger.trace("bitrate test took "+Math.round(1e3*P)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*C)+" ms"),E=v=1}}return p=this.findBestLevel(b,w,o,m+C,E,v),Math.max(p,0)},s.findBestLevel=function(i,a,r,o,T,w){for(var x,L=this.fragCurrent,A=this.partCurrent,_=this.lastLoadedFragLevel,b=this.hls.levels,m=b[_],p=!!(m!=null&&(x=m.details)!==null&&x!==void 0&&x.live),C=m==null?void 0:m.codecSet,E=A?A.duration:L?L.duration:0,v=r;v>=a;v--){var P=b[v];if(!P||C&&P.codecSet!==C)continue;var F=P.details,R=(A?F==null?void 0:F.partTarget:F==null?void 0:F.averagetargetduration)||E,H=void 0;v<=_?H=T*i:H=w*i;var U=b[v].maxBitrate,S=U*R/H;if(I.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+v+"/"+Math.round(H)+"/"+U+"/"+R+"/"+o+"/"+S),H>U&&(!S||p&&!this.bitrateTestDelay||S<o))return v}return-1},f(c,[{key:"nextAutoLevel",get:function(){var i=this._nextAutoLevel,a=this.bwEstimator;if(i!==-1&&(!a||!a.canEstimate()))return i;var r=this.getNextABRAutoLevel();return i!==-1&&(r=Math.min(i,r)),r},set:function(i){this._nextAutoLevel=i}}]),c}();z.default=h},"./src/controller/audio-stream-controller.ts":function(J,z,D){"use strict";D.r(z);var V=D("./src/polyfills/number.ts"),N=D("./src/controller/base-stream-controller.ts"),O=D("./src/events.ts"),K=D("./src/utils/buffer-helper.ts"),W=D("./src/controller/fragment-tracker.ts"),n=D("./src/types/level.ts"),I=D("./src/types/loader.ts"),g=D("./src/loader/fragment.ts"),f=D("./src/demux/chunk-cache.ts"),h=D("./src/demux/transmuxer-interface.ts"),c=D("./src/types/transmuxer.ts"),s=D("./src/controller/fragment-finders.ts"),d=D("./src/utils/discontinuities.ts"),i=D("./src/errors.ts"),a=D("./src/utils/logger.ts");function r(){return r=Object.assign||function(L){for(var A=1;A<arguments.length;A++){var _=arguments[A];for(var b in _)Object.prototype.hasOwnProperty.call(_,b)&&(L[b]=_[b])}return L},r.apply(this,arguments)}function o(L,A){L.prototype=Object.create(A.prototype),L.prototype.constructor=L,T(L,A)}function T(L,A){return T=Object.setPrototypeOf||function(b,m){return b.__proto__=m,b},T(L,A)}var w=100,x=function(L){o(A,L);function A(b,m){var p;return p=L.call(this,b,m,"[audio-stream-controller]")||this,p.videoBuffer=null,p.videoTrackCC=-1,p.waitingVideoCC=-1,p.audioSwitch=!1,p.trackId=-1,p.waitingData=null,p.mainDetails=null,p.bufferFlushed=!1,p._registerListeners(),p}var _=A.prototype;return _.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},_._registerListeners=function(){var m=this.hls;m.on(O.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.on(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.on(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),m.on(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.on(O.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),m.on(O.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),m.on(O.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),m.on(O.Events.ERROR,this.onError,this),m.on(O.Events.BUFFER_RESET,this.onBufferReset,this),m.on(O.Events.BUFFER_CREATED,this.onBufferCreated,this),m.on(O.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),m.on(O.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),m.on(O.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_._unregisterListeners=function(){var m=this.hls;m.off(O.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.off(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.off(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),m.off(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.off(O.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),m.off(O.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),m.off(O.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),m.off(O.Events.ERROR,this.onError,this),m.off(O.Events.BUFFER_RESET,this.onBufferReset,this),m.off(O.Events.BUFFER_CREATED,this.onBufferCreated,this),m.off(O.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),m.off(O.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),m.off(O.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_.onInitPtsFound=function(m,p){var C=p.frag,E=p.id,v=p.initPTS;if(E==="main"){var P=C.cc;this.initPTS[C.cc]=v,this.log("InitPTS for cc: "+P+" found from main: "+v),this.videoTrackCC=P,this.state===N.State.WAITING_INIT_PTS&&this.tick()}},_.startLoad=function(m){if(!this.levels){this.startPosition=m,this.state=N.State.STOPPED;return}var p=this.lastCurrentTime;this.stopLoad(),this.setInterval(w),this.fragLoadError=0,p>0&&m===-1?(this.log("Override startPosition with lastCurrentTime @"+p.toFixed(3)),this.state=N.State.IDLE):(this.loadedmetadata=!1,this.state=N.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=m,this.tick()},_.doTick=function(){switch(this.state){case N.State.IDLE:this.doTickIdle();break;case N.State.WAITING_TRACK:{var m,p=this.levels,C=this.trackId,E=p==null||((m=p[C])===null||m===void 0)?void 0:m.details;if(E){if(this.waitForCdnTuneIn(E))break;this.state=N.State.WAITING_INIT_PTS}break}case N.State.FRAG_LOADING_WAITING_RETRY:{var v,P=performance.now(),F=this.retryDate;(!F||P>=F||(v=this.media)!==null&&v!==void 0&&v.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=N.State.IDLE);break}case N.State.WAITING_INIT_PTS:{var R=this.waitingData;if(R){var H=R.frag,U=R.part,S=R.cache,G=R.complete;if(this.initPTS[H.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=N.State.FRAG_LOADING;var Q=S.flush(),se={frag:H,part:U,payload:Q,networkDetails:null};this._handleFragmentLoadProgress(se),G&&L.prototype._handleFragmentLoadComplete.call(this,se)}else if(this.videoTrackCC!==this.waitingVideoCC)a.logger.log("Waiting fragment cc ("+H.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var fe=this.getLoadPosition(),we=K.BufferHelper.bufferInfo(this.mediaBuffer,fe,this.config.maxBufferHole),be=Object(s.fragmentWithinToleranceTest)(we.end,this.config.maxFragLookUpTolerance,H);be<0&&(a.logger.log("Waiting fragment cc ("+H.cc+") @ "+H.start+" cancelled because another fragment at "+we.end+" is needed"),this.clearWaitingFragment())}}else this.state=N.State.IDLE}}this.onTickEnd()},_.clearWaitingFragment=function(){var m=this.waitingData;m&&(this.fragmentTracker.removeFragment(m.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=N.State.IDLE)},_.onTickEnd=function(){var m=this.media;if(!m||!m.readyState)return;var p=this.mediaBuffer?this.mediaBuffer:m,C=p.buffered;!this.loadedmetadata&&C.length&&(this.loadedmetadata=!0),this.lastCurrentTime=m.currentTime},_.doTickIdle=function(){var m,p,C=this.hls,E=this.levels,v=this.media,P=this.trackId,F=C.config;if(!E||!E[P])return;if(!v&&(this.startFragRequested||!F.startFragPrefetch))return;var R=E[P],H=R.details;if(!H||H.live&&this.levelLastLoaded!==P||this.waitForCdnTuneIn(H)){this.state=N.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,g.ElementaryStreamTypes.AUDIO,I.PlaylistLevelType.AUDIO));var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,I.PlaylistLevelType.AUDIO);if(U===null)return;var S=U.len,G=this.getMaxBufferLength(),Q=this.audioSwitch;if(S>=G&&!Q)return;if(!Q&&this._streamEnded(U,H)){C.trigger(O.Events.BUFFER_EOS,{type:"audio"}),this.state=N.State.ENDED;return}var se=H.fragments,fe=se[0].start,we=U.end;if(Q){var be=this.getLoadPosition();we=be,H.PTSKnown&&be<fe&&((U.end>fe||U.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),v.currentTime=fe+.05))}var Se=this.getNextFragment(we,H);if(!Se){this.bufferFlushed=!0;return}((m=Se.decryptdata)===null||m===void 0?void 0:m.keyFormat)==="identity"&&!((p=Se.decryptdata)!==null&&p!==void 0&&p.key)?this.loadKey(Se,H):this.loadFragment(Se,H,we)},_.getMaxBufferLength=function(){var m=L.prototype.getMaxBufferLength.call(this),p=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,I.PlaylistLevelType.MAIN);return p===null?m:Math.max(m,p.len)},_.onMediaDetaching=function(){this.videoBuffer=null,L.prototype.onMediaDetaching.call(this)},_.onAudioTracksUpdated=function(m,p){var C=p.audioTracks;this.resetTransmuxer(),this.levels=C.map(function(E){return new n.Level(E)})},_.onAudioTrackSwitching=function(m,p){var C=!!p.url;this.trackId=p.id;var E=this.fragCurrent;E!=null&&E.loader&&E.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),C?this.setInterval(w):this.resetTransmuxer(),C?(this.audioSwitch=!0,this.state=N.State.IDLE):this.state=N.State.STOPPED,this.tick()},_.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},_.onLevelLoaded=function(m,p){this.mainDetails=p.details},_.onAudioTrackLoaded=function(m,p){var C,E=this.levels,v=p.details,P=p.id;if(!E){this.warn("Audio tracks were reset while loading level "+P);return}this.log("Track "+P+" loaded ["+v.startSN+","+v.endSN+"],duration:"+v.totalduration);var F=E[P],R=0;if(v.live||(C=F.details)!==null&&C!==void 0&&C.live){var H=this.mainDetails;if(v.fragments[0]||(v.deltaUpdateFailed=!0),v.deltaUpdateFailed||!H)return;!F.details&&v.hasProgramDateTime&&H.hasProgramDateTime?(Object(d.alignMediaPlaylistByPDT)(v,H),R=v.fragments[0].start):R=this.alignPlaylists(v,F.details)}F.details=v,this.levelLastLoaded=P,!this.startFragRequested&&(this.mainDetails||!v.live)&&this.setStartPosition(F.details,R),this.state===N.State.WAITING_TRACK&&!this.waitForCdnTuneIn(v)&&(this.state=N.State.IDLE),this.tick()},_._handleFragmentLoadProgress=function(m){var p,C=m.frag,E=m.part,v=m.payload,P=this.config,F=this.trackId,R=this.levels;if(!R){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+C.sn+" of level "+C.level+" will not be buffered");return}var H=R[F];console.assert(H,"Audio track is defined on fragment load progress");var U=H.details;console.assert(U,"Audio track details are defined on fragment load progress");var S=P.defaultAudioCodec||H.audioCodec||"mp4a.40.2",G=this.transmuxer;G||(G=this.transmuxer=new h.default(this.hls,I.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var Q=this.initPTS[C.cc],se=(p=C.initSegment)===null||p===void 0?void 0:p.data;if(Q!==void 0){var fe=!1,we=E?E.index:-1,be=we!==-1,Se=new c.ChunkMetadata(C.level,C.sn,C.stats.chunkCount,v.byteLength,we,be);G.push(v,se,S,"",C,E,U.totalduration,fe,Se,Q)}else{a.logger.log("Unknown video PTS for cc "+C.cc+", waiting for video PTS before demuxing audio frag "+C.sn+" of ["+U.startSN+" ,"+U.endSN+"],track "+F);var Ae=this.waitingData=this.waitingData||{frag:C,part:E,cache:new f.default,complete:!1},De=Ae.cache;De.push(new Uint8Array(v)),this.waitingVideoCC=this.videoTrackCC,this.state=N.State.WAITING_INIT_PTS}},_._handleFragmentLoadComplete=function(m){if(this.waitingData){this.waitingData.complete=!0;return}L.prototype._handleFragmentLoadComplete.call(this,m)},_.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},_.onBufferCreated=function(m,p){var C=p.tracks.audio;C&&(this.mediaBuffer=C.buffer),p.tracks.video&&(this.videoBuffer=p.tracks.video.buffer)},_.onFragBuffered=function(m,p){var C=p.frag,E=p.part;if(C.type!==I.PlaylistLevelType.AUDIO)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+", audioSwitch: "+this.audioSwitch);return}C.sn!=="initSegment"&&(this.fragPrevious=C,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(O.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(C,E)},_.onError=function(m,p){switch(p.details){case i.ErrorDetails.FRAG_LOAD_ERROR:case i.ErrorDetails.FRAG_LOAD_TIMEOUT:case i.ErrorDetails.KEY_LOAD_ERROR:case i.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(I.PlaylistLevelType.AUDIO,p);break;case i.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case i.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==N.State.ERROR&&this.state!==N.State.STOPPED&&(this.state=p.fatal?N.State.ERROR:N.State.IDLE,this.warn(p.details+" while loading frag, switching to "+this.state+" state"));break;case i.ErrorDetails.BUFFER_FULL_ERROR:if(p.parent==="audio"&&(this.state===N.State.PARSING||this.state===N.State.PARSED)){var C=!0,E=this.getFwdBufferInfo(this.mediaBuffer,I.PlaylistLevelType.AUDIO);E&&E.len>.5&&(C=!this.reduceMaxBufferLength(E.len)),C&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,L.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},_.onBufferFlushed=function(m,p){var C=p.type;C===g.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},_._handleTransmuxComplete=function(m){var p,C="audio",E=this.hls,v=m.remuxResult,P=m.chunkMeta,F=this.getCurrentContext(P);if(!F){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 R=F.frag,H=F.part,U=v.audio,S=v.text,G=v.id3,Q=v.initSegment;if(this.fragContextChanged(R))return;if(this.state=N.State.PARSING,this.audioSwitch&&U&&this.completeAudioSwitch(),Q!=null&&Q.tracks&&(this._bufferInitSegment(Q.tracks,R,P),E.trigger(O.Events.FRAG_PARSING_INIT_SEGMENT,{frag:R,id:C,tracks:Q.tracks})),U){var se=U.startPTS,fe=U.endPTS,we=U.startDTS,be=U.endDTS;H&&(H.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:se,endPTS:fe,startDTS:we,endDTS:be}),R.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,se,fe,we,be),this.bufferFragmentData(U,R,H,P)}if(G!=null&&(p=G.samples)!==null&&p!==void 0&&p.length){var Se=r({frag:R,id:C},G);E.trigger(O.Events.FRAG_PARSING_METADATA,Se)}if(S){var Ae=r({frag:R,id:C},S);E.trigger(O.Events.FRAG_PARSING_USERDATA,Ae)}},_._bufferInitSegment=function(m,p,C){if(this.state!==N.State.PARSING)return;m.video&&delete m.video;var E=m.audio;if(!E)return;E.levelCodec=E.codec,E.id="audio",this.log("Init audio buffer, container:"+E.container+", codecs[parsed]=["+E.codec+"]"),this.hls.trigger(O.Events.BUFFER_CODECS,m);var v=E.initSegment;if(v!=null&&v.byteLength){var P={type:"audio",frag:p,part:null,chunkMeta:C,parent:p.type,data:v};this.hls.trigger(O.Events.BUFFER_APPENDING,P)}this.tick()},_.loadFragment=function(m,p,C){var E=this.fragmentTracker.getState(m);this.fragCurrent=m,(this.audioSwitch||E===W.FragmentState.NOT_LOADED||E===W.FragmentState.PARTIAL)&&(m.sn==="initSegment"?this._loadInitSegment(m):p.live&&!Object(V.isFiniteNumber)(this.initPTS[m.cc])?(this.log("Waiting for video PTS in continuity counter "+m.cc+" of live stream before loading audio fragment "+m.sn+" of level "+this.trackId),this.state=N.State.WAITING_INIT_PTS):(this.startFragRequested=!0,L.prototype.loadFragment.call(this,m,p,C)))},_.completeAudioSwitch=function(){var m=this.hls,p=this.media,C=this.trackId;p&&(this.log("Switching audio track : flushing all audio"),L.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,m.trigger(O.Events.AUDIO_TRACK_SWITCHED,{id:C})},A}(N.default);z.default=x},"./src/controller/audio-track-controller.ts":function(J,z,D){"use strict";D.r(z);var V=D("./src/events.ts"),N=D("./src/errors.ts"),O=D("./src/controller/base-playlist-controller.ts"),K=D("./src/types/loader.ts");function W(h,c){for(var s=0;s<c.length;s++){var d=c[s];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(h,d.key,d)}}function n(h,c,s){return c&&W(h.prototype,c),s&&W(h,s),h}function I(h,c){h.prototype=Object.create(c.prototype),h.prototype.constructor=h,g(h,c)}function g(h,c){return g=Object.setPrototypeOf||function(d,i){return d.__proto__=i,d},g(h,c)}var f=function(h){I(c,h);function c(d){var i;return i=h.call(this,d,"[audio-track-controller]")||this,i.tracks=[],i.groupId=null,i.tracksInGroup=[],i.trackId=-1,i.trackName="",i.selectDefaultTrack=!0,i.registerListeners(),i}var s=c.prototype;return s.registerListeners=function(){var i=this.hls;i.on(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.on(V.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.on(V.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),i.on(V.Events.ERROR,this.onError,this)},s.unregisterListeners=function(){var i=this.hls;i.off(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.off(V.Events.LEVEL_LOADING,this.onLevelLoading,this),i.off(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.off(V.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),i.off(V.Events.ERROR,this.onError,this)},s.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,h.prototype.destroy.call(this)},s.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},s.onManifestParsed=function(i,a){this.tracks=a.audioTracks||[]},s.onAudioTrackLoaded=function(i,a){var r=a.id,o=a.details,T=this.tracksInGroup[r];if(!T){this.warn("Invalid audio track id "+r);return}var w=T.details;T.details=a.details,this.log("audioTrack "+r+" loaded ["+o.startSN+"-"+o.endSN+"]"),r===this.trackId&&(this.retryCount=0,this.playlistLoaded(r,a,w))},s.onLevelLoading=function(i,a){this.switchLevel(a.level)},s.onLevelSwitching=function(i,a){this.switchLevel(a.level)},s.switchLevel=function(i){var a=this.hls.levels[i];if(!(a!=null&&a.audioGroupIds))return;var r=a.audioGroupIds[a.urlId];if(this.groupId!==r){this.groupId=r;var o=this.tracks.filter(function(w){return!r||w.groupId===r});this.selectDefaultTrack&&!o.some(function(w){return w.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=o;var T={audioTracks:o};this.log("Updating audio tracks, "+o.length+' track(s) found in "'+r+'" group-id'),this.hls.trigger(V.Events.AUDIO_TRACKS_UPDATED,T),this.selectInitialTrack()}},s.onError=function(i,a){if(h.prototype.onError.call(this,i,a),a.fatal||!a.context)return;a.context.type===K.PlaylistContextType.AUDIO_TRACK&&a.context.id===this.trackId&&a.context.groupId===this.groupId&&this.retryLoadingOrFail(a)},s.setAudioTrack=function(i){var a=this.tracksInGroup;if(i<0||i>=a.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var r=a[this.trackId];this.log("Now switching to audio-track index "+i);var o=a[i],T=o.id,w=o.groupId,x=w===void 0?"":w,L=o.name,A=o.type,_=o.url;if(this.trackId=i,this.trackName=L,this.selectDefaultTrack=!1,this.hls.trigger(V.Events.AUDIO_TRACK_SWITCHING,{id:T,groupId:x,name:L,type:A,url:_}),o.details&&!o.details.live)return;var b=this.switchParams(o.url,r==null?void 0:r.details);this.loadPlaylist(b)},s.selectInitialTrack=function(){var i=this.tracksInGroup;console.assert(i.length,"Initial audio track should be selected when tracks are known");var a=this.trackName,r=this.findTrackId(a)||this.findTrackId();r!==-1?this.setAudioTrack(r):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(V.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},s.findTrackId=function(i){for(var a=this.tracksInGroup,r=0;r<a.length;r++){var o=a[r];if((!this.selectDefaultTrack||o.default)&&(!i||i===o.name))return o.id}return-1},s.loadPlaylist=function(i){var a=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(a)){var r=a.id,o=a.groupId,T=a.url;if(i)try{T=i.addDirectives(T)}catch(w){this.warn("Could not construct new URL with HLS Delivery Directives: "+w)}this.log("loading audio-track playlist for id: "+r),this.clearTimer(),this.hls.trigger(V.Events.AUDIO_TRACK_LOADING,{url:T,id:r,groupId:o,deliveryDirectives:i||null})}},n(c,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(i){this.selectDefaultTrack=!1,this.setAudioTrack(i)}}]),c}(O.default);z.default=f},"./src/controller/base-playlist-controller.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"default",function(){return n});var V=D("./src/polyfills/number.ts"),N=D("./src/types/level.ts"),O=D("./src/controller/level-helper.ts"),K=D("./src/utils/logger.ts"),W=D("./src/errors.ts"),n=function(){function I(f,h){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=K.logger.log.bind(K.logger,h+":"),this.warn=K.logger.warn.bind(K.logger,h+":"),this.hls=f}var g=I.prototype;return g.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},g.onError=function(h,c){c.fatal&&c.type===W.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},g.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},g.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},g.stopLoad=function(){this.canLoad=!1,this.clearTimer()},g.switchParams=function(h,c){var s=c==null?void 0:c.renditionReports;if(s)for(var d=0;d<s.length;d++){var i=s[d],a=""+i.URI;if(a===h.substr(-a.length)){var r=parseInt(i["LAST-MSN"]),o=parseInt(i["LAST-PART"]);if(c&&this.hls.config.lowLatencyMode){var T=Math.min(c.age-c.partTarget,c.targetduration);o!==void 0&&T>c.partTarget&&(o+=1)}if(Object(V.isFiniteNumber)(r))return new N.HlsUrlParameters(r,Object(V.isFiniteNumber)(o)?o:void 0,N.HlsSkip.No)}}},g.loadPlaylist=function(h){},g.shouldLoadTrack=function(h){return this.canLoad&&h&&!!h.url&&(!h.details||h.details.live)},g.playlistLoaded=function(h,c,s){var d=this,i=c.details,a=c.stats,r=a.loading.end?Math.max(0,self.performance.now()-a.loading.end):0;if(i.advancedDateTime=Date.now()-r,i.live||s!=null&&s.live){if(i.reloaded(s),s&&this.log("live playlist "+h+" "+(i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:"MISSED")),s&&i.fragments.length>0&&Object(O.mergeDetails)(s,i),!this.canLoad||!i.live)return;var o,T=void 0,w=void 0;if(i.canBlockReload&&i.endSN&&i.advanced){var x=this.hls.config.lowLatencyMode,L=i.lastPartSn,A=i.endSN,_=i.lastPartIndex,b=_!==-1,m=L===A,p=x?0:_;b?(T=m?A+1:L,w=m?p:_+1):T=A+1;var C=i.age,E=C+i.ageHeader,v=Math.min(E-i.partTarget,i.targetduration*1.5);if(v>0){if(s&&v>s.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+s.tuneInGoal+" to: "+v+" with playlist age: "+i.age),v=0;else{var P=Math.floor(v/i.targetduration);if(T+=P,w!==void 0){var F=Math.round(v%i.targetduration/i.partTarget);w+=F}this.log("CDN Tune-in age: "+i.ageHeader+"s last advanced "+C.toFixed(2)+"s goal: "+v+" skip sn "+P+" to part "+w)}i.tuneInGoal=v}if(o=this.getDeliveryDirectives(i,c.deliveryDirectives,T,w),x||!m){this.loadPlaylist(o);return}}else o=this.getDeliveryDirectives(i,c.deliveryDirectives,T,w);var R=Object(O.computeReloadInterval)(i,a);T!==void 0&&i.canBlockReload&&(R-=i.partTarget||1),this.log("reload live playlist "+h+" in "+Math.round(R)+" ms"),this.timer=self.setTimeout(function(){return d.loadPlaylist(o)},R)}else this.clearTimer()},g.getDeliveryDirectives=function(h,c,s,d){var i=Object(N.getSkipValue)(h,s);return c!=null&&c.skip&&h.deltaUpdateFailed&&(s=c.msn,d=c.part,i=N.HlsSkip.No),new N.HlsUrlParameters(s,d,i)},g.retryLoadingOrFail=function(h){var c=this,s=this.hls.config,d=this.retryCount<s.levelLoadingMaxRetry;if(d){var i;if(this.retryCount++,h.details.indexOf("LoadTimeOut")>-1&&(i=h.context)!==null&&i!==void 0&&i.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+h.details+'"'),this.loadPlaylist();else{var a=Math.min(Math.pow(2,this.retryCount)*s.levelLoadingRetryDelay,s.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return c.loadPlaylist()},a),this.warn("retry playlist loading #"+this.retryCount+" in "+a+' ms after "'+h.details+'"')}}else this.warn('cannot recover from error "'+h.details+'"'),this.clearTimer(),h.fatal=!0;return d},I}()},"./src/controller/base-stream-controller.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"State",function(){return A}),D.d(z,"default",function(){return _});var V=D("./src/polyfills/number.ts"),N=D("./src/task-loop.ts"),O=D("./src/controller/fragment-tracker.ts"),K=D("./src/utils/buffer-helper.ts"),W=D("./src/utils/logger.ts"),n=D("./src/events.ts"),I=D("./src/errors.ts"),g=D("./src/types/transmuxer.ts"),f=D("./src/utils/mp4-tools.ts"),h=D("./src/utils/discontinuities.ts"),c=D("./src/controller/fragment-finders.ts"),s=D("./src/controller/level-helper.ts"),d=D("./src/loader/fragment-loader.ts"),i=D("./src/crypt/decrypter.ts"),a=D("./src/utils/time-ranges.ts"),r=D("./src/types/loader.ts");function o(b,m){for(var p=0;p<m.length;p++){var C=m[p];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(b,C.key,C)}}function T(b,m,p){return m&&o(b.prototype,m),p&&o(b,p),b}function w(b){if(b===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b}function x(b,m){b.prototype=Object.create(m.prototype),b.prototype.constructor=b,L(b,m)}function L(b,m){return L=Object.setPrototypeOf||function(C,E){return C.__proto__=E,C},L(b,m)}var A={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},_=function(b){x(m,b);function m(C,E,v){var P;return P=b.call(this)||this,P.hls=void 0,P.fragPrevious=null,P.fragCurrent=null,P.fragmentTracker=void 0,P.transmuxer=null,P._state=A.STOPPED,P.media=void 0,P.mediaBuffer=void 0,P.config=void 0,P.bitrateTest=!1,P.lastCurrentTime=0,P.nextLoadPosition=0,P.startPosition=0,P.loadedmetadata=!1,P.fragLoadError=0,P.retryDate=0,P.levels=null,P.fragmentLoader=void 0,P.levelLastLoaded=null,P.startFragRequested=!1,P.decrypter=void 0,P.initPTS=[],P.onvseeking=null,P.onvended=null,P.logPrefix="",P.log=void 0,P.warn=void 0,P.logPrefix=v,P.log=W.logger.log.bind(W.logger,v+":"),P.warn=W.logger.warn.bind(W.logger,v+":"),P.hls=C,P.fragmentLoader=new d.default(C.config),P.fragmentTracker=E,P.config=C.config,P.decrypter=new i.default(C,C.config),C.on(n.Events.KEY_LOADED,P.onKeyLoaded,w(P)),P}var p=m.prototype;return p.doTick=function(){this.onTickEnd()},p.onTickEnd=function(){},p.startLoad=function(E){},p.stopLoad=function(){this.fragmentLoader.abort();var E=this.fragCurrent;E&&this.fragmentTracker.removeFragment(E),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=A.STOPPED},p._streamEnded=function(E,v){var P=this.fragCurrent,F=this.fragmentTracker;if(!v.live&&P&&P.sn===v.endSN&&!E.nextStart){var R=F.getState(P);return R===O.FragmentState.PARTIAL||R===O.FragmentState.OK}return!1},p.onMediaAttached=function(E,v){var P=this.media=this.mediaBuffer=v.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),P.addEventListener("seeking",this.onvseeking),P.addEventListener("ended",this.onvended);var F=this.config;this.levels&&F.autoStartLoad&&this.state===A.STOPPED&&this.startLoad(F.startPosition)},p.onMediaDetaching=function(){var E=this.media;E!=null&&E.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),E&&(E.removeEventListener("seeking",this.onvseeking),E.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},p.onMediaSeeking=function(){var E=this.config,v=this.fragCurrent,P=this.media,F=this.mediaBuffer,R=this.state,H=P?P.currentTime:0,U=K.BufferHelper.bufferInfo(F||P,H,E.maxBufferHole);if(this.log("media seeking to "+(Object(V.isFiniteNumber)(H)?H.toFixed(3):H)+", state: "+R),R===A.ENDED)this.resetLoadingState();else if(v&&!U.len){var S=E.maxFragLookUpTolerance,G=v.start-S,Q=v.start+v.duration+S,se=H>Q;(H<G||se)&&(se&&v.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),v.loader.abort()),this.resetLoadingState())}P&&(this.lastCurrentTime=H),!this.loadedmetadata&&!U.len&&(this.nextLoadPosition=this.startPosition=H),this.tickImmediate()},p.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},p.onKeyLoaded=function(E,v){if(this.state!==A.KEY_LOADING||v.frag!==this.fragCurrent||!this.levels)return;this.state=A.IDLE;var P=this.levels[v.frag.level].details;P&&this.loadFragment(v.frag,P,v.frag.start)},p.onHandlerDestroying=function(){this.stopLoad(),b.prototype.onHandlerDestroying.call(this)},p.onHandlerDestroyed=function(){this.state=A.STOPPED,this.hls.off(n.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,b.prototype.onHandlerDestroyed.call(this)},p.loadKey=function(E,v){this.log("Loading key for "+E.sn+" of ["+v.startSN+"-"+v.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+E.level),this.state=A.KEY_LOADING,this.fragCurrent=E,this.hls.trigger(n.Events.KEY_LOADING,{frag:E})},p.loadFragment=function(E,v,P){this._loadFragForPlayback(E,v,P)},p._loadFragForPlayback=function(E,v,P){var F=this,R=function(U){if(F.fragContextChanged(E)){F.warn("Fragment "+E.sn+(U.part?" p: "+U.part.index:"")+" of level "+E.level+" was dropped during download."),F.fragmentTracker.removeFragment(E);return}E.stats.chunkCount++,F._handleFragmentLoadProgress(U)};this._doFragLoad(E,v,P,R).then(function(H){if(!H)return;F.fragLoadError=0;var U=F.state;if(F.fragContextChanged(E)){(U===A.FRAG_LOADING||U===A.BACKTRACKING||!F.fragCurrent&&U===A.PARSING)&&(F.fragmentTracker.removeFragment(E),F.state=A.IDLE);return}if("payload"in H&&(F.log("Loaded fragment "+E.sn+" of level "+E.level),F.hls.trigger(n.Events.FRAG_LOADED,H),F.state===A.BACKTRACKING)){F.fragmentTracker.backtrack(E,H),F.resetFragmentLoading(E);return}F._handleFragmentLoadComplete(H)}).catch(function(H){F.warn(H),F.resetFragmentLoading(E)})},p.flushMainBuffer=function(E,v,P){if(P===void 0&&(P=null),!(E-v))return;var F={startOffset:E,endOffset:v,type:P};this.fragLoadError=0,this.hls.trigger(n.Events.BUFFER_FLUSHING,F)},p._loadInitSegment=function(E){var v=this;this._doFragLoad(E).then(function(P){if(!P||v.fragContextChanged(E)||!v.levels)throw new Error("init load aborted");return P}).then(function(P){var F=v.hls,R=P.payload,H=E.decryptdata;if(R&&R.byteLength>0&&H&&H.key&&H.iv&&H.method==="AES-128"){var U=self.performance.now();return v.decrypter.webCryptoDecrypt(new Uint8Array(R),H.key.buffer,H.iv.buffer).then(function(S){var G=self.performance.now();return F.trigger(n.Events.FRAG_DECRYPTED,{frag:E,payload:S,stats:{tstart:U,tdecrypt:G}}),P.payload=S,P})}return P}).then(function(P){var F=v.fragCurrent,R=v.hls,H=v.levels;if(!H)throw new Error("init load aborted, missing levels");var U=H[E.level].details;console.assert(U,"Level details are defined when init segment is loaded");var S=E.stats;v.state=A.IDLE,v.fragLoadError=0,E.data=new Uint8Array(P.payload),S.parsing.start=S.buffering.start=self.performance.now(),S.parsing.end=S.buffering.end=self.performance.now(),P.frag===F&&R.trigger(n.Events.FRAG_BUFFERED,{stats:S,frag:F,part:null,id:E.type}),v.tick()}).catch(function(P){v.warn(P),v.resetFragmentLoading(E)})},p.fragContextChanged=function(E){var v=this.fragCurrent;return!E||!v||E.level!==v.level||E.sn!==v.sn||E.urlId!==v.urlId},p.fragBufferedComplete=function(E,v){var P=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+E.type+" sn: "+E.sn+(v?" part: "+v.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+E.level+" "+a.default.toString(K.BufferHelper.getBuffered(P))),this.state=A.IDLE,this.tick()},p._handleFragmentLoadComplete=function(E){var v=this.transmuxer;if(!v)return;var P=E.frag,F=E.part,R=E.partsLoaded,H=!R||R.length===0||R.some(function(S){return!S}),U=new g.ChunkMetadata(P.level,P.sn,P.stats.chunkCount+1,0,F?F.index:-1,!H);v.flush(U)},p._handleFragmentLoadProgress=function(E){},p._doFragLoad=function(E,v,P,F){var R=this;if(P===void 0&&(P=null),!this.levels)throw new Error("frag load aborted, missing levels");if(P=Math.max(E.start,P||0),this.config.lowLatencyMode&&v){var H=v.partList;if(H&&F){P>E.end&&v.fragmentHint&&(E=v.fragmentHint);var U=this.getNextPart(H,E,P);if(U>-1){var S=H[U];return this.log("Loading part sn: "+E.sn+" p: "+S.index+" cc: "+E.cc+" of playlist ["+v.startSN+"-"+v.endSN+"] parts [0-"+U+"-"+(H.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+E.level+", target: "+parseFloat(P.toFixed(3))),this.nextLoadPosition=S.start+S.duration,this.state=A.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:E,part:H[U],targetBufferTime:P}),this.doFragPartsLoad(E,H,U,F).catch(function(G){return R.handleFragLoadError(G)})}else if(!E.url||this.loadedEndOfParts(H,P))return Promise.resolve(null)}}return this.log("Loading fragment "+E.sn+" cc: "+E.cc+" "+(v?"of ["+v.startSN+"-"+v.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+E.level+", target: "+parseFloat(P.toFixed(3))),Object(V.isFiniteNumber)(E.sn)&&!this.bitrateTest&&(this.nextLoadPosition=E.start+E.duration),this.state=A.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:E,targetBufferTime:P}),this.fragmentLoader.load(E,F).catch(function(G){return R.handleFragLoadError(G)})},p.doFragPartsLoad=function(E,v,P,F){var R=this;return new Promise(function(H,U){var S=[],G=function Q(se){var fe=v[se];R.fragmentLoader.loadPart(E,fe,F).then(function(we){S[fe.index]=we;var be=we.part;R.hls.trigger(n.Events.FRAG_LOADED,we);var Se=v[se+1];if(Se&&Se.fragment===E)Q(se+1);else return H({frag:E,part:be,partsLoaded:S})}).catch(U)};G(P)})},p.handleFragLoadError=function(E){var v=E.data;return v&&v.details===I.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(v.frag,v.part):this.hls.trigger(n.Events.ERROR,v),null},p._handleTransmuxerFlush=function(E){var v=this.getCurrentContext(E);if(!v||this.state!==A.PARSING){this.fragCurrent||(this.state=A.IDLE);return}var P=v.frag,F=v.part,R=v.level,H=self.performance.now();P.stats.parsing.end=H,F&&(F.stats.parsing.end=H),this.updateLevelTiming(P,F,R,E.partial)},p.getCurrentContext=function(E){var v=this.levels,P=E.level,F=E.sn,R=E.part;if(!v||!v[P])return this.warn("Levels object was unset while buffering fragment "+F+" of level "+P+". The current chunk will not be buffered."),null;var H=v[P],U=R>-1?Object(s.getPartWith)(H,F,R):null,S=U?U.fragment:Object(s.getFragmentWithSN)(H,F,this.fragCurrent);return S?{frag:S,part:U,level:H}:null},p.bufferFragmentData=function(E,v,P,F){if(!E||this.state!==A.PARSING)return;var R=E.data1,H=E.data2,U=R;if(R&&H&&(U=Object(f.appendUint8Array)(R,H)),!U||!U.length)return;var S={type:E.type,frag:v,part:P,chunkMeta:F,parent:v.type,data:U};this.hls.trigger(n.Events.BUFFER_APPENDING,S),E.dropped&&E.independent&&!P&&this.flushBufferGap(v)},p.flushBufferGap=function(E){var v=this.media;if(!v)return;if(!K.BufferHelper.isBuffered(v,v.currentTime)){this.flushMainBuffer(0,E.start);return}var P=v.currentTime,F=K.BufferHelper.bufferInfo(v,P,0),R=E.duration,H=Math.min(this.config.maxFragLookUpTolerance*2,R*.25),U=Math.max(Math.min(E.start-H,F.end-H),P+H);E.start-U>H&&this.flushMainBuffer(U,E.start)},p.getFwdBufferInfo=function(E,v){var P=this.config,F=this.getLoadPosition();if(!Object(V.isFiniteNumber)(F))return null;var R=K.BufferHelper.bufferInfo(E,F,P.maxBufferHole);if(R.len===0&&R.nextStart!==void 0){var H=this.fragmentTracker.getBufferedFrag(F,v);if(H&&R.nextStart<H.end)return K.BufferHelper.bufferInfo(E,F,Math.max(R.nextStart,P.maxBufferHole))}return R},p.getMaxBufferLength=function(E){var v=this.config,P;return E?P=Math.max(8*v.maxBufferSize/E,v.maxBufferLength):P=v.maxBufferLength,Math.min(P,v.maxMaxBufferLength)},p.reduceMaxBufferLength=function(E){var v=this.config,P=E||v.maxBufferLength;return v.maxMaxBufferLength>=P?(v.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+v.maxMaxBufferLength+"s"),!0):!1},p.getNextFragment=function(E,v){var P,F,R=v.fragments,H=R.length;if(!H)return null;var U=this.config,S=R[0].start,G;if(v.live){var Q=U.initialLiveManifestSize;if(H<Q)return this.warn("Not enough fragments to start playback (have: "+H+", need: "+Q+")"),null;!v.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(G=this.getInitialLiveFragment(v,R),this.startPosition=G?this.hls.liveSyncPosition||G.start:E)}else E<=S&&(G=R[0]);if(!G){var se=U.lowLatencyMode?v.partEnd:v.fragmentEnd;G=this.getFragmentAtPosition(E,se,v)}return(P=G)!==null&&P!==void 0&&P.initSegment&&!((F=G)!==null&&F!==void 0&&F.initSegment.data)&&!this.bitrateTest&&(G=G.initSegment),G},p.getNextPart=function(E,v,P){for(var F=-1,R=!1,H=!0,U=0,S=E.length;U<S;U++){var G=E[U];if(H=H&&!G.independent,F>-1&&P<G.start)break;var Q=G.loaded;!Q&&(R||G.independent||H)&&G.fragment===v&&(F=U),R=Q}return F},p.loadedEndOfParts=function(E,v){var P=E[E.length-1];return P&&v>P.start&&P.loaded},p.getInitialLiveFragment=function(E,v){var P=this.fragPrevious,F=null;if(P){if(E.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+P.programDateTime),F=Object(c.findFragmentByPDT)(v,P.endProgramDateTime,this.config.maxFragLookUpTolerance)),!F){var R=P.sn+1;if(R>=E.startSN&&R<=E.endSN){var H=v[R-E.startSN];P.cc===H.cc&&(F=H,this.log("Live playlist, switching playlist, load frag with next SN: "+F.sn))}F||(F=Object(c.findFragWithCC)(v,P.cc),F&&this.log("Live playlist, switching playlist, load frag with same CC: "+F.sn))}}else{var U=this.hls.liveSyncPosition;U!==null&&(F=this.getFragmentAtPosition(U,this.bitrateTest?E.fragmentEnd:E.edge,E))}return F},p.getFragmentAtPosition=function(E,v,P){var F=this.config,R=this.fragPrevious,H=P.fragments,U=P.endSN,S=P.fragmentHint,G=F.maxFragLookUpTolerance,Q=!!(F.lowLatencyMode&&P.partList&&S);Q&&S&&!this.bitrateTest&&(H=H.concat(S),U=S.sn);var se;if(E<v){var fe=E>v-G?0:G;se=Object(c.findFragmentByPTS)(R,H,E,fe)}else se=H[H.length-1];if(se){var we=se.sn-P.startSN,be=R&&se.level===R.level,Se=H[we+1],Ae=this.fragmentTracker.getState(se);if(Ae===O.FragmentState.BACKTRACKED){se=null;for(var De=we;H[De]&&this.fragmentTracker.getState(H[De])===O.FragmentState.BACKTRACKED;)R?se=H[De--]:se=H[--De];se||(se=Se)}else R&&se.sn===R.sn&&!Q&&(be&&(se.sn<U&&this.fragmentTracker.getState(Se)!==O.FragmentState.OK?(this.log("SN "+se.sn+" just loaded, load next one: "+Se.sn),se=Se):se=null))}return se},p.synchronizeToLiveEdge=function(E){var v=this.config,P=this.media;if(!P)return;var F=this.hls.liveSyncPosition,R=P.currentTime,H=E.fragments[0].start,U=E.edge,S=R>=H-v.maxFragLookUpTolerance&&R<=U;if(F!==null&&P.duration>F&&(R<F||!S)){var G=v.liveMaxLatencyDuration!==void 0?v.liveMaxLatencyDuration:v.liveMaxLatencyDurationCount*E.targetduration;(!S&&P.readyState<4||R<U-G)&&(this.loadedmetadata||(this.nextLoadPosition=F),P.readyState&&(this.warn("Playback: "+R.toFixed(3)+" is located too far from the end of live sliding playlist: "+U+", reset currentTime to : "+F.toFixed(3)),P.currentTime=F))}},p.alignPlaylists=function(E,v){var P=this.levels,F=this.levelLastLoaded,R=this.fragPrevious,H=F!==null?P[F]:null,U=E.fragments.length;if(!U)return this.warn("No fragments in live playlist"),0;var S=E.fragments[0].start,G=!v,Q=E.alignedSliding&&Object(V.isFiniteNumber)(S);if(G||!Q&&!S){Object(h.alignStream)(R,H,E);var se=E.fragments[0].start;return this.log("Live playlist sliding: "+se.toFixed(2)+" start-sn: "+(v?v.startSN:"na")+"->"+E.startSN+" prev-sn: "+(R?R.sn:"na")+" fragments: "+U),se}return S},p.waitForCdnTuneIn=function(E){var v=3;return E.live&&E.canBlockReload&&E.tuneInGoal>Math.max(E.partHoldBack,E.partTarget*v)},p.setStartPosition=function(E,v){var P=this.startPosition;if(P<v&&(P=-1),P===-1||this.lastCurrentTime===-1){var F=E.startTimeOffset;Object(V.isFiniteNumber)(F)?(P=v+F,F<0&&(P+=E.totalduration),P=Math.min(Math.max(v,P),v+E.totalduration),this.log("Start time offset "+F+" found in playlist, adjust startPosition to "+P),this.startPosition=P):E.live?P=this.hls.liveSyncPosition||v:this.startPosition=P=0,this.lastCurrentTime=P}this.nextLoadPosition=P},p.getLoadPosition=function(){var E=this.media,v=0;return this.loadedmetadata&&E?v=E.currentTime:this.nextLoadPosition&&(v=this.nextLoadPosition),v},p.handleFragLoadAborted=function(E,v){this.transmuxer&&E.sn!=="initSegment"&&E.stats.aborted&&(this.warn("Fragment "+E.sn+(v?" part"+v.index:"")+" of level "+E.level+" was aborted"),this.resetFragmentLoading(E))},p.resetFragmentLoading=function(E){(!this.fragCurrent||!this.fragContextChanged(E))&&(this.state=A.IDLE)},p.onFragmentOrKeyLoadError=function(E,v){if(v.fatal)return;var P=v.frag;if(!P||P.type!==E)return;var F=this.fragCurrent;console.assert(F&&P.sn===F.sn&&P.level===F.level&&P.urlId===F.urlId,"Frag load error must match current frag to retry");var R=this.config;if(this.fragLoadError+1<=R.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(P.level))return;var H=Math.min(Math.pow(2,this.fragLoadError)*R.fragLoadingRetryDelay,R.fragLoadingMaxRetryTimeout);this.warn("Fragment "+P.sn+" of "+E+" "+P.level+" failed to load, retrying in "+H+"ms"),this.retryDate=self.performance.now()+H,this.fragLoadError++,this.state=A.FRAG_LOADING_WAITING_RETRY}else v.levelRetry?(E===r.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=A.IDLE):(W.logger.error(v.details+" reaches max retry, redispatch as fatal ..."),v.fatal=!0,this.hls.stopLoad(),this.state=A.ERROR)},p.afterBufferFlushed=function(E,v,P){if(!E)return;var F=K.BufferHelper.getBuffered(E);this.fragmentTracker.detectEvictedFragments(v,F,P),this.state===A.ENDED&&this.resetLoadingState()},p.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=A.IDLE},p.resetLiveStartWhenNotLoaded=function(E){if(!this.loadedmetadata){this.startFragRequested=!1;var v=this.levels?this.levels[E].details:null;if(v!=null&&v.live)return this.startPosition=-1,this.setStartPosition(v,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},p.updateLevelTiming=function(E,v,P,F){var R=this,H=P.details;console.assert(!!H,"level.details must be defined");var U=Object.keys(E.elementaryStreams).reduce(function(S,G){var Q=E.elementaryStreams[G];if(Q){var se=Q.endPTS-Q.startPTS;if(se<=0)return R.warn("Could not parse fragment "+E.sn+" "+G+" duration reliably ("+se+") resetting transmuxer to fallback to playlist timing"),R.resetTransmuxer(),S||!1;var fe=F?0:Object(s.updateFragPTSDTS)(H,E,Q.startPTS,Q.endPTS,Q.startDTS,Q.endDTS);return R.hls.trigger(n.Events.LEVEL_PTS_UPDATED,{details:H,level:P,drift:fe,type:G,frag:E,start:Q.startPTS,end:Q.endPTS}),!0}return S},!1);U?(this.state=A.PARSED,this.hls.trigger(n.Events.FRAG_PARSED,{frag:E,part:v})):this.resetLoadingState()},p.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},T(m,[{key:"state",get:function(){return this._state},set:function(E){var v=this._state;v!==E&&(this._state=E,this.log(v+"->"+E))}}]),m}(N.default)},"./src/controller/buffer-controller.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"default",function(){return c});var V=D("./src/polyfills/number.ts"),N=D("./src/events.ts"),O=D("./src/utils/logger.ts"),K=D("./src/errors.ts"),W=D("./src/utils/buffer-helper.ts"),n=D("./src/utils/mediasource-helper.ts"),I=D("./src/loader/fragment.ts"),g=D("./src/controller/buffer-operation-queue.ts"),f=Object(n.getMediaSource)(),h=/([ha]vc.)(?:\.[^.,]+)+/,c=function(){function s(i){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 r=a.hls,o=a.media,T=a.mediaSource;O.logger.log("[buffer-controller]: Media source opened"),o&&(a.updateMediaElementDuration(),r.trigger(N.Events.MEDIA_ATTACHED,{media:o})),T&&T.removeEventListener("sourceopen",a._onMediaSourceOpen),a.checkPendingTracks()},this._onMediaSourceClose=function(){O.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){O.logger.log("[buffer-controller]: Media source ended")},this.hls=i,this._initSourceBuffer(),this.registerListeners()}var d=s.prototype;return d.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},d.destroy=function(){this.unregisterListeners(),this.details=null},d.registerListeners=function(){var a=this.hls;a.on(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(N.Events.BUFFER_RESET,this.onBufferReset,this),a.on(N.Events.BUFFER_APPENDING,this.onBufferAppending,this),a.on(N.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.on(N.Events.BUFFER_EOS,this.onBufferEos,this),a.on(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),a.on(N.Events.LEVEL_UPDATED,this.onLevelUpdated,this),a.on(N.Events.FRAG_PARSED,this.onFragParsed,this),a.on(N.Events.FRAG_CHANGED,this.onFragChanged,this)},d.unregisterListeners=function(){var a=this.hls;a.off(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(N.Events.BUFFER_RESET,this.onBufferReset,this),a.off(N.Events.BUFFER_APPENDING,this.onBufferAppending,this),a.off(N.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.off(N.Events.BUFFER_EOS,this.onBufferEos,this),a.off(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),a.off(N.Events.LEVEL_UPDATED,this.onLevelUpdated,this),a.off(N.Events.FRAG_PARSED,this.onFragParsed,this),a.off(N.Events.FRAG_CHANGED,this.onFragChanged,this)},d._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new g.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},d.onManifestParsed=function(a,r){var o=2;(r.audio&&!r.video||!r.altAudio)&&(o=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=o,this.details=null,O.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},d.onMediaAttaching=function(a,r){var o=this.media=r.media;if(o&&f){var T=this.mediaSource=new f;T.addEventListener("sourceopen",this._onMediaSourceOpen),T.addEventListener("sourceended",this._onMediaSourceEnded),T.addEventListener("sourceclose",this._onMediaSourceClose),o.src=self.URL.createObjectURL(T),this._objectUrl=o.src}},d.onMediaDetaching=function(){var a=this.media,r=this.mediaSource,o=this._objectUrl;if(r){if(O.logger.log("[buffer-controller]: media source detaching"),r.readyState==="open")try{r.endOfStream()}catch(T){O.logger.warn("[buffer-controller]: onMediaDetaching: "+T.message+" while calling endOfStream")}this.onBufferReset(),r.removeEventListener("sourceopen",this._onMediaSourceOpen),r.removeEventListener("sourceended",this._onMediaSourceEnded),r.removeEventListener("sourceclose",this._onMediaSourceClose),a&&(o&&self.URL.revokeObjectURL(o),a.src===o?(a.removeAttribute("src"),a.load()):O.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(N.Events.MEDIA_DETACHED,void 0)},d.onBufferReset=function(){var a=this;this.getSourceBufferTypes().forEach(function(r){var o=a.sourceBuffer[r];try{o&&(a.removeBufferListeners(r),a.mediaSource&&a.mediaSource.removeSourceBuffer(o),a.sourceBuffer[r]=void 0)}catch(T){O.logger.warn("[buffer-controller]: Failed to reset the "+r+" buffer",T)}}),this._initSourceBuffer()},d.onBufferCodecs=function(a,r){var o=this,T=this.getSourceBufferTypes().length;if(Object.keys(r).forEach(function(w){if(T){var x=o.tracks[w];if(x&&typeof x.buffer.changeType=="function"){var L=r[w],A=L.codec,_=L.levelCodec,b=L.container,m=(x.levelCodec||x.codec).replace(h,"$1"),p=(_||A).replace(h,"$1");if(m!==p){var C=b+";codecs="+(_||A);o.appendChangeType(w,C)}}}else o.pendingTracks[w]=r[w]}),T)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},d.appendChangeType=function(a,r){var o=this,T=this.operationQueue,w={execute:function(){var L=o.sourceBuffer[a];L&&(O.logger.log("[buffer-controller]: changing "+a+" sourceBuffer type to "+r),L.changeType(r)),T.shiftAndExecuteNext(a)},onStart:function(){},onComplete:function(){},onError:function(L){O.logger.warn("[buffer-controller]: Failed to change "+a+" SourceBuffer type",L)}};T.append(w,a)},d.onBufferAppending=function(a,r){var o=this,T=this.hls,w=this.operationQueue,x=this.tracks,L=r.data,A=r.type,_=r.frag,b=r.part,m=r.chunkMeta,p=m.buffering[A],C=self.performance.now();p.start=C;var E=_.stats.buffering,v=b?b.stats.buffering:null;E.start===0&&(E.start=C),v&&v.start===0&&(v.start=C);var P=x.audio,F=A==="audio"&&m.id===1&&(P==null?void 0:P.container)==="audio/mpeg",R={execute:function(){if(p.executeStart=self.performance.now(),F){var U=o.sourceBuffer[A];if(U){var S=_.start-U.timestampOffset;Math.abs(S)>=.1&&(O.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+_.start+" (delta: "+S+") sn: "+_.sn+")"),U.timestampOffset=_.start)}}o.appendExecutor(L,A)},onStart:function(){},onComplete:function(){var U=self.performance.now();p.executeEnd=p.end=U,E.first===0&&(E.first=U),v&&v.first===0&&(v.first=U);var S=o.sourceBuffer,G={};for(var Q in S)G[Q]=W.BufferHelper.getBuffered(S[Q]);o.appendError=0,o.hls.trigger(N.Events.BUFFER_APPENDED,{type:A,frag:_,part:b,chunkMeta:m,parent:_.type,timeRanges:G})},onError:function(U){O.logger.error("[buffer-controller]: Error encountered while trying to append to the "+A+" SourceBuffer",U);var S={type:K.ErrorTypes.MEDIA_ERROR,parent:_.type,details:K.ErrorDetails.BUFFER_APPEND_ERROR,err:U,fatal:!1};U.code===DOMException.QUOTA_EXCEEDED_ERR?S.details=K.ErrorDetails.BUFFER_FULL_ERROR:(o.appendError++,S.details=K.ErrorDetails.BUFFER_APPEND_ERROR,o.appendError>T.config.appendErrorMaxRetry&&(O.logger.error("[buffer-controller]: Failed "+T.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),S.fatal=!0)),T.trigger(N.Events.ERROR,S)}};w.append(R,A)},d.onBufferFlushing=function(a,r){var o=this,T=this.operationQueue,w=function(L){return{execute:o.removeExecutor.bind(o,L,r.startOffset,r.endOffset),onStart:function(){},onComplete:function(){o.hls.trigger(N.Events.BUFFER_FLUSHED,{type:L})},onError:function(_){O.logger.warn("[buffer-controller]: Failed to remove from "+L+" SourceBuffer",_)}}};r.type?T.append(w(r.type),r.type):this.getSourceBufferTypes().forEach(function(x){T.append(w(x),x)})},d.onFragParsed=function(a,r){var o=this,T=r.frag,w=r.part,x=[],L=w?w.elementaryStreams:T.elementaryStreams;L[I.ElementaryStreamTypes.AUDIOVIDEO]?x.push("audiovideo"):(L[I.ElementaryStreamTypes.AUDIO]&&x.push("audio"),L[I.ElementaryStreamTypes.VIDEO]&&x.push("video"));var A=function(){var b=self.performance.now();T.stats.buffering.end=b,w&&(w.stats.buffering.end=b);var m=w?w.stats:T.stats;o.hls.trigger(N.Events.FRAG_BUFFERED,{frag:T,part:w,stats:m,id:T.type})};x.length===0&&O.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+T.type+" level: "+T.level+" sn: "+T.sn),this.blockBuffers(A,x)},d.onFragChanged=function(a,r){this.flushBackBuffer()},d.onBufferEos=function(a,r){var o=this,T=this.getSourceBufferTypes().reduce(function(w,x){var L=o.sourceBuffer[x];return(!r.type||r.type===x)&&(L&&!L.ended&&(L.ended=!0,O.logger.log("[buffer-controller]: "+x+" sourceBuffer now EOS"))),w&&!!(!L||L.ended)},!0);T&&this.blockBuffers(function(){var w=o.mediaSource;if(!w||w.readyState!=="open")return;w.endOfStream()})},d.onLevelUpdated=function(a,r){var o=r.details;if(!o.fragments.length)return;this.details=o,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},d.flushBackBuffer=function(){var a=this.hls,r=this.details,o=this.media,T=this.sourceBuffer;if(!o||r===null)return;var w=this.getSourceBufferTypes();if(!w.length)return;var x=r.live&&a.config.liveBackBufferLength!==null?a.config.liveBackBufferLength:a.config.backBufferLength;if(!Object(V.isFiniteNumber)(x)||x<0)return;var L=o.currentTime,A=r.levelTargetDuration,_=Math.max(x,A),b=Math.floor(L/A)*A-_;w.forEach(function(m){var p=T[m];if(p){var C=W.BufferHelper.getBuffered(p);C.length>0&&b>C.start(0)&&(a.trigger(N.Events.BACK_BUFFER_REACHED,{bufferEnd:b}),r.live&&a.trigger(N.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:b}),a.trigger(N.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:b,type:m}))}})},d.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var a=this.details,r=this.hls,o=this.media,T=this.mediaSource,w=a.fragments[0].start+a.totalduration,x=o.duration,L=Object(V.isFiniteNumber)(T.duration)?T.duration:0;a.live&&r.config.liveDurationInfinity?(O.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),T.duration=Infinity,this.updateSeekableRange(a)):(w>L&&w>x||!Object(V.isFiniteNumber)(x))&&(O.logger.log("[buffer-controller]: Updating Media Source duration to "+w.toFixed(3)),T.duration=w)},d.updateSeekableRange=function(a){var r=this.mediaSource,o=a.fragments,T=o.length;if(T&&a.live&&r!==null&&r!==void 0&&r.setLiveSeekableRange){var w=Math.max(0,o[0].start),x=Math.max(w,w+a.totalduration);r.setLiveSeekableRange(w,x)}},d.checkPendingTracks=function(){var a=this.bufferCodecEventsExpected,r=this.operationQueue,o=this.pendingTracks,T=Object.keys(o).length;if(T&&!a||T===2){this.createSourceBuffers(o),this.pendingTracks={};var w=this.getSourceBufferTypes();if(w.length===0){this.hls.trigger(N.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}w.forEach(function(x){r.executeNext(x)})}},d.createSourceBuffers=function(a){var r=this.sourceBuffer,o=this.mediaSource;if(!o)throw Error("createSourceBuffers called when mediaSource was null");var T=0;for(var w in a)if(!r[w]){var x=a[w];if(!x)throw Error("source buffer exists for track "+w+", however track does not");var L=x.levelCodec||x.codec,A=x.container+";codecs="+L;O.logger.log("[buffer-controller]: creating sourceBuffer("+A+")");try{var _=r[w]=o.addSourceBuffer(A),b=w;this.addBufferListener(b,"updatestart",this._onSBUpdateStart),this.addBufferListener(b,"updateend",this._onSBUpdateEnd),this.addBufferListener(b,"error",this._onSBUpdateError),this.tracks[w]={buffer:_,codec:L,container:x.container,levelCodec:x.levelCodec,id:x.id},T++}catch(m){O.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+m.message),this.hls.trigger(N.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:m,mimeType:A})}}T&&this.hls.trigger(N.Events.BUFFER_CREATED,{tracks:this.tracks})},d._onSBUpdateStart=function(a){var r=this.operationQueue,o=r.current(a);o.onStart()},d._onSBUpdateEnd=function(a){var r=this.operationQueue,o=r.current(a);o.onComplete(),r.shiftAndExecuteNext(a)},d._onSBUpdateError=function(a,r){O.logger.error("[buffer-controller]: "+a+" SourceBuffer error",r),this.hls.trigger(N.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var o=this.operationQueue.current(a);o&&o.onError(r)},d.removeExecutor=function(a,r,o){var T=this.media,w=this.mediaSource,x=this.operationQueue,L=this.sourceBuffer,A=L[a];if(!T||!w||!A){O.logger.warn("[buffer-controller]: Attempting to remove from the "+a+" SourceBuffer, but it does not exist"),x.shiftAndExecuteNext(a);return}var _=Object(V.isFiniteNumber)(T.duration)?T.duration:Infinity,b=Object(V.isFiniteNumber)(w.duration)?w.duration:Infinity,m=Math.max(0,r),p=Math.min(o,_,b);p>m?(O.logger.log("[buffer-controller]: Removing ["+m+","+p+"] from the "+a+" SourceBuffer"),console.assert(!A.updating,a+" sourceBuffer must not be updating"),A.remove(m,p)):x.shiftAndExecuteNext(a)},d.appendExecutor=function(a,r){var o=this.operationQueue,T=this.sourceBuffer,w=T[r];if(!w){O.logger.warn("[buffer-controller]: Attempting to append to the "+r+" SourceBuffer, but it does not exist"),o.shiftAndExecuteNext(r);return}w.ended=!1,console.assert(!w.updating,r+" sourceBuffer must not be updating"),w.appendBuffer(a)},d.blockBuffers=function(a,r){var o=this;if(r===void 0&&(r=this.getSourceBufferTypes()),!r.length){O.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(a);return}var T=this.operationQueue,w=r.map(function(x){return T.appendBlocker(x)});Promise.all(w).then(function(){a(),r.forEach(function(x){var L=o.sourceBuffer[x];(!L||!L.updating)&&T.shiftAndExecuteNext(x)})})},d.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},d.addBufferListener=function(a,r,o){var T=this.sourceBuffer[a];if(!T)return;var w=o.bind(this,a);this.listeners[a].push({event:r,listener:w}),T.addEventListener(r,w)},d.removeBufferListeners=function(a){var r=this.sourceBuffer[a];if(!r)return;this.listeners[a].forEach(function(o){r.removeEventListener(o.event,o.listener)})},s}()},"./src/controller/buffer-operation-queue.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"default",function(){return N});var V=D("./src/utils/logger.ts"),N=function(){function O(W){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=W}var K=O.prototype;return K.append=function(n,I){var g=this.queues[I];g.push(n),g.length===1&&this.buffers[I]&&this.executeNext(I)},K.insertAbort=function(n,I){var g=this.queues[I];g.unshift(n),this.executeNext(I)},K.appendBlocker=function(n){var I,g=new Promise(function(h){I=h}),f={execute:I,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(f,n),g},K.executeNext=function(n){var I=this.buffers,g=this.queues,f=I[n],h=g[n];if(h.length){var c=h[0];try{c.execute()}catch(s){V.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),c.onError(s),(!f||!f.updating)&&(h.shift(),this.executeNext(n))}}},K.shiftAndExecuteNext=function(n){this.queues[n].shift(),this.executeNext(n)},K.current=function(n){return this.queues[n][0]},O}()},"./src/controller/cap-level-controller.ts":function(J,z,D){"use strict";D.r(z);var V=D("./src/events.ts");function N(W,n){for(var I=0;I<n.length;I++){var g=n[I];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(W,g.key,g)}}function O(W,n,I){return n&&N(W.prototype,n),I&&N(W,I),W}var K=function(){function W(I){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=I,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var n=W.prototype;return n.setStreamController=function(g){this.streamController=g},n.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},n.registerListeners=function(){var g=this.hls;g.on(V.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.on(V.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.on(V.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.unregisterListener=function(){var g=this.hls;g.off(V.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.off(V.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.off(V.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.onFpsDropLevelCapping=function(g,f){W.isLevelAllowed(f.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(f.droppedLevel)},n.onMediaAttaching=function(g,f){this.media=f.media instanceof HTMLVideoElement?f.media:null},n.onManifestParsed=function(g,f){var h=this.hls;this.restrictedLevels=[],this.firstLevel=f.firstLevel,h.config.capLevelToPlayerSize&&f.video&&this.startCapping()},n.onBufferCodecs=function(g,f){var h=this.hls;h.config.capLevelToPlayerSize&&f.video&&this.startCapping()},n.onMediaDetaching=function(){this.stopCapping()},n.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&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}}},n.getMaxLevel=function(g){var f=this,h=this.hls.levels;if(!h.length)return-1;var c=h.filter(function(s,d){return W.isLevelAllowed(d,f.restrictedLevels)&&d<=g});return this.clientRect=null,W.getMaxLevelByMediaSize(c,this.mediaWidth,this.mediaHeight)},n.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()},n.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},n.getDimensions=function(){if(this.clientRect)return this.clientRect;var g=this.media,f={width:0,height:0};if(g){var h=g.getBoundingClientRect();f.width=h.width,f.height=h.height,!f.width&&!f.height&&(f.width=h.right-h.left||g.width||0,f.height=h.bottom-h.top||g.height||0)}return this.clientRect=f,f},W.isLevelAllowed=function(g,f){return f===void 0&&(f=[]),f.indexOf(g)===-1},W.getMaxLevelByMediaSize=function(g,f,h){if(!g||!g.length)return-1;for(var c=function(r,o){return o?r.width!==o.width||r.height!==o.height:!0},s=g.length-1,d=0;d<g.length;d+=1){var i=g[d];if((i.width>=f||i.height>=h)&&c(i,g[d+1])){s=d;break}}return s},O(W,[{key:"mediaWidth",get:function(){return this.getDimensions().width*W.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*W.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var g=1;try{g=self.devicePixelRatio}catch(f){}return g}}]),W}();z.default=K},"./src/controller/cmcd-controller.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"default",function(){return c});var V=D("./src/events.ts"),N=D("./src/types/cmcd.ts"),O=D("./src/utils/buffer-helper.ts"),K=D("./src/utils/logger.ts");function W(s,d){for(var i=0;i<d.length;i++){var a=d[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(s,a.key,a)}}function n(s,d,i){return d&&W(s.prototype,d),i&&W(s,i),s}function I(s,d){var i=typeof Symbol!="undefined"&&s[Symbol.iterator]||s["@@iterator"];if(i)return(i=i.call(s)).next.bind(i);if(Array.isArray(s)||(i=g(s))||d&&s&&typeof s.length=="number"){i&&(s=i);var a=0;return function(){return a>=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,d){if(!s)return;if(typeof s=="string")return f(s,d);var i=Object.prototype.toString.call(s).slice(8,-1);if(i==="Object"&&s.constructor&&(i=s.constructor.name),i==="Map"||i==="Set")return Array.from(s);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return f(s,d)}function f(s,d){(d==null||d>s.length)&&(d=s.length);for(var i=0,a=new Array(d);i<d;i++)a[i]=s[i];return a}function h(){return h=Object.assign||function(s){for(var d=1;d<arguments.length;d++){var i=arguments[d];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(s[a]=i[a])}return s},h.apply(this,arguments)}var c=function(){function s(i){var a=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){a.initialized&&(a.starved=!0),a.buffering=!0},this.onPlaying=function(){a.initialized||(a.initialized=!0),a.buffering=!1},this.applyPlaylistData=function(T){try{a.apply(T,{ot:N.CMCDObjectType.MANIFEST,su:!a.initialized})}catch(w){K.logger.warn("Could not generate manifest CMCD data.",w)}},this.applyFragmentData=function(T){try{var w=T.frag,x=a.hls.levels[w.level],L=a.getObjectType(w),A={d:w.duration*1e3,ot:L};(L===N.CMCDObjectType.VIDEO||L===N.CMCDObjectType.AUDIO||L==N.CMCDObjectType.MUXED)&&(A.br=x.bitrate/1e3,A.tb=a.getTopBandwidth(L),A.bl=a.getBufferLength(L)),a.apply(T,A)}catch(_){K.logger.warn("Could not generate segment CMCD data.",_)}},this.hls=i;var r=this.config=i.config,o=r.cmcd;o!=null&&(r.pLoader=this.createPlaylistLoader(),r.fLoader=this.createFragmentLoader(),this.sid=o.sessionId||s.uuid(),this.cid=o.contentId,this.useHeaders=o.useHeaders===!0,this.registerListeners())}var d=s.prototype;return d.registerListeners=function(){var a=this.hls;a.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.on(V.Events.MEDIA_DETACHED,this.onMediaDetached,this),a.on(V.Events.BUFFER_CREATED,this.onBufferCreated,this)},d.unregisterListeners=function(){var a=this.hls;a.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.off(V.Events.MEDIA_DETACHED,this.onMediaDetached,this),a.off(V.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},d.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},d.onMediaAttached=function(a,r){this.media=r.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},d.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},d.onBufferCreated=function(a,r){var o,T;this.audioBuffer=(o=r.tracks.audio)===null||o===void 0?void 0:o.buffer,this.videoBuffer=(T=r.tracks.video)===null||T===void 0?void 0:T.buffer},d.createData=function(){var a;return{v:N.CMCDVersion,sf:N.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(a=this.media)===null||a===void 0?void 0:a.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},d.apply=function(a,r){r===void 0&&(r={}),h(r,this.createData());var o=r.ot===N.CMCDObjectType.INIT||r.ot===N.CMCDObjectType.VIDEO||r.ot===N.CMCDObjectType.MUXED;if(this.starved&&o&&(r.bs=!0,r.su=!0,this.starved=!1),r.su==null&&(r.su=this.buffering),this.useHeaders){var T=s.toHeaders(r);if(!Object.keys(T).length)return;a.headers||(a.headers={}),h(a.headers,T)}else{var w=s.toQuery(r);if(!w)return;a.url=s.appendQueryToUri(a.url,w)}},d.getObjectType=function(a){var r=a.type;return r==="subtitle"?N.CMCDObjectType.TIMED_TEXT:a.sn==="initSegment"?N.CMCDObjectType.INIT:r==="audio"?N.CMCDObjectType.AUDIO:r==="main"?this.hls.audioTracks.length?N.CMCDObjectType.VIDEO:N.CMCDObjectType.MUXED:void 0},d.getTopBandwidth=function(a){for(var r=0,o=a===N.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,T=I(o),w;!(w=T()).done;){var x=w.value;x.bitrate>r&&(r=x.bitrate)}return r>0?r:NaN},d.getBufferLength=function(a){var r=this.hls.media,o=a===N.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!o||!r)return NaN;var T=O.BufferHelper.bufferInfo(o,r.currentTime,this.config.maxBufferHole);return T.len*1e3},d.createPlaylistLoader=function(){var a=this.config.pLoader,r=this.applyPlaylistData,o=a||this.config.loader;return function(){function T(x){this.loader=void 0,this.loader=new o(x)}var w=T.prototype;return w.destroy=function(){this.loader.destroy()},w.abort=function(){this.loader.abort()},w.load=function(L,A,_){r(L),this.loader.load(L,A,_)},n(T,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),T}()},d.createFragmentLoader=function(){var a=this.config.fLoader,r=this.applyFragmentData,o=a||this.config.loader;return function(){function T(x){this.loader=void 0,this.loader=new o(x)}var w=T.prototype;return w.destroy=function(){this.loader.destroy()},w.abort=function(){this.loader.abort()},w.load=function(L,A,_){r(L),this.loader.load(L,A,_)},n(T,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),T}()},s.uuid=function(){var a=URL.createObjectURL(new Blob),r=a.toString();return URL.revokeObjectURL(a),r.substr(r.lastIndexOf("/")+1)},s.serialize=function(a){for(var r=[],o=function(F){return!Number.isNaN(F)&&F!=null&&F!==""&&F!==!1},T=function(F){return Math.round(F)},w=function(F){return T(F/100)*100},x=function(F){return encodeURIComponent(F)},L={br:T,d:T,bl:w,dl:w,mtp:w,nor:x,rtp:w,tb:T},A=Object.keys(a||{}).sort(),_=I(A),b;!(b=_()).done;){var m=b.value,p=a[m];if(!o(p))continue;if(m==="v"&&p===1)continue;if(m=="pr"&&p===1)continue;var C=L[m];C&&(p=C(p));var E=typeof p,v=void 0;m==="ot"||m==="sf"||m==="st"?v=m+"="+p:E==="boolean"?v=m:E==="number"?v=m+"="+p:v=m+"="+JSON.stringify(p),r.push(v)}return r.join(",")},s.toHeaders=function(a){for(var r=Object.keys(a),o={},T=["Object","Request","Session","Status"],w=[{},{},{},{}],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},L=0,A=r;L<A.length;L++){var _=A[L],b=x[_]!=null?x[_]:1;w[b][_]=a[_]}for(var m=0;m<w.length;m++){var p=s.serialize(w[m]);p&&(o["CMCD-"+T[m]]=p)}return o},s.toQuery=function(a){return"CMCD="+encodeURIComponent(s.serialize(a))},s.appendQueryToUri=function(a,r){if(!r)return a;var o=a.includes("?")?"&":"?";return""+a+o+r},s}()},"./src/controller/eme-controller.ts":function(J,z,D){"use strict";D.r(z);var V=D("./src/events.ts"),N=D("./src/errors.ts"),O=D("./src/utils/logger.ts"),K=D("./src/utils/mediakeys-helper.ts");function W(c,s){for(var d=0;d<s.length;d++){var i=s[d];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(c,i.key,i)}}function n(c,s,d){return s&&W(c.prototype,s),d&&W(c,d),c}var I=3,g=function(s,d,i){var a={audioCapabilities:[],videoCapabilities:[]};return s.forEach(function(r){a.audioCapabilities.push({contentType:'audio/mp4; codecs="'+r+'"',robustness:i.audioRobustness||""})}),d.forEach(function(r){a.videoCapabilities.push({contentType:'video/mp4; codecs="'+r+'"',robustness:i.videoRobustness||""})}),[a]},f=function(s,d,i,a){switch(s){case K.KeySystems.WIDEVINE:return g(d,i,a);default:throw new Error("Unknown key-system: "+s)}},h=function(){function c(d){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=d,this._config=d.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var s=c.prototype;return s.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},s._registerListeners=function(){this.hls.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(V.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this)},s._unregisterListeners=function(){this.hls.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(V.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this)},s.getLicenseServerUrl=function(i){switch(i){case K.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+i+'"')},s._attemptKeySystemAccess=function(i,a,r){var o=this,T=f(i,a,r,this._drmSystemOptions);O.logger.log("Requesting encrypted media key-system access");var w=this.requestMediaKeySystemAccess(i,T);this.mediaKeysPromise=w.then(function(x){return o._onMediaKeySystemAccessObtained(i,x)}),w.catch(function(x){O.logger.error('Failed to obtain key-system "'+i+'" access:',x)})},s._onMediaKeySystemAccessObtained=function(i,a){var r=this;O.logger.log('Access for key-system "'+i+'" obtained');var o={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:a,mediaKeySystemDomain:i};this._mediaKeysList.push(o);var T=Promise.resolve().then(function(){return a.createMediaKeys()}).then(function(w){return o.mediaKeys=w,O.logger.log('Media-keys created for key-system "'+i+'"'),r._onMediaKeysCreated(),w});return T.catch(function(w){O.logger.error("Failed to create media-keys:",w)}),T},s._onMediaKeysCreated=function(){var i=this;this._mediaKeysList.forEach(function(a){a.mediaKeysSession||(a.mediaKeysSession=a.mediaKeys.createSession(),i._onNewMediaKeySession(a.mediaKeysSession))})},s._onNewMediaKeySession=function(i){var a=this;O.logger.log("New key-system session "+i.sessionId),i.addEventListener("message",function(r){a._onKeySessionMessage(i,r.message)},!1)},s._onKeySessionMessage=function(i,a){O.logger.log("Got EME message event, creating license request"),this._requestLicense(a,function(r){O.logger.log("Received license data (length: "+(r&&r.byteLength)+"), updating key-session"),i.update(r)})},s.onMediaEncrypted=function(i){var a=this;if(O.logger.log('Media is encrypted using "'+i.initDataType+'" init data type'),!this.mediaKeysPromise){O.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(V.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var r=function(T){if(!a._media)return;a._attemptSetMediaKeys(T),a._generateRequestWithPreferredKeySession(i.initDataType,i.initData)};this.mediaKeysPromise.then(r).catch(r)},s._attemptSetMediaKeys=function(i){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var a=this._mediaKeysList[0];if(!a||!a.mediaKeys){O.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(V.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}O.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(a.mediaKeys),this._hasSetMediaKeys=!0}},s._generateRequestWithPreferredKeySession=function(i,a){var r=this,o=this._mediaKeysList[0];if(!o){O.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(V.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(o.mediaKeysSessionInitialized){O.logger.warn("Key-Session already initialized but requested again");return}var T=o.mediaKeysSession;if(!T){O.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(V.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!a){O.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(V.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}O.logger.log('Generating key-session request for "'+i+'" init data type'),o.mediaKeysSessionInitialized=!0,T.generateRequest(i,a).then(function(){O.logger.debug("Key-session generation succeeded")}).catch(function(w){O.logger.error("Error generating key-session request:",w),r.hls.trigger(V.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},s._createLicenseXhr=function(i,a,r){var o=new XMLHttpRequest;o.responseType="arraybuffer",o.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,o,i,a,r);var T=this._licenseXhrSetup;if(T)try{T.call(this.hls,o,i),T=void 0}catch(w){O.logger.error(w)}try{o.readyState||o.open("POST",i,!0),T&&T.call(this.hls,o,i)}catch(w){throw new Error("issue setting up KeySystem license XHR "+w)}return o},s._onLicenseRequestReadyStageChange=function(i,a,r,o){switch(i.readyState){case 4:if(i.status===200){this._requestLicenseFailureCount=0,O.logger.log("License request succeeded");var T=i.response,w=this._licenseResponseCallback;if(w)try{T=w.call(this.hls,i,a)}catch(L){O.logger.error(L)}o(T)}else{if(O.logger.error("License Request XHR failed ("+a+"). Status: "+i.status+" ("+i.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>I){this.hls.trigger(V.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var x=I-this._requestLicenseFailureCount+1;O.logger.warn("Retrying license request, "+x+" attempts left"),this._requestLicense(r,o)}break}},s._generateLicenseRequestChallenge=function(i,a){switch(i.mediaKeySystemDomain){case K.KeySystems.WIDEVINE:return a}throw new Error("unsupported key-system: "+i.mediaKeySystemDomain)},s._requestLicense=function(i,a){O.logger.log("Requesting content license for key-system");var r=this._mediaKeysList[0];if(!r){O.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(V.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var o=this.getLicenseServerUrl(r.mediaKeySystemDomain),T=this._createLicenseXhr(o,i,a);O.logger.log("Sending license request to URL: "+o);var w=this._generateLicenseRequestChallenge(r,i);T.send(w)}catch(x){O.logger.error("Failure requesting DRM license: "+x),this.hls.trigger(V.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},s.onMediaAttached=function(i,a){if(!this._emeEnabled)return;var r=a.media;this._media=r,r.addEventListener("encrypted",this._onMediaEncrypted)},s.onMediaDetached=function(){var i=this._media,a=this._mediaKeysList;if(!i)return;i.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(a.map(function(r){if(r.mediaKeysSession)return r.mediaKeysSession.close().catch(function(){})})).then(function(){return i.setMediaKeys(null)}).catch(function(){})},s.onManifestParsed=function(i,a){if(!this._emeEnabled)return;var r=a.levels.map(function(T){return T.audioCodec}).filter(function(T){return!!T}),o=a.levels.map(function(T){return T.videoCodec}).filter(function(T){return!!T});this._attemptKeySystemAccess(K.KeySystems.WIDEVINE,r,o)},n(c,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),c}();z.default=h},"./src/controller/fps-controller.ts":function(J,z,D){"use strict";D.r(z);var V=D("./src/events.ts"),N=D("./src/utils/logger.ts"),O=function(){function K(n){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=n,this.registerListeners()}var W=K.prototype;return W.setStreamController=function(I){this.streamController=I},W.registerListeners=function(){this.hls.on(V.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},W.unregisterListeners=function(){this.hls.off(V.Events.MEDIA_ATTACHING,this.onMediaAttaching)},W.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},W.onMediaAttaching=function(I,g){var f=this.hls.config;if(f.capLevelOnFPSDrop){var h=g.media instanceof self.HTMLVideoElement?g.media:null;this.media=h,h&&typeof h.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),f.fpsDroppedMonitoringPeriod)}},W.checkFPS=function(I,g,f){var h=performance.now();if(g){if(this.lastTime){var c=h-this.lastTime,s=f-this.lastDroppedFrames,d=g-this.lastDecodedFrames,i=1e3*s/c,a=this.hls;if(a.trigger(V.Events.FPS_DROP,{currentDropped:s,currentDecoded:d,totalDroppedFrames:f}),i>0&&s>a.config.fpsDroppedMonitoringThreshold*d){var r=a.currentLevel;N.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+r),r>0&&(a.autoLevelCapping===-1||a.autoLevelCapping>=r)&&(r=r-1,a.trigger(V.Events.FPS_DROP_LEVEL_CAPPING,{level:r,droppedLevel:a.currentLevel}),a.autoLevelCapping=r,this.streamController.nextLevelSwitch())}}this.lastTime=h,this.lastDroppedFrames=f,this.lastDecodedFrames=g}},W.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)},K}();z.default=O},"./src/controller/fragment-finders.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"findFragmentByPDT",function(){return O}),D.d(z,"findFragmentByPTS",function(){return K}),D.d(z,"fragmentWithinToleranceTest",function(){return W}),D.d(z,"pdtWithinToleranceTest",function(){return n}),D.d(z,"findFragWithCC",function(){return I});var V=D("./src/polyfills/number.ts"),N=D("./src/utils/binary-search.ts");function O(g,f,h){if(f===null||!Array.isArray(g)||!g.length||!Object(V.isFiniteNumber)(f))return null;var c=g[0].programDateTime;if(f<(c||0))return null;var s=g[g.length-1].endProgramDateTime;if(f>=(s||0))return null;h=h||0;for(var d=0;d<g.length;++d){var i=g[d];if(n(f,h,i))return i}return null}function K(g,f,h,c){h===void 0&&(h=0),c===void 0&&(c=0);var s=null;if(g?s=f[g.sn-f[0].sn+1]||null:h===0&&f[0].start===0&&(s=f[0]),s&&W(h,c,s)===0)return s;var d=N.default.search(f,W.bind(null,h,c));return d||s}function W(g,f,h){g===void 0&&(g=0),f===void 0&&(f=0);var c=Math.min(f,h.duration+(h.deltaPTS?h.deltaPTS:0));return h.start+h.duration-c<=g?1:h.start-c>g&&h.start?-1:0}function n(g,f,h){var c=Math.min(f,h.duration+(h.deltaPTS?h.deltaPTS:0))*1e3,s=h.endProgramDateTime||0;return s-c>g}function I(g,f){return N.default.search(g,function(h){return h.cc<f?1:h.cc>f?-1:0})}},"./src/controller/fragment-tracker.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"FragmentState",function(){return O}),D.d(z,"FragmentTracker",function(){return K});var V=D("./src/events.ts"),N=D("./src/types/loader.ts"),O;(function(I){I.NOT_LOADED="NOT_LOADED",I.BACKTRACKED="BACKTRACKED",I.APPENDING="APPENDING",I.PARTIAL="PARTIAL",I.OK="OK"})(O||(O={}));var K=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 h=this.hls;h.on(V.Events.BUFFER_APPENDED,this.onBufferAppended,this),h.on(V.Events.FRAG_BUFFERED,this.onFragBuffered,this),h.on(V.Events.FRAG_LOADED,this.onFragLoaded,this)},g._unregisterListeners=function(){var h=this.hls;h.off(V.Events.BUFFER_APPENDED,this.onBufferAppended,this),h.off(V.Events.FRAG_BUFFERED,this.onFragBuffered,this),h.off(V.Events.FRAG_LOADED,this.onFragLoaded,this)},g.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},g.getAppendedFrag=function(h,c){if(c===N.PlaylistLevelType.MAIN){var s=this.activeFragment,d=this.activeParts;if(!s)return null;if(d)for(var i=d.length;i--;){var a=d[i],r=a?a.end:s.appendedPTS;if(a.start<=h&&r!==void 0&&h<=r)return i>9&&(this.activeParts=d.slice(i-9)),a}else if(s.start<=h&&s.appendedPTS!==void 0&&h<=s.appendedPTS)return s}return this.getBufferedFrag(h,c)},g.getBufferedFrag=function(h,c){for(var s=this.fragments,d=Object.keys(s),i=d.length;i--;){var a=s[d[i]];if((a==null?void 0:a.body.type)===c&&a.buffered){var r=a.body;if(r.start<=h&&h<=r.end)return r}}return null},g.detectEvictedFragments=function(h,c,s){var d=this;Object.keys(this.fragments).forEach(function(i){var a=d.fragments[i];if(!a)return;if(!a.buffered){a.body.type===s&&d.removeFragment(a.body);return}var r=a.range[h];if(!r)return;r.time.some(function(o){var T=!d.isTimeBuffered(o.startPTS,o.endPTS,c);return T&&d.removeFragment(a.body),T})})},g.detectPartialFragments=function(h){var c=this,s=this.timeRanges,d=h.frag,i=h.part;if(!s||d.sn==="initSegment")return;var a=n(d),r=this.fragments[a];if(!r)return;Object.keys(s).forEach(function(o){var T=d.elementaryStreams[o];if(!T)return;var w=s[o],x=i!==null||T.partial===!0;r.range[o]=c.getBufferedTimes(d,i,x,w)}),r.backtrack=r.loaded=null,Object.keys(r.range).length?r.buffered=!0:this.removeFragment(r.body)},g.fragBuffered=function(h){var c=n(h),s=this.fragments[c];s&&(s.backtrack=s.loaded=null,s.buffered=!0)},g.getBufferedTimes=function(h,c,s,d){for(var i={time:[],partial:s},a=c?c.start:h.start,r=c?c.end:h.end,o=h.minEndPTS||r,T=h.maxStartPTS||a,w=0;w<d.length;w++){var x=d.start(w)-this.bufferPadding,L=d.end(w)+this.bufferPadding;if(T>=x&&o<=L){i.time.push({startPTS:Math.max(a,d.start(w)),endPTS:Math.min(r,d.end(w))});break}else if(a<L&&r>x)i.partial=!0,i.time.push({startPTS:Math.max(a,d.start(w)),endPTS:Math.min(r,d.end(w))});else if(r<=x)break}return i},g.getPartialFragment=function(h){var c=null,s,d,i,a=0,r=this.bufferPadding,o=this.fragments;return Object.keys(o).forEach(function(T){var w=o[T];if(!w)return;W(w)&&(d=w.body.start-r,i=w.body.end+r,h>=d&&h<=i&&(s=Math.min(h-d,i-h),a<=s&&(c=w.body,a=s)))}),c},g.getState=function(h){var c=n(h),s=this.fragments[c];return s?s.buffered?W(s)?O.PARTIAL:O.OK:s.backtrack?O.BACKTRACKED:O.APPENDING:O.NOT_LOADED},g.backtrack=function(h,c){var s=n(h),d=this.fragments[s];if(!d||d.backtrack)return null;var i=d.backtrack=c||d.loaded;return d.loaded=null,i},g.getBacktrackData=function(h){var c=n(h),s=this.fragments[c];if(s){var d,i=s.backtrack;if(i!=null&&(d=i.payload)!==null&&d!==void 0&&d.byteLength)return i;this.removeFragment(h)}return null},g.isTimeBuffered=function(h,c,s){for(var d,i,a=0;a<s.length;a++){if(d=s.start(a)-this.bufferPadding,i=s.end(a)+this.bufferPadding,h>=d&&c<=i)return!0;if(c<=d)return!1}return!1},g.onFragLoaded=function(h,c){var s=c.frag,d=c.part;if(s.sn==="initSegment"||s.bitrateTest||d)return;var i=n(s);this.fragments[i]={body:s,loaded:c,backtrack:null,buffered:!1,range:Object.create(null)}},g.onBufferAppended=function(h,c){var s=this,d=c.frag,i=c.part,a=c.timeRanges;if(d.type===N.PlaylistLevelType.MAIN)if(this.activeFragment=d,i){var r=this.activeParts;r||(this.activeParts=r=[]),r.push(i)}else this.activeParts=null;this.timeRanges=a,Object.keys(a).forEach(function(o){var T=a[o];if(s.detectEvictedFragments(o,T),!i)for(var w=0;w<T.length;w++)d.appendedPTS=Math.max(T.end(w),d.appendedPTS||0)})},g.onFragBuffered=function(h,c){this.detectPartialFragments(c)},g.hasFragment=function(h){var c=n(h);return!!this.fragments[c]},g.removeFragmentsInRange=function(h,c,s){var d=this;Object.keys(this.fragments).forEach(function(i){var a=d.fragments[i];if(!a)return;if(a.buffered){var r=a.body;r.type===s&&r.start<c&&r.end>h&&d.removeFragment(r)}})},g.removeFragment=function(h){var c=n(h);h.stats.loaded=0,h.clearElementaryStreamInfo(),delete this.fragments[c]},g.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},I}();function W(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 n(I){return I.type+"_"+I.level+"_"+I.urlId+"_"+I.sn}},"./src/controller/gap-controller.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"STALL_MINIMUM_DURATION_MS",function(){return W}),D.d(z,"MAX_START_GAP_JUMP",function(){return n}),D.d(z,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return I}),D.d(z,"SKIP_BUFFER_RANGE_START",function(){return g}),D.d(z,"default",function(){return f});var V=D("./src/utils/buffer-helper.ts"),N=D("./src/errors.ts"),O=D("./src/events.ts"),K=D("./src/utils/logger.ts"),W=250,n=2,I=.1,g=.05,f=function(){function h(s,d,i,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=d,this.fragmentTracker=i,this.hls=a}var c=h.prototype;return c.destroy=function(){this.hls=this.fragmentTracker=this.media=null},c.poll=function(d){var i=this.config,a=this.media,r=this.stalled,o=a.currentTime,T=a.seeking,w=this.seeking&&!T,x=!this.seeking&&T;if(this.seeking=T,o!==d){if(this.moved=!0,r!==null){if(this.stallReported){var L=self.performance.now()-r;K.logger.warn("playback not stuck anymore @"+o+", after "+Math.round(L)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((x||w)&&(this.stalled=null),a.paused||a.ended||a.playbackRate===0||!V.BufferHelper.getBuffered(a).length)return;var A=V.BufferHelper.bufferInfo(a,o,0),_=A.len>0,b=A.nextStart||0;if(!_&&!b)return;if(T){var m=A.len>n,p=!b||b-o>n&&!this.fragmentTracker.getPartialFragment(o);if(m||p)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var C,E=Math.max(b,A.start||0)-o,v=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,P=v==null||((C=v.details)===null||C===void 0)?void 0:C.live,F=P?v.details.targetduration*2:n;if(E>0&&E<=F){this._trySkipBufferHole(null);return}}var R=self.performance.now();if(r===null){this.stalled=R;return}var H=R-r;!T&&H>=W&&this._reportStall(A.len);var U=V.BufferHelper.bufferInfo(a,o,i.maxBufferHole);this._tryFixBufferStall(U,H)},c._tryFixBufferStall=function(d,i){var a=this.config,r=this.fragmentTracker,o=this.media,T=o.currentTime,w=r.getPartialFragment(T);if(w){var x=this._trySkipBufferHole(w);if(x)return}d.len>a.maxBufferHole&&i>a.highBufferWatchdogPeriod*1e3&&(K.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},c._reportStall=function(d){var i=this.hls,a=this.media,r=this.stallReported;r||(this.stallReported=!0,K.logger.warn("Playback stalling at @"+a.currentTime+" due to low buffer (buffer="+d+")"),i.trigger(O.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:d}))},c._trySkipBufferHole=function(d){for(var i=this.config,a=this.hls,r=this.media,o=r.currentTime,T=0,w=V.BufferHelper.getBuffered(r),x=0;x<w.length;x++){var L=w.start(x);if(o+i.maxBufferHole>=T&&o<L){var A=Math.max(L+g,r.currentTime+I);return K.logger.warn("skipping hole, adjusting currentTime from "+o+" to "+A),this.moved=!0,this.stalled=null,r.currentTime=A,d&&a.trigger(O.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+o+" to "+A,frag:d}),A}T=w.end(x)}return 0},c._tryNudgeBuffer=function(){var d=this.config,i=this.hls,a=this.media,r=a.currentTime,o=(this.nudgeRetry||0)+1;if(this.nudgeRetry=o,o<d.nudgeMaxRetry){var T=r+o*d.nudgeOffset;K.logger.warn("Nudging 'currentTime' from "+r+" to "+T),a.currentTime=T,i.trigger(O.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else K.logger.error("Playhead still not moving while enough data buffered @"+r+" after "+d.nudgeMaxRetry+" nudges"),i.trigger(O.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},h}()},"./src/controller/id3-track-controller.ts":function(J,z,D){"use strict";D.r(z);var V=D("./src/events.ts"),N=D("./src/utils/texttrack-utils.ts"),O=D("./src/demux/id3.ts"),K=.25,W=function(){function n(g){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=g,this._registerListeners()}var I=n.prototype;return I.destroy=function(){this._unregisterListeners()},I._registerListeners=function(){var f=this.hls;f.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.on(V.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),f.on(V.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},I._unregisterListeners=function(){var f=this.hls;f.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.off(V.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),f.off(V.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},I.onMediaAttached=function(f,h){this.media=h.media},I.onMediaDetaching=function(){if(!this.id3Track)return;Object(N.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},I.getID3Track=function(f){if(!this.media)return;for(var h=0;h<f.length;h++){var c=f[h];if(c.kind==="metadata"&&c.label==="id3")return Object(N.sendAddTrackEvent)(c,this.media),c}return this.media.addTextTrack("metadata","id3")},I.onFragParsingMetadata=function(f,h){if(!this.media)return;var c=h.frag,s=h.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var d=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,i=0;i<s.length;i++){var a=O.getID3Frames(s[i].data);if(a){var r=s[i].pts,o=i<s.length-1?s[i+1].pts:c.end,T=o-r;T<=0&&(o=r+K);for(var w=0;w<a.length;w++){var x=a[w];if(!O.isTimeStampFrame(x)){var L=new d(r,o,"");L.value=x,this.id3Track.addCue(L)}}}}},I.onBufferFlushing=function(f,h){var c=h.startOffset,s=h.endOffset,d=h.type;if(!d||d==="audio"){var i=this.id3Track;i&&Object(N.removeCuesInRange)(i,c,s)}},n}();z.default=W},"./src/controller/latency-controller.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"default",function(){return n});var V=D("./src/errors.ts"),N=D("./src/events.ts"),O=D("./src/utils/logger.ts");function K(I,g){for(var f=0;f<g.length;f++){var h=g[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(I,h.key,h)}}function W(I,g,f){return g&&K(I.prototype,g),f&&K(I,f),I}var n=function(){function I(f){var h=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return h.timeupdate()},this.hls=f,this.config=f.config,this.registerListeners()}var g=I.prototype;return g.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},g.registerListeners=function(){this.hls.on(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(N.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(N.Events.ERROR,this.onError,this)},g.unregisterListeners=function(){this.hls.off(N.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(N.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(N.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(N.Events.ERROR,this.onError)},g.onMediaAttached=function(h,c){this.media=c.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},g.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},g.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},g.onLevelUpdated=function(h,c){var s=c.details;this.levelDetails=s,s.advanced&&this.timeupdate(),!s.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},g.onError=function(h,c){if(c.details!==V.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,O.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},g.timeupdate=function(){var h=this.media,c=this.levelDetails;if(!h||!c)return;this.currentTime=h.currentTime;var s=this.computeLatency();if(s===null)return;this._latency=s;var d=this.config,i=d.lowLatencyMode,a=d.maxLiveSyncPlaybackRate;if(!i||a===1)return;var r=this.targetLatency;if(r===null)return;var o=s-r,T=Math.min(this.maxLatency,r+c.targetduration),w=o<T;if(c.live&&w&&o>.05&&this.forwardBufferLength>1){var x=Math.min(2,Math.max(1,a)),L=Math.round(2/(1+Math.exp(-.75*o-this.edgeStalled))*20)/20;h.playbackRate=Math.min(x,Math.max(1,L))}else h.playbackRate!==1&&h.playbackRate!==0&&(h.playbackRate=1)},g.estimateLiveEdge=function(){var h=this.levelDetails;return h===null?null:h.edge+h.age},g.computeLatency=function(){var h=this.estimateLiveEdge();return h===null?null:h-this.currentTime},W(I,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var h=this.config,c=this.levelDetails;return h.liveMaxLatencyDuration!==void 0?h.liveMaxLatencyDuration:c?h.liveMaxLatencyDurationCount*c.targetduration:0}},{key:"targetLatency",get:function(){var h=this.levelDetails;if(h===null)return null;var c=h.holdBack,s=h.partHoldBack,d=h.targetduration,i=this.config,a=i.liveSyncDuration,r=i.liveSyncDurationCount,o=i.lowLatencyMode,T=this.hls.userConfig,w=o&&s||c;(T.liveSyncDuration||T.liveSyncDurationCount||w===0)&&(w=a!==void 0?a:r*d);var x=d,L=1;return w+Math.min(this.stallCount*L,x)}},{key:"liveSyncPosition",get:function(){var h=this.estimateLiveEdge(),c=this.targetLatency,s=this.levelDetails;if(h===null||c===null||s===null)return null;var d=s.edge,i=h-c-this.edgeStalled,a=d-s.totalduration,r=d-(this.config.lowLatencyMode&&s.partTarget||s.targetduration);return Math.min(Math.max(a,i),r)}},{key:"drift",get:function(){var h=this.levelDetails;return h===null?1:h.drift}},{key:"edgeStalled",get:function(){var h=this.levelDetails;if(h===null)return 0;var c=(this.config.lowLatencyMode&&h.partTarget||h.targetduration)*3;return Math.max(h.age-c,0)}},{key:"forwardBufferLength",get:function(){var h=this.media,c=this.levelDetails;if(!h||!c)return 0;var s=h.buffered.length;return s?h.buffered.end(s-1):c.edge-this.currentTime}}]),I}()},"./src/controller/level-controller.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"default",function(){return i});var V=D("./src/types/level.ts"),N=D("./src/events.ts"),O=D("./src/errors.ts"),K=D("./src/utils/codecs.ts"),W=D("./src/controller/level-helper.ts"),n=D("./src/controller/base-playlist-controller.ts"),I=D("./src/types/loader.ts");function g(){return g=Object.assign||function(a){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var T in o)Object.prototype.hasOwnProperty.call(o,T)&&(a[T]=o[T])}return a},g.apply(this,arguments)}function f(a,r){for(var o=0;o<r.length;o++){var T=r[o];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(a,T.key,T)}}function h(a,r,o){return r&&f(a.prototype,r),o&&f(a,o),a}function c(a,r){a.prototype=Object.create(r.prototype),a.prototype.constructor=a,s(a,r)}function s(a,r){return s=Object.setPrototypeOf||function(T,w){return T.__proto__=w,T},s(a,r)}var d=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),i=function(a){c(r,a);function r(T){var w;return w=a.call(this,T,"[level-controller]")||this,w._levels=[],w._firstLevel=-1,w._startLevel=void 0,w.currentLevelIndex=-1,w.manualLevelIndex=-1,w.onParsedComplete=void 0,w._registerListeners(),w}var o=r.prototype;return o._registerListeners=function(){var w=this.hls;w.on(N.Events.MANIFEST_LOADED,this.onManifestLoaded,this),w.on(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.on(N.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),w.on(N.Events.FRAG_LOADED,this.onFragLoaded,this),w.on(N.Events.ERROR,this.onError,this)},o._unregisterListeners=function(){var w=this.hls;w.off(N.Events.MANIFEST_LOADED,this.onManifestLoaded,this),w.off(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.off(N.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),w.off(N.Events.FRAG_LOADED,this.onFragLoaded,this),w.off(N.Events.ERROR,this.onError,this)},o.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,a.prototype.destroy.call(this)},o.startLoad=function(){var w=this._levels;w.forEach(function(x){x.loadError=0}),a.prototype.startLoad.call(this)},o.onManifestLoaded=function(w,x){var L=[],A=[],_=[],b,m={},p,C=!1,E=!1,v=!1;if(x.levels.forEach(function(H){var U=H.attrs;C=C||!!(H.width&&H.height),E=E||!!H.videoCodec,v=v||!!H.audioCodec,d&&H.audioCodec&&H.audioCodec.indexOf("mp4a.40.34")!==-1&&(H.audioCodec=void 0);var S=H.bitrate+"-"+H.attrs.RESOLUTION+"-"+H.attrs.CODECS;p=m[S],p?p.url.push(H.url):(p=new V.Level(H),m[S]=p,L.push(p)),U&&(U.AUDIO&&Object(W.addGroupId)(p,"audio",U.AUDIO),U.SUBTITLES&&Object(W.addGroupId)(p,"text",U.SUBTITLES))}),(C||E)&&v&&(L=L.filter(function(H){var U=H.videoCodec,S=H.width,G=H.height;return!!U||!!(S&&G)})),L=L.filter(function(H){var U=H.audioCodec,S=H.videoCodec;return(!U||Object(K.isCodecSupportedInMp4)(U,"audio"))&&(!S||Object(K.isCodecSupportedInMp4)(S,"video"))}),x.audioTracks&&(A=x.audioTracks.filter(function(H){return!H.audioCodec||Object(K.isCodecSupportedInMp4)(H.audioCodec,"audio")}),Object(W.assignTrackIdsByGroup)(A)),x.subtitles&&(_=x.subtitles,Object(W.assignTrackIdsByGroup)(_)),L.length>0){b=L[0].bitrate,L.sort(function(H,U){return H.bitrate-U.bitrate}),this._levels=L;for(var P=0;P<L.length;P++)if(L[P].bitrate===b){this._firstLevel=P,this.log("manifest loaded, "+L.length+" level(s) found, first bitrate: "+b);break}var F=v&&!E,R={levels:L,audioTracks:A,subtitleTracks:_,firstLevel:this._firstLevel,stats:x.stats,audio:v,video:E,altAudio:!F&&A.some(function(H){return!!H.url})};this.hls.trigger(N.Events.MANIFEST_PARSED,R),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(N.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:x.url,reason:"no level with compatible codecs found in manifest"})},o.onError=function(w,x){if(a.prototype.onError.call(this,w,x),x.fatal)return;var L=x.context,A=this._levels[this.currentLevelIndex];if(L&&(L.type===I.PlaylistContextType.AUDIO_TRACK&&A.audioGroupIds&&L.groupId===A.audioGroupIds[A.urlId]||L.type===I.PlaylistContextType.SUBTITLE_TRACK&&A.textGroupIds&&L.groupId===A.textGroupIds[A.urlId])){this.redundantFailover(this.currentLevelIndex);return}var _=!1,b=!0,m;switch(x.details){case O.ErrorDetails.FRAG_LOAD_ERROR:case O.ErrorDetails.FRAG_LOAD_TIMEOUT:case O.ErrorDetails.KEY_LOAD_ERROR:case O.ErrorDetails.KEY_LOAD_TIMEOUT:if(x.frag){var p=this._levels[x.frag.level];p?(p.fragmentError++,p.fragmentError>this.hls.config.fragLoadingMaxRetry&&(m=x.frag.level)):m=x.frag.level}break;case O.ErrorDetails.LEVEL_LOAD_ERROR:case O.ErrorDetails.LEVEL_LOAD_TIMEOUT:L&&(L.deliveryDirectives&&(b=!1),m=L.level),_=!0;break;case O.ErrorDetails.REMUX_ALLOC_ERROR:m=x.level,_=!0;break}m!==void 0&&this.recoverLevel(x,m,_,b)},o.recoverLevel=function(w,x,L,A){var _=w.details,b=this._levels[x];if(b.loadError++,L){var m=this.retryLoadingOrFail(w);if(m)w.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(A){var p=b.url.length;if(p>1&&b.loadError<p)w.levelRetry=!0,this.redundantFailover(x);else if(this.manualLevelIndex===-1){var C=x===0?this._levels.length-1:x-1;this.currentLevelIndex!==C&&this._levels[C].loadError===0&&(this.warn(_+": switch to "+C),w.levelRetry=!0,this.hls.nextAutoLevel=C)}}},o.redundantFailover=function(w){var x=this._levels[w],L=x.url.length;if(L>1){var A=(x.urlId+1)%L;this.warn("Switching to redundant URL-id "+A),this._levels.forEach(function(_){_.urlId=A}),this.level=w}},o.onFragLoaded=function(w,x){var L=x.frag;if(L!==void 0&&L.type===I.PlaylistLevelType.MAIN){var A=this._levels[L.level];A!==void 0&&(A.fragmentError=0,A.loadError=0)}},o.onLevelLoaded=function(w,x){var L,A=x.level,_=x.details,b=this._levels[A];if(!b){var m;this.warn("Invalid level index "+A),(m=x.deliveryDirectives)!==null&&m!==void 0&&m.skip&&(_.deltaUpdateFailed=!0);return}A===this.currentLevelIndex?(b.fragmentError===0&&(b.loadError=0,this.retryCount=0),this.playlistLoaded(A,x,b.details)):(L=x.deliveryDirectives)!==null&&L!==void 0&&L.skip&&(_.deltaUpdateFailed=!0)},o.onAudioTrackSwitched=function(w,x){var L=this.hls.levels[this.currentLevelIndex];if(!L)return;if(L.audioGroupIds){for(var A=-1,_=this.hls.audioTracks[x.id].groupId,b=0;b<L.audioGroupIds.length;b++)if(L.audioGroupIds[b]===_){A=b;break}A!==L.urlId&&(L.urlId=A,this.startLoad())}},o.loadPlaylist=function(w){var x=this.currentLevelIndex,L=this._levels[x];if(this.canLoad&&L&&L.url.length>0){var A=L.urlId,_=L.url[A];if(w)try{_=w.addDirectives(_)}catch(b){this.warn("Could not construct new URL with HLS Delivery Directives: "+b)}this.log("Attempt loading level index "+x+(w?" at sn "+w.msn+" part "+w.part:"")+" with URL-id "+A+" "+_),this.clearTimer(),this.hls.trigger(N.Events.LEVEL_LOADING,{url:_,level:x,id:A,deliveryDirectives:w||null})}},o.removeLevel=function(w,x){var L=function(b,m){return m!==x},A=this._levels.filter(function(_,b){return b!==w?!0:_.url.length>1&&x!==void 0?(_.url=_.url.filter(L),_.audioGroupIds&&(_.audioGroupIds=_.audioGroupIds.filter(L)),_.textGroupIds&&(_.textGroupIds=_.textGroupIds.filter(L)),_.urlId=0,!0):!1}).map(function(_,b){var m=_.details;return m!=null&&m.fragments&&m.fragments.forEach(function(p){p.level=b}),_});this._levels=A,this.hls.trigger(N.Events.LEVELS_UPDATED,{levels:A})},h(r,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(w){var x,L=this._levels;if(L.length===0)return;if(this.currentLevelIndex===w&&(x=L[w])!==null&&x!==void 0&&x.details)return;if(w<0||w>=L.length){var A=w<0;if(this.hls.trigger(N.Events.ERROR,{type:O.ErrorTypes.OTHER_ERROR,details:O.ErrorDetails.LEVEL_SWITCH_ERROR,level:w,fatal:A,reason:"invalid level idx"}),A)return;w=Math.min(w,L.length-1)}this.clearTimer();var _=this.currentLevelIndex,b=L[_],m=L[w];this.log("switching to level "+w+" from "+_),this.currentLevelIndex=w;var p=g({},m,{level:w,maxBitrate:m.maxBitrate,uri:m.uri,urlId:m.urlId});delete p._urlId,this.hls.trigger(N.Events.LEVEL_SWITCHING,p);var C=m.details;if(!C||C.live){var E=this.switchParams(m.uri,b==null?void 0:b.details);this.loadPlaylist(E)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(w){this.manualLevelIndex=w,this._startLevel===void 0&&(this._startLevel=w),w!==-1&&(this.level=w)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(w){this._firstLevel=w}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var w=this.hls.config.startLevel;return w!==void 0?w:this._firstLevel}else return this._startLevel},set:function(w){this._startLevel=w}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(w){this.level=w,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=w)}}]),r}(n.default)},"./src/controller/level-helper.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"addGroupId",function(){return O}),D.d(z,"assignTrackIdsByGroup",function(){return K}),D.d(z,"updatePTS",function(){return W}),D.d(z,"updateFragPTSDTS",function(){return I}),D.d(z,"mergeDetails",function(){return g}),D.d(z,"mapPartIntersection",function(){return f}),D.d(z,"mapFragmentIntersection",function(){return h}),D.d(z,"adjustSliding",function(){return c}),D.d(z,"addSliding",function(){return s}),D.d(z,"computeReloadInterval",function(){return d}),D.d(z,"getFragmentWithSN",function(){return i}),D.d(z,"getPartWith",function(){return a});var V=D("./src/polyfills/number.ts"),N=D("./src/utils/logger.ts");function O(r,o,T){switch(o){case"audio":r.audioGroupIds||(r.audioGroupIds=[]),r.audioGroupIds.push(T);break;case"text":r.textGroupIds||(r.textGroupIds=[]),r.textGroupIds.push(T);break}}function K(r){var o={};r.forEach(function(T){var w=T.groupId||"";T.id=o[w]=o[w]||0,o[w]++})}function W(r,o,T){var w=r[o],x=r[T];n(w,x)}function n(r,o){var T=o.startPTS;if(Object(V.isFiniteNumber)(T)){var w=0,x;o.sn>r.sn?(w=T-r.start,x=r):(w=r.start-T,x=o),x.duration!==w&&(x.duration=w)}else if(o.sn>r.sn){var L=r.cc===o.cc;L&&r.minEndPTS?o.start=r.start+(r.minEndPTS-r.start):o.start=r.start+r.duration}else o.start=Math.max(r.start-o.duration,0)}function I(r,o,T,w,x,L){var A=w-T;A<=0&&(N.logger.warn("Fragment should have a positive duration",o),w=T+o.duration,L=x+o.duration);var _=T,b=w,m=o.startPTS,p=o.endPTS;if(Object(V.isFiniteNumber)(m)){var C=Math.abs(m-T);Object(V.isFiniteNumber)(o.deltaPTS)?o.deltaPTS=Math.max(C,o.deltaPTS):o.deltaPTS=C,_=Math.max(T,m),T=Math.min(T,m),x=Math.min(x,o.startDTS),b=Math.min(w,p),w=Math.max(w,p),L=Math.max(L,o.endDTS)}o.duration=w-T;var E=T-o.start;o.appendedPTS=w,o.start=o.startPTS=T,o.maxStartPTS=_,o.startDTS=x,o.endPTS=w,o.minEndPTS=b,o.endDTS=L;var v=o.sn;if(!r||v<r.startSN||v>r.endSN)return 0;var P,F=v-r.startSN,R=r.fragments;for(R[F]=o,P=F;P>0;P--)n(R[P],R[P-1]);for(P=F;P<R.length-1;P++)n(R[P],R[P+1]);return r.fragmentHint&&n(R[R.length-1],r.fragmentHint),r.PTSKnown=r.alignedSliding=!0,E}function g(r,o){for(var T=null,w=r.fragments,x=w.length-1;x>=0;x--){var L=w[x].initSegment;if(L){T=L;break}}r.fragmentHint&&delete r.fragmentHint.endPTS;var A=0,_;if(h(r,o,function(P,F){P.relurl&&(A=P.cc-F.cc),Object(V.isFiniteNumber)(P.startPTS)&&Object(V.isFiniteNumber)(P.endPTS)&&(F.start=F.startPTS=P.startPTS,F.startDTS=P.startDTS,F.appendedPTS=P.appendedPTS,F.maxStartPTS=P.maxStartPTS,F.endPTS=P.endPTS,F.endDTS=P.endDTS,F.minEndPTS=P.minEndPTS,F.duration=P.endPTS-P.startPTS,F.duration&&(_=F),o.PTSKnown=o.alignedSliding=!0),F.elementaryStreams=P.elementaryStreams,F.loader=P.loader,F.stats=P.stats,F.urlId=P.urlId,P.initSegment&&(F.initSegment=P.initSegment,T=P.initSegment)}),T){var b=o.fragmentHint?o.fragments.concat(o.fragmentHint):o.fragments;b.forEach(function(P){var F;(!P.initSegment||P.initSegment.relurl===((F=T)===null||F===void 0?void 0:F.relurl))&&(P.initSegment=T)})}if(o.skippedSegments&&(o.deltaUpdateFailed=o.fragments.some(function(P){return!P}),o.deltaUpdateFailed)){N.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var m=o.skippedSegments;m--;)o.fragments.shift();o.startSN=o.fragments[0].sn,o.startCC=o.fragments[0].cc}var p=o.fragments;if(A){N.logger.warn("discontinuity sliding from playlist, take drift into account");for(var C=0;C<p.length;C++)p[C].cc+=A}o.skippedSegments&&(o.startCC=o.fragments[0].cc),f(r.partList,o.partList,function(P,F){F.elementaryStreams=P.elementaryStreams,F.stats=P.stats}),_?I(o,_,_.startPTS,_.endPTS,_.startDTS,_.endDTS):c(r,o),p.length&&(o.totalduration=o.edge-p[0].start),o.driftStartTime=r.driftStartTime,o.driftStart=r.driftStart;var E=o.advancedDateTime;if(o.advanced&&E){var v=o.edge;o.driftStart||(o.driftStartTime=E,o.driftStart=v),o.driftEndTime=E,o.driftEnd=v}else o.driftEndTime=r.driftEndTime,o.driftEnd=r.driftEnd,o.advancedDateTime=r.advancedDateTime}function f(r,o,T){if(r&&o)for(var w=0,x=0,L=r.length;x<=L;x++){var A=r[x],_=o[x+w];A&&_&&A.index===_.index&&A.fragment.sn===_.fragment.sn?T(A,_):w--}}function h(r,o,T){for(var w=o.skippedSegments,x=Math.max(r.startSN,o.startSN)-o.startSN,L=(r.fragmentHint?1:0)+(w?o.endSN:Math.min(r.endSN,o.endSN))-o.startSN,A=o.startSN-r.startSN,_=o.fragmentHint?o.fragments.concat(o.fragmentHint):o.fragments,b=r.fragmentHint?r.fragments.concat(r.fragmentHint):r.fragments,m=x;m<=L;m++){var p=b[A+m],C=_[m];w&&!C&&m<w&&(C=o.fragments[m]=p),p&&C&&T(p,C)}}function c(r,o){var T=o.startSN+o.skippedSegments-r.startSN,w=r.fragments;if(T<0||T>=w.length)return;s(o,w[T].start)}function s(r,o){if(o){for(var T=r.fragments,w=r.skippedSegments;w<T.length;w++)T[w].start+=o;r.fragmentHint&&(r.fragmentHint.start+=o)}}function d(r,o){var T=1e3*r.levelTargetDuration,w=T/2,x=r.age,L=x>0&&x<T*3,A=o.loading.end-o.loading.start,_,b=r.availabilityDelay;if(r.updated===!1)if(L){var m=333*r.misses;_=Math.max(Math.min(w,A*2),m),r.availabilityDelay=(r.availabilityDelay||0)+_}else _=w;else L?(b=Math.min(b||T/2,x),r.availabilityDelay=b,_=b+T-x):_=T-A;return Math.round(_)}function i(r,o,T){if(!r||!r.details)return null;var w=r.details,x=w.fragments[o-w.startSN];return x||(x=w.fragmentHint,x&&x.sn===o?x:o<w.startSN&&T&&T.sn===o?T:null)}function a(r,o,T){if(!r||!r.details)return null;var w=r.details.partList;if(w)for(var x=w.length;x--;){var L=w[x];if(L.index===T&&L.fragment.sn===o)return L}return null}},"./src/controller/stream-controller.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"default",function(){return w});var V=D("./src/polyfills/number.ts"),N=D("./src/controller/base-stream-controller.ts"),O=D("./src/is-supported.ts"),K=D("./src/events.ts"),W=D("./src/utils/buffer-helper.ts"),n=D("./src/controller/fragment-tracker.ts"),I=D("./src/types/loader.ts"),g=D("./src/loader/fragment.ts"),f=D("./src/demux/transmuxer-interface.ts"),h=D("./src/types/transmuxer.ts"),c=D("./src/controller/gap-controller.ts"),s=D("./src/errors.ts"),d=D("./src/utils/logger.ts");function i(x,L){for(var A=0;A<L.length;A++){var _=L[A];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(x,_.key,_)}}function a(x,L,A){return L&&i(x.prototype,L),A&&i(x,A),x}function r(x,L){x.prototype=Object.create(L.prototype),x.prototype.constructor=x,o(x,L)}function o(x,L){return o=Object.setPrototypeOf||function(_,b){return _.__proto__=b,_},o(x,L)}var T=100,w=function(x){r(L,x);function L(_,b){var m;return m=x.call(this,_,b,"[stream-controller]")||this,m.audioCodecSwap=!1,m.gapController=null,m.level=-1,m._forceStartLoad=!1,m.altAudio=!1,m.audioOnly=!1,m.fragPlaying=null,m.onvplaying=null,m.onvseeked=null,m.fragLastKbps=0,m.stalled=!1,m.couldBacktrack=!1,m.audioCodecSwitch=!1,m.videoBuffer=null,m._registerListeners(),m}var A=L.prototype;return A._registerListeners=function(){var b=this.hls;b.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),b.on(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.on(K.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),b.on(K.Events.ERROR,this.onError,this),b.on(K.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),b.on(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),b.on(K.Events.BUFFER_CREATED,this.onBufferCreated,this),b.on(K.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),b.on(K.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),b.on(K.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A._unregisterListeners=function(){var b=this.hls;b.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.off(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.off(K.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),b.off(K.Events.ERROR,this.onError,this),b.off(K.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),b.off(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),b.off(K.Events.BUFFER_CREATED,this.onBufferCreated,this),b.off(K.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),b.off(K.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),b.off(K.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},A.startLoad=function(b){if(this.levels){var m=this.lastCurrentTime,p=this.hls;if(this.stopLoad(),this.setInterval(T),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var C=p.startLevel;C===-1&&(p.config.testBandwidth?(C=0,this.bitrateTest=!0):C=p.nextAutoLevel),this.level=p.nextLoadLevel=C,this.loadedmetadata=!1}m>0&&b===-1&&(this.log("Override startPosition with lastCurrentTime @"+m.toFixed(3)),b=m),this.state=N.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=b,this.tick()}else this._forceStartLoad=!0,this.state=N.State.STOPPED},A.stopLoad=function(){this._forceStartLoad=!1,x.prototype.stopLoad.call(this)},A.doTick=function(){switch(this.state){case N.State.IDLE:this.doTickIdle();break;case N.State.WAITING_LEVEL:{var b,m=this.levels,p=this.level,C=m==null||((b=m[p])===null||b===void 0)?void 0:b.details;if(C&&(!C.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(C))break;this.state=N.State.IDLE;break}break}case N.State.FRAG_LOADING_WAITING_RETRY:{var E,v=self.performance.now(),P=this.retryDate;(!P||v>=P||(E=this.media)!==null&&E!==void 0&&E.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=N.State.IDLE)}break;default:break}this.onTickEnd()},A.onTickEnd=function(){x.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},A.doTickIdle=function(){var b,m,p=this.hls,C=this.levelLastLoaded,E=this.levels,v=this.media,P=p.config,F=p.nextLoadLevel;if(C===null||!v&&(this.startFragRequested||!P.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!E||!E[F])return;var R=E[F];this.level=p.nextLoadLevel=F;var H=R.details;if(!H||this.state===N.State.WAITING_LEVEL||H.live&&this.levelLastLoaded!==F){this.state=N.State.WAITING_LEVEL;return}var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:v,I.PlaylistLevelType.MAIN);if(U===null)return;var S=U.len,G=this.getMaxBufferLength(R.maxBitrate);if(S>=G)return;if(this._streamEnded(U,H)){var Q={};this.altAudio&&(Q.type="video"),this.hls.trigger(K.Events.BUFFER_EOS,Q),this.state=N.State.ENDED;return}var se=U.end,fe=this.getNextFragment(se,H);if(this.couldBacktrack&&!this.fragPrevious&&fe&&fe.sn!=="initSegment"){var we=fe.sn-H.startSN;we>1&&(fe=H.fragments[we-1],this.fragmentTracker.removeFragment(fe))}if(fe&&this.fragmentTracker.getState(fe)===n.FragmentState.OK&&this.nextLoadPosition>se){var be=this.audioOnly&&!this.altAudio?g.ElementaryStreamTypes.AUDIO:g.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(v,be,I.PlaylistLevelType.MAIN),fe=this.getNextFragment(this.nextLoadPosition,H)}if(!fe)return;fe.initSegment&&!fe.initSegment.data&&!this.bitrateTest&&(fe=fe.initSegment),((b=fe.decryptdata)===null||b===void 0?void 0:b.keyFormat)==="identity"&&!((m=fe.decryptdata)!==null&&m!==void 0&&m.key)?this.loadKey(fe,H):this.loadFragment(fe,H,se)},A.loadFragment=function(b,m,p){var C,E=this.fragmentTracker.getState(b);if(this.fragCurrent=b,E===n.FragmentState.BACKTRACKED){var v=this.fragmentTracker.getBacktrackData(b);if(v){this._handleFragmentLoadProgress(v),this._handleFragmentLoadComplete(v);return}else E=n.FragmentState.NOT_LOADED}E===n.FragmentState.NOT_LOADED||E===n.FragmentState.PARTIAL?b.sn==="initSegment"?this._loadInitSegment(b):this.bitrateTest?(b.bitrateTest=!0,this.log("Fragment "+b.sn+" of level "+b.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(b)):(this.startFragRequested=!0,x.prototype.loadFragment.call(this,b,m,p)):E===n.FragmentState.APPENDING?this.reduceMaxBufferLength(b.duration)&&this.fragmentTracker.removeFragment(b):((C=this.media)===null||C===void 0?void 0:C.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},A.getAppendedFrag=function(b){var m=this.fragmentTracker.getAppendedFrag(b,I.PlaylistLevelType.MAIN);return m&&"fragment"in m?m.fragment:m},A.getBufferedFrag=function(b){return this.fragmentTracker.getBufferedFrag(b,I.PlaylistLevelType.MAIN)},A.followingBufferedFrag=function(b){return b?this.getBufferedFrag(b.end+.5):null},A.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},A.nextLevelSwitch=function(){var b=this.levels,m=this.media;if(m!=null&&m.readyState){var p,C=this.getAppendedFrag(m.currentTime);if(C&&C.start>1&&this.flushMainBuffer(0,C.start-1),!m.paused&&b){var E=this.hls.nextLoadLevel,v=b[E],P=this.fragLastKbps;P&&this.fragCurrent?p=this.fragCurrent.duration*v.maxBitrate/(1e3*P)+1:p=0}else p=0;var F=this.getBufferedFrag(m.currentTime+p);if(F){var R=this.followingBufferedFrag(F);if(R){this.abortCurrentFrag();var H=R.maxStartPTS?R.maxStartPTS:R.start,U=R.duration,S=Math.max(F.end,H+Math.min(Math.max(U-this.config.maxFragLookUpTolerance,U*.5),U*.75));this.flushMainBuffer(S,Number.POSITIVE_INFINITY)}}}},A.abortCurrentFrag=function(){var b=this.fragCurrent;this.fragCurrent=null,b!=null&&b.loader&&b.loader.abort(),this.state===N.State.KEY_LOADING&&(this.state=N.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},A.flushMainBuffer=function(b,m){x.prototype.flushMainBuffer.call(this,b,m,this.altAudio?"video":null)},A.onMediaAttached=function(b,m){x.prototype.onMediaAttached.call(this,b,m);var p=m.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),p.addEventListener("playing",this.onvplaying),p.addEventListener("seeked",this.onvseeked),this.gapController=new c.default(this.config,p,this.fragmentTracker,this.hls)},A.onMediaDetaching=function(){var b=this.media;b&&(b.removeEventListener("playing",this.onvplaying),b.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)},A.onMediaPlaying=function(){this.tick()},A.onMediaSeeked=function(){var b=this.media,m=b?b.currentTime:null;Object(V.isFiniteNumber)(m)&&this.log("Media seeked to "+m.toFixed(3)),this.tick()},A.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(K.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},A.onManifestParsed=function(b,m){var p=!1,C=!1,E;m.levels.forEach(function(v){E=v.audioCodec,E&&(E.indexOf("mp4a.40.2")!==-1&&(p=!0),E.indexOf("mp4a.40.5")!==-1&&(C=!0))}),this.audioCodecSwitch=p&&C&&!Object(O.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=m.levels,this.startFragRequested=!1},A.onLevelLoading=function(b,m){var p=this.levels;if(!p||this.state!==N.State.IDLE)return;var C=p[m.level];(!C.details||C.details.live&&this.levelLastLoaded!==m.level||this.waitForCdnTuneIn(C.details))&&(this.state=N.State.WAITING_LEVEL)},A.onLevelLoaded=function(b,m){var p,C=this.levels,E=m.level,v=m.details,P=v.totalduration;if(!C){this.warn("Levels were reset while loading level "+E);return}this.log("Level "+E+" loaded ["+v.startSN+","+v.endSN+"], cc ["+v.startCC+", "+v.endCC+"] duration:"+P);var F=this.fragCurrent;F&&(this.state===N.State.FRAG_LOADING||this.state===N.State.FRAG_LOADING_WAITING_RETRY)&&(F.level!==m.level&&F.loader&&(this.state=N.State.IDLE,F.loader.abort()));var R=C[E],H=0;if(v.live||(p=R.details)!==null&&p!==void 0&&p.live){if(v.fragments[0]||(v.deltaUpdateFailed=!0),v.deltaUpdateFailed)return;H=this.alignPlaylists(v,R.details)}if(R.details=v,this.levelLastLoaded=E,this.hls.trigger(K.Events.LEVEL_UPDATED,{details:v,level:E}),this.state===N.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(v))return;this.state=N.State.IDLE}this.startFragRequested?v.live&&this.synchronizeToLiveEdge(v):this.setStartPosition(v,H),this.tick()},A._handleFragmentLoadProgress=function(b){var m,p=b.frag,C=b.part,E=b.payload,v=this.levels;if(!v){this.warn("Levels were reset while fragment load was in progress. Fragment "+p.sn+" of level "+p.level+" will not be buffered");return}var P=v[p.level],F=P.details;if(!F){this.warn("Dropping fragment "+p.sn+" of level "+p.level+" after level details were reset");return}var R=P.videoCodec,H=F.PTSKnown||!F.live,U=(m=p.initSegment)===null||m===void 0?void 0:m.data,S=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=C?C.index:-1,se=Q!==-1,fe=new h.ChunkMetadata(p.level,p.sn,p.stats.chunkCount,E.byteLength,Q,se),we=this.initPTS[p.cc];G.push(E,U,S,R,p,C,F.totalduration,H,fe,we)},A.onAudioTrackSwitching=function(b,m){var p=this.altAudio,C=!!m.url,E=m.id;if(!C){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var v=this.fragCurrent;v!=null&&v.loader&&(this.log("Switching to main audio track, cancel main fragment load"),v.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var P=this.hls;p&&P.trigger(K.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),P.trigger(K.Events.AUDIO_TRACK_SWITCHED,{id:E})}},A.onAudioTrackSwitched=function(b,m){var p=m.id,C=!!this.hls.audioTracks[p].url;if(C){var E=this.videoBuffer;E&&this.mediaBuffer!==E&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=E)}this.altAudio=C,this.tick()},A.onBufferCreated=function(b,m){var p=m.tracks,C,E,v=!1;for(var P in p){var F=p[P];if(F.id==="main"){if(E=P,C=F,P==="video"){var R=p[P];R&&(this.videoBuffer=R.buffer)}}else v=!0}v&&C?(this.log("Alternate track found, use "+E+".buffered to schedule main fragment loading"),this.mediaBuffer=C.buffer):this.mediaBuffer=this.media},A.onFragBuffered=function(b,m){var p=m.frag,C=m.part;if(p&&p.type!==I.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(p)){this.warn("Fragment "+p.sn+(C?" p: "+C.index:"")+" of level "+p.level+" finished buffering, but was aborted. state: "+this.state),this.state===N.State.PARSED&&(this.state=N.State.IDLE);return}var E=C?C.stats:p.stats;this.fragLastKbps=Math.round(8*E.total/(E.buffering.end-E.loading.first)),p.sn!=="initSegment"&&(this.fragPrevious=p),this.fragBufferedComplete(p,C)},A.onError=function(b,m){switch(m.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,m);break;case s.ErrorDetails.LEVEL_LOAD_ERROR:case s.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==N.State.ERROR&&(m.fatal?(this.warn(""+m.details),this.state=N.State.ERROR):!m.levelRetry&&this.state===N.State.WAITING_LEVEL&&(this.state=N.State.IDLE));break;case s.ErrorDetails.BUFFER_FULL_ERROR:if(m.parent==="main"&&(this.state===N.State.PARSING||this.state===N.State.PARSED)){var p=!0,C=this.getFwdBufferInfo(this.media,I.PlaylistLevelType.MAIN);C&&C.len>.5&&(p=!this.reduceMaxBufferLength(C.len)),p&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},A.checkBuffer=function(){var b=this.media,m=this.gapController;if(!b||!m||!b.readyState)return;var p=W.BufferHelper.getBuffered(b);!this.loadedmetadata&&p.length?(this.loadedmetadata=!0,this.seekToStartPos()):m.poll(this.lastCurrentTime),this.lastCurrentTime=b.currentTime},A.onFragLoadEmergencyAborted=function(){this.state=N.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},A.onBufferFlushed=function(b,m){var p=m.type;if(p!==g.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var C=(p===g.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(C,p,I.PlaylistLevelType.MAIN)}},A.onLevelsUpdated=function(b,m){this.levels=m.levels},A.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},A.seekToStartPos=function(){var b=this.media,m=b.currentTime,p=this.startPosition;if(p>=0&&m<p){if(b.seeking){d.logger.log("could not seek to "+p+", already seeking at "+m);return}var C=W.BufferHelper.getBuffered(b),E=C.length?C.start(0):0,v=E-p;v>0&&(v<this.config.maxBufferHole||v<this.config.maxFragLookUpTolerance)&&(d.logger.log("adjusting start position by "+v+" to match buffer start"),p+=v,this.startPosition=p),this.log("seek to target start position "+p+" from current time "+m),b.currentTime=p}},A._getAudioCodec=function(b){var m=this.config.defaultAudioCodec||b.audioCodec;return this.audioCodecSwap&&m&&(this.log("Swapping audio codec"),m.indexOf("mp4a.40.5")!==-1?m="mp4a.40.2":m="mp4a.40.5"),m},A._loadBitrateTestFrag=function(b){var m=this;this._doFragLoad(b).then(function(p){var C=m.hls;if(!p||C.nextLoadLevel||m.fragContextChanged(b))return;m.fragLoadError=0,m.state=N.State.IDLE,m.startFragRequested=!1,m.bitrateTest=!1;var E=b.stats;E.parsing.start=E.parsing.end=E.buffering.start=E.buffering.end=self.performance.now(),C.trigger(K.Events.FRAG_LOADED,p)})},A._handleTransmuxComplete=function(b){var m,p="main",C=this.hls,E=b.remuxResult,v=b.chunkMeta,P=this.getCurrentContext(v);if(!P){this.warn("The loading context changed while buffering fragment "+v.sn+" of level "+v.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(v.level);return}var F=P.frag,R=P.part,H=P.level,U=E.video,S=E.text,G=E.id3,Q=E.initSegment,se=this.altAudio?void 0:E.audio;if(this.fragContextChanged(F))return;if(this.state=N.State.PARSING,Q){Q.tracks&&(this._bufferInitSegment(H,Q.tracks,F,v),C.trigger(K.Events.FRAG_PARSING_INIT_SEGMENT,{frag:F,id:p,tracks:Q.tracks}));var fe=Q.initPTS,we=Q.timescale;Object(V.isFiniteNumber)(fe)&&(this.initPTS[F.cc]=fe,C.trigger(K.Events.INIT_PTS_FOUND,{frag:F,id:p,initPTS:fe,timescale:we}))}if(U&&E.independent!==!1){if(H.details){var be=U.startPTS,Se=U.endPTS,Ae=U.startDTS,De=U.endDTS;if(R)R.elementaryStreams[U.type]={startPTS:be,endPTS:Se,startDTS:Ae,endDTS:De};else if(U.firstKeyFrame&&U.independent&&(this.couldBacktrack=!0),U.dropped&&U.independent){var ve=this.getLoadPosition()+this.config.maxBufferHole;if(ve<be){this.backtrack(F);return}F.setElementaryStreamInfo(U.type,F.start,Se,F.start,De,!0)}F.setElementaryStreamInfo(U.type,be,Se,Ae,De),this.bufferFragmentData(U,F,R,v)}}else if(E.independent===!1){this.backtrack(F);return}if(se){var Y=se.startPTS,k=se.endPTS,B=se.startDTS,Z=se.endDTS;R&&(R.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:Y,endPTS:k,startDTS:B,endDTS:Z}),F.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,Y,k,B,Z),this.bufferFragmentData(se,F,R,v)}if(G!=null&&(m=G.samples)!==null&&m!==void 0&&m.length){var re={frag:F,id:p,samples:G.samples};C.trigger(K.Events.FRAG_PARSING_METADATA,re)}if(S){var X={frag:F,id:p,samples:S.samples};C.trigger(K.Events.FRAG_PARSING_USERDATA,X)}},A._bufferInitSegment=function(b,m,p,C){var E=this;if(this.state!==N.State.PARSING)return;this.audioOnly=!!m.audio&&!m.video,this.altAudio&&!this.audioOnly&&delete m.audio;var v=m.audio,P=m.video,F=m.audiovideo;if(v){var R=b.audioCodec,H=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(R&&(R.indexOf("mp4a.40.5")!==-1?R="mp4a.40.2":R="mp4a.40.5"),v.metadata.channelCount!==1&&H.indexOf("firefox")===-1&&(R="mp4a.40.5")),H.indexOf("android")!==-1&&v.container!=="audio/mpeg"&&(R="mp4a.40.2",this.log("Android: force audio codec to "+R)),b.audioCodec&&b.audioCodec!==R&&this.log('Swapping manifest audio codec "'+b.audioCodec+'" for "'+R+'"'),v.levelCodec=R,v.id="main",this.log("Init audio buffer, container:"+v.container+", codecs[selected/level/parsed]=["+(R||"")+"/"+(b.audioCodec||"")+"/"+v.codec+"]")}P&&(P.levelCodec=b.videoCodec,P.id="main",this.log("Init video buffer, container:"+P.container+", codecs[level/parsed]=["+(b.videoCodec||"")+"/"+P.codec+"]")),F&&this.log("Init audiovideo buffer, container:"+F.container+", codecs[level/parsed]=["+(b.attrs.CODECS||"")+"/"+F.codec+"]"),this.hls.trigger(K.Events.BUFFER_CODECS,m),Object.keys(m).forEach(function(U){var S=m[U],G=S.initSegment;G!=null&&G.byteLength&&E.hls.trigger(K.Events.BUFFER_APPENDING,{type:U,data:G,frag:p,part:null,chunkMeta:C,parent:p.type})}),this.tick()},A.backtrack=function(b){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(b);var m=this.fragmentTracker.backtrack(b);this.fragPrevious=null,this.nextLoadPosition=b.start,m?this.resetFragmentLoading(b):this.state=N.State.BACKTRACKING},A.checkFragmentChanged=function(){var b=this.media,m=null;if(b&&b.readyState>1&&b.seeking===!1){var p=b.currentTime;if(W.BufferHelper.isBuffered(b,p)?m=this.getAppendedFrag(p):W.BufferHelper.isBuffered(b,p+.1)&&(m=this.getAppendedFrag(p+.1)),m){var C=this.fragPlaying,E=m.level;(!C||m.sn!==C.sn||C.level!==E||m.urlId!==C.urlId)&&(this.hls.trigger(K.Events.FRAG_CHANGED,{frag:m}),(!C||C.level!==E)&&this.hls.trigger(K.Events.LEVEL_SWITCHED,{level:E}),this.fragPlaying=m)}}},a(L,[{key:"nextLevel",get:function(){var b=this.nextBufferedFrag;return b?b.level:-1}},{key:"currentLevel",get:function(){var b=this.media;if(b){var m=this.getAppendedFrag(b.currentTime);if(m)return m.level}return-1}},{key:"nextBufferedFrag",get:function(){var b=this.media;if(b){var m=this.getAppendedFrag(b.currentTime);return this.followingBufferedFrag(m)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),L}(N.default)},"./src/controller/subtitle-stream-controller.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"SubtitleStreamController",function(){return r});var V=D("./src/events.ts"),N=D("./src/utils/logger.ts"),O=D("./src/utils/buffer-helper.ts"),K=D("./src/controller/fragment-finders.ts"),W=D("./src/utils/discontinuities.ts"),n=D("./src/controller/level-helper.ts"),I=D("./src/controller/fragment-tracker.ts"),g=D("./src/controller/base-stream-controller.ts"),f=D("./src/types/loader.ts"),h=D("./src/types/level.ts");function c(o,T){for(var w=0;w<T.length;w++){var x=T[w];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(o,x.key,x)}}function s(o,T,w){return T&&c(o.prototype,T),w&&c(o,w),o}function d(o,T){o.prototype=Object.create(T.prototype),o.prototype.constructor=o,i(o,T)}function i(o,T){return i=Object.setPrototypeOf||function(x,L){return x.__proto__=L,x},i(o,T)}var a=500,r=function(o){d(T,o);function T(x,L){var A;return A=o.call(this,x,L,"[subtitle-stream-controller]")||this,A.levels=[],A.currentTrackId=-1,A.tracksBuffered=[],A.mainDetails=null,A._registerListeners(),A}var w=T.prototype;return w.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},w._registerListeners=function(){var L=this.hls;L.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),L.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),L.on(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),L.on(V.Events.LEVEL_LOADED,this.onLevelLoaded,this),L.on(V.Events.ERROR,this.onError,this),L.on(V.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),L.on(V.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),L.on(V.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),L.on(V.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),L.on(V.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},w._unregisterListeners=function(){var L=this.hls;L.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),L.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),L.off(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),L.off(V.Events.LEVEL_LOADED,this.onLevelLoaded,this),L.off(V.Events.ERROR,this.onError,this),L.off(V.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),L.off(V.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),L.off(V.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),L.off(V.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),L.off(V.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},w.startLoad=function(){this.stopLoad(),this.state=g.State.IDLE,this.setInterval(a),this.tick()},w.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},w.onLevelLoaded=function(L,A){this.mainDetails=A.details},w.onSubtitleFragProcessed=function(L,A){var _=A.frag,b=A.success;if(this.fragPrevious=_,this.state=g.State.IDLE,!b)return;var m=this.tracksBuffered[this.currentTrackId];if(!m)return;for(var p,C=_.start,E=0;E<m.length;E++)if(C>=m[E].start&&C<=m[E].end){p=m[E];break}var v=_.start+_.duration;p?p.end=v:(p={start:C,end:v},m.push(p)),this.fragmentTracker.fragBuffered(_)},w.onBufferFlushing=function(L,A){var _=A.startOffset,b=A.endOffset;if(_===0&&b!==Number.POSITIVE_INFINITY){var m=this.currentTrackId,p=this.levels;if(!p.length||!p[m]||!p[m].details)return;var C=p[m].details,E=C.targetduration,v=b-E;if(v<=0)return;A.endOffsetSubtitles=Math.max(0,v),this.tracksBuffered.forEach(function(P){for(var F=0;F<P.length;){if(P[F].end<=v){P.shift();continue}else if(P[F].start<v)P[F].start=v;else break;F++}}),this.fragmentTracker.removeFragmentsInRange(_,v,f.PlaylistLevelType.SUBTITLE)}},w.onError=function(L,A){var _,b=A.frag;if(!b||b.type!==f.PlaylistLevelType.SUBTITLE)return;(_=this.fragCurrent)!==null&&_!==void 0&&_.loader&&this.fragCurrent.loader.abort(),this.state=g.State.IDLE},w.onSubtitleTracksUpdated=function(L,A){var _=this,b=A.subtitleTracks;this.tracksBuffered=[],this.levels=b.map(function(m){return new h.Level(m)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(m){_.tracksBuffered[m.id]=[]}),this.mediaBuffer=null},w.onSubtitleTrackSwitch=function(L,A){if(this.currentTrackId=A.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var _=this.levels[this.currentTrackId];_!=null&&_.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,_&&this.setInterval(a)},w.onSubtitleTrackLoaded=function(L,A){var _,b=A.details,m=A.id,p=this.currentTrackId,C=this.levels;if(!C.length)return;var E=C[p];if(m>=C.length||m!==p||!E)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,b.live||(_=E.details)!==null&&_!==void 0&&_.live){var v=this.mainDetails;if(b.deltaUpdateFailed||!v)return;var P=v.fragments[0];if(!E.details)b.hasProgramDateTime&&v.hasProgramDateTime?Object(W.alignMediaPlaylistByPDT)(b,v):P&&Object(n.addSliding)(b,P.start);else{var F=this.alignPlaylists(b,E.details);F===0&&P&&Object(n.addSliding)(b,P.start)}}if(E.details=b,this.levelLastLoaded=m,this.tick(),b.live&&!this.fragCurrent&&this.media&&this.state===g.State.IDLE){var R=Object(K.findFragmentByPTS)(null,b.fragments,this.media.currentTime,0);R||(this.warn("Subtitle playlist not aligned with playback"),E.details=void 0)}},w._handleFragmentLoadComplete=function(L){var A=L.frag,_=L.payload,b=A.decryptdata,m=this.hls;if(this.fragContextChanged(A))return;if(_&&_.byteLength>0&&b&&b.key&&b.iv&&b.method==="AES-128"){var p=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(_),b.key.buffer,b.iv.buffer).then(function(C){var E=performance.now();m.trigger(V.Events.FRAG_DECRYPTED,{frag:A,payload:C,stats:{tstart:p,tdecrypt:E}})})}},w.doTick=function(){if(!this.media){this.state=g.State.IDLE;return}if(this.state===g.State.IDLE){var L,A=this.currentTrackId,_=this.levels;if(!_.length||!_[A]||!_[A].details)return;var b=_[A].details,m=b.targetduration,p=this.config,C=this.media,E=O.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,C.currentTime-m,p.maxBufferHole),v=E.end,P=E.len,F=this.getMaxBufferLength()+m;if(P>F)return;console.assert(b,"Subtitle track details are defined on idle subtitle stream controller tick");var R=b.fragments,H=R.length,U=b.edge,S,G=this.fragPrevious;if(v<U){var Q=p.maxFragLookUpTolerance;G&&b.hasProgramDateTime&&(S=Object(K.findFragmentByPDT)(R,G.endProgramDateTime,Q)),S||(S=Object(K.findFragmentByPTS)(G,R,v,Q),!S&&G&&G.start<R[0].start&&(S=R[0]))}else S=R[H-1];(L=S)!==null&&L!==void 0&&L.encrypted?(N.logger.log("Loading key for "+S.sn),this.state=g.State.KEY_LOADING,this.hls.trigger(V.Events.KEY_LOADING,{frag:S})):S&&this.fragmentTracker.getState(S)===I.FragmentState.NOT_LOADED&&this.loadFragment(S,b,v)}},w.loadFragment=function(L,A,_){this.fragCurrent=L,o.prototype.loadFragment.call(this,L,A,_)},s(T,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),T}(g.default)},"./src/controller/subtitle-track-controller.ts":function(J,z,D){"use strict";D.r(z);var V=D("./src/events.ts"),N=D("./src/utils/texttrack-utils.ts"),O=D("./src/controller/base-playlist-controller.ts"),K=D("./src/types/loader.ts");function W(c,s){for(var d=0;d<s.length;d++){var i=s[d];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(c,i.key,i)}}function n(c,s,d){return s&&W(c.prototype,s),d&&W(c,d),c}function I(c,s){c.prototype=Object.create(s.prototype),c.prototype.constructor=c,g(c,s)}function g(c,s){return g=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},g(c,s)}var f=function(c){I(s,c);function s(i){var a;return a=c.call(this,i,"[subtitle-track-controller]")||this,a.media=null,a.tracks=[],a.groupId=null,a.tracksInGroup=[],a.trackId=-1,a.selectDefaultTrack=!0,a.queuedDefaultTrack=-1,a.trackChangeListener=function(){return a.onTextTracksChanged()},a.asyncPollTrackChange=function(){return a.pollTrackChange(0)},a.useTextTrackPolling=!1,a.subtitlePollingInterval=-1,a.subtitleDisplay=!0,a.registerListeners(),a}var d=s.prototype;return d.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,c.prototype.destroy.call(this)},d.registerListeners=function(){var a=this.hls;a.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(V.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.on(V.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),a.on(V.Events.ERROR,this.onError,this)},d.unregisterListeners=function(){var a=this.hls;a.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(V.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.off(V.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),a.off(V.Events.ERROR,this.onError,this)},d.onMediaAttached=function(a,r){if(this.media=r.media,!this.media)return;this.queuedDefaultTrack>-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)},d.pollTrackChange=function(a){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,a)},d.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=h(this.media.textTracks);a.forEach(function(r){Object(N.clearCurrentCues)(r)}),this.subtitleTrack=-1,this.media=null},d.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},d.onManifestParsed=function(a,r){this.tracks=r.subtitleTracks},d.onSubtitleTrackLoaded=function(a,r){var o=r.id,T=r.details,w=this.trackId,x=this.tracksInGroup[w];if(!x){this.warn("Invalid subtitle track id "+o);return}var L=x.details;x.details=r.details,this.log("subtitle track "+o+" loaded ["+T.startSN+"-"+T.endSN+"]"),o===this.trackId&&(this.retryCount=0,this.playlistLoaded(o,r,L))},d.onLevelLoading=function(a,r){this.switchLevel(r.level)},d.onLevelSwitching=function(a,r){this.switchLevel(r.level)},d.switchLevel=function(a){var r=this.hls.levels[a];if(!(r!=null&&r.textGroupIds))return;var o=r.textGroupIds[r.urlId];if(this.groupId!==o){var T=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,w=this.tracks.filter(function(A){return!o||A.groupId===o});this.tracksInGroup=w;var x=this.findTrackId(T==null?void 0:T.name)||this.findTrackId();this.groupId=o;var L={subtitleTracks:w};this.log("Updating subtitle tracks, "+w.length+' track(s) found in "'+o+'" group-id'),this.hls.trigger(V.Events.SUBTITLE_TRACKS_UPDATED,L),x!==-1&&this.setSubtitleTrack(x,T)}},d.findTrackId=function(a){for(var r=this.tracksInGroup,o=0;o<r.length;o++){var T=r[o];if((!this.selectDefaultTrack||T.default)&&(!a||a===T.name))return T.id}return-1},d.onError=function(a,r){if(c.prototype.onError.call(this,a,r),r.fatal||!r.context)return;r.context.type===K.PlaylistContextType.SUBTITLE_TRACK&&r.context.id===this.trackId&&r.context.groupId===this.groupId&&this.retryLoadingOrFail(r)},d.loadPlaylist=function(a){var r=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(r)){var o=r.id,T=r.groupId,w=r.url;if(a)try{w=a.addDirectives(w)}catch(x){this.warn("Could not construct new URL with HLS Delivery Directives: "+x)}this.log("Loading subtitle playlist for id "+o),this.hls.trigger(V.Events.SUBTITLE_TRACK_LOADING,{url:w,id:o,groupId:T,deliveryDirectives:a||null})}},d.toggleTrackModes=function(a){var r=this,o=this.media,T=this.subtitleDisplay,w=this.trackId;if(!o)return;var x=h(o.textTracks),L=x.filter(function(b){return b.groupId===r.groupId});if(a===-1)[].slice.call(x).forEach(function(b){b.mode="disabled"});else{var A=L[w];A&&(A.mode="disabled")}var _=L[a];_&&(_.mode=T?"showing":"hidden")},d.setSubtitleTrack=function(a,r){var o,T=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=a;return}if(this.trackId!==a&&this.toggleTrackModes(a),this.trackId===a&&(a===-1||(o=T[a])!==null&&o!==void 0&&o.details)||a<-1||a>=T.length)return;this.clearTimer();var w=T[a];if(this.log("Switching to subtitle track "+a),this.trackId=a,w){var x=w.id,L=w.groupId,A=L===void 0?"":L,_=w.name,b=w.type,m=w.url;this.hls.trigger(V.Events.SUBTITLE_TRACK_SWITCH,{id:x,groupId:A,name:_,type:b,url:m});var p=this.switchParams(w.url,r==null?void 0:r.details);this.loadPlaylist(p)}else this.hls.trigger(V.Events.SUBTITLE_TRACK_SWITCH,{id:a})},d.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var a=-1,r=h(this.media.textTracks),o=0;o<r.length;o++)if(r[o].mode==="hidden")a=o;else if(r[o].mode==="showing"){a=o;break}this.subtitleTrack!==a&&(this.subtitleTrack=a)},n(s,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(a){this.selectDefaultTrack=!1;var r=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(a,r)}}]),s}(O.default);function h(c){for(var s=[],d=0;d<c.length;d++){var i=c[d];i.kind==="subtitles"&&i.label&&s.push(c[d])}return s}z.default=f},"./src/controller/timeline-controller.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"TimelineController",function(){return h});var V=D("./src/polyfills/number.ts"),N=D("./src/events.ts"),O=D("./src/utils/cea-608-parser.ts"),K=D("./src/utils/output-filter.ts"),W=D("./src/utils/webvtt-parser.ts"),n=D("./src/utils/texttrack-utils.ts"),I=D("./src/utils/imsc1-ttml-parser.ts"),g=D("./src/types/loader.ts"),f=D("./src/utils/logger.ts"),h=function(){function i(r){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=d(),this.captionsProperties=void 0,this.hls=r,this.config=r.config,this.Cues=r.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var o=new K.default(this,"textTrack1"),T=new K.default(this,"textTrack2"),w=new K.default(this,"textTrack3"),x=new K.default(this,"textTrack4");this.cea608Parser1=new O.default(1,o,T),this.cea608Parser2=new O.default(3,w,x)}r.on(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(N.Events.MANIFEST_LOADED,this.onManifestLoaded,this),r.on(N.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),r.on(N.Events.FRAG_LOADING,this.onFragLoading,this),r.on(N.Events.FRAG_LOADED,this.onFragLoaded,this),r.on(N.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),r.on(N.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),r.on(N.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),r.on(N.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),r.on(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var a=i.prototype;return a.destroy=function(){var o=this.hls;o.off(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.off(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(N.Events.MANIFEST_LOADED,this.onManifestLoaded,this),o.off(N.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),o.off(N.Events.FRAG_LOADING,this.onFragLoading,this),o.off(N.Events.FRAG_LOADED,this.onFragLoaded,this),o.off(N.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),o.off(N.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),o.off(N.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),o.off(N.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),o.off(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},a.addCues=function(o,T,w,x,L){for(var A=!1,_=L.length;_--;){var b=L[_],m=s(b[0],b[1],T,w);if(m>=0&&(b[0]=Math.min(b[0],T),b[1]=Math.max(b[1],w),A=!0,m/(w-T)>.5))return}if(A||L.push([T,w]),this.config.renderTextTracksNatively){var p=this.captionsTracks[o];this.Cues.newCue(p,T,w,x)}else{var C=this.Cues.newCue(null,T,w,x);this.hls.trigger(N.Events.CUES_PARSED,{type:"captions",cues:C,track:o})}},a.onInitPtsFound=function(o,T){var w=this,x=T.frag,L=T.id,A=T.initPTS,_=T.timescale,b=this.unparsedVttFrags;L==="main"&&(this.initPTS[x.cc]=A,this.timescale[x.cc]=_),b.length&&(this.unparsedVttFrags=[],b.forEach(function(m){w.onFragLoaded(N.Events.FRAG_LOADED,m)}))},a.getExistingTrack=function(o){var T=this.media;if(T)for(var w=0;w<T.textTracks.length;w++){var x=T.textTracks[w];if(x[o])return x}return null},a.createCaptionsTrack=function(o){this.config.renderTextTracksNatively?this.createNativeTrack(o):this.createNonNativeTrack(o)},a.createNativeTrack=function(o){if(this.captionsTracks[o])return;var T=this.captionsProperties,w=this.captionsTracks,x=this.media,L=T[o],A=L.label,_=L.languageCode,b=this.getExistingTrack(o);if(b)w[o]=b,Object(n.clearCurrentCues)(w[o]),Object(n.sendAddTrackEvent)(w[o],x);else{var m=this.createTextTrack("captions",A,_);m&&(m[o]=!0,w[o]=m)}},a.createNonNativeTrack=function(o){if(this.nonNativeCaptionsTracks[o])return;var T=this.captionsProperties[o];if(!T)return;var w=T.label,x={_id:o,label:w,kind:"captions",default:T.media?!!T.media.default:!1,closedCaptions:T.media};this.nonNativeCaptionsTracks[o]=x,this.hls.trigger(N.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[x]})},a.createTextTrack=function(o,T,w){var x=this.media;return x?x.addTextTrack(o,T,w):void 0},a.onMediaAttaching=function(o,T){this.media=T.media,this._cleanTracks()},a.onMediaDetaching=function(){var o=this.captionsTracks;Object.keys(o).forEach(function(T){Object(n.clearCurrentCues)(o[T]),delete o[T]}),this.nonNativeCaptionsTracks={}},a.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=d(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},a._cleanTracks=function(){var o=this.media;if(!o)return;var T=o.textTracks;if(T)for(var w=0;w<T.length;w++)Object(n.clearCurrentCues)(T[w])},a.onSubtitleTracksUpdated=function(o,T){var w=this;this.textTracks=[];var x=T.subtitleTracks||[],L=x.some(function(m){return m.textCodec===I.IMSC1_CODEC});if(this.config.enableWebVTT||L&&this.config.enableIMSC1){var A=this.tracks&&x&&this.tracks.length===x.length;if(this.tracks=x||[],this.config.renderTextTracksNatively){var _=this.media?this.media.textTracks:[];this.tracks.forEach(function(m,p){var C;if(p<_.length){for(var E=null,v=0;v<_.length;v++)if(c(_[v],m)){E=_[v];break}E&&(C=E)}C?Object(n.clearCurrentCues)(C):(C=w.createTextTrack("subtitles",m.name,m.lang),C&&(C.mode="disabled")),C&&(C.groupId=m.groupId,w.textTracks.push(C))})}else if(!A&&this.tracks&&this.tracks.length){var b=this.tracks.map(function(m){return{label:m.name,kind:m.type.toLowerCase(),default:m.default,subtitleTrack:m}});this.hls.trigger(N.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:b})}}},a.onManifestLoaded=function(o,T){var w=this;this.config.enableCEA708Captions&&T.captions&&T.captions.forEach(function(x){var L=/(?:CC|SERVICE)([1-4])/.exec(x.instreamId);if(!L)return;var A="textTrack"+L[1],_=w.captionsProperties[A];if(!_)return;_.label=x.name,x.lang&&(_.languageCode=x.lang),_.media=x})},a.onFragLoading=function(o,T){var w=this.cea608Parser1,x=this.cea608Parser2,L=this.lastSn,A=this.lastPartIndex;if(!this.enabled||!(w&&x))return;if(T.frag.type===g.PlaylistLevelType.MAIN){var _,b,m=T.frag.sn,p=(_=T==null||((b=T.part)===null||b===void 0)?void 0:b.index)!=null?_:-1;m===L+1||m===L&&p===A+1||(w.reset(),x.reset()),this.lastSn=m,this.lastPartIndex=p}},a.onFragLoaded=function(o,T){var w=T.frag,x=T.payload,L=this.initPTS,A=this.unparsedVttFrags;if(w.type===g.PlaylistLevelType.SUBTITLE)if(x.byteLength){if(!Object(V.isFiniteNumber)(L[w.cc])){A.push(T),L.length&&this.hls.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:w,error:new Error("Missing initial subtitle PTS")});return}var _=w.decryptdata;if(_==null||_.key==null||_.method!=="AES-128"){var b=this.tracks[w.level],m=this.vttCCs;m[w.cc]||(m[w.cc]={start:w.start,prevCC:this.prevCC,new:!0},this.prevCC=w.cc),b&&b.textCodec===I.IMSC1_CODEC?this._parseIMSC1(w,x):this._parseVTTs(w,x,m)}}else this.hls.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:w,error:new Error("Empty subtitle payload")})},a._parseIMSC1=function(o,T){var w=this,x=this.hls;Object(I.parseIMSC1)(T,this.initPTS[o.cc],this.timescale[o.cc],function(L){w._appendCues(L,o.level),x.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:o})},function(L){f.logger.log("Failed to parse IMSC1: "+L),x.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:o,error:L})})},a._parseVTTs=function(o,T,w){var x=this,L=this.hls;Object(W.parseWebVTT)(T,this.initPTS[o.cc],this.timescale[o.cc],w,o.cc,o.start,function(A){x._appendCues(A,o.level),L.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:o})},function(A){x._fallbackToIMSC1(o,T),f.logger.log("Failed to parse VTT cue: "+A),L.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:o,error:A})})},a._fallbackToIMSC1=function(o,T){var w=this,x=this.tracks[o.level];x.textCodec||Object(I.parseIMSC1)(T,this.initPTS[o.cc],this.timescale[o.cc],function(){x.textCodec=I.IMSC1_CODEC,w._parseIMSC1(o,T)},function(){x.textCodec="wvtt"})},a._appendCues=function(o,T){var w=this.hls;if(this.config.renderTextTracksNatively){var x=this.textTracks[T];if(x.mode==="disabled")return;o.forEach(function(_){return Object(n.addCueToTrack)(x,_)})}else{var L=this.tracks[T],A=L.default?"default":"subtitles"+T;w.trigger(N.Events.CUES_PARSED,{type:"subtitles",cues:o,track:A})}},a.onFragDecrypted=function(o,T){var w=T.frag;if(w.type===g.PlaylistLevelType.SUBTITLE){if(!Object(V.isFiniteNumber)(this.initPTS[w.cc])){this.unparsedVttFrags.push(T);return}this.onFragLoaded(N.Events.FRAG_LOADED,T)}},a.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},a.onFragParsingUserdata=function(o,T){var w=this.cea608Parser1,x=this.cea608Parser2;if(!this.enabled||!(w&&x))return;for(var L=0;L<T.samples.length;L++){var A=T.samples[L].bytes;if(A){var _=this.extractCea608Data(A);w.addData(T.samples[L].pts,_[0]),x.addData(T.samples[L].pts,_[1])}}},a.onBufferFlushing=function(o,T){var w=T.startOffset,x=T.endOffset,L=T.endOffsetSubtitles,A=T.type,_=this.media;if(!_||_.currentTime<x)return;if(!A||A==="video"){var b=this.captionsTracks;Object.keys(b).forEach(function(p){return Object(n.removeCuesInRange)(b[p],w,x)})}if(this.config.renderTextTracksNatively&&(w===0&&L!==void 0)){var m=this.textTracks;Object.keys(m).forEach(function(p){return Object(n.removeCuesInRange)(m[p],w,L)})}},a.extractCea608Data=function(o){for(var T=o[0]&31,w=2,x=[[],[]],L=0;L<T;L++){var A=o[w++],_=127&o[w++],b=127&o[w++],m=(4&A)!==0,p=3&A;if(_===0&&b===0)continue;m&&((p===0||p===1)&&(x[p].push(_),x[p].push(b)))}return x},i}();function c(i,a){return i&&i.label===a.name&&!(i.textTrack1||i.textTrack2)}function s(i,a,r,o){return Math.min(a,o)-Math.max(i,r)}function d(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"default",function(){return V});var V=function(){function N(K,W){this.subtle=void 0,this.aesIV=void 0,this.subtle=K,this.aesIV=W}var O=N.prototype;return O.decrypt=function(W,n){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},n,W)},N}()},"./src/crypt/aes-decryptor.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"removePadding",function(){return N}),D.d(z,"default",function(){return O});var V=D("./src/utils/typed-array.ts");function N(K){var W=K.byteLength,n=W&&new DataView(K.buffer).getUint8(W-1);return n?Object(V.sliceUint8)(K,0,W-n):K}var O=function(){function K(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var W=K.prototype;return W.uint8ArrayToUint32Array_=function(I){for(var g=new DataView(I),f=new Uint32Array(4),h=0;h<4;h++)f[h]=g.getUint32(h*4);return f},W.initTable=function(){var I=this.sBox,g=this.invSBox,f=this.subMix,h=f[0],c=f[1],s=f[2],d=f[3],i=this.invSubMix,a=i[0],r=i[1],o=i[2],T=i[3],w=new Uint32Array(256),x=0,L=0,A=0;for(A=0;A<256;A++)A<128?w[A]=A<<1:w[A]=A<<1^283;for(A=0;A<256;A++){var _=L^L<<1^L<<2^L<<3^L<<4;_=_>>>8^_&255^99,I[x]=_,g[_]=x;var b=w[x],m=w[b],p=w[m],C=w[_]*257^_*16843008;h[x]=C<<24|C>>>8,c[x]=C<<16|C>>>16,s[x]=C<<8|C>>>24,d[x]=C,C=p*16843009^m*65537^b*257^x*16843008,a[_]=C<<24|C>>>8,r[_]=C<<16|C>>>16,o[_]=C<<8|C>>>24,T[_]=C,x?(x=b^w[w[w[p^b]]],L^=w[w[L]]):x=L=1}},W.expandKey=function(I){for(var g=this.uint8ArrayToUint32Array_(I),f=!0,h=0;h<g.length&&f;)f=g[h]===this.key[h],h++;if(f)return;this.key=g;var c=this.keySize=g.length;if(c!==4&&c!==6&&c!==8)throw new Error("Invalid aes key size="+c);var s=this.ksRows=(c+6+1)*4,d,i,a=this.keySchedule=new Uint32Array(s),r=this.invKeySchedule=new Uint32Array(s),o=this.sBox,T=this.rcon,w=this.invSubMix,x=w[0],L=w[1],A=w[2],_=w[3],b,m;for(d=0;d<s;d++){if(d<c){b=a[d]=g[d];continue}m=b,d%c===0?(m=m<<8|m>>>24,m=o[m>>>24]<<24|o[m>>>16&255]<<16|o[m>>>8&255]<<8|o[m&255],m^=T[d/c|0]<<24):c>6&&d%c===4&&(m=o[m>>>24]<<24|o[m>>>16&255]<<16|o[m>>>8&255]<<8|o[m&255]),a[d]=b=(a[d-c]^m)>>>0}for(i=0;i<s;i++)d=s-i,i&3?m=a[d]:m=a[d-4],i<4||d<=4?r[i]=m:r[i]=x[o[m>>>24]]^L[o[m>>>16&255]]^A[o[m>>>8&255]]^_[o[m&255]],r[i]=r[i]>>>0},W.networkToHostOrderSwap=function(I){return I<<24|(I&65280)<<8|(I&16711680)>>8|I>>>24},W.decrypt=function(I,g,f){for(var h=this.keySize+6,c=this.invKeySchedule,s=this.invSBox,d=this.invSubMix,i=d[0],a=d[1],r=d[2],o=d[3],T=this.uint8ArrayToUint32Array_(f),w=T[0],x=T[1],L=T[2],A=T[3],_=new Int32Array(I),b=new Int32Array(_.length),m,p,C,E,v,P,F,R,H,U,S,G,Q,se,fe=this.networkToHostOrderSwap;g<_.length;){for(H=fe(_[g]),U=fe(_[g+1]),S=fe(_[g+2]),G=fe(_[g+3]),v=H^c[0],P=G^c[1],F=S^c[2],R=U^c[3],Q=4,se=1;se<h;se++)m=i[v>>>24]^a[P>>16&255]^r[F>>8&255]^o[R&255]^c[Q],p=i[P>>>24]^a[F>>16&255]^r[R>>8&255]^o[v&255]^c[Q+1],C=i[F>>>24]^a[R>>16&255]^r[v>>8&255]^o[P&255]^c[Q+2],E=i[R>>>24]^a[v>>16&255]^r[P>>8&255]^o[F&255]^c[Q+3],v=m,P=p,F=C,R=E,Q=Q+4;m=s[v>>>24]<<24^s[P>>16&255]<<16^s[F>>8&255]<<8^s[R&255]^c[Q],p=s[P>>>24]<<24^s[F>>16&255]<<16^s[R>>8&255]<<8^s[v&255]^c[Q+1],C=s[F>>>24]<<24^s[R>>16&255]<<16^s[v>>8&255]<<8^s[P&255]^c[Q+2],E=s[R>>>24]<<24^s[v>>16&255]<<16^s[P>>8&255]<<8^s[F&255]^c[Q+3],b[g]=fe(m^w),b[g+1]=fe(E^x),b[g+2]=fe(C^L),b[g+3]=fe(p^A),w=H,x=U,L=S,A=G,g=g+4}return b.buffer},K}()},"./src/crypt/decrypter.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"default",function(){return g});var V=D("./src/crypt/aes-crypto.ts"),N=D("./src/crypt/fast-aes-key.ts"),O=D("./src/crypt/aes-decryptor.ts"),K=D("./src/utils/logger.ts"),W=D("./src/utils/mp4-tools.ts"),n=D("./src/utils/typed-array.ts"),I=16,g=function(){function f(c,s,d){var i=d===void 0?{}:d,a=i.removePKCS7Padding,r=a===void 0?!0:a;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=c,this.config=s,this.removePKCS7Padding=r,r)try{var o=self.crypto;o&&(this.subtle=o.subtle||o.webkitSubtle)}catch(T){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var h=f.prototype;return h.destroy=function(){this.observer=null},h.isSync=function(){return this.config.enableSoftwareAES},h.flush=function(){var s=this.currentResult;if(!s){this.reset();return}var d=new Uint8Array(s);return this.reset(),this.removePKCS7Padding?Object(O.removePadding)(d):d},h.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},h.decrypt=function(s,d,i,a){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(s),d,i);var r=this.flush();r&&a(r.buffer)}else this.webCryptoDecrypt(new Uint8Array(s),d,i).then(a)},h.softwareDecrypt=function(s,d,i){var a=this.currentIV,r=this.currentResult,o=this.remainderData;this.logOnce("JS AES decrypt"),o&&(s=Object(W.appendUint8Array)(o,s),this.remainderData=null);var T=this.getValidChunk(s);if(!T.length)return null;a&&(i=a);var w=this.softwareDecrypter;w||(w=this.softwareDecrypter=new O.default),w.expandKey(d);var x=r;return this.currentResult=w.decrypt(T.buffer,0,i),this.currentIV=Object(n.sliceUint8)(T,-16).buffer,x||null},h.webCryptoDecrypt=function(s,d,i){var a=this,r=this.subtle;return(this.key!==d||!this.fastAesKey)&&(this.key=d,this.fastAesKey=new N.default(r,d)),this.fastAesKey.expandKey().then(function(o){if(!r)return Promise.reject(new Error("web crypto not initialized"));var T=new V.default(r,i);return T.decrypt(s.buffer,o)}).catch(function(o){return a.onWebCryptoError(o,s,d,i)})},h.onWebCryptoError=function(s,d,i,a){return K.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",s),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(d,i,a)},h.getValidChunk=function(s){var d=s,i=s.length-s.length%I;return i!==s.length&&(d=Object(n.sliceUint8)(s,0,i),this.remainderData=Object(n.sliceUint8)(s,i)),d},h.logOnce=function(s){if(!this.logEnabled)return;K.logger.log("[decrypter.ts]: "+s),this.logEnabled=!1},f}()},"./src/crypt/fast-aes-key.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"default",function(){return V});var V=function(){function N(K,W){this.subtle=void 0,this.key=void 0,this.subtle=K,this.key=W}var O=N.prototype;return O.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},N}()},"./src/demux/aacdemuxer.ts":function(J,z,D){"use strict";D.r(z);var V=D("./src/demux/base-audio-demuxer.ts"),N=D("./src/demux/adts.ts"),O=D("./src/utils/logger.ts"),K=D("./src/demux/id3.ts");function W(g,f){g.prototype=Object.create(f.prototype),g.prototype.constructor=g,n(g,f)}function n(g,f){return n=Object.setPrototypeOf||function(c,s){return c.__proto__=s,c},n(g,f)}var I=function(g){W(f,g);function f(c,s){var d;return d=g.call(this)||this,d.observer=void 0,d.config=void 0,d.observer=c,d.config=s,d}var h=f.prototype;return h.resetInitSegment=function(s,d,i){g.prototype.resetInitSegment.call(this,s,d,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:s,duration:i,inputTimeScale:9e4,dropped:0}},f.probe=function(s){if(!s)return!1;for(var d=K.getID3Data(s,0)||[],i=d.length,a=s.length;i<a;i++)if(N.probe(s,i))return O.logger.log("ADTS sync word found !"),!0;return!1},h.canParse=function(s,d){return N.canParse(s,d)},h.appendFrame=function(s,d,i){N.initTrackConfig(s,this.observer,d,i,s.manifestCodec);var a=N.appendFrame(s,d,i,this.initPTS,this.frameIndex);if(a&&a.missing===0)return a},f}(V.default);I.minProbeByteLength=9,z.default=I},"./src/demux/adts.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"getAudioConfig",function(){return K}),D.d(z,"isHeaderPattern",function(){return W}),D.d(z,"getHeaderLength",function(){return n}),D.d(z,"getFullFrameLength",function(){return I}),D.d(z,"canGetFrameLength",function(){return g}),D.d(z,"isHeader",function(){return f}),D.d(z,"canParse",function(){return h}),D.d(z,"probe",function(){return c}),D.d(z,"initTrackConfig",function(){return s}),D.d(z,"getFrameDuration",function(){return d}),D.d(z,"parseFrameHeader",function(){return i}),D.d(z,"appendFrame",function(){return a});var V=D("./src/utils/logger.ts"),N=D("./src/errors.ts"),O=D("./src/events.ts");function K(r,o,T,w){var x,L,A,_,b=navigator.userAgent.toLowerCase(),m=w,p=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];x=((o[T+2]&192)>>>6)+1;var C=(o[T+2]&60)>>>2;if(C>p.length-1){r.trigger(O.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+C});return}return A=(o[T+2]&1)<<2,A|=(o[T+3]&192)>>>6,V.logger.log("manifest codec:"+w+", ADTS type:"+x+", samplingIndex:"+C),/firefox/i.test(b)?C>=6?(x=5,_=new Array(4),L=C-3):(x=2,_=new Array(2),L=C):b.indexOf("android")!==-1?(x=2,_=new Array(2),L=C):(x=5,_=new Array(4),w&&(w.indexOf("mp4a.40.29")!==-1||w.indexOf("mp4a.40.5")!==-1)||!w&&C>=6?L=C-3:((w&&w.indexOf("mp4a.40.2")!==-1&&(C>=6&&A===1||/vivaldi/i.test(b))||!w&&A===1)&&(x=2,_=new Array(2)),L=C)),_[0]=x<<3,_[0]|=(C&14)>>1,_[1]|=(C&1)<<7,_[1]|=A<<3,x===5&&(_[1]|=(L&14)>>1,_[2]=(L&1)<<7,_[2]|=2<<2,_[3]=0),{config:_,samplerate:p[C],channelCount:A,codec:"mp4a.40."+x,manifestCodec:m}}function W(r,o){return r[o]===255&&(r[o+1]&246)===240}function n(r,o){return r[o+1]&1?7:9}function I(r,o){return(r[o+3]&3)<<11|r[o+4]<<3|(r[o+5]&224)>>>5}function g(r,o){return o+5<r.length}function f(r,o){return o+1<r.length&&W(r,o)}function h(r,o){return g(r,o)&&W(r,o)&&I(r,o)<=r.length-o}function c(r,o){if(f(r,o)){var T=n(r,o);if(o+T>=r.length)return!1;var w=I(r,o);if(w<=T)return!1;var x=o+w;return x===r.length||f(r,x)}return!1}function s(r,o,T,w,x){if(!r.samplerate){var L=K(o,T,w,x);if(!L)return;r.config=L.config,r.samplerate=L.samplerate,r.channelCount=L.channelCount,r.codec=L.codec,r.manifestCodec=L.manifestCodec,V.logger.log("parsed codec:"+r.codec+", rate:"+L.samplerate+", channels:"+L.channelCount)}}function d(r){return 1024*9e4/r}function i(r,o,T,w,x){var L=n(r,o),A=I(r,o);if(A-=L,A>0){var _=T+w*x;return{headerLength:L,frameLength:A,stamp:_}}}function a(r,o,T,w,x){var L=d(r.samplerate),A=i(o,T,w,x,L);if(A){var _=A.frameLength,b=A.headerLength,m=A.stamp,p=b+_,C=Math.max(0,T+p-o.length),E;C?(E=new Uint8Array(p-b),E.set(o.subarray(T+b,o.length),0)):E=o.subarray(T+b,T+p);var v={unit:E,pts:m};return C||r.samples.push(v),{sample:v,length:p,missing:C}}}},"./src/demux/base-audio-demuxer.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"initPTSFn",function(){return I});var V=D("./src/polyfills/number.ts"),N=D("./src/demux/id3.ts"),O=D("./src/demux/dummy-demuxed-track.ts"),K=D("./src/utils/mp4-tools.ts"),W=D("./src/utils/typed-array.ts"),n=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(c,s,d){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},f.resetTimeStamp=function(){},f.resetContiguity=function(){},f.canParse=function(c,s){return!1},f.appendFrame=function(c,s,d){},f.demux=function(c,s){this.cachedData&&(c=Object(K.appendUint8Array)(this.cachedData,c),this.cachedData=null);var d=N.getID3Data(c,0),i=d?d.length:0,a,r,o=this._audioTrack,T=this._id3Track,w=d?N.getTimeStamp(d):void 0,x=c.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=I(w,s)),d&&d.length>0&&T.samples.push({pts:this.initPTS,dts:this.initPTS,data:d}),r=this.initPTS;i<x;){if(this.canParse(c,i)){var L=this.appendFrame(o,c,i);L?(this.frameIndex++,r=L.sample.pts,i+=L.length,a=i):i=x}else N.canParse(c,i)?(d=N.getID3Data(c,i),T.samples.push({pts:r,dts:r,data:d}),i+=d.length,a=i):i++;if(i===x&&a!==x){var A=Object(W.sliceUint8)(c,a);this.cachedData?this.cachedData=Object(K.appendUint8Array)(this.cachedData,A):this.cachedData=A}}return{audioTrack:o,avcTrack:Object(O.dummyTrack)(),id3Track:T,textTrack:Object(O.dummyTrack)()}},f.demuxSampleAes=function(c,s,d){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},f.flush=function(c){var s=this.cachedData;return s&&(this.cachedData=null,this.demux(s,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(O.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(O.dummyTrack)()}},f.destroy=function(){},g}(),I=function(f,h){return Object(V.isFiniteNumber)(f)?f*90:h*9e4};z.default=n},"./src/demux/chunk-cache.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"default",function(){return V});var V=function(){function O(){this.chunks=[],this.dataLength=0}var K=O.prototype;return K.push=function(n){this.chunks.push(n),this.dataLength+=n.length},K.flush=function(){var n=this.chunks,I=this.dataLength,g;if(n.length)n.length===1?g=n[0]:g=N(n,I);else return new Uint8Array(0);return this.reset(),g},K.reset=function(){this.chunks.length=0,this.dataLength=0},O}();function N(O,K){for(var W=new Uint8Array(K),n=0,I=0;I<O.length;I++){var g=O[I];W.set(g,n),n+=g.length}return W}},"./src/demux/dummy-demuxed-track.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"dummyTrack",function(){return V});function V(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(J,z,D){"use strict";D.r(z);var V=D("./src/utils/logger.ts"),N=function(){function O(W){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=W,this.bytesAvailable=W.byteLength,this.word=0,this.bitsAvailable=0}var K=O.prototype;return K.loadWord=function(){var n=this.data,I=this.bytesAvailable,g=n.byteLength-I,f=new Uint8Array(4),h=Math.min(4,I);if(h===0)throw new Error("no bytes available");f.set(n.subarray(g,g+h)),this.word=new DataView(f.buffer).getUint32(0),this.bitsAvailable=h*8,this.bytesAvailable-=h},K.skipBits=function(n){var I;this.bitsAvailable>n?(this.word<<=n,this.bitsAvailable-=n):(n-=this.bitsAvailable,I=n>>3,n-=I>>3,this.bytesAvailable-=I,this.loadWord(),this.word<<=n,this.bitsAvailable-=n)},K.readBits=function(n){var I=Math.min(this.bitsAvailable,n),g=this.word>>>32-I;return n>32&&V.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=n-I,I>0&&this.bitsAvailable?g<<I|this.readBits(I):g},K.skipLZ=function(){var n;for(n=0;n<this.bitsAvailable;++n)if((this.word&2147483648>>>n)!==0)return this.word<<=n,this.bitsAvailable-=n,n;return this.loadWord(),n+this.skipLZ()},K.skipUEG=function(){this.skipBits(1+this.skipLZ())},K.skipEG=function(){this.skipBits(1+this.skipLZ())},K.readUEG=function(){var n=this.skipLZ();return this.readBits(n+1)-1},K.readEG=function(){var n=this.readUEG();return 1&n?1+n>>>1:-1*(n>>>1)},K.readBoolean=function(){return this.readBits(1)===1},K.readUByte=function(){return this.readBits(8)},K.readUShort=function(){return this.readBits(16)},K.readUInt=function(){return this.readBits(32)},K.skipScalingList=function(n){for(var I=8,g=8,f,h=0;h<n;h++)g!==0&&(f=this.readEG(),g=(I+f+256)%256),I=g===0?I:g},K.readSPS=function(){var n=0,I=0,g=0,f=0,h,c,s,d=this.readUByte.bind(this),i=this.readBits.bind(this),a=this.readUEG.bind(this),r=this.readBoolean.bind(this),o=this.skipBits.bind(this),T=this.skipEG.bind(this),w=this.skipUEG.bind(this),x=this.skipScalingList.bind(this);d();var L=d();if(i(5),o(3),d(),w(),L===100||L===110||L===122||L===244||L===44||L===83||L===86||L===118||L===128){var A=a();if(A===3&&o(1),w(),w(),o(1),r())for(c=A!==3?8:12,s=0;s<c;s++)r()&&(s<6?x(16):x(64))}w();var _=a();if(_===0)a();else if(_===1)for(o(1),T(),T(),h=a(),s=0;s<h;s++)T();w(),o(1);var b=a(),m=a(),p=i(1);p===0&&o(1),o(1),r()&&(n=a(),I=a(),g=a(),f=a());var C=[1,1];if(r()&&r()){var E=d();switch(E){case 1:C=[1,1];break;case 2:C=[12,11];break;case 3:C=[10,11];break;case 4:C=[16,11];break;case 5:C=[40,33];break;case 6:C=[24,11];break;case 7:C=[20,11];break;case 8:C=[32,11];break;case 9:C=[80,33];break;case 10:C=[18,11];break;case 11:C=[15,11];break;case 12:C=[64,33];break;case 13:C=[160,99];break;case 14:C=[4,3];break;case 15:C=[3,2];break;case 16:C=[2,1];break;case 255:{C=[d()<<8|d(),d()<<8|d()];break}}}return{width:Math.ceil((b+1)*16-n*2-I*2),height:(2-p)*(m+1)*16-(p?2:4)*(g+f),pixelRatio:C}},K.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},O}();z.default=N},"./src/demux/id3.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"isHeader",function(){return V}),D.d(z,"isFooter",function(){return N}),D.d(z,"getID3Data",function(){return O}),D.d(z,"canParse",function(){return W}),D.d(z,"getTimeStamp",function(){return n}),D.d(z,"isTimeStampFrame",function(){return I}),D.d(z,"getID3Frames",function(){return f}),D.d(z,"decodeFrame",function(){return h}),D.d(z,"utf8ArrayToStr",function(){return a}),D.d(z,"testables",function(){return r});var V=function(x,L){return L+10<=x.length&&(x[L]===73&&x[L+1]===68&&x[L+2]===51&&(x[L+3]<255&&x[L+4]<255&&(x[L+6]<128&&x[L+7]<128&&x[L+8]<128&&x[L+9]<128)))},N=function(x,L){return L+10<=x.length&&(x[L]===51&&x[L+1]===68&&x[L+2]===73&&(x[L+3]<255&&x[L+4]<255&&(x[L+6]<128&&x[L+7]<128&&x[L+8]<128&&x[L+9]<128)))},O=function(x,L){for(var A=L,_=0;V(x,L);){_+=10;var b=K(x,L+6);_+=b,N(x,L+10)&&(_+=10),L+=_}return _>0?x.subarray(A,A+_):void 0},K=function(x,L){var A=0;return A=(x[L]&127)<<21,A|=(x[L+1]&127)<<14,A|=(x[L+2]&127)<<7,A|=x[L+3]&127,A},W=function(x,L){return V(x,L)&&K(x,L+6)+10<=x.length-L},n=function(x){for(var L=f(x),A=0;A<L.length;A++){var _=L[A];if(I(_))return i(_)}return},I=function(x){return x&&x.key==="PRIV"&&x.info==="com.apple.streaming.transportStreamTimestamp"},g=function(x){var L=String.fromCharCode(x[0],x[1],x[2],x[3]),A=K(x,4),_=10;return{type:L,size:A,data:x.subarray(_,_+A)}},f=function(x){for(var L=0,A=[];V(x,L);){var _=K(x,L+6);L+=10;for(var b=L+_;L+8<b;){var m=g(x.subarray(L)),p=h(m);p&&A.push(p),L+=m.size+10}N(x,L)&&(L+=10)}return A},h=function(x){return x.type==="PRIV"?c(x):x.type[0]==="W"?d(x):s(x)},c=function(x){if(x.size<2)return;var L=a(x.data,!0),A=new Uint8Array(x.data.subarray(L.length+1));return{key:x.type,info:L,data:A.buffer}},s=function(x){if(x.size<2)return;if(x.type==="TXXX"){var L=1,A=a(x.data.subarray(L),!0);L+=A.length+1;var _=a(x.data.subarray(L));return{key:x.type,info:A,data:_}}var b=a(x.data.subarray(1));return{key:x.type,data:b}},d=function(x){if(x.type==="WXXX"){if(x.size<2)return;var L=1,A=a(x.data.subarray(L),!0);L+=A.length+1;var _=a(x.data.subarray(L));return{key:x.type,info:A,data:_}}var b=a(x.data);return{key:x.type,data:b}},i=function(x){if(x.data.byteLength===8){var L=new Uint8Array(x.data),A=L[3]&1,_=(L[4]<<23)+(L[5]<<15)+(L[6]<<7)+L[7];return _/=45,A&&(_+=4772185884e-2),Math.round(_)}return},a=function(x,L){L===void 0&&(L=!1);var A=T();if(A){var _=A.decode(x);if(L){var b=_.indexOf("\0");return b!==-1?_.substring(0,b):_}return _.replace(/\0/g,"")}for(var m=x.length,p,C,E,v="",P=0;P<m;){if(p=x[P++],p===0&&L)return v;if(p===0||p===3)continue;switch(p>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:v+=String.fromCharCode(p);break;case 12:case 13:C=x[P++],v+=String.fromCharCode((p&31)<<6|C&63);break;case 14:C=x[P++],E=x[P++],v+=String.fromCharCode((p&15)<<12|(C&63)<<6|(E&63)<<0);break;default:}}return v},r={decodeTextFrame:s},o;function T(){return!o&&typeof self.TextDecoder!="undefined"&&(o=new self.TextDecoder("utf-8")),o}},"./src/demux/mp3demuxer.ts":function(J,z,D){"use strict";D.r(z);var V=D("./src/demux/base-audio-demuxer.ts"),N=D("./src/demux/id3.ts"),O=D("./src/utils/logger.ts"),K=D("./src/demux/mpegaudio.ts");function W(g,f){g.prototype=Object.create(f.prototype),g.prototype.constructor=g,n(g,f)}function n(g,f){return n=Object.setPrototypeOf||function(c,s){return c.__proto__=s,c},n(g,f)}var I=function(g){W(f,g);function f(){return g.apply(this,arguments)||this}var h=f.prototype;return h.resetInitSegment=function(s,d,i){g.prototype.resetInitSegment.call(this,s,d,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:s,duration:i,inputTimeScale:9e4,dropped:0}},f.probe=function(s){if(!s)return!1;for(var d=N.getID3Data(s,0)||[],i=d.length,a=s.length;i<a;i++)if(K.probe(s,i))return O.logger.log("MPEG Audio sync word found !"),!0;return!1},h.canParse=function(s,d){return K.canParse(s,d)},h.appendFrame=function(s,d,i){return this.initPTS===null?void 0:K.appendFrame(s,d,i,this.initPTS,this.frameIndex)},f}(V.default);I.minProbeByteLength=4,z.default=I},"./src/demux/mp4demuxer.ts":function(J,z,D){"use strict";D.r(z);var V=D("./src/utils/mp4-tools.ts"),N=D("./src/demux/dummy-demuxed-track.ts"),O=function(){function K(n,I){this.remainderData=null,this.config=void 0,this.config=I}var W=K.prototype;return W.resetTimeStamp=function(){},W.resetInitSegment=function(){},W.resetContiguity=function(){},K.probe=function(I){return Object(V.findBox)({data:I,start:0,end:Math.min(I.length,16384)},["moof"]).length>0},W.demux=function(I){var g=I,f=Object(N.dummyTrack)();if(this.config.progressive){this.remainderData&&(g=Object(V.appendUint8Array)(this.remainderData,I));var h=Object(V.segmentValidRange)(g);this.remainderData=h.remainder,f.samples=h.valid||new Uint8Array}else f.samples=g;return{audioTrack:Object(N.dummyTrack)(),avcTrack:f,id3Track:Object(N.dummyTrack)(),textTrack:Object(N.dummyTrack)()}},W.flush=function(){var I=Object(N.dummyTrack)();return I.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(N.dummyTrack)(),avcTrack:I,id3Track:Object(N.dummyTrack)(),textTrack:Object(N.dummyTrack)()}},W.demuxSampleAes=function(I,g,f){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},W.destroy=function(){},K}();O.minProbeByteLength=1024,z.default=O},"./src/demux/mpegaudio.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"appendFrame",function(){return n}),D.d(z,"parseHeader",function(){return I}),D.d(z,"isHeaderPattern",function(){return g}),D.d(z,"isHeader",function(){return f}),D.d(z,"canParse",function(){return h}),D.d(z,"probe",function(){return c});var V=null,N=[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],O=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],K=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],W=[0,1,1,4];function n(s,d,i,a,r){if(i+24>d.length)return;var o=I(d,i);if(o&&i+o.frameLength<=d.length){var T=o.samplesPerFrame*9e4/o.sampleRate,w=a+r*T,x={unit:d.subarray(i,i+o.frameLength),pts:w,dts:w};return s.config=[],s.channelCount=o.channelCount,s.samplerate=o.sampleRate,s.samples.push(x),{sample:x,length:o.frameLength,missing:0}}}function I(s,d){var i=s[d+1]>>3&3,a=s[d+1]>>1&3,r=s[d+2]>>4&15,o=s[d+2]>>2&3;if(i!==1&&r!==0&&r!==15&&o!==3){var T=s[d+2]>>1&1,w=s[d+3]>>6,x=i===3?3-a:a===3?3:4,L=N[x*14+r-1]*1e3,A=i===3?0:i===2?1:2,_=O[A*3+o],b=w===3?1:2,m=K[i][a],p=W[a],C=m*8*p,E=Math.floor(m*L/_+T)*p;if(V===null){var v=navigator.userAgent||"",P=v.match(/Chrome\/(\d+)/i);V=P?parseInt(P[1]):0}var F=!!V&&V<=87;return F&&a===2&&L>=224e3&&w===0&&(s[d+3]=s[d+3]|128),{sampleRate:_,channelCount:b,frameLength:E,samplesPerFrame:C}}}function g(s,d){return s[d]===255&&(s[d+1]&224)===224&&(s[d+1]&6)!==0}function f(s,d){return d+1<s.length&&g(s,d)}function h(s,d){var i=4;return g(s,d)&&i<=s.length-d}function c(s,d){if(d+1<s.length&&g(s,d)){var i=4,a=I(s,d),r=i;a!=null&&a.frameLength&&(r=a.frameLength);var o=d+r;return o===s.length||f(s,o)}return!1}},"./src/demux/sample-aes.ts":function(J,z,D){"use strict";D.r(z);var V=D("./src/crypt/decrypter.ts"),N=D("./src/demux/tsdemuxer.ts"),O=function(){function K(n,I,g){this.keyData=void 0,this.decrypter=void 0,this.keyData=g,this.decrypter=new V.default(n,I,{removePKCS7Padding:!1})}var W=K.prototype;return W.decryptBuffer=function(I,g){this.decrypter.decrypt(I,this.keyData.key.buffer,this.keyData.iv.buffer,g)},W.decryptAacSample=function(I,g,f,h){var c=I[g].unit,s=c.subarray(16,c.length-c.length%16),d=s.buffer.slice(s.byteOffset,s.byteOffset+s.length),i=this;this.decryptBuffer(d,function(a){var r=new Uint8Array(a);c.set(r,16),h||i.decryptAacSamples(I,g+1,f)})},W.decryptAacSamples=function(I,g,f){for(;;g++){if(g>=I.length){f();return}if(I[g].unit.length<32)continue;var h=this.decrypter.isSync();if(this.decryptAacSample(I,g,f,h),!h)return}},W.getAvcEncryptedData=function(I){for(var g=Math.floor((I.length-48)/160)*16+16,f=new Int8Array(g),h=0,c=32;c<=I.length-16;c+=160,h+=16)f.set(I.subarray(c,c+16),h);return f},W.getAvcDecryptedUnit=function(I,g){for(var f=new Uint8Array(g),h=0,c=32;c<=I.length-16;c+=160,h+=16)I.set(f.subarray(h,h+16),c);return I},W.decryptAvcSample=function(I,g,f,h,c,s){var d=Object(N.discardEPB)(c.data),i=this.getAvcEncryptedData(d),a=this;this.decryptBuffer(i.buffer,function(r){c.data=a.getAvcDecryptedUnit(d,r),s||a.decryptAvcSamples(I,g,f+1,h)})},W.decryptAvcSamples=function(I,g,f,h){if(I instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;g++,f=0){if(g>=I.length){h();return}for(var c=I[g].units;!(f>=c.length);f++){var s=c[f];if(s.data.length<=48||s.type!==1&&s.type!==5)continue;var d=this.decrypter.isSync();if(this.decryptAvcSample(I,g,f,h,s,d),!d)return}}},K}();z.default=O},"./src/demux/transmuxer-interface.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"default",function(){return c});var V=D("./node_modules/webworkify-webpack/index.js"),N=D.n(V),O=D("./src/events.ts"),K=D("./src/demux/transmuxer.ts"),W=D("./src/utils/logger.ts"),n=D("./src/errors.ts"),I=D("./src/utils/mediasource-helper.ts"),g=D("./node_modules/eventemitter3/index.js"),f=D.n(g),h=Object(I.getMediaSource)()||{isTypeSupported:function(){return!1}},c=function(){function s(i,a,r,o){var T=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=i,this.id=a,this.onTransmuxComplete=r,this.onFlush=o;var w=i.config,x=function(m,p){p=p||{},p.frag=T.frag,p.id=T.id,i.trigger(m,p)};this.observer=new g.EventEmitter,this.observer.on(O.Events.FRAG_DECRYPTED,x),this.observer.on(O.Events.ERROR,x);var L={mp4:h.isTypeSupported("video/mp4"),mpeg:h.isTypeSupported("audio/mpeg"),mp3:h.isTypeSupported('audio/mp4; codecs="mp3"')},A=navigator.vendor;if(w.enableWorker&&typeof Worker!="undefined"){W.logger.log("demuxing in webworker");var _;try{_=this.worker=V("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),_.addEventListener("message",this.onwmsg),_.onerror=function(b){i.trigger(O.Events.ERROR,{type:n.ErrorTypes.OTHER_ERROR,details:n.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(b.message+" ("+b.filename+":"+b.lineno+")")})},_.postMessage({cmd:"init",typeSupported:L,vendor:A,id:a,config:JSON.stringify(w)})}catch(b){W.logger.warn("Error in worker:",b),W.logger.error("Error while initializing DemuxerWorker, fallback to inline"),_&&self.URL.revokeObjectURL(_.objectURL),this.transmuxer=new K.default(this.observer,L,w,A,a),this.worker=null}}else this.transmuxer=new K.default(this.observer,L,w,A,a)}var d=s.prototype;return d.destroy=function(){var a=this.worker;if(a)a.removeEventListener("message",this.onwmsg),a.terminate(),this.worker=null;else{var r=this.transmuxer;r&&(r.destroy(),this.transmuxer=null)}var o=this.observer;o&&o.removeAllListeners(),this.observer=null},d.push=function(a,r,o,T,w,x,L,A,_,b){var m=this;_.transmuxing.start=self.performance.now();var p=this.transmuxer,C=this.worker,E=x?x.start:w.start,v=w.decryptdata,P=this.frag,F=!(P&&w.cc===P.cc),R=!(P&&_.level===P.level),H=P?_.sn-P.sn:-1,U=this.part?_.part-this.part.index:1,S=!R&&(H===1||H===0&&U===1),G=self.performance.now();(R||H||w.stats.parsing.start===0)&&(w.stats.parsing.start=G),x&&(U||!S)&&(x.stats.parsing.start=G);var Q=new K.TransmuxState(F,S,A,R,E);if(!S||F){W.logger.log("[transmuxer-interface, "+w.type+"]: Starting new transmux session for sn: "+_.sn+" p: "+_.part+" level: "+_.level+" id: "+_.id+`
discontinuity: `+F+`
trackSwitch: `+R+`
contiguous: `+S+`
accurateTimeOffset: `+A+`
timeOffset: `+E);var se=new K.TransmuxConfig(o,T,r,L,b);this.configureTransmuxer(se)}if(this.frag=w,this.part=x,C)C.postMessage({cmd:"demux",data:a,decryptdata:v,chunkMeta:_,state:Q},a instanceof ArrayBuffer?[a]:[]);else if(p){var fe=p.push(a,v,_,Q);Object(K.isPromise)(fe)?fe.then(function(we){m.handleTransmuxComplete(we)}):this.handleTransmuxComplete(fe)}},d.flush=function(a){var r=this;a.transmuxing.start=self.performance.now();var o=this.transmuxer,T=this.worker;if(T)T.postMessage({cmd:"flush",chunkMeta:a});else if(o){var w=o.flush(a);Object(K.isPromise)(w)?w.then(function(x){r.handleFlushResult(x,a)}):this.handleFlushResult(w,a)}},d.handleFlushResult=function(a,r){var o=this;a.forEach(function(T){o.handleTransmuxComplete(T)}),this.onFlush(r)},d.onWorkerMessage=function(a){var r=a.data,o=this.hls;switch(r.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(r.data);break}case"flush":{this.onFlush(r.data);break}default:{r.data=r.data||{},r.data.frag=this.frag,r.data.id=this.id,o.trigger(r.event,r.data);break}}},d.configureTransmuxer=function(a){var r=this.worker,o=this.transmuxer;r?r.postMessage({cmd:"configure",config:a}):o&&o.configure(a)},d.handleTransmuxComplete=function(a){a.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(a)},s}()},"./src/demux/transmuxer-worker.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"default",function(){return n});var V=D("./src/demux/transmuxer.ts"),N=D("./src/events.ts"),O=D("./src/utils/logger.ts"),K=D("./node_modules/eventemitter3/index.js"),W=D.n(K);function n(c){var s=new K.EventEmitter,d=function(a,r){c.postMessage({event:a,data:r})};s.on(N.Events.FRAG_DECRYPTED,d),s.on(N.Events.ERROR,d),c.addEventListener("message",function(i){var a=i.data;switch(a.cmd){case"init":{var r=JSON.parse(a.config);c.transmuxer=new V.default(s,a.typeSupported,r,a.vendor,a.id),Object(O.enableLogs)(r.debug),d("init",null);break}case"configure":{c.transmuxer.configure(a.config);break}case"demux":{var o=c.transmuxer.push(a.data,a.decryptdata,a.chunkMeta,a.state);Object(V.isPromise)(o)?o.then(function(x){I(c,x)}):I(c,o);break}case"flush":{var T=a.chunkMeta,w=c.transmuxer.flush(T);Object(V.isPromise)(w)?w.then(function(x){f(c,x,T)}):f(c,w,T);break}default:break}})}function I(c,s){if(h(s.remuxResult))return;var d=[],i=s.remuxResult,a=i.audio,r=i.video;a&&g(d,a),r&&g(d,r),c.postMessage({event:"transmuxComplete",data:s},d)}function g(c,s){s.data1&&c.push(s.data1.buffer),s.data2&&c.push(s.data2.buffer)}function f(c,s,d){s.forEach(function(i){I(c,i)}),c.postMessage({event:"flush",data:d})}function h(c){return!c.audio&&!c.video&&!c.text&&!c.id3&&!c.initSegment}},"./src/demux/transmuxer.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"default",function(){return r}),D.d(z,"isPromise",function(){return w}),D.d(z,"TransmuxConfig",function(){return x}),D.d(z,"TransmuxState",function(){return L});var V=D("./src/events.ts"),N=D("./src/errors.ts"),O=D("./src/crypt/decrypter.ts"),K=D("./src/demux/aacdemuxer.ts"),W=D("./src/demux/mp4demuxer.ts"),n=D("./src/demux/tsdemuxer.ts"),I=D("./src/demux/mp3demuxer.ts"),g=D("./src/remux/mp4-remuxer.ts"),f=D("./src/remux/passthrough-remuxer.ts"),h=D("./src/demux/chunk-cache.ts"),c=D("./src/utils/mp4-tools.ts"),s=D("./src/utils/logger.ts"),d;try{d=self.performance.now.bind(self.performance)}catch(A){s.logger.debug("Unable to use Performance API on this environment"),d=self.Date.now}var i=[{demux:n.default,remux:g.default},{demux:W.default,remux:f.default},{demux:K.default,remux:g.default},{demux:I.default,remux:g.default}],a=1024;i.forEach(function(A){var _=A.demux;a=Math.max(a,_.minProbeByteLength)});var r=function(){function A(b,m,p,C,E){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 h.default,this.observer=b,this.typeSupported=m,this.config=p,this.vendor=C,this.id=E}var _=A.prototype;return _.configure=function(m){this.transmuxConfig=m,this.decrypter&&this.decrypter.reset()},_.push=function(m,p,C,E){var v=this,P=C.transmuxing;P.executeStart=d();var F=new Uint8Array(m),R=this.cache,H=this.config,U=this.currentTransmuxState,S=this.transmuxConfig;E&&(this.currentTransmuxState=E);var G=o(F,p);if(G&&G.method==="AES-128"){var Q=this.getDecrypter();if(H.enableSoftwareAES){var se=Q.softwareDecrypt(F,G.key.buffer,G.iv.buffer);if(!se)return P.executeEnd=d(),T(C);F=new Uint8Array(se)}else return this.decryptionPromise=Q.webCryptoDecrypt(F,G.key.buffer,G.iv.buffer).then(function(Me){var He=v.push(Me,null,C);return v.decryptionPromise=null,He}),this.decryptionPromise}var fe=E||U,we=fe.contiguous,be=fe.discontinuity,Se=fe.trackSwitch,Ae=fe.accurateTimeOffset,De=fe.timeOffset,ve=S.audioCodec,Y=S.videoCodec,k=S.defaultInitPts,B=S.duration,Z=S.initSegmentData;if((be||Se)&&this.resetInitSegment(Z,ve,Y,B),be&&this.resetInitialTimestamp(k),we||this.resetContiguity(),this.needsProbing(F,be,Se)){if(R.dataLength){var re=R.flush();F=Object(c.appendUint8Array)(re,F)}this.configureTransmuxer(F,S)}var X=this.transmux(F,G,De,Ae,C),ye=this.currentTransmuxState;return ye.contiguous=!0,ye.discontinuity=!1,ye.trackSwitch=!1,P.executeEnd=d(),X},_.flush=function(m){var p=this,C=m.transmuxing;C.executeStart=d();var E=this.decrypter,v=this.cache,P=this.currentTransmuxState,F=this.decryptionPromise;if(F)return F.then(function(){return p.flush(m)});var R=[],H=P.timeOffset;if(E){var U=E.flush();U&&R.push(this.push(U,null,m))}var S=v.dataLength;v.reset();var G=this.demuxer,Q=this.remuxer;if(!G||!Q)return S>=a&&this.observer.emit(V.Events.ERROR,V.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),C.executeEnd=d(),[T(m)];var se=G.flush(H);return w(se)?se.then(function(fe){return p.flushRemux(R,fe,m),R}):(this.flushRemux(R,se,m),R)},_.flushRemux=function(m,p,C){var E=p.audioTrack,v=p.avcTrack,P=p.id3Track,F=p.textTrack,R=this.currentTransmuxState,H=R.accurateTimeOffset,U=R.timeOffset;s.logger.log("[transmuxer.ts]: Flushed fragment "+C.sn+(C.part>-1?" p: "+C.part:"")+" of level "+C.level);var S=this.remuxer.remux(E,v,P,F,U,H,!0,this.id);m.push({remuxResult:S,chunkMeta:C}),C.transmuxing.executeEnd=d()},_.resetInitialTimestamp=function(m){var p=this.demuxer,C=this.remuxer;if(!p||!C)return;p.resetTimeStamp(m),C.resetTimeStamp(m)},_.resetContiguity=function(){var m=this.demuxer,p=this.remuxer;if(!m||!p)return;m.resetContiguity(),p.resetNextTimestamp()},_.resetInitSegment=function(m,p,C,E){var v=this.demuxer,P=this.remuxer;if(!v||!P)return;v.resetInitSegment(p,C,E),P.resetInitSegment(m,p,C)},_.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},_.transmux=function(m,p,C,E,v){var P;return p&&p.method==="SAMPLE-AES"?P=this.transmuxSampleAes(m,p,C,E,v):P=this.transmuxUnencrypted(m,C,E,v),P},_.transmuxUnencrypted=function(m,p,C,E){var v=this.demuxer.demux(m,p,!1,!this.config.progressive),P=v.audioTrack,F=v.avcTrack,R=v.id3Track,H=v.textTrack,U=this.remuxer.remux(P,F,R,H,p,C,!1,this.id);return{remuxResult:U,chunkMeta:E}},_.transmuxSampleAes=function(m,p,C,E,v){var P=this;return this.demuxer.demuxSampleAes(m,p,C).then(function(F){var R=P.remuxer.remux(F.audioTrack,F.avcTrack,F.id3Track,F.textTrack,C,E,!1,P.id);return{remuxResult:R,chunkMeta:v}})},_.configureTransmuxer=function(m,p){for(var C=this.config,E=this.observer,v=this.typeSupported,P=this.vendor,F=p.audioCodec,R=p.defaultInitPts,H=p.duration,U=p.initSegmentData,S=p.videoCodec,G,Q=0,se=i.length;Q<se;Q++)if(i[Q].demux.probe(m)){G=i[Q];break}G||(s.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),G={demux:W.default,remux:f.default});var fe=this.demuxer,we=this.remuxer,be=G.remux,Se=G.demux;(!we||!(we instanceof be))&&(this.remuxer=new be(E,C,v,P)),(!fe||!(fe instanceof Se))&&(this.demuxer=new Se(E,C,v),this.probe=Se.probe),this.resetInitSegment(U,F,S,H),this.resetInitialTimestamp(R)},_.needsProbing=function(m,p,C){return!this.demuxer||!this.remuxer||p||C},_.getDecrypter=function(){var m=this.decrypter;return m||(m=this.decrypter=new O.default(this.observer,this.config)),m},A}();function o(A,_){var b=null;return A.byteLength>0&&_!=null&&_.key!=null&&_.iv!==null&&_.method!=null&&(b=_),b}var T=function(_){return{remuxResult:{},chunkMeta:_}};function w(A){return"then"in A&&A.then instanceof Function}var x=function(_,b,m,p,C){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=_,this.videoCodec=b,this.initSegmentData=m,this.duration=p,this.defaultInitPts=C},L=function(_,b,m,p,C){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=_,this.contiguous=b,this.accurateTimeOffset=m,this.trackSwitch=p,this.timeOffset=C}},"./src/demux/tsdemuxer.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"discardEPB",function(){return T});var V=D("./src/demux/adts.ts"),N=D("./src/demux/mpegaudio.ts"),O=D("./src/demux/exp-golomb.ts"),K=D("./src/demux/id3.ts"),W=D("./src/demux/sample-aes.ts"),n=D("./src/events.ts"),I=D("./src/utils/mp4-tools.ts"),g=D("./src/utils/logger.ts"),f=D("./src/errors.ts"),h={video:1,audio:2,id3:3,text:4},c=function(){function w(L,A,_){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=L,this.config=A,this.typeSupported=_}w.probe=function(A){var _=w.syncOffset(A);return _<0?!1:(_&&g.logger.warn("MPEG2-TS detected but first sync word found @ offset "+_+", junk ahead ?"),!0)},w.syncOffset=function(A){for(var _=Math.min(1e3,A.length-3*188),b=0;b<_;){if(A[b]===71&&A[b+188]===71&&A[b+2*188]===71)return b;b++}return-1},w.createTrack=function(A,_){return{container:A==="video"||A==="audio"?"video/mp2t":void 0,type:A,id:h[A],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:A==="audio"?_:void 0}};var x=w.prototype;return x.resetInitSegment=function(A,_,b){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=w.createTrack("video",b),this._audioTrack=w.createTrack("audio",b),this._id3Track=w.createTrack("id3",b),this._txtTrack=w.createTrack("text",b),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=A,this.videoCodec=_,this._duration=b},x.resetTimeStamp=function(){},x.resetContiguity=function(){var A=this._audioTrack,_=this._avcTrack,b=this._id3Track;A&&(A.pesData=null),_&&(_.pesData=null),b&&(b.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},x.demux=function(A,_,b,m){b===void 0&&(b=!1),m===void 0&&(m=!1),b||(this.sampleAes=null);var p,C=this._avcTrack,E=this._audioTrack,v=this._id3Track,P=C.pid,F=C.pesData,R=E.pid,H=v.pid,U=E.pesData,S=v.pesData,G=!1,Q=this.pmtParsed,se=this._pmtId,fe=A.length;if(this.remainderData&&(A=Object(I.appendUint8Array)(this.remainderData,A),fe=A.length,this.remainderData=null),fe<188&&!m)return this.remainderData=A,{audioTrack:E,avcTrack:C,id3Track:v,textTrack:this._txtTrack};var we=Math.max(0,w.syncOffset(A));fe-=(fe+we)%188,fe<A.byteLength&&!m&&(this.remainderData=new Uint8Array(A.buffer,fe,A.buffer.byteLength-fe));for(var be=we;be<fe;be+=188)if(A[be]===71){var Se=!!(A[be+1]&64),Ae=((A[be+1]&31)<<8)+A[be+2],De=(A[be+3]&48)>>4,ve=void 0;if(De>1){if(ve=be+5+A[be+4],ve===be+188)continue}else ve=be+4;switch(Ae){case P:Se&&(F&&(p=a(F))&&this.parseAVCPES(p,!1),F={data:[],size:0}),F&&(F.data.push(A.subarray(ve,be+188)),F.size+=be+188-ve);break;case R:Se&&(U&&(p=a(U))&&(E.isAAC?this.parseAACPES(p):this.parseMPEGPES(p)),U={data:[],size:0}),U&&(U.data.push(A.subarray(ve,be+188)),U.size+=be+188-ve);break;case H:Se&&(S&&(p=a(S))&&this.parseID3PES(p),S={data:[],size:0}),S&&(S.data.push(A.subarray(ve,be+188)),S.size+=be+188-ve);break;case 0:Se&&(ve+=A[ve]+1),se=this._pmtId=d(A,ve);break;case se:{Se&&(ve+=A[ve]+1);var Y=i(A,ve,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,b);P=Y.avc,P>0&&(C.pid=P),R=Y.audio,R>0&&(E.pid=R,E.isAAC=Y.isAAC),H=Y.id3,H>0&&(v.pid=H),G&&!Q&&(g.logger.log("reparse from beginning"),G=!1,be=we-188),Q=this.pmtParsed=!0;break}case 17:case 8191:break;default:G=!0;break}}else this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});C.pesData=F,E.pesData=U,v.pesData=S;var k={audioTrack:E,avcTrack:C,id3Track:v,textTrack:this._txtTrack};return m&&this.extractRemainingSamples(k),k},x.flush=function(){var A=this.remainderData;this.remainderData=null;var _;return A?_=this.demux(A,-1,!1,!0):_={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(_),this.sampleAes?this.decrypt(_,this.sampleAes):_},x.extractRemainingSamples=function(A){var _=A.audioTrack,b=A.avcTrack,m=A.id3Track,p=b.pesData,C=_.pesData,E=m.pesData,v;p&&(v=a(p))?(this.parseAVCPES(v,!0),b.pesData=null):b.pesData=p,C&&(v=a(C))?(_.isAAC?this.parseAACPES(v):this.parseMPEGPES(v),_.pesData=null):(C!=null&&C.size&&g.logger.log("last AAC PES packet truncated,might overlap between fragments"),_.pesData=C),E&&(v=a(E))?(this.parseID3PES(v),m.pesData=null):m.pesData=E},x.demuxSampleAes=function(A,_,b){var m=this.demux(A,b,!0,!this.config.progressive),p=this.sampleAes=new W.default(this.observer,this.config,_);return this.decrypt(m,p)},x.decrypt=function(A,_){return new Promise(function(b){var m=A.audioTrack,p=A.avcTrack;m.samples&&m.isAAC?_.decryptAacSamples(m.samples,0,function(){p.samples?_.decryptAvcSamples(p.samples,0,0,function(){b(A)}):b(A)}):p.samples&&_.decryptAvcSamples(p.samples,0,0,function(){b(A)})})},x.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},x.parseAVCPES=function(A,_){var b=this,m=this._avcTrack,p=this.parseAVCNALu(A.data),C=!1,E=this.avcSample,v,P=!1;A.data=null,E&&p.length&&!m.audFound&&(r(E,m),E=this.avcSample=s(!1,A.pts,A.dts,"")),p.forEach(function(F){switch(F.type){case 1:{v=!0,E||(E=b.avcSample=s(!0,A.pts,A.dts,"")),C&&(E.debug+="NDR "),E.frame=!0;var R=F.data;if(P&&R.length>4){var H=new O.default(R).readSliceType();(H===2||H===4||H===7||H===9)&&(E.key=!0)}break}case 5:v=!0,E||(E=b.avcSample=s(!0,A.pts,A.dts,"")),C&&(E.debug+="IDR "),E.key=!0,E.frame=!0;break;case 6:{v=!0,C&&E&&(E.debug+="SEI ");var U=new O.default(T(F.data));U.readUByte();for(var S=0,G=0,Q=!1,se=0;!Q&&U.bytesAvailable>1;){S=0;do se=U.readUByte(),S+=se;while(se===255);G=0;do se=U.readUByte(),G+=se;while(se===255);if(S===4&&U.bytesAvailable!==0){Q=!0;var fe=U.readUByte();if(fe===181){var we=U.readUShort();if(we===49){var be=U.readUInt();if(be===1195456820){var Se=U.readUByte();if(Se===3){for(var Ae=U.readUByte(),De=U.readUByte(),ve=31&Ae,Y=[Ae,De],k=0;k<ve;k++)Y.push(U.readUByte()),Y.push(U.readUByte()),Y.push(U.readUByte());o(b._txtTrack.samples,{type:3,pts:A.pts,bytes:Y})}}}}}else if(S===5&&U.bytesAvailable!==0){if(Q=!0,G>16){for(var B=[],Z=0;Z<16;Z++)B.push(U.readUByte().toString(16)),(Z===3||Z===5||Z===7||Z===9)&&B.push("-");for(var re=G-16,X=new Uint8Array(re),ye=0;ye<re;ye++)X[ye]=U.readUByte();o(b._txtTrack.samples,{pts:A.pts,payloadType:S,uuid:B.join(""),userData:Object(K.utf8ArrayToStr)(X),userDataBytes:X})}}else if(G<U.bytesAvailable)for(var Me=0;Me<G;Me++)U.readUByte()}break}case 7:if(v=!0,P=!0,C&&E&&(E.debug+="SPS "),!m.sps){var He=new O.default(F.data),me=He.readSPS();m.width=me.width,m.height=me.height,m.pixelRatio=me.pixelRatio,m.sps=[F.data],m.duration=b._duration;for(var Ee=F.data.subarray(1,4),Le="avc1.",Pe=0;Pe<3;Pe++){var Ye=Ee[Pe].toString(16);Ye.length<2&&(Ye="0"+Ye),Le+=Ye}m.codec=Le}break;case 8:v=!0,C&&E&&(E.debug+="PPS "),m.pps||(m.pps=[F.data]);break;case 9:v=!1,m.audFound=!0,E&&r(E,m),E=b.avcSample=s(!1,A.pts,A.dts,C?"AUD ":"");break;case 12:v=!1;break;default:v=!1,E&&(E.debug+="unknown NAL "+F.type+" ");break}if(E&&v){var tt=E.units;tt.push(F)}}),_&&E&&(r(E,m),this.avcSample=null)},x.getLastNalUnit=function(){var A,_=this.avcSample,b;if(!_||_.units.length===0){var m=this._avcTrack.samples;_=m[m.length-1]}if((A=_)!==null&&A!==void 0&&A.units){var p=_.units;b=p[p.length-1]}return b},x.parseAVCNALu=function(A){var _=A.byteLength,b=this._avcTrack,m=b.naluState||0,p=m,C=[],E=0,v,P,F,R=-1,H=0;for(m===-1&&(R=0,H=A[0]&31,m=0,E=1);E<_;){if(v=A[E++],!m){m=v?0:1;continue}if(m===1){m=v?0:2;continue}if(!v)m=3;else if(v===1){if(R>=0){var U={data:A.subarray(R,E-m-1),type:H};C.push(U)}else{var S=this.getLastNalUnit();if(S&&(p&&E<=4-p&&(S.state&&(S.data=S.data.subarray(0,S.data.byteLength-p))),P=E-m-1,P>0)){var G=new Uint8Array(S.data.byteLength+P);G.set(S.data,0),G.set(A.subarray(0,P),S.data.byteLength),S.data=G,S.state=0}}E<_?(F=A[E]&31,R=E,H=F,m=0):m=-1}else m=0}if(R>=0&&m>=0){var Q={data:A.subarray(R,_),type:H,state:m};C.push(Q)}if(C.length===0){var se=this.getLastNalUnit();if(se){var fe=new Uint8Array(se.data.byteLength+A.byteLength);fe.set(se.data,0),fe.set(A,se.data.byteLength),se.data=fe}}return b.naluState=m,C},x.parseAACPES=function(A){var _=0,b=this._audioTrack,m=this.aacOverFlow,p=A.data;if(m){this.aacOverFlow=null;var C=m.sample.unit.byteLength,E=Math.min(m.missing,C),v=C-E;m.sample.unit.set(p.subarray(0,E),v),b.samples.push(m.sample),_=m.missing}var P,F;for(P=_,F=p.length;P<F-1&&!V.isHeader(p,P);P++);if(P!==_){var R,H;if(P<F-1?(R="AAC PES did not start with ADTS header,offset:"+P,H=!1):(R="no ADTS header found in AAC PES",H=!0),g.logger.warn("parsing error:"+R),this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.FRAG_PARSING_ERROR,fatal:H,reason:R}),H)return}V.initTrackConfig(b,this.observer,p,P,this.audioCodec);var U;if(A.pts!==void 0)U=A.pts;else if(m){var S=V.getFrameDuration(b.samplerate);U=m.sample.pts+S}else{g.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var G=0;P<F;)if(V.isHeader(p,P)){if(P+5<F){var Q=V.appendFrame(b,p,P,U,G);if(Q)if(Q.missing)this.aacOverFlow=Q;else{P+=Q.length,G++;continue}}break}else P++},x.parseMPEGPES=function(A){var _=A.data,b=_.length,m=0,p=0,C=A.pts;if(C===void 0){g.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;p<b;)if(N.isHeader(_,p)){var E=N.appendFrame(this._audioTrack,_,p,C,m);if(E)p+=E.length,m++;else break}else p++},x.parseID3PES=function(A){if(A.pts===void 0){g.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(A)},w}();c.minProbeByteLength=188;function s(w,x,L,A){return{key:w,frame:!1,pts:x,dts:L,units:[],debug:A,length:0}}function d(w,x){return(w[x+10]&31)<<8|w[x+11]}function i(w,x,L,A){var _={audio:-1,avc:-1,id3:-1,isAAC:!0},b=(w[x+1]&15)<<8|w[x+2],m=x+3+b-4,p=(w[x+10]&15)<<8|w[x+11];for(x+=12+p;x<m;){var C=(w[x+1]&31)<<8|w[x+2];switch(w[x]){case 207:if(!A){g.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:_.audio===-1&&(_.audio=C);break;case 21:_.id3===-1&&(_.id3=C);break;case 219:if(!A){g.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:_.avc===-1&&(_.avc=C);break;case 3:case 4:L?_.audio===-1&&(_.audio=C,_.isAAC=!1):g.logger.log("MPEG audio found, not supported in this browser");break;case 36:g.logger.warn("Unsupported HEVC stream type found");break;default:break}x+=((w[x+3]&15)<<8|w[x+4])+5}return _}function a(w){var x=0,L,A,_,b,m,p=w.data;if(!w||w.size===0)return null;for(;p[0].length<19&&p.length>1;){var C=new Uint8Array(p[0].length+p[1].length);C.set(p[0]),C.set(p[1],p[0].length),p[0]=C,p.splice(1,1)}L=p[0];var E=(L[0]<<16)+(L[1]<<8)+L[2];if(E===1){if(A=(L[4]<<8)+L[5],A&&A>w.size-6)return null;var v=L[7];v&192&&(b=(L[9]&14)*536870912+(L[10]&255)*4194304+(L[11]&254)*16384+(L[12]&255)*128+(L[13]&254)/2,v&64?(m=(L[14]&14)*536870912+(L[15]&255)*4194304+(L[16]&254)*16384+(L[17]&255)*128+(L[18]&254)/2,b-m>60*9e4&&(g.logger.warn(Math.round((b-m)/9e4)+"s delta between PTS and DTS, align them"),b=m)):m=b),_=L[8];var P=_+9;if(w.size<=P)return null;w.size-=P;for(var F=new Uint8Array(w.size),R=0,H=p.length;R<H;R++){L=p[R];var U=L.byteLength;if(P)if(P>U){P-=U;continue}else L=L.subarray(P),U-=P,P=0;F.set(L,x),x+=U}return A&&(A-=_+3),{data:F,pts:b,dts:m,len:A}}return null}function r(w,x){if(w.units.length&&w.frame){if(w.pts===void 0){var L=x.samples,A=L.length;if(A){var _=L[A-1];w.pts=_.pts,w.dts=_.dts}else{x.dropped++;return}}x.samples.push(w)}w.debug.length&&g.logger.log(w.pts+"/"+w.dts+":"+w.debug)}function o(w,x){var L=w.length;if(L>0){if(x.pts>=w[L-1].pts)w.push(x);else for(var A=L-1;A>=0;A--)if(x.pts<w[A].pts){w.splice(A,0,x);break}}else w.push(x)}function T(w){for(var x=w.byteLength,L=[],A=1;A<x-2;)w[A]===0&&w[A+1]===0&&w[A+2]===3?(L.push(A+2),A+=2):A++;if(L.length===0)return w;var _=x-L.length,b=new Uint8Array(_),m=0;for(A=0;A<_;m++,A++)m===L[0]&&(m++,L.shift()),b[A]=w[m];return b}z.default=c},"./src/errors.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"ErrorTypes",function(){return V}),D.d(z,"ErrorDetails",function(){return N});var V;(function(O){O.NETWORK_ERROR="networkError",O.MEDIA_ERROR="mediaError",O.KEY_SYSTEM_ERROR="keySystemError",O.MUX_ERROR="muxError",O.OTHER_ERROR="otherError"})(V||(V={}));var N;(function(O){O.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",O.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",O.KEY_SYSTEM_NO_SESSION="keySystemNoSession",O.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",O.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",O.MANIFEST_LOAD_ERROR="manifestLoadError",O.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",O.MANIFEST_PARSING_ERROR="manifestParsingError",O.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",O.LEVEL_EMPTY_ERROR="levelEmptyError",O.LEVEL_LOAD_ERROR="levelLoadError",O.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",O.LEVEL_SWITCH_ERROR="levelSwitchError",O.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",O.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",O.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",O.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",O.FRAG_LOAD_ERROR="fragLoadError",O.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",O.FRAG_DECRYPT_ERROR="fragDecryptError",O.FRAG_PARSING_ERROR="fragParsingError",O.REMUX_ALLOC_ERROR="remuxAllocError",O.KEY_LOAD_ERROR="keyLoadError",O.KEY_LOAD_TIMEOUT="keyLoadTimeOut",O.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",O.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",O.BUFFER_APPEND_ERROR="bufferAppendError",O.BUFFER_APPENDING_ERROR="bufferAppendingError",O.BUFFER_STALLED_ERROR="bufferStalledError",O.BUFFER_FULL_ERROR="bufferFullError",O.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",O.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",O.INTERNAL_EXCEPTION="internalException",O.INTERNAL_ABORTED="aborted",O.UNKNOWN="unknown"})(N||(N={}))},"./src/events.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"Events",function(){return V});var V;(function(N){N.MEDIA_ATTACHING="hlsMediaAttaching",N.MEDIA_ATTACHED="hlsMediaAttached",N.MEDIA_DETACHING="hlsMediaDetaching",N.MEDIA_DETACHED="hlsMediaDetached",N.BUFFER_RESET="hlsBufferReset",N.BUFFER_CODECS="hlsBufferCodecs",N.BUFFER_CREATED="hlsBufferCreated",N.BUFFER_APPENDING="hlsBufferAppending",N.BUFFER_APPENDED="hlsBufferAppended",N.BUFFER_EOS="hlsBufferEos",N.BUFFER_FLUSHING="hlsBufferFlushing",N.BUFFER_FLUSHED="hlsBufferFlushed",N.MANIFEST_LOADING="hlsManifestLoading",N.MANIFEST_LOADED="hlsManifestLoaded",N.MANIFEST_PARSED="hlsManifestParsed",N.LEVEL_SWITCHING="hlsLevelSwitching",N.LEVEL_SWITCHED="hlsLevelSwitched",N.LEVEL_LOADING="hlsLevelLoading",N.LEVEL_LOADED="hlsLevelLoaded",N.LEVEL_UPDATED="hlsLevelUpdated",N.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",N.LEVELS_UPDATED="hlsLevelsUpdated",N.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",N.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",N.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",N.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",N.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",N.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",N.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",N.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",N.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",N.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",N.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",N.CUES_PARSED="hlsCuesParsed",N.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",N.INIT_PTS_FOUND="hlsInitPtsFound",N.FRAG_LOADING="hlsFragLoading",N.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",N.FRAG_LOADED="hlsFragLoaded",N.FRAG_DECRYPTED="hlsFragDecrypted",N.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",N.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",N.FRAG_PARSING_METADATA="hlsFragParsingMetadata",N.FRAG_PARSED="hlsFragParsed",N.FRAG_BUFFERED="hlsFragBuffered",N.FRAG_CHANGED="hlsFragChanged",N.FPS_DROP="hlsFpsDrop",N.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",N.ERROR="hlsError",N.DESTROYING="hlsDestroying",N.KEY_LOADING="hlsKeyLoading",N.KEY_LOADED="hlsKeyLoaded",N.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",N.BACK_BUFFER_REACHED="hlsBackBufferReached"})(V||(V={}))},"./src/hls.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"default",function(){return w});var V=D("./node_modules/url-toolkit/src/url-toolkit.js"),N=D.n(V),O=D("./src/loader/playlist-loader.ts"),K=D("./src/loader/key-loader.ts"),W=D("./src/controller/id3-track-controller.ts"),n=D("./src/controller/latency-controller.ts"),I=D("./src/controller/level-controller.ts"),g=D("./src/controller/fragment-tracker.ts"),f=D("./src/controller/stream-controller.ts"),h=D("./src/is-supported.ts"),c=D("./src/utils/logger.ts"),s=D("./src/config.ts"),d=D("./node_modules/eventemitter3/index.js"),i=D.n(d),a=D("./src/events.ts"),r=D("./src/errors.ts");function o(x,L){for(var A=0;A<L.length;A++){var _=L[A];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(x,_.key,_)}}function T(x,L,A){return L&&o(x.prototype,L),A&&o(x,A),x}var w=function(){x.isSupported=function(){return Object(h.isSupported)()};function x(A){A===void 0&&(A={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new d.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var _=this.config=Object(s.mergeConfig)(x.DefaultConfig,A);this.userConfig=A,Object(c.enableLogs)(_.debug),this._autoLevelCapping=-1,_.progressive&&Object(s.enableStreamingMode)(_);var b=_.abrController,m=_.bufferController,p=_.capLevelController,C=_.fpsController,E=this.abrController=new b(this),v=this.bufferController=new m(this),P=this.capLevelController=new p(this),F=new C(this),R=new O.default(this),H=new K.default(this),U=new W.default(this),S=this.levelController=new I.default(this),G=new g.FragmentTracker(this),Q=this.streamController=new f.default(this,G);P.setStreamController(Q),F.setStreamController(Q);var se=[S,Q];this.networkControllers=se;var fe=[R,H,E,v,P,F,U,G];this.audioTrackController=this.createController(_.audioTrackController,null,se),this.createController(_.audioStreamController,G,se),this.subtitleTrackController=this.createController(_.subtitleTrackController,null,se),this.createController(_.subtitleStreamController,G,se),this.createController(_.timelineController,null,fe),this.emeController=this.createController(_.emeController,null,fe),this.cmcdController=this.createController(_.cmcdController,null,fe),this.latencyController=this.createController(n.default,null,fe),this.coreComponents=fe}var L=x.prototype;return L.createController=function(_,b,m){if(_){var p=b?new _(this,b):new _(this);return m&&m.push(p),p}return null},L.on=function(_,b,m){m===void 0&&(m=this),this._emitter.on(_,b,m)},L.once=function(_,b,m){m===void 0&&(m=this),this._emitter.once(_,b,m)},L.removeAllListeners=function(_){this._emitter.removeAllListeners(_)},L.off=function(_,b,m,p){m===void 0&&(m=this),this._emitter.off(_,b,m,p)},L.listeners=function(_){return this._emitter.listeners(_)},L.emit=function(_,b,m){return this._emitter.emit(_,b,m)},L.trigger=function(_,b){if(this.config.debug)return this.emit(_,_,b);try{return this.emit(_,_,b)}catch(m){c.logger.error("An internal error happened while handling event "+_+'. Error message: "'+m.message+'". Here is a stacktrace:',m),this.trigger(a.Events.ERROR,{type:r.ErrorTypes.OTHER_ERROR,details:r.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:_,error:m})}return!1},L.listenerCount=function(_){return this._emitter.listenerCount(_)},L.destroy=function(){c.logger.log("destroy"),this.trigger(a.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(_){return _.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(_){return _.destroy()}),this.coreComponents.length=0},L.attachMedia=function(_){c.logger.log("attachMedia"),this._media=_,this.trigger(a.Events.MEDIA_ATTACHING,{media:_})},L.detachMedia=function(){c.logger.log("detachMedia"),this.trigger(a.Events.MEDIA_DETACHING,void 0),this._media=null},L.loadSource=function(_){this.stopLoad();var b=this.media,m=this.url,p=this.url=V.buildAbsoluteURL(self.location.href,_,{alwaysNormalize:!0});c.logger.log("loadSource:"+p),b&&m&&m!==p&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(b)),this.trigger(a.Events.MANIFEST_LOADING,{url:_})},L.startLoad=function(_){_===void 0&&(_=-1),c.logger.log("startLoad("+_+")"),this.networkControllers.forEach(function(b){b.startLoad(_)})},L.stopLoad=function(){c.logger.log("stopLoad"),this.networkControllers.forEach(function(_){_.stopLoad()})},L.swapAudioCodec=function(){c.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},L.recoverMediaError=function(){c.logger.log("recoverMediaError");var _=this._media;this.detachMedia(),_&&this.attachMedia(_)},L.removeLevel=function(_,b){b===void 0&&(b=0),this.levelController.removeLevel(_,b)},T(x,[{key:"levels",get:function(){var _=this.levelController.levels;return _||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(_){c.logger.log("set currentLevel:"+_),this.loadLevel=_,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(_){c.logger.log("set nextLevel:"+_),this.levelController.manualLevel=_,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(_){c.logger.log("set loadLevel:"+_),this.levelController.manualLevel=_}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(_){this.levelController.nextLoadLevel=_}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(_){c.logger.log("set firstLevel:"+_),this.levelController.firstLevel=_}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(_){c.logger.log("set startLevel:"+_),_!==-1&&(_=Math.max(_,this.minAutoLevel)),this.levelController.startLevel=_}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(_){var b=!!_;b!==this.config.capLevelToPlayerSize&&(b?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=b)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(_){this._autoLevelCapping!==_&&(c.logger.log("set autoLevelCapping:"+_),this._autoLevelCapping=_)}},{key:"bandwidthEstimate",get:function(){var _=this.abrController.bwEstimator;return _?_.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var _=this.levels,b=this.config.minAutoBitrate;if(!_)return 0;for(var m=_.length,p=0;p<m;p++)if(_[p].maxBitrate>b)return p;return 0}},{key:"maxAutoLevel",get:function(){var _=this.levels,b=this.autoLevelCapping,m;return b===-1&&_&&_.length?m=_.length-1:m=b,m}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(_){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,_)}},{key:"audioTracks",get:function(){var _=this.audioTrackController;return _?_.audioTracks:[]}},{key:"audioTrack",get:function(){var _=this.audioTrackController;return _?_.audioTrack:-1},set:function(_){var b=this.audioTrackController;b&&(b.audioTrack=_)}},{key:"subtitleTracks",get:function(){var _=this.subtitleTrackController;return _?_.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var _=this.subtitleTrackController;return _?_.subtitleTrack:-1},set:function(_){var b=this.subtitleTrackController;b&&(b.subtitleTrack=_)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var _=this.subtitleTrackController;return _?_.subtitleDisplay:!1},set:function(_){var b=this.subtitleTrackController;b&&(b.subtitleDisplay=_)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(_){this.config.lowLatencyMode=_}},{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 r.ErrorTypes}},{key:"ErrorDetails",get:function(){return r.ErrorDetails}},{key:"DefaultConfig",get:function(){return x.defaultConfig?x.defaultConfig:s.hlsDefaultConfig},set:function(_){x.defaultConfig=_}}]),x}();w.defaultConfig=void 0},"./src/is-supported.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"isSupported",function(){return O}),D.d(z,"changeTypeSupported",function(){return K});var V=D("./src/utils/mediasource-helper.ts");function N(){return self.SourceBuffer||self.WebKitSourceBuffer}function O(){var W=Object(V.getMediaSource)();if(!W)return!1;var n=N(),I=W&&typeof W.isTypeSupported=="function"&&W.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),g=!n||n.prototype&&typeof n.prototype.appendBuffer=="function"&&typeof n.prototype.remove=="function";return!!I&&!!g}function K(){var W,n=N();return typeof(n==null||((W=n.prototype)===null||W===void 0)?void 0:W.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"default",function(){return c}),D.d(z,"LoadError",function(){return d});var V=D("./src/polyfills/number.ts"),N=D("./src/errors.ts");function O(i,a){i.prototype=Object.create(a.prototype),i.prototype.constructor=i,g(i,a)}function K(i){var a=typeof Map=="function"?new Map:void 0;return K=function(o){if(o===null||!I(o))return o;if(typeof o!="function")throw new TypeError("Super expression must either be null or a function");if(typeof a!="undefined"){if(a.has(o))return a.get(o);a.set(o,T)}function T(){return W(o,arguments,f(this).constructor)}return T.prototype=Object.create(o.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),g(T,o)},K(i)}function W(i,a,r){return n()?W=Reflect.construct:W=function(T,w,x){var L=[null];L.push.apply(L,w);var A=Function.bind.apply(T,L),_=new A;return x&&g(_,x.prototype),_},W.apply(null,arguments)}function n(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(i){return!1}}function I(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function g(i,a){return g=Object.setPrototypeOf||function(o,T){return o.__proto__=T,o},g(i,a)}function f(i){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},f(i)}var h=Math.pow(2,17),c=function(){function i(r){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=r}var a=i.prototype;return a.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},a.abort=function(){this.loader&&this.loader.abort()},a.load=function(o,T){var w=this,x=o.url;if(!x)return Promise.reject(new d({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:o,networkDetails:null},"Fragment does not have a "+(x?"part list":"url")));this.abort();var L=this.config,A=L.fLoader,_=L.loader;return new Promise(function(b,m){w.loader&&w.loader.destroy();var p=w.loader=o.loader=A?new A(L):new _(L),C=s(o),E={timeout:L.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:L.fragLoadingMaxRetryTimeout,highWaterMark:h};o.stats=p.stats,p.load(C,E,{onSuccess:function(P,F,R,H){w.resetLoader(o,p),b({frag:o,part:null,payload:P.data,networkDetails:H})},onError:function(P,F,R){w.resetLoader(o,p),m(new d({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:o,response:P,networkDetails:R}))},onAbort:function(P,F,R){w.resetLoader(o,p),m(new d({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:o,networkDetails:R}))},onTimeout:function(P,F,R){w.resetLoader(o,p),m(new d({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:o,networkDetails:R}))},onProgress:function(P,F,R,H){T&&T({frag:o,part:null,payload:R,networkDetails:H})}})})},a.loadPart=function(o,T,w){var x=this;this.abort();var L=this.config,A=L.fLoader,_=L.loader;return new Promise(function(b,m){x.loader&&x.loader.destroy();var p=x.loader=o.loader=A?new A(L):new _(L),C=s(o,T),E={timeout:L.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:L.fragLoadingMaxRetryTimeout,highWaterMark:h};T.stats=p.stats,p.load(C,E,{onSuccess:function(P,F,R,H){x.resetLoader(o,p),x.updateStatsFromPart(o,T);var U={frag:o,part:T,payload:P.data,networkDetails:H};w(U),b(U)},onError:function(P,F,R){x.resetLoader(o,p),m(new d({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:o,part:T,response:P,networkDetails:R}))},onAbort:function(P,F,R){o.stats.aborted=T.stats.aborted,x.resetLoader(o,p),m(new d({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:o,part:T,networkDetails:R}))},onTimeout:function(P,F,R){x.resetLoader(o,p),m(new d({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:o,part:T,networkDetails:R}))}})})},a.updateStatsFromPart=function(o,T){var w=o.stats,x=T.stats,L=x.total;if(w.loaded+=x.loaded,L){var A=Math.round(o.duration/T.duration),_=Math.min(Math.round(w.loaded/L),A),b=A-_,m=b*Math.round(w.loaded/_);w.total=w.loaded+m}else w.total=Math.max(w.loaded,w.total);var p=w.loading,C=x.loading;p.start?p.first+=C.first-C.start:(p.start=C.start,p.first=C.first),p.end=C.end},a.resetLoader=function(o,T){o.loader=null,this.loader===T&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),T.destroy()},i}();function s(i,a){a===void 0&&(a=null);var r=a||i,o={frag:i,part:a,responseType:"arraybuffer",url:r.url,headers:{},rangeStart:0,rangeEnd:0},T=r.byteRangeStartOffset,w=r.byteRangeEndOffset;return Object(V.isFiniteNumber)(T)&&Object(V.isFiniteNumber)(w)&&(o.rangeStart=T,o.rangeEnd=w),o}var d=function(i){O(a,i);function a(r){for(var o,T=arguments.length,w=new Array(T>1?T-1:0),x=1;x<T;x++)w[x-1]=arguments[x];return o=i.call.apply(i,[this].concat(w))||this,o.data=void 0,o.data=r,o}return a}(K(Error))},"./src/loader/fragment.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"ElementaryStreamTypes",function(){return c}),D.d(z,"BaseSegment",function(){return s}),D.d(z,"Fragment",function(){return d}),D.d(z,"Part",function(){return i});var V=D("./src/polyfills/number.ts"),N=D("./node_modules/url-toolkit/src/url-toolkit.js"),O=D.n(N),K=D("./src/utils/logger.ts"),W=D("./src/loader/level-key.ts"),n=D("./src/loader/load-stats.ts");function I(a,r){a.prototype=Object.create(r.prototype),a.prototype.constructor=a,g(a,r)}function g(a,r){return g=Object.setPrototypeOf||function(T,w){return T.__proto__=w,T},g(a,r)}function f(a,r){for(var o=0;o<r.length;o++){var T=r[o];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(a,T.key,T)}}function h(a,r,o){return r&&f(a.prototype,r),o&&f(a,o),a}var c;(function(a){a.AUDIO="audio",a.VIDEO="video",a.AUDIOVIDEO="audiovideo"})(c||(c={}));var s=function(){function a(o){var T;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(T={},T[c.AUDIO]=null,T[c.VIDEO]=null,T[c.AUDIOVIDEO]=null,T),this.baseurl=o}var r=a.prototype;return r.setByteRange=function(T,w){var x=T.split("@",2),L=[];x.length===1?L[0]=w?w.byteRangeEndOffset:0:L[0]=parseInt(x[1]),L[1]=parseInt(x[0])+L[0],this._byteRange=L},h(a,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(N.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(T){this._url=T}}]),a}(),d=function(a){I(r,a);function r(T,w){var x;return x=a.call(this,w)||this,x._decryptdata=null,x.rawProgramDateTime=null,x.programDateTime=null,x.tagList=[],x.duration=0,x.sn=0,x.levelkey=void 0,x.type=void 0,x.loader=null,x.level=-1,x.cc=0,x.startPTS=void 0,x.endPTS=void 0,x.appendedPTS=void 0,x.startDTS=void 0,x.endDTS=void 0,x.start=0,x.deltaPTS=void 0,x.maxStartPTS=void 0,x.minEndPTS=void 0,x.stats=new n.LoadStats,x.urlId=0,x.data=void 0,x.bitrateTest=!1,x.title=null,x.initSegment=null,x.type=T,x}var o=r.prototype;return o.createInitializationVector=function(w){for(var x=new Uint8Array(16),L=12;L<16;L++)x[L]=w>>8*(15-L)&255;return x},o.setDecryptDataFromLevelKey=function(w,x){var L=w;return(w==null?void 0:w.method)==="AES-128"&&w.uri&&!w.iv&&(L=W.LevelKey.fromURI(w.uri),L.method=w.method,L.iv=this.createInitializationVector(x),L.keyFormat="identity"),L},o.setElementaryStreamInfo=function(w,x,L,A,_,b){b===void 0&&(b=!1);var m=this.elementaryStreams,p=m[w];if(!p){m[w]={startPTS:x,endPTS:L,startDTS:A,endDTS:_,partial:b};return}p.startPTS=Math.min(p.startPTS,x),p.endPTS=Math.max(p.endPTS,L),p.startDTS=Math.min(p.startDTS,A),p.endDTS=Math.max(p.endDTS,_)},o.clearElementaryStreamInfo=function(){var w=this.elementaryStreams;w[c.AUDIO]=null,w[c.VIDEO]=null,w[c.AUDIOVIDEO]=null},h(r,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var w=this.sn;typeof w!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&K.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),w=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,w)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(V.isFiniteNumber)(this.programDateTime))return null;var w=Object(V.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+w*1e3}},{key:"encrypted",get:function(){var w;return!!((w=this.decryptdata)!==null&&w!==void 0&&w.keyFormat&&this.decryptdata.uri)}}]),r}(s),i=function(a){I(r,a);function r(o,T,w,x,L){var A;A=a.call(this,w)||this,A.fragOffset=0,A.duration=0,A.gap=!1,A.independent=!1,A.relurl=void 0,A.fragment=void 0,A.index=void 0,A.stats=new n.LoadStats,A.duration=o.decimalFloatingPoint("DURATION"),A.gap=o.bool("GAP"),A.independent=o.bool("INDEPENDENT"),A.relurl=o.enumeratedString("URI"),A.fragment=T,A.index=x;var _=o.enumeratedString("BYTERANGE");return _&&A.setByteRange(_,L),L&&(A.fragOffset=L.fragOffset+L.duration),A}return h(r,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var T=this.elementaryStreams;return!!(T.audio||T.video||T.audiovideo)}}]),r}(s)},"./src/loader/key-loader.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"default",function(){return K});var V=D("./src/events.ts"),N=D("./src/errors.ts"),O=D("./src/utils/logger.ts"),K=function(){function W(I){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=I,this._registerListeners()}var n=W.prototype;return n._registerListeners=function(){this.hls.on(V.Events.KEY_LOADING,this.onKeyLoading,this)},n._unregisterListeners=function(){this.hls.off(V.Events.KEY_LOADING,this.onKeyLoading)},n.destroy=function(){this._unregisterListeners();for(var g in this.loaders){var f=this.loaders[g];f&&f.destroy()}this.loaders={}},n.onKeyLoading=function(g,f){var h=f.frag,c=h.type,s=this.loaders[c];if(!h.decryptdata){O.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var d=h.decryptdata.uri;if(d!==this.decrypturl||this.decryptkey===null){var i=this.hls.config;if(s&&(O.logger.warn("abort previous key loader for type:"+c),s.abort()),!d){O.logger.warn("key uri is falsy");return}var a=i.loader,r=h.loader=this.loaders[c]=new a(i);this.decrypturl=d,this.decryptkey=null;var o={url:d,frag:h,responseType:"arraybuffer"},T={timeout:i.fragLoadingTimeOut,maxRetry:0,retryDelay:i.fragLoadingRetryDelay,maxRetryDelay:i.fragLoadingMaxRetryTimeout,highWaterMark:0},w={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};r.load(o,T,w)}else this.decryptkey&&(h.decryptdata.key=this.decryptkey,this.hls.trigger(V.Events.KEY_LOADED,{frag:h}))},n.loadsuccess=function(g,f,h){var c=h.frag;if(!c.decryptdata){O.logger.error("after key load, decryptdata unset");return}this.decryptkey=c.decryptdata.key=new Uint8Array(g.data),c.loader=null,delete this.loaders[c.type],this.hls.trigger(V.Events.KEY_LOADED,{frag:c})},n.loaderror=function(g,f){var h=f.frag,c=h.loader;c&&c.abort(),delete this.loaders[h.type],this.hls.trigger(V.Events.ERROR,{type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:h,response:g})},n.loadtimeout=function(g,f){var h=f.frag,c=h.loader;c&&c.abort(),delete this.loaders[h.type],this.hls.trigger(V.Events.ERROR,{type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:h})},W}()},"./src/loader/level-details.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"LevelDetails",function(){return W});var V=D("./src/polyfills/number.ts");function N(n,I){for(var g=0;g<I.length;g++){var f=I[g];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(n,f.key,f)}}function O(n,I,g){return I&&N(n.prototype,I),g&&N(n,g),n}var K=10,W=function(){function n(g){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=g}var I=n.prototype;return I.reloaded=function(f){if(!f){this.advanced=!0,this.updated=!0;return}var h=this.lastPartSn-f.lastPartSn,c=this.lastPartIndex-f.lastPartIndex;this.updated=this.endSN!==f.endSN||!!c||!!h,this.advanced=this.endSN>f.endSN||h>0||h===0&&c>0,this.updated||this.advanced?this.misses=Math.floor(f.misses*.6):this.misses=f.misses+1,this.availabilityDelay=f.availabilityDelay},O(n,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(V.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||K}},{key:"drift",get:function(){var f=this.driftEndTime-this.driftStartTime;if(f>0){var h=this.driftEnd-this.driftStart;return h*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}}]),n}()},"./src/loader/level-key.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"LevelKey",function(){return W});var V=D("./node_modules/url-toolkit/src/url-toolkit.js"),N=D.n(V);function O(n,I){for(var g=0;g<I.length;g++){var f=I[g];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(n,f.key,f)}}function K(n,I,g){return I&&O(n.prototype,I),g&&O(n,g),n}var W=function(){n.fromURL=function(g,f){return new n(g,f)},n.fromURI=function(g){return new n(g)};function n(I,g){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,g?this._uri=Object(V.buildAbsoluteURL)(I,g,{alwaysNormalize:!0}):this._uri=I}return K(n,[{key:"uri",get:function(){return this._uri}}]),n}()},"./src/loader/load-stats.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"LoadStats",function(){return V});var V=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"default",function(){return r});var V=D("./src/polyfills/number.ts"),N=D("./node_modules/url-toolkit/src/url-toolkit.js"),O=D.n(N),K=D("./src/loader/fragment.ts"),W=D("./src/loader/level-details.ts"),n=D("./src/loader/level-key.ts"),I=D("./src/utils/attr-list.ts"),g=D("./src/utils/logger.ts"),f=D("./src/utils/codecs.ts"),h=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,c=/#EXT-X-MEDIA:(.*)/g,s=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),d=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),i=/\.(mp4|m4s|m4v|m4a)$/i;function a(L){var A,_;return i.test((A=(_=N.parseURL(L))===null||_===void 0?void 0:_.path)!=null?A:"")}var r=function(){function L(){}return L.findGroup=function(_,b){for(var m=0;m<_.length;m++){var p=_[m];if(p.id===b)return p}},L.convertAVC1ToAVCOTI=function(_){var b=_.split(".");if(b.length>2){var m=b.shift()+".";return m+=parseInt(b.shift()).toString(16),m+=("000"+parseInt(b.shift()).toString(16)).substr(-4),m}return _},L.resolve=function(_,b){return N.buildAbsoluteURL(b,_,{alwaysNormalize:!0})},L.parseMasterPlaylist=function(_,b){var m=[],p={},C=!1;h.lastIndex=0;for(var E;(E=h.exec(_))!=null;)if(E[1]){var v=new I.AttrList(E[1]),P={attrs:v,bitrate:v.decimalInteger("AVERAGE-BANDWIDTH")||v.decimalInteger("BANDWIDTH"),name:v.NAME,url:L.resolve(E[2],b)},F=v.decimalResolution("RESOLUTION");F&&(P.width=F.width,P.height=F.height),o((v.CODECS||"").split(/[ ,]+/).filter(function(H){return H}),P),P.videoCodec&&P.videoCodec.indexOf("avc1")!==-1&&(P.videoCodec=L.convertAVC1ToAVCOTI(P.videoCodec)),m.push(P)}else if(E[3]){var R=new I.AttrList(E[3]);R["DATA-ID"]&&(C=!0,p[R["DATA-ID"]]=R)}return{levels:m,sessionData:C?p:null}},L.parseMasterPlaylistMedia=function(_,b,m,p){p===void 0&&(p=[]);var C,E=[],v=0;for(c.lastIndex=0;(C=c.exec(_))!==null;){var P=new I.AttrList(C[1]);if(P.TYPE===m){var F={attrs:P,bitrate:0,id:v++,groupId:P["GROUP-ID"],instreamId:P["INSTREAM-ID"],name:P.NAME||P.LANGUAGE||"",type:m,default:P.bool("DEFAULT"),autoselect:P.bool("AUTOSELECT"),forced:P.bool("FORCED"),lang:P.LANGUAGE,url:P.URI?L.resolve(P.URI,b):""};if(p.length){var R=L.findGroup(p,F.groupId)||p[0];T(F,R,"audioCodec"),T(F,R,"textCodec")}E.push(F)}}return E},L.parseLevelPlaylist=function(_,b,m,p,C){var E=new W.LevelDetails(b),v=E.fragments,P=null,F=0,R=0,H=0,U=0,S=null,G=new K.Fragment(p,b),Q,se,fe,we=-1,be=!1;for(s.lastIndex=0,E.m3u8=_;(Q=s.exec(_))!==null;){be&&(be=!1,G=new K.Fragment(p,b),G.start=H,G.sn=F,G.cc=U,G.level=m,P&&(G.initSegment=P,G.rawProgramDateTime=P.rawProgramDateTime));var Se=Q[1];if(Se){G.duration=parseFloat(Se);var Ae=(" "+Q[2]).slice(1);G.title=Ae||null,G.tagList.push(Ae?["INF",Se,Ae]:["INF",Se])}else if(Q[3])Object(V.isFiniteNumber)(G.duration)&&(G.start=H,fe&&(G.levelkey=fe),G.sn=F,G.level=m,G.cc=U,G.urlId=C,v.push(G),G.relurl=(" "+Q[3]).slice(1),x(G,S),S=G,H+=G.duration,F++,R=0,be=!0);else if(Q[4]){var De=(" "+Q[4]).slice(1);S?G.setByteRange(De,S):G.setByteRange(De)}else if(Q[5])G.rawProgramDateTime=(" "+Q[5]).slice(1),G.tagList.push(["PROGRAM-DATE-TIME",G.rawProgramDateTime]),we===-1&&(we=v.length);else{if(Q=Q[0].match(d),!Q){g.logger.warn("No matches on slow regex match for level playlist!");continue}for(se=1;se<Q.length&&!(typeof Q[se]!="undefined");se++);var ve=(" "+Q[se]).slice(1),Y=(" "+Q[se+1]).slice(1),k=Q[se+2]?(" "+Q[se+2]).slice(1):"";switch(ve){case"PLAYLIST-TYPE":E.type=Y.toUpperCase();break;case"MEDIA-SEQUENCE":F=E.startSN=parseInt(Y);break;case"SKIP":{var B=new I.AttrList(Y),Z=B.decimalInteger("SKIPPED-SEGMENTS");if(Object(V.isFiniteNumber)(Z)){E.skippedSegments=Z;for(var re=Z;re--;)v.unshift(null);F+=Z}var X=B.enumeratedString("RECENTLY-REMOVED-DATERANGES");X&&(E.recentlyRemovedDateranges=X.split(" "));break}case"TARGETDURATION":E.targetduration=parseFloat(Y);break;case"VERSION":E.version=parseInt(Y);break;case"EXTM3U":break;case"ENDLIST":E.live=!1;break;case"#":(Y||k)&&G.tagList.push(k?[Y,k]:[Y]);break;case"DIS":U++;case"GAP":G.tagList.push([ve]);break;case"BITRATE":G.tagList.push([ve,Y]);break;case"DISCONTINUITY-SEQ":U=parseInt(Y);break;case"KEY":{var ye,Me=new I.AttrList(Y),He=Me.enumeratedString("METHOD"),me=Me.URI,Ee=Me.hexadecimalInteger("IV"),Le=Me.enumeratedString("KEYFORMATVERSIONS"),Pe=Me.enumeratedString("KEYID"),Ye=(ye=Me.enumeratedString("KEYFORMAT"))!=null?ye:"identity",tt=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(tt.indexOf(Ye)>-1){g.logger.warn("Keyformat "+Ye+" is not supported from the manifest");continue}else if(Ye!=="identity")continue;He&&(fe=n.LevelKey.fromURL(b,me),me&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(He)>=0&&(fe.method=He,fe.keyFormat=Ye,Pe&&(fe.keyID=Pe),Le&&(fe.keyFormatVersions=Le),fe.iv=Ee));break}case"START":{var ut=new I.AttrList(Y),lt=ut.decimalFloatingPoint("TIME-OFFSET");Object(V.isFiniteNumber)(lt)&&(E.startTimeOffset=lt);break}case"MAP":{var gt=new I.AttrList(Y);G.relurl=gt.URI,gt.BYTERANGE&&G.setByteRange(gt.BYTERANGE),G.level=m,G.sn="initSegment",fe&&(G.levelkey=fe),G.initSegment=null,P=G,be=!0;break}case"SERVER-CONTROL":{var ht=new I.AttrList(Y);E.canBlockReload=ht.bool("CAN-BLOCK-RELOAD"),E.canSkipUntil=ht.optionalFloat("CAN-SKIP-UNTIL",0),E.canSkipDateRanges=E.canSkipUntil>0&&ht.bool("CAN-SKIP-DATERANGES"),E.partHoldBack=ht.optionalFloat("PART-HOLD-BACK",0),E.holdBack=ht.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ie=new I.AttrList(Y);E.partTarget=Ie.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Re=E.partList;Re||(Re=E.partList=[]);var $e=R>0?Re[Re.length-1]:void 0,Ze=R++,ue=new K.Part(new I.AttrList(Y),G,b,Ze,$e);Re.push(ue),G.duration+=ue.duration;break}case"PRELOAD-HINT":{var q=new I.AttrList(Y);E.preloadHint=q;break}case"RENDITION-REPORT":{var te=new I.AttrList(Y);E.renditionReports=E.renditionReports||[],E.renditionReports.push(te);break}default:g.logger.warn("line parsed but not handled: "+Q);break}}}S&&!S.relurl?(v.pop(),H-=S.duration,E.partList&&(E.fragmentHint=S)):E.partList&&(x(G,S),G.cc=U,E.fragmentHint=G);var ae=v.length,ce=v[0],ie=v[ae-1];if(H+=E.skippedSegments*E.targetduration,H>0&&ae&&ie){E.averagetargetduration=H/ae;var oe=ie.sn;E.endSN=oe!=="initSegment"?oe:0,ce&&(E.startCC=ce.cc,ce.initSegment||E.fragments.every(function(he){return he.relurl&&a(he.relurl)})&&(g.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),G=new K.Fragment(p,b),G.relurl=ie.relurl,G.level=m,G.sn="initSegment",ce.initSegment=G,E.needSidxRanges=!0))}else E.endSN=0,E.startCC=0;return E.fragmentHint&&(H+=E.fragmentHint.duration),E.totalduration=H,E.endCC=U,we>0&&w(v,we),E},L}();function o(L,A){["video","audio","text"].forEach(function(_){var b=L.filter(function(p){return Object(f.isCodecType)(p,_)});if(b.length){var m=b.filter(function(p){return p.lastIndexOf("avc1",0)===0||p.lastIndexOf("mp4a",0)===0});A[_+"Codec"]=m.length>0?m[0]:b[0],L=L.filter(function(p){return b.indexOf(p)===-1})}}),A.unknownCodecs=L}function T(L,A,_){var b=A[_];b&&(L[_]=b)}function w(L,A){for(var _=L[A],b=A;b--;){var m=L[b];if(!m)return;m.programDateTime=_.programDateTime-m.duration*1e3,_=m}}function x(L,A){L.rawProgramDateTime?L.programDateTime=Date.parse(L.rawProgramDateTime):A!=null&&A.programDateTime&&(L.programDateTime=A.endProgramDateTime),Object(V.isFiniteNumber)(L.programDateTime)||(L.programDateTime=null,L.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(J,z,D){"use strict";D.r(z);var V=D("./src/polyfills/number.ts"),N=D("./src/events.ts"),O=D("./src/errors.ts"),K=D("./src/utils/logger.ts"),W=D("./src/utils/mp4-tools.ts"),n=D("./src/loader/m3u8-parser.ts"),I=D("./src/types/loader.ts"),g=D("./src/utils/attr-list.ts");function f(s){var d=s.type;switch(d){case I.PlaylistContextType.AUDIO_TRACK:return I.PlaylistLevelType.AUDIO;case I.PlaylistContextType.SUBTITLE_TRACK:return I.PlaylistLevelType.SUBTITLE;default:return I.PlaylistLevelType.MAIN}}function h(s,d){var i=s.url;return(i===void 0||i.indexOf("data:")===0)&&(i=d.url),i}var c=function(){function s(i){this.hls=void 0,this.loaders=Object.create(null),this.hls=i,this.registerListeners()}var d=s.prototype;return d.registerListeners=function(){var a=this.hls;a.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(N.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(N.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),a.on(N.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},d.unregisterListeners=function(){var a=this.hls;a.off(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(N.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(N.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),a.off(N.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},d.createInternalLoader=function(a){var r=this.hls.config,o=r.pLoader,T=r.loader,w=o||T,x=new w(r);return a.loader=x,this.loaders[a.type]=x,x},d.getInternalLoader=function(a){return this.loaders[a.type]},d.resetInternalLoader=function(a){this.loaders[a]&&delete this.loaders[a]},d.destroyInternalLoaders=function(){for(var a in this.loaders){var r=this.loaders[a];r&&r.destroy(),this.resetInternalLoader(a)}},d.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},d.onManifestLoading=function(a,r){var o=r.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:I.PlaylistContextType.MANIFEST,url:o,deliveryDirectives:null})},d.onLevelLoading=function(a,r){var o=r.id,T=r.level,w=r.url,x=r.deliveryDirectives;this.load({id:o,groupId:null,level:T,responseType:"text",type:I.PlaylistContextType.LEVEL,url:w,deliveryDirectives:x})},d.onAudioTrackLoading=function(a,r){var o=r.id,T=r.groupId,w=r.url,x=r.deliveryDirectives;this.load({id:o,groupId:T,level:null,responseType:"text",type:I.PlaylistContextType.AUDIO_TRACK,url:w,deliveryDirectives:x})},d.onSubtitleTrackLoading=function(a,r){var o=r.id,T=r.groupId,w=r.url,x=r.deliveryDirectives;this.load({id:o,groupId:T,level:null,responseType:"text",type:I.PlaylistContextType.SUBTITLE_TRACK,url:w,deliveryDirectives:x})},d.load=function(a){var r,o=this.hls.config,T=this.getInternalLoader(a);if(T){var w=T.context;if(w&&w.url===a.url){K.logger.trace("[playlist-loader]: playlist request ongoing");return}K.logger.log("[playlist-loader]: aborting previous loader for type: "+a.type),T.abort()}var x,L,A,_;switch(a.type){case I.PlaylistContextType.MANIFEST:x=o.manifestLoadingMaxRetry,L=o.manifestLoadingTimeOut,A=o.manifestLoadingRetryDelay,_=o.manifestLoadingMaxRetryTimeout;break;case I.PlaylistContextType.LEVEL:case I.PlaylistContextType.AUDIO_TRACK:case I.PlaylistContextType.SUBTITLE_TRACK:x=0,L=o.levelLoadingTimeOut;break;default:x=o.levelLoadingMaxRetry,L=o.levelLoadingTimeOut,A=o.levelLoadingRetryDelay,_=o.levelLoadingMaxRetryTimeout;break}if(T=this.createInternalLoader(a),(r=a.deliveryDirectives)!==null&&r!==void 0&&r.part){var b;if(a.type===I.PlaylistContextType.LEVEL&&a.level!==null?b=this.hls.levels[a.level].details:a.type===I.PlaylistContextType.AUDIO_TRACK&&a.id!==null?b=this.hls.audioTracks[a.id].details:a.type===I.PlaylistContextType.SUBTITLE_TRACK&&a.id!==null&&(b=this.hls.subtitleTracks[a.id].details),b){var m=b.partTarget,p=b.targetduration;m&&p&&(L=Math.min(Math.max(m*3,p*.8)*1e3,L))}}var C={timeout:L,maxRetry:x,retryDelay:A,maxRetryDelay:_,highWaterMark:0},E={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};T.load(a,C,E)},d.loadsuccess=function(a,r,o,T){if(T===void 0&&(T=null),o.isSidxRequest){this.handleSidxRequest(a,o),this.handlePlaylistLoaded(a,r,o,T);return}this.resetInternalLoader(o.type);var w=a.data;if(w.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(a,o,"no EXTM3U delimiter",T);return}r.parsing.start=performance.now(),w.indexOf("#EXTINF:")>0||w.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(a,r,o,T):this.handleMasterPlaylist(a,r,o,T)},d.loaderror=function(a,r,o){o===void 0&&(o=null),this.handleNetworkError(r,o,!1,a)},d.loadtimeout=function(a,r,o){o===void 0&&(o=null),this.handleNetworkError(r,o,!0)},d.handleMasterPlaylist=function(a,r,o,T){var w=this.hls,x=a.data,L=h(a,o),A=n.default.parseMasterPlaylist(x,L),_=A.levels,b=A.sessionData;if(!_.length){this.handleManifestParsingError(a,o,"no level found in manifest",T);return}var m=_.map(function(F){return{id:F.attrs.AUDIO,audioCodec:F.audioCodec}}),p=_.map(function(F){return{id:F.attrs.SUBTITLES,textCodec:F.textCodec}}),C=n.default.parseMasterPlaylistMedia(x,L,"AUDIO",m),E=n.default.parseMasterPlaylistMedia(x,L,"SUBTITLES",p),v=n.default.parseMasterPlaylistMedia(x,L,"CLOSED-CAPTIONS");if(C.length){var P=C.some(function(F){return!F.url});!P&&_[0].audioCodec&&!_[0].attrs.AUDIO&&(K.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),C.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new g.AttrList({}),bitrate:0,url:""}))}w.trigger(N.Events.MANIFEST_LOADED,{levels:_,audioTracks:C,subtitles:E,captions:v,url:L,stats:r,networkDetails:T,sessionData:b})},d.handleTrackOrLevelPlaylist=function(a,r,o,T){var w=this.hls,x=o.id,L=o.level,A=o.type,_=h(a,o),b=Object(V.isFiniteNumber)(x)?x:0,m=Object(V.isFiniteNumber)(L)?L:b,p=f(o),C=n.default.parseLevelPlaylist(a.data,_,m,p,b);if(!C.fragments.length){w.trigger(N.Events.ERROR,{type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:_,reason:"no fragments found in level",level:typeof o.level=="number"?o.level:void 0});return}if(A===I.PlaylistContextType.MANIFEST){var E={attrs:new g.AttrList({}),bitrate:0,details:C,name:"",url:_};w.trigger(N.Events.MANIFEST_LOADED,{levels:[E],audioTracks:[],url:_,stats:r,networkDetails:T,sessionData:null})}if(r.parsing.end=performance.now(),C.needSidxRanges){var v,P=(v=C.fragments[0].initSegment)===null||v===void 0?void 0:v.url;this.load({url:P,isSidxRequest:!0,type:A,level:L,levelDetails:C,id:x,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}o.levelDetails=C,this.handlePlaylistLoaded(a,r,o,T)},d.handleSidxRequest=function(a,r){var o=Object(W.parseSegmentIndex)(new Uint8Array(a.data));if(!o)return;var T=o.references,w=r.levelDetails;T.forEach(function(x,L){var A=x.info,_=w.fragments[L];_.byteRange.length===0&&_.setByteRange(String(1+A.end-A.start)+"@"+String(A.start)),_.initSegment&&_.initSegment.setByteRange(String(o.moovEndOffset)+"@0")})},d.handleManifestParsingError=function(a,r,o,T){this.hls.trigger(N.Events.ERROR,{type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:r.type===I.PlaylistContextType.MANIFEST,url:a.url,reason:o,response:a,context:r,networkDetails:T})},d.handleNetworkError=function(a,r,o,T){o===void 0&&(o=!1),K.logger.warn("[playlist-loader]: A network "+(o?"timeout":"error")+" occurred while loading "+a.type+" level: "+a.level+" id: "+a.id+' group-id: "'+a.groupId+'"');var w=O.ErrorDetails.UNKNOWN,x=!1,L=this.getInternalLoader(a);switch(a.type){case I.PlaylistContextType.MANIFEST:w=o?O.ErrorDetails.MANIFEST_LOAD_TIMEOUT:O.ErrorDetails.MANIFEST_LOAD_ERROR,x=!0;break;case I.PlaylistContextType.LEVEL:w=o?O.ErrorDetails.LEVEL_LOAD_TIMEOUT:O.ErrorDetails.LEVEL_LOAD_ERROR,x=!1;break;case I.PlaylistContextType.AUDIO_TRACK:w=o?O.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:O.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,x=!1;break;case I.PlaylistContextType.SUBTITLE_TRACK:w=o?O.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:O.ErrorDetails.SUBTITLE_LOAD_ERROR,x=!1;break}L&&this.resetInternalLoader(a.type);var A={type:O.ErrorTypes.NETWORK_ERROR,details:w,fatal:x,url:a.url,loader:L,context:a,networkDetails:r};T&&(A.response=T),this.hls.trigger(N.Events.ERROR,A)},d.handlePlaylistLoaded=function(a,r,o,T){var w=o.type,x=o.level,L=o.id,A=o.groupId,_=o.loader,b=o.levelDetails,m=o.deliveryDirectives;if(!(b!=null&&b.targetduration)){this.handleManifestParsingError(a,o,"invalid target duration",T);return}if(!_)return;b.live&&(_.getCacheAge&&(b.ageHeader=_.getCacheAge()||0),(!_.getCacheAge||isNaN(b.ageHeader))&&(b.ageHeader=0));switch(w){case I.PlaylistContextType.MANIFEST:case I.PlaylistContextType.LEVEL:this.hls.trigger(N.Events.LEVEL_LOADED,{details:b,level:x||0,id:L||0,stats:r,networkDetails:T,deliveryDirectives:m});break;case I.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(N.Events.AUDIO_TRACK_LOADED,{details:b,id:L||0,groupId:A||"",stats:r,networkDetails:T,deliveryDirectives:m});break;case I.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(N.Events.SUBTITLE_TRACK_LOADED,{details:b,id:L||0,groupId:A||"",stats:r,networkDetails:T,deliveryDirectives:m});break}},s}();z.default=c},"./src/polyfills/number.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"isFiniteNumber",function(){return V}),D.d(z,"MAX_SAFE_INTEGER",function(){return N});var V=Number.isFinite||function(O){return typeof O=="number"&&isFinite(O)},N=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(J,z,D){"use strict";D.r(z);var V=function(){function N(){}return N.getSilentFrame=function(K,W){switch(K){case"mp4a.40.2":if(W===1)return new Uint8Array([0,200,0,128,35,128]);if(W===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(W===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(W===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(W===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(W===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(W===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(W===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(W===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},N}();z.default=V},"./src/remux/mp4-generator.ts":function(J,z,D){"use strict";D.r(z);var V=Math.pow(2,32)-1,N=function(){function O(){}return O.init=function(){O.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 W;for(W in O.types)O.types.hasOwnProperty(W)&&(O.types[W]=[W.charCodeAt(0),W.charCodeAt(1),W.charCodeAt(2),W.charCodeAt(3)]);var n=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]);O.HDLR_TYPES={video:n,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]);O.STTS=O.STSC=O.STCO=f,O.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),O.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),O.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),O.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var h=new Uint8Array([105,115,111,109]),c=new Uint8Array([97,118,99,49]),s=new Uint8Array([0,0,0,1]);O.FTYP=O.box(O.types.ftyp,h,s,h,c),O.DINF=O.box(O.types.dinf,O.box(O.types.dref,g))},O.box=function(W){for(var n=8,I=arguments.length,g=new Array(I>1?I-1:0),f=1;f<I;f++)g[f-1]=arguments[f];for(var h=g.length,c=h;h--;)n+=g[h].byteLength;var s=new Uint8Array(n);for(s[0]=n>>24&255,s[1]=n>>16&255,s[2]=n>>8&255,s[3]=n&255,s.set(W,4),h=0,n=8;h<c;h++)s.set(g[h],n),n+=g[h].byteLength;return s},O.hdlr=function(W){return O.box(O.types.hdlr,O.HDLR_TYPES[W])},O.mdat=function(W){return O.box(O.types.mdat,W)},O.mdhd=function(W,n){n*=W;var I=Math.floor(n/(V+1)),g=Math.floor(n%(V+1));return O.box(O.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,W>>24&255,W>>16&255,W>>8&255,W&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]))},O.mdia=function(W){return O.box(O.types.mdia,O.mdhd(W.timescale,W.duration),O.hdlr(W.type),O.minf(W))},O.mfhd=function(W){return O.box(O.types.mfhd,new Uint8Array([0,0,0,0,W>>24,W>>16&255,W>>8&255,W&255]))},O.minf=function(W){return W.type==="audio"?O.box(O.types.minf,O.box(O.types.smhd,O.SMHD),O.DINF,O.stbl(W)):O.box(O.types.minf,O.box(O.types.vmhd,O.VMHD),O.DINF,O.stbl(W))},O.moof=function(W,n,I){return O.box(O.types.moof,O.mfhd(W),O.traf(I,n))},O.moov=function(W){for(var n=W.length,I=[];n--;)I[n]=O.trak(W[n]);return O.box.apply(null,[O.types.moov,O.mvhd(W[0].timescale,W[0].duration)].concat(I).concat(O.mvex(W)))},O.mvex=function(W){for(var n=W.length,I=[];n--;)I[n]=O.trex(W[n]);return O.box.apply(null,[O.types.mvex].concat(I))},O.mvhd=function(W,n){n*=W;var I=Math.floor(n/(V+1)),g=Math.floor(n%(V+1)),f=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,W>>24&255,W>>16&255,W>>8&255,W&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 O.box(O.types.mvhd,f)},O.sdtp=function(W){var n=W.samples||[],I=new Uint8Array(4+n.length),g,f;for(g=0;g<n.length;g++)f=n[g].flags,I[g+4]=f.dependsOn<<4|f.isDependedOn<<2|f.hasRedundancy;return O.box(O.types.sdtp,I)},O.stbl=function(W){return O.box(O.types.stbl,O.stsd(W),O.box(O.types.stts,O.STTS),O.box(O.types.stsc,O.STSC),O.box(O.types.stsz,O.STSZ),O.box(O.types.stco,O.STCO))},O.avc1=function(W){var n=[],I=[],g,f,h;for(g=0;g<W.sps.length;g++)f=W.sps[g],h=f.byteLength,n.push(h>>>8&255),n.push(h&255),n=n.concat(Array.prototype.slice.call(f));for(g=0;g<W.pps.length;g++)f=W.pps[g],h=f.byteLength,I.push(h>>>8&255),I.push(h&255),I=I.concat(Array.prototype.slice.call(f));var c=O.box(O.types.avcC,new Uint8Array([1,n[3],n[4],n[5],252|3,224|W.sps.length].concat(n).concat([W.pps.length]).concat(I))),s=W.width,d=W.height,i=W.pixelRatio[0],a=W.pixelRatio[1];return O.box(O.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,d>>8&255,d&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]),c,O.box(O.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),O.box(O.types.pasp,new Uint8Array([i>>24,i>>16&255,i>>8&255,i&255,a>>24,a>>16&255,a>>8&255,a&255])))},O.esds=function(W){var n=W.config.length;return new Uint8Array([0,0,0,0,3,23+n,0,1,0,4,15+n,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([n]).concat(W.config).concat([6,1,2]))},O.mp4a=function(W){var n=W.samplerate;return O.box(O.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,W.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]),O.box(O.types.esds,O.esds(W)))},O.mp3=function(W){var n=W.samplerate;return O.box(O.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,W.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]))},O.stsd=function(W){return W.type==="audio"?!W.isAAC&&W.codec==="mp3"?O.box(O.types.stsd,O.STSD,O.mp3(W)):O.box(O.types.stsd,O.STSD,O.mp4a(W)):O.box(O.types.stsd,O.STSD,O.avc1(W))},O.tkhd=function(W){var n=W.id,I=W.duration*W.timescale,g=W.width,f=W.height,h=Math.floor(I/(V+1)),c=Math.floor(I%(V+1));return O.box(O.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,n>>24&255,n>>16&255,n>>8&255,n&255,0,0,0,0,h>>24,h>>16&255,h>>8&255,h&255,c>>24,c>>16&255,c>>8&255,c&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]))},O.traf=function(W,n){var I=O.sdtp(W),g=W.id,f=Math.floor(n/(V+1)),h=Math.floor(n%(V+1));return O.box(O.types.traf,O.box(O.types.tfhd,new Uint8Array([0,0,0,0,g>>24,g>>16&255,g>>8&255,g&255])),O.box(O.types.tfdt,new Uint8Array([1,0,0,0,f>>24,f>>16&255,f>>8&255,f&255,h>>24,h>>16&255,h>>8&255,h&255])),O.trun(W,I.length+16+20+8+16+8+8),I)},O.trak=function(W){return W.duration=W.duration||4294967295,O.box(O.types.trak,O.tkhd(W),O.mdia(W))},O.trex=function(W){var n=W.id;return O.box(O.types.trex,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,n&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},O.trun=function(W,n){var I=W.samples||[],g=I.length,f=12+16*g,h=new Uint8Array(f),c,s,d,i,a,r;for(n+=8+f,h.set([0,0,15,1,g>>>24&255,g>>>16&255,g>>>8&255,g&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255],0),c=0;c<g;c++)s=I[c],d=s.duration,i=s.size,a=s.flags,r=s.cts,h.set([d>>>24&255,d>>>16&255,d>>>8&255,d&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255,a.isLeading<<2|a.dependsOn,a.isDependedOn<<6|a.hasRedundancy<<4|a.paddingValue<<1|a.isNonSync,a.degradPrio&240<<8,a.degradPrio&15,r>>>24&255,r>>>16&255,r>>>8&255,r&255],12+16*c);return O.box(O.types.trun,h)},O.initSegment=function(W){O.types||O.init();var n=O.moov(W),I=new Uint8Array(O.FTYP.byteLength+n.byteLength);return I.set(O.FTYP),I.set(n,O.FTYP.byteLength),I},O}();N.types=void 0,N.HDLR_TYPES=void 0,N.STTS=void 0,N.STSC=void 0,N.STCO=void 0,N.STSZ=void 0,N.VMHD=void 0,N.SMHD=void 0,N.STSD=void 0,N.FTYP=void 0,N.DINF=void 0,z.default=N},"./src/remux/mp4-remuxer.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"default",function(){return r}),D.d(z,"normalizePts",function(){return o});var V=D("./src/polyfills/number.ts"),N=D("./src/remux/aac-helper.ts"),O=D("./src/remux/mp4-generator.ts"),K=D("./src/events.ts"),W=D("./src/errors.ts"),n=D("./src/utils/logger.ts"),I=D("./src/types/loader.ts"),g=D("./src/utils/timescale-conversion.ts");function f(){return f=Object.assign||function(L){for(var A=1;A<arguments.length;A++){var _=arguments[A];for(var b in _)Object.prototype.hasOwnProperty.call(_,b)&&(L[b]=_[b])}return L},f.apply(this,arguments)}var h=10*1e3,c=1024,s=1152,d=null,i=null,a=!1,r=function(){function L(_,b,m,p){if(p===void 0&&(p=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=_,this.config=b,this.typeSupported=m,this.ISGenerated=!1,d===null){var C=navigator.userAgent||"",E=C.match(/Chrome\/(\d+)/i);d=E?parseInt(E[1]):0}if(i===null){var v=navigator.userAgent.match(/Safari\/(\d+)/i);i=v?parseInt(v[1]):0}a=!!d&&d<75||!!i&&i<600}var A=L.prototype;return A.destroy=function(){},A.resetTimeStamp=function(b){n.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=b},A.resetNextTimestamp=function(){n.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},A.resetInitSegment=function(){n.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},A.getVideoStartPts=function(b){var m=!1,p=b.reduce(function(C,E){var v=E.pts-C;return v<-4294967296?(m=!0,o(C,E.pts)):v>0?C:E.pts},b[0].pts);return m&&n.logger.debug("PTS rollover detected"),p},A.remux=function(b,m,p,C,E,v,P,F){var R,H,U,S,G,Q,se=E,fe=E,we=b.pid>-1,be=m.pid>-1,Se=m.samples.length,Ae=b.samples.length>0,De=Se>1,ve=(!we||Ae)&&(!be||De)||this.ISGenerated||P;if(ve){this.ISGenerated||(U=this.generateIS(b,m,E));var Y=this.isVideoContiguous,k=-1;if(De&&(k=T(m.samples),!Y&&this.config.forceKeyFrameOnDiscontinuity))if(Q=!0,k>0){n.logger.warn("[mp4-remuxer]: Dropped "+k+" out of "+Se+" video samples due to a missing keyframe");var B=this.getVideoStartPts(m.samples);m.samples=m.samples.slice(k),m.dropped+=k,fe+=(m.samples[0].pts-B)/(m.timescale||9e4)}else k===-1&&(n.logger.warn("[mp4-remuxer]: No keyframe found out of "+Se+" video samples"),Q=!1);if(this.ISGenerated){if(Ae&&De){var Z=this.getVideoStartPts(m.samples),re=o(b.samples[0].pts,Z)-Z,X=re/m.inputTimeScale;se+=Math.max(0,X),fe+=Math.max(0,-X)}if(Ae){if(b.samplerate||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),U=this.generateIS(b,m,E)),H=this.remuxAudio(b,se,this.isAudioContiguous,v,be||De||F===I.PlaylistLevelType.AUDIO?fe:void 0),De){var ye=H?H.endPTS-H.startPTS:0;m.inputTimeScale||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),U=this.generateIS(b,m,E)),R=this.remuxVideo(m,fe,Y,ye)}}else De&&(R=this.remuxVideo(m,fe,Y,0));R&&(R.firstKeyFrame=k,R.independent=k!==-1)}}return this.ISGenerated&&(p.samples.length&&(G=this.remuxID3(p,E)),C.samples.length&&(S=this.remuxText(C,E))),{audio:H,video:R,initSegment:U,independent:Q,text:S,id3:G}},A.generateIS=function(b,m,p){var C=b.samples,E=m.samples,v=this.typeSupported,P={},F=!Object(V.isFiniteNumber)(this._initPTS),R="audio/mp4",H,U,S;if(F&&(H=U=Infinity),b.config&&C.length&&(b.timescale=b.samplerate,b.isAAC||(v.mpeg?(R="audio/mpeg",b.codec=""):v.mp3&&(b.codec="mp3")),P.audio={id:"audio",container:R,codec:b.codec,initSegment:!b.isAAC&&v.mpeg?new Uint8Array(0):O.default.initSegment([b]),metadata:{channelCount:b.channelCount}},F&&(S=b.inputTimeScale,H=U=C[0].pts-Math.round(S*p))),m.sps&&m.pps&&E.length&&(m.timescale=m.inputTimeScale,P.video={id:"main",container:"video/mp4",codec:m.codec,initSegment:O.default.initSegment([m]),metadata:{width:m.width,height:m.height}},F)){S=m.inputTimeScale;var G=this.getVideoStartPts(E),Q=Math.round(S*p);U=Math.min(U,o(E[0].dts,G)-Q),H=Math.min(H,G-Q)}if(Object.keys(P).length)return this.ISGenerated=!0,F&&(this._initPTS=H,this._initDTS=U),{tracks:P,initPTS:H,timescale:S}},A.remuxVideo=function(b,m,p,C){var E=b.inputTimeScale,v=b.samples,P=[],F=v.length,R=this._initPTS,H=this.nextAvcDts,U=8,S,G,Q,se=Number.POSITIVE_INFINITY,fe=Number.NEGATIVE_INFINITY,we=0,be=!1;if(!p||H===null){var Se=m*E,Ae=v[0].pts-o(v[0].dts,v[0].pts);H=Se-Ae}for(var De=0;De<F;De++){var ve=v[De];if(ve.pts=o(ve.pts-R,H),ve.dts=o(ve.dts-R,H),ve.dts>ve.pts){var Y=9e4*.2;we=Math.max(Math.min(we,ve.pts-ve.dts),-1*Y)}ve.dts<v[De>0?De-1:De].dts&&(be=!0)}be&&v.sort(function(nt,We){var Ve=nt.dts-We.dts,Ne=nt.pts-We.pts;return Ve||Ne}),G=v[0].dts,Q=v[v.length-1].dts;var k=Math.round((Q-G)/(F-1));if(we<0){if(we<k*-2){n.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(g.toMsFromMpegTsClock)(-k,!0)+" ms");for(var B=we,Z=0;Z<F;Z++)v[Z].dts=B=Math.max(B,v[Z].pts-k),v[Z].pts=Math.max(B,v[Z].pts)}else{n.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(g.toMsFromMpegTsClock)(we,!0)+" ms to overcome this issue");for(var re=0;re<F;re++)v[re].dts=v[re].dts+we}G=v[0].dts}if(p){var X=G-H,ye=X>k,Me=X<-1;if(ye||Me){ye?n.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(X,!0)+" ms ("+X+"dts) hole between fragments detected, filling it"):n.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(-X,!0)+" ms ("+X+"dts) overlapping between fragments detected"),G=H;var He=v[0].pts-X;v[0].dts=G,v[0].pts=He,n.logger.log("Video: First PTS/DTS adjusted: "+Object(g.toMsFromMpegTsClock)(He,!0)+"/"+Object(g.toMsFromMpegTsClock)(G,!0)+", delta: "+Object(g.toMsFromMpegTsClock)(X,!0)+" ms")}}a&&(G=Math.max(0,G));for(var me=0,Ee=0,Le=0;Le<F;Le++){for(var Pe=v[Le],Ye=Pe.units,tt=Ye.length,ut=0,lt=0;lt<tt;lt++)ut+=Ye[lt].data.length;Ee+=ut,me+=tt,Pe.length=ut,Pe.dts=Math.max(Pe.dts,G),Pe.pts=Math.max(Pe.pts,Pe.dts,0),se=Math.min(Pe.pts,se),fe=Math.max(Pe.pts,fe)}Q=v[F-1].dts;var gt=Ee+4*me+8,ht;try{ht=new Uint8Array(gt)}catch(nt){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:W.ErrorTypes.MUX_ERROR,details:W.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:gt,reason:"fail allocating video mdat "+gt});return}var Ie=new DataView(ht.buffer);Ie.setUint32(0,gt),ht.set(O.default.types.mdat,4);for(var Re=0;Re<F;Re++){for(var $e=v[Re],Ze=$e.units,ue=0,q=0,te=Ze.length;q<te;q++){var ae=Ze[q],ce=ae.data,ie=ae.data.byteLength;Ie.setUint32(U,ie),U+=4,ht.set(ce,U),U+=ie,ue+=4+ie}if(Re<F-1)S=v[Re+1].dts-$e.dts;else{var oe=this.config,he=$e.dts-v[Re>0?Re-1:Re].dts;if(oe.stretchShortVideoTrack&&this.nextAudioPts!==null){var ge=Math.floor(oe.maxBufferHole*E),_e=(C?se+C*E:this.nextAudioPts)-$e.pts;_e>ge?(S=_e-he,S<0&&(S=he),n.logger.log("[mp4-remuxer]: It is approximately "+_e/90+" ms to the next segment; using duration "+S/90+" ms for the last video frame.")):S=he}else S=he}var Oe=Math.round($e.pts-$e.dts);P.push(new w($e.key,S,ue,Oe))}if(P.length&&d&&d<70){var Ge=P[0].flags;Ge.dependsOn=2,Ge.isNonSync=0}console.assert(S!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=H=Q+S,this.isVideoContiguous=!0;var et=O.default.moof(b.sequenceNumber++,G,f({},b,{samples:P})),ct="video",st={data1:et,data2:ht,startPTS:se/E,endPTS:(fe+S)/E,startDTS:G/E,endDTS:H/E,type:ct,hasAudio:!1,hasVideo:!0,nb:P.length,dropped:b.dropped};return b.samples=[],b.dropped=0,console.assert(ht.length,"MDAT length must not be zero"),st},A.remuxAudio=function(b,m,p,C,E){var v=b.inputTimeScale,P=b.samplerate?b.samplerate:v,F=v/P,R=b.isAAC?c:s,H=R*F,U=this._initPTS,S=!b.isAAC&&this.typeSupported.mpeg,G=[],Q=b.samples,se=S?0:8,fe=this.nextAudioPts||-1,we=m*v;if(this.isAudioContiguous=p=p||Q.length&&fe>0&&(C&&Math.abs(we-fe)<9e3||Math.abs(o(Q[0].pts-U,we)-fe)<20*H),Q.forEach(function(ce){ce.pts=o(ce.pts-U,we)}),!p||fe<0){if(Q=Q.filter(function(ce){return ce.pts>=0}),!Q.length)return;E===0?fe=0:C?fe=Math.max(0,we):fe=Q[0].pts}if(b.isAAC)for(var be=E!==void 0,Se=this.config.maxAudioFramesDrift,Ae=0,De=fe;Ae<Q.length;Ae++){var ve=Q[Ae],Y=ve.pts,k=Y-De,B=Math.abs(1e3*k/v);if(k<=-Se*H&&be)Ae===0&&(n.logger.warn("Audio frame @ "+(Y/v).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*k/v)+" ms."),this.nextAudioPts=fe=De=Y);else if(k>=Se*H&&B<h&&be){var Z=Math.round(k/H);De=Y-Z*H,De<0&&(Z--,De+=H),Ae===0&&(this.nextAudioPts=fe=De),n.logger.warn("[mp4-remuxer]: Injecting "+Z+" audio frame @ "+(De/v).toFixed(3)+"s due to "+Math.round(1e3*k/v)+" ms gap.");for(var re=0;re<Z;re++){var X=Math.max(De,0),ye=N.default.getSilentFrame(b.manifestCodec||b.codec,b.channelCount);ye||(n.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ye=ve.unit.subarray()),Q.splice(Ae,0,{unit:ye,pts:X}),De+=H,Ae++}}ve.pts=De,De+=H}for(var Me=null,He=null,me,Ee=0,Le=Q.length;Le--;)Ee+=Q[Le].unit.byteLength;for(var Pe=0,Ye=Q.length;Pe<Ye;Pe++){var tt=Q[Pe],ut=tt.unit,lt=tt.pts;if(He!==null){var gt=G[Pe-1];gt.duration=Math.round((lt-He)/F)}else if(p&&b.isAAC&&(lt=fe),Me=lt,Ee>0){Ee+=se;try{me=new Uint8Array(Ee)}catch(ce){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:W.ErrorTypes.MUX_ERROR,details:W.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ee,reason:"fail allocating audio mdat "+Ee});return}if(!S){var ht=new DataView(me.buffer);ht.setUint32(0,Ee),me.set(O.default.types.mdat,4)}}else return;me.set(ut,se);var Ie=ut.byteLength;se+=Ie,G.push(new w(!0,R,Ie,0)),He=lt}var Re=G.length;if(!Re)return;var $e=G[G.length-1];this.nextAudioPts=fe=He+F*$e.duration;var Ze=S?new Uint8Array(0):O.default.moof(b.sequenceNumber++,Me/F,f({},b,{samples:G}));b.samples=[];var ue=Me/v,q=fe/v,te="audio",ae={data1:Ze,data2:me,startPTS:ue,endPTS:q,startDTS:ue,endDTS:q,type:te,hasAudio:!0,hasVideo:!1,nb:Re};return this.isAudioContiguous=!0,console.assert(me.length,"MDAT length must not be zero"),ae},A.remuxEmptyAudio=function(b,m,p,C){var E=b.inputTimeScale,v=b.samplerate?b.samplerate:E,P=E/v,F=this.nextAudioPts,R=(F!==null?F:C.startDTS*E)+this._initDTS,H=C.endDTS*E+this._initDTS,U=P*c,S=Math.ceil((H-R)/U),G=N.default.getSilentFrame(b.manifestCodec||b.codec,b.channelCount);if(n.logger.warn("[mp4-remuxer]: remux empty Audio"),!G){n.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var Q=[],se=0;se<S;se++){var fe=R+se*U;Q.push({unit:G,pts:fe,dts:fe})}return b.samples=Q,this.remuxAudio(b,m,p,!1)},A.remuxID3=function(b,m){var p=b.samples.length;if(!p)return;for(var C=b.inputTimeScale,E=this._initPTS,v=this._initDTS,P=0;P<p;P++){var F=b.samples[P];F.pts=o(F.pts-E,m*C)/C,F.dts=o(F.dts-v,m*C)/C}var R=b.samples;return b.samples=[],{samples:R}},A.remuxText=function(b,m){var p=b.samples.length;if(!p)return;for(var C=b.inputTimeScale,E=this._initPTS,v=0;v<p;v++){var P=b.samples[v];P.pts=o(P.pts-E,m*C)/C}b.samples.sort(function(R,H){return R.pts-H.pts});var F=b.samples;return b.samples=[],{samples:F}},L}();function o(L,A){var _;if(A===null)return L;for(A<L?_=-8589934592:_=8589934592;Math.abs(L-A)>4294967296;)L+=_;return L}function T(L){for(var A=0;A<L.length;A++)if(L[A].key)return A;return-1}var w=function(A,_,b,m){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=_,this.size=b,this.cts=m,this.flags=new x(A)},x=function(A){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=A?2:1,this.isNonSync=A?0:1}},"./src/remux/passthrough-remuxer.ts":function(J,z,D){"use strict";D.r(z);var V=D("./src/polyfills/number.ts"),N=D("./src/utils/mp4-tools.ts"),O=D("./src/loader/fragment.ts"),K=D("./src/utils/logger.ts"),W=function(){function g(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var f=g.prototype;return f.destroy=function(){},f.resetTimeStamp=function(c){this.initPTS=c,this.lastEndDTS=null},f.resetNextTimestamp=function(){this.lastEndDTS=null},f.resetInitSegment=function(c,s,d){this.audioCodec=s,this.videoCodec=d,this.generateInitSegment(c),this.emitInitSegment=!0},f.generateInitSegment=function(c){var s=this.audioCodec,d=this.videoCodec;if(!c||!c.byteLength){this.initTracks=void 0,this.initData=void 0;return}var i=this.initData=Object(N.parseInitSegment)(c);s||(s=I(i.audio,O.ElementaryStreamTypes.AUDIO)),d||(d=I(i.video,O.ElementaryStreamTypes.VIDEO));var a={};i.audio&&i.video?a.audiovideo={container:"video/mp4",codec:s+","+d,initSegment:c,id:"main"}:i.audio?a.audio={container:"audio/mp4",codec:s,initSegment:c,id:"audio"}:i.video?a.video={container:"video/mp4",codec:d,initSegment:c,id:"main"}:K.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=a},f.remux=function(c,s,d,i,a){var r=this.initPTS,o=this.lastEndDTS,T={audio:void 0,video:void 0,text:i,id3:d,initSegment:void 0};Object(V.isFiniteNumber)(o)||(o=this.lastEndDTS=a||0);var w=s.samples;if(!w||!w.length)return T;var x={initPTS:void 0,timescale:1},L=this.initData;if((!L||!L.length)&&(this.generateInitSegment(w),L=this.initData),!L||!L.length)return K.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),T;this.emitInitSegment&&(x.tracks=this.initTracks,this.emitInitSegment=!1),Object(V.isFiniteNumber)(r)||(this.initPTS=x.initPTS=r=n(L,w,o));var A=Object(N.getDuration)(w,L),_=o,b=A+_;Object(N.offsetStartDTS)(L,w,r),A>0?this.lastEndDTS=b:(K.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var m=!!L.audio,p=!!L.video,C="";m&&(C+="audio"),p&&(C+="video");var E={data1:w,startPTS:_,startDTS:_,endPTS:b,endDTS:b,type:C,hasAudio:m,hasVideo:p,nb:1,dropped:0};return T.audio=E.type==="audio"?E:void 0,T.video=E.type!=="audio"?E:void 0,T.text=i,T.id3=d,T.initSegment=x,T},g}(),n=function(f,h,c){return Object(N.getStartDTS)(f,h)-c};function I(g,f){var h=g==null?void 0:g.codec;return h&&h.length>4?h:h==="hvc1"?"hvc1.1.c.L120.90":h==="av01"?"av01.0.04M.08":h==="avc1"||f===O.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}z.default=W},"./src/task-loop.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"default",function(){return V});var V=function(){function N(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var O=N.prototype;return O.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},O.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},O.onHandlerDestroyed=function(){},O.hasInterval=function(){return!!this._tickInterval},O.hasNextTick=function(){return!!this._tickTimer},O.setInterval=function(W){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,W),!0)},O.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},O.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},O.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},O.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},O.doTick=function(){},N}()},"./src/types/cmcd.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"CMCDVersion",function(){return V}),D.d(z,"CMCDObjectType",function(){return N}),D.d(z,"CMCDStreamingFormat",function(){return O}),D.d(z,"CMCDStreamType",function(){return K});var V=1,N;(function(W){W.MANIFEST="m",W.AUDIO="a",W.VIDEO="v",W.MUXED="av",W.INIT="i",W.CAPTION="c",W.TIMED_TEXT="tt",W.KEY="k",W.OTHER="o"})(N||(N={}));var O;(function(W){W.DASH="d",W.HLS="h",W.SMOOTH="s",W.OTHER="o"})(O||(O={}));var K;(function(W){W.VOD="v",W.LIVE="l"})(K||(K={}))},"./src/types/level.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"HlsSkip",function(){return O}),D.d(z,"getSkipValue",function(){return K}),D.d(z,"HlsUrlParameters",function(){return W}),D.d(z,"Level",function(){return n});function V(I,g){for(var f=0;f<g.length;f++){var h=g[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(I,h.key,h)}}function N(I,g,f){return g&&V(I.prototype,g),f&&V(I,f),I}var O;(function(I){I.No="",I.Yes="YES",I.v2="v2"})(O||(O={}));function K(I,g){var f=I.canSkipUntil,h=I.canSkipDateRanges,c=I.endSN,s=g!==void 0?g-c:0;return f&&s<f?h?O.v2:O.Yes:O.No}var W=function(){function I(f,h,c){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=f,this.part=h,this.skip=c}var g=I.prototype;return g.addDirectives=function(h){var c=new self.URL(h);return this.msn!==void 0&&c.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&c.searchParams.set("_HLS_part",this.part.toString()),this.skip&&c.searchParams.set("_HLS_skip",this.skip),c.toString()},I}(),n=function(){function I(g){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[g.url],this.attrs=g.attrs,this.bitrate=g.bitrate,g.details&&(this.details=g.details),this.id=g.id||0,this.name=g.name,this.width=g.width||0,this.height=g.height||0,this.audioCodec=g.audioCodec,this.videoCodec=g.videoCodec,this.unknownCodecs=g.unknownCodecs,this.codecSet=[g.videoCodec,g.audioCodec].filter(function(f){return f}).join(",").replace(/\.[^.,]+/g,"")}return N(I,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(f){var h=f%this.url.length;this._urlId!==h&&(this.details=void 0,this._urlId=h)}}]),I}()},"./src/types/loader.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"PlaylistContextType",function(){return V}),D.d(z,"PlaylistLevelType",function(){return N});var V;(function(O){O.MANIFEST="manifest",O.LEVEL="level",O.AUDIO_TRACK="audioTrack",O.SUBTITLE_TRACK="subtitleTrack"})(V||(V={}));var N;(function(O){O.MAIN="main",O.AUDIO="audio",O.SUBTITLE="subtitle"})(N||(N={}))},"./src/types/transmuxer.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"ChunkMetadata",function(){return V});var V=function(K,W,n,I,g,f){I===void 0&&(I=0),g===void 0&&(g=-1),f===void 0&&(f=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=N(),this.buffering={audio:N(),video:N(),audiovideo:N()},this.level=K,this.sn=W,this.id=n,this.size=I,this.part=g,this.partial=f};function N(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"AttrList",function(){return O});var V=/^(\d+)x(\d+)$/,N=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,O=function(){function K(n){typeof n=="string"&&(n=K.parseAttrList(n));for(var I in n)n.hasOwnProperty(I)&&(this[I]=n[I])}var W=K.prototype;return W.decimalInteger=function(I){var g=parseInt(this[I],10);return g>Number.MAX_SAFE_INTEGER?Infinity:g},W.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),h=0;h<g.length/2;h++)f[h]=parseInt(g.slice(h*2,h*2+2),16);return f}else return null},W.hexadecimalIntegerAsNumber=function(I){var g=parseInt(this[I],16);return g>Number.MAX_SAFE_INTEGER?Infinity:g},W.decimalFloatingPoint=function(I){return parseFloat(this[I])},W.optionalFloat=function(I,g){var f=this[I];return f?parseFloat(f):g},W.enumeratedString=function(I){return this[I]},W.bool=function(I){return this[I]==="YES"},W.decimalResolution=function(I){var g=V.exec(this[I]);return g===null?void 0:{width:parseInt(g[1],10),height:parseInt(g[2],10)}},K.parseAttrList=function(I){var g,f={},h='"';for(N.lastIndex=0;(g=N.exec(I))!==null;){var c=g[2];c.indexOf(h)===0&&c.lastIndexOf(h)===c.length-1&&(c=c.slice(1,-1)),f[g[1]]=c}return f},K}()},"./src/utils/binary-search.ts":function(J,z,D){"use strict";D.r(z);var V={search:function(O,K){for(var W=0,n=O.length-1,I=null,g=null;W<=n;){I=(W+n)/2|0,g=O[I];var f=K(g);if(f>0)W=I+1;else if(f<0)n=I-1;else return g}return null}};z.default=V},"./src/utils/buffer-helper.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"BufferHelper",function(){return O});var V=D("./src/utils/logger.ts"),N={length:0,start:function(){return 0},end:function(){return 0}},O=function(){function K(){}return K.isBuffered=function(n,I){try{if(n){for(var g=K.getBuffered(n),f=0;f<g.length;f++)if(I>=g.start(f)&&I<=g.end(f))return!0}}catch(h){}return!1},K.bufferInfo=function(n,I,g){try{if(n){var f=K.getBuffered(n),h=[],c;for(c=0;c<f.length;c++)h.push({start:f.start(c),end:f.end(c)});return this.bufferedInfo(h,I,g)}}catch(s){}return{len:0,start:I,end:I,nextStart:void 0}},K.bufferedInfo=function(n,I,g){I=Math.max(0,I),n.sort(function(x,L){var A=x.start-L.start;return A||L.end-x.end});var f=[];if(g)for(var h=0;h<n.length;h++){var c=f.length;if(c){var s=f[c-1].end;n[h].start-s<g?n[h].end>s&&(f[c-1].end=n[h].end):f.push(n[h])}else f.push(n[h])}else f=n;for(var d=0,i,a=I,r=I,o=0;o<f.length;o++){var T=f[o].start,w=f[o].end;if(I+g>=T&&I<w)a=T,r=w,d=r-I;else if(I+g<T){i=T;break}}return{len:d,start:a||0,end:r||0,nextStart:i}},K.getBuffered=function(n){try{return n.buffered}catch(I){return V.logger.log("failed to get media.buffered",I),N}},K}()},"./src/utils/cea-608-parser.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"Row",function(){return r}),D.d(z,"CaptionScreen",function(){return o});var V=D("./src/utils/logger.ts"),N={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},O=function(b){var m=b;return N.hasOwnProperty(b)&&(m=N[b]),String.fromCharCode(m)},K=15,W=100,n={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},I={17:2,18:4,21:6,22:8,23:10,19:13,20:15},g={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},f={25:2,26:4,29:6,30:8,31:10,27:13,28:15},h=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],c;(function(_){_[_.ERROR=0]="ERROR",_[_.TEXT=1]="TEXT",_[_.WARNING=2]="WARNING",_[_.INFO=2]="INFO",_[_.DEBUG=3]="DEBUG",_[_.DATA=3]="DATA"})(c||(c={}));var s=function(){function _(){this.time=null,this.verboseLevel=c.ERROR}var b=_.prototype;return b.log=function(p,C){this.verboseLevel>=p&&V.logger.log(this.time+" ["+p+"] "+C)},_}(),d=function(b){for(var m=[],p=0;p<b.length;p++)m.push(b[p].toString(16));return m},i=function(){function _(m,p,C,E,v){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=m||"white",this.underline=p||!1,this.italics=C||!1,this.background=E||"black",this.flash=v||!1}var b=_.prototype;return b.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},b.setStyles=function(p){for(var C=["foreground","underline","italics","background","flash"],E=0;E<C.length;E++){var v=C[E];p.hasOwnProperty(v)&&(this[v]=p[v])}},b.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},b.equals=function(p){return this.foreground===p.foreground&&this.underline===p.underline&&this.italics===p.italics&&this.background===p.background&&this.flash===p.flash},b.copy=function(p){this.foreground=p.foreground,this.underline=p.underline,this.italics=p.italics,this.background=p.background,this.flash=p.flash},b.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},_}(),a=function(){function _(m,p,C,E,v,P){this.uchar=void 0,this.penState=void 0,this.uchar=m||" ",this.penState=new i(p,C,E,v,P)}var b=_.prototype;return b.reset=function(){this.uchar=" ",this.penState.reset()},b.setChar=function(p,C){this.uchar=p,this.penState.copy(C)},b.setPenState=function(p){this.penState.copy(p)},b.equals=function(p){return this.uchar===p.uchar&&this.penState.equals(p.penState)},b.copy=function(p){this.uchar=p.uchar,this.penState.copy(p.penState)},b.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},_}(),r=function(){function _(m){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var p=0;p<W;p++)this.chars.push(new a);this.logger=m,this.pos=0,this.currPenState=new i}var b=_.prototype;return b.equals=function(p){for(var C=!0,E=0;E<W;E++)if(!this.chars[E].equals(p.chars[E])){C=!1;break}return C},b.copy=function(p){for(var C=0;C<W;C++)this.chars[C].copy(p.chars[C])},b.isEmpty=function(){for(var p=!0,C=0;C<W;C++)if(!this.chars[C].isEmpty()){p=!1;break}return p},b.setCursor=function(p){this.pos!==p&&(this.pos=p),this.pos<0?(this.logger.log(c.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>W&&(this.logger.log(c.DEBUG,"Too large cursor position "+this.pos),this.pos=W)},b.moveCursor=function(p){var C=this.pos+p;if(p>1)for(var E=this.pos+1;E<C+1;E++)this.chars[E].setPenState(this.currPenState);this.setCursor(C)},b.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},b.insertChar=function(p){p>=144&&this.backSpace();var C=O(p);if(this.pos>=W){this.logger.log(c.ERROR,"Cannot insert "+p.toString(16)+" ("+C+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(C,this.currPenState),this.moveCursor(1)},b.clearFromPos=function(p){var C;for(C=p;C<W;C++)this.chars[C].reset()},b.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},b.clearToEndOfRow=function(){this.clearFromPos(this.pos)},b.getTextString=function(){for(var p=[],C=!0,E=0;E<W;E++){var v=this.chars[E].uchar;v!==" "&&(C=!1),p.push(v)}return C?"":p.join("")},b.setPenStyles=function(p){this.currPenState.setStyles(p);var C=this.chars[this.pos];C.setPenState(this.currPenState)},_}(),o=function(){function _(m){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var p=0;p<K;p++)this.rows.push(new r(m));this.logger=m,this.currRow=K-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var b=_.prototype;return b.reset=function(){for(var p=0;p<K;p++)this.rows[p].clear();this.currRow=K-1},b.equals=function(p){for(var C=!0,E=0;E<K;E++)if(!this.rows[E].equals(p.rows[E])){C=!1;break}return C},b.copy=function(p){for(var C=0;C<K;C++)this.rows[C].copy(p.rows[C])},b.isEmpty=function(){for(var p=!0,C=0;C<K;C++)if(!this.rows[C].isEmpty()){p=!1;break}return p},b.backSpace=function(){var p=this.rows[this.currRow];p.backSpace()},b.clearToEndOfRow=function(){var p=this.rows[this.currRow];p.clearToEndOfRow()},b.insertChar=function(p){var C=this.rows[this.currRow];C.insertChar(p)},b.setPen=function(p){var C=this.rows[this.currRow];C.setPenStyles(p)},b.moveCursor=function(p){var C=this.rows[this.currRow];C.moveCursor(p)},b.setCursor=function(p){this.logger.log(c.INFO,"setCursor: "+p);var C=this.rows[this.currRow];C.setCursor(p)},b.setPAC=function(p){this.logger.log(c.INFO,"pacData = "+JSON.stringify(p));var C=p.row-1;if(this.nrRollUpRows&&C<this.nrRollUpRows-1&&(C=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==C){for(var E=0;E<K;E++)this.rows[E].clear();var v=this.currRow+1-this.nrRollUpRows,P=this.lastOutputScreen;if(P){var F=P.rows[v].cueStartTime,R=this.logger.time;if(F&&R!==null&&F<R)for(var H=0;H<this.nrRollUpRows;H++)this.rows[C-this.nrRollUpRows+H+1].copy(P.rows[v+H])}}this.currRow=C;var U=this.rows[this.currRow];if(p.indent!==null){var S=p.indent,G=Math.max(S-1,0);U.setCursor(p.indent),p.color=U.chars[G].penState.foreground}var Q={foreground:p.color,underline:p.underline,italics:p.italics,background:"black",flash:!1};this.setPen(Q)},b.setBkgData=function(p){this.logger.log(c.INFO,"bkgData = "+JSON.stringify(p)),this.backSpace(),this.setPen(p),this.insertChar(32)},b.setRollUpRows=function(p){this.nrRollUpRows=p},b.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(c.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(c.TEXT,this.getDisplayText());var p=this.currRow+1-this.nrRollUpRows,C=this.rows.splice(p,1)[0];C.clear(),this.rows.splice(this.currRow,0,C),this.logger.log(c.INFO,"Rolling up")},b.getDisplayText=function(p){p=p||!1;for(var C=[],E="",v=-1,P=0;P<K;P++){var F=this.rows[P].getTextString();F&&(v=P+1,p?C.push("Row "+v+": '"+F+"'"):C.push(F.trim()))}return C.length>0&&(p?E="["+C.join(" | ")+"]":E=C.join(`
`)),E},b.getTextAndFormat=function(){return this.rows},_}(),T=function(){function _(m,p,C){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=m,this.outputFilter=p,this.mode=null,this.verbose=0,this.displayedMemory=new o(C),this.nonDisplayedMemory=new o(C),this.lastOutputScreen=new o(C),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=C}var b=_.prototype;return b.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},b.getHandler=function(){return this.outputFilter},b.setHandler=function(p){this.outputFilter=p},b.setPAC=function(p){this.writeScreen.setPAC(p)},b.setBkgData=function(p){this.writeScreen.setBkgData(p)},b.setMode=function(p){if(p===this.mode)return;this.mode=p,this.logger.log(c.INFO,"MODE="+p),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=p},b.insertChars=function(p){for(var C=0;C<p.length;C++)this.writeScreen.insertChar(p[C]);var E=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(c.INFO,E+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(c.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},b.ccRCL=function(){this.logger.log(c.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},b.ccBS=function(){if(this.logger.log(c.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},b.ccAOF=function(){},b.ccAON=function(){},b.ccDER=function(){this.logger.log(c.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},b.ccRU=function(p){this.logger.log(c.INFO,"RU("+p+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(p)},b.ccFON=function(){this.logger.log(c.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},b.ccRDC=function(){this.logger.log(c.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},b.ccTR=function(){this.logger.log(c.INFO,"TR"),this.setMode("MODE_TEXT")},b.ccRTD=function(){this.logger.log(c.INFO,"RTD"),this.setMode("MODE_TEXT")},b.ccEDM=function(){this.logger.log(c.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},b.ccCR=function(){this.logger.log(c.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},b.ccENM=function(){this.logger.log(c.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},b.ccEOC=function(){if(this.logger.log(c.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var p=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=p,this.writeScreen=this.nonDisplayedMemory,this.logger.log(c.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},b.ccTO=function(p){this.logger.log(c.INFO,"TO("+p+") - Tab Offset"),this.writeScreen.moveCursor(p)},b.ccMIDROW=function(p){var C={flash:!1};if(C.underline=p%2===1,C.italics=p>=46,C.italics)C.foreground="white";else{var E=Math.floor(p/2)-16,v=["white","green","blue","cyan","red","yellow","magenta"];C.foreground=v[E]}this.logger.log(c.INFO,"MIDROW: "+JSON.stringify(C)),this.writeScreen.setPen(C)},b.outputDataUpdate=function(p){p===void 0&&(p=!1);var C=this.logger.time;if(C===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=C:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,C,this.lastOutputScreen),p&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:C),this.lastOutputScreen.copy(this.displayedMemory))},b.cueSplitAtTime=function(p){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,p,this.displayedMemory),this.cueStartTime=p))},_}(),w=function(){function _(m,p,C){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var E=new s;this.channels=[null,new T(m,p,E),new T(m+1,C,E)],this.cmdHistory=A(),this.logger=E}var b=_.prototype;return b.getHandler=function(p){return this.channels[p].getHandler()},b.setHandler=function(p,C){this.channels[p].setHandler(C)},b.addData=function(p,C){var E,v,P,F=!1;this.logger.time=p;for(var R=0;R<C.length;R+=2){if(v=C[R]&127,P=C[R+1]&127,v===0&&P===0)continue;if(this.logger.log(c.DATA,"["+d([C[R],C[R+1]])+"] -> ("+d([v,P])+")"),E=this.parseCmd(v,P),E||(E=this.parseMidrow(v,P)),E||(E=this.parsePAC(v,P)),E||(E=this.parseBackgroundAttributes(v,P)),!E&&(F=this.parseChars(v,P),F)){var H=this.currentChannel;if(H&&H>0){var U=this.channels[H];U.insertChars(F)}else this.logger.log(c.WARNING,"No channel found yet. TEXT-MODE?")}!E&&!F&&this.logger.log(c.WARNING,"Couldn't parse cleaned data "+d([v,P])+" orig: "+d([C[R],C[R+1]]))}},b.parseCmd=function(p,C){var E=this.cmdHistory,v=(p===20||p===28||p===21||p===29)&&C>=32&&C<=47,P=(p===23||p===31)&&C>=33&&C<=35;if(!(v||P))return!1;if(L(p,C,E))return x(null,null,E),this.logger.log(c.DEBUG,"Repeated command ("+d([p,C])+") is dropped"),!0;var F=p===20||p===21||p===23?1:2,R=this.channels[F];return p===20||p===21||p===28||p===29?C===32?R.ccRCL():C===33?R.ccBS():C===34?R.ccAOF():C===35?R.ccAON():C===36?R.ccDER():C===37?R.ccRU(2):C===38?R.ccRU(3):C===39?R.ccRU(4):C===40?R.ccFON():C===41?R.ccRDC():C===42?R.ccTR():C===43?R.ccRTD():C===44?R.ccEDM():C===45?R.ccCR():C===46?R.ccENM():C===47&&R.ccEOC():R.ccTO(C-32),x(p,C,E),this.currentChannel=F,!0},b.parseMidrow=function(p,C){var E=0;if((p===17||p===25)&&C>=32&&C<=47){if(p===17?E=1:E=2,E!==this.currentChannel)return this.logger.log(c.ERROR,"Mismatch channel in midrow parsing"),!1;var v=this.channels[E];return v?(v.ccMIDROW(C),this.logger.log(c.DEBUG,"MIDROW ("+d([p,C])+")"),!0):!1}return!1},b.parsePAC=function(p,C){var E,v=this.cmdHistory,P=(p>=17&&p<=23||p>=25&&p<=31)&&C>=64&&C<=127,F=(p===16||p===24)&&C>=64&&C<=95;if(!(P||F))return!1;if(L(p,C,v))return x(null,null,v),!0;var R=p<=23?1:2;C>=64&&C<=95?E=R===1?n[p]:g[p]:E=R===1?I[p]:f[p];var H=this.channels[R];return H?(H.setPAC(this.interpretPAC(E,C)),x(p,C,v),this.currentChannel=R,!0):!1},b.interpretPAC=function(p,C){var E,v={color:null,italics:!1,indent:null,underline:!1,row:p};return C>95?E=C-96:E=C-64,v.underline=(E&1)===1,E<=13?v.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(E/2)]:E<=15?(v.italics=!0,v.color="white"):v.indent=Math.floor((E-16)/2)*4,v},b.parseChars=function(p,C){var E,v=null,P=null;if(p>=25?(E=2,P=p-8):(E=1,P=p),P>=17&&P<=19){var F;P===17?F=C+80:P===18?F=C+112:F=C+144,this.logger.log(c.INFO,"Special char '"+O(F)+"' in channel "+E),v=[F]}else p>=32&&p<=127&&(v=C===0?[p]:[p,C]);if(v){var R=d(v);this.logger.log(c.DEBUG,"Char codes = "+R.join(",")),x(p,C,this.cmdHistory)}return v},b.parseBackgroundAttributes=function(p,C){var E=(p===16||p===24)&&C>=32&&C<=47,v=(p===23||p===31)&&C>=45&&C<=47;if(!(E||v))return!1;var P,F={};p===16||p===24?(P=Math.floor((C-32)/2),F.background=h[P],C%2===1&&(F.background=F.background+"_semi")):C===45?F.background="transparent":(F.foreground="black",C===47&&(F.underline=!0));var R=p<=23?1:2,H=this.channels[R];return H.setBkgData(F),x(p,C,this.cmdHistory),!0},b.reset=function(){for(var p=0;p<Object.keys(this.channels).length;p++){var C=this.channels[p];C&&C.reset()}this.cmdHistory=A()},b.cueSplitAtTime=function(p){for(var C=0;C<this.channels.length;C++){var E=this.channels[C];E&&E.cueSplitAtTime(p)}},_}();function x(_,b,m){m.a=_,m.b=b}function L(_,b,m){return m.a===_&&m.b===b}function A(){return{a:null,b:null}}z.default=w},"./src/utils/codecs.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"isCodecType",function(){return N}),D.d(z,"isCodecSupportedInMp4",function(){return O});var V={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function N(K,W){var n=V[W];return!!n&&n[K.slice(0,4)]===!0}function O(K,W){return MediaSource.isTypeSupported((W||"video")+'/mp4;codecs="'+K+'"')}},"./src/utils/cues.ts":function(J,z,D){"use strict";D.r(z);var V=D("./src/utils/vttparser.ts"),N=D("./src/utils/webvtt-parser.ts"),O=D("./src/utils/texttrack-utils.ts"),K=/\s/,W={newCue:function(I,g,f,h){for(var c=[],s,d,i,a,r,o=self.VTTCue||self.TextTrackCue,T=0;T<h.rows.length;T++)if(s=h.rows[T],i=!0,a=0,r="",!s.isEmpty()){for(var w=0;w<s.chars.length;w++)K.test(s.chars[w].uchar)&&i?a++:(r+=s.chars[w].uchar,i=!1);s.cueStartTime=g,g===f&&(f+=1e-4),a>=16?a--:a++;var x=Object(V.fixLineBreaks)(r.trim()),L=Object(N.generateCueId)(g,f,x);(!I||!I.cues||!I.cues.getCueById(L))&&(d=new o(g,f,x),d.id=L,d.line=T+1,d.align="left",d.position=10+Math.min(80,Math.floor(a*8/32)*10),c.push(d))}return I&&c.length&&(c.sort(function(A,_){return A.line==="auto"||_.line==="auto"?0:A.line>8&&_.line>8?_.line-A.line:A.line-_.line}),c.forEach(function(A){return Object(O.addCueToTrack)(I,A)})),c}};z.default=W},"./src/utils/discontinuities.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"findFirstFragWithCC",function(){return K}),D.d(z,"shouldAlignOnDiscontinuities",function(){return W}),D.d(z,"findDiscontinuousReferenceFrag",function(){return n}),D.d(z,"adjustSlidingStart",function(){return g}),D.d(z,"alignStream",function(){return f}),D.d(z,"alignPDT",function(){return c}),D.d(z,"alignFragmentByPDTDelta",function(){return s}),D.d(z,"alignMediaPlaylistByPDT",function(){return d});var V=D("./src/polyfills/number.ts"),N=D("./src/utils/logger.ts"),O=D("./src/controller/level-helper.ts");function K(i,a){for(var r=null,o=0,T=i.length;o<T;o++){var w=i[o];if(w&&w.cc===a){r=w;break}}return r}function W(i,a,r){return!!(a.details&&(r.endCC>r.startCC||i&&i.cc<r.startCC))}function n(i,a){var r=i.fragments,o=a.fragments;if(!o.length||!r.length){N.logger.log("No fragments to align");return}var T=K(r,o[0].cc);if(!T||T&&!T.startPTS){N.logger.log("No frag in previous level to align on");return}return T}function I(i,a){if(i){var r=i.start+a;i.start=i.startPTS=r,i.endPTS=r+i.duration}}function g(i,a){for(var r=a.fragments,o=0,T=r.length;o<T;o++)I(r[o],i);a.fragmentHint&&I(a.fragmentHint,i),a.alignedSliding=!0}function f(i,a,r){if(!a)return;h(i,r,a),!r.alignedSliding&&a.details&&c(r,a.details),!r.alignedSliding&&a.details&&!r.skippedSegments&&Object(O.adjustSliding)(a.details,r)}function h(i,a,r){if(W(i,r,a)){var o=n(r.details,a);o&&Object(V.isFiniteNumber)(o.start)&&(N.logger.log("Adjusting PTS using last level due to CC increase within current level "+a.url),g(o.start,a))}}function c(i,a){if(!a.fragments.length||!i.hasProgramDateTime||!a.hasProgramDateTime)return;var r=a.fragments[0].programDateTime,o=i.fragments[0].programDateTime,T=(o-r)/1e3+a.fragments[0].start;T&&Object(V.isFiniteNumber)(T)&&(N.logger.log("Adjusting PTS using programDateTime delta "+(o-r)+"ms, sliding:"+T.toFixed(3)+" "+i.url+" "),g(T,i))}function s(i,a){var r=i.programDateTime;if(!r)return;var o=(r-a)/1e3;i.start=i.startPTS=o,i.endPTS=o+i.duration}function d(i,a){if(!a.fragments.length||!i.hasProgramDateTime||!a.hasProgramDateTime)return;var r=a.fragments[0].programDateTime,o=a.fragments[0].start,T=r-o*1e3;i.fragments.forEach(function(w){s(w,T)}),i.fragmentHint&&s(i.fragmentHint,T),i.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(J,z,D){"use strict";D.r(z);var V=D("./src/utils/ewma.ts"),N=function(){function O(W,n,I){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=I,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new V.default(W),this.fast_=new V.default(n)}var K=O.prototype;return K.update=function(n,I){var g=this.slow_,f=this.fast_;this.slow_.halfLife!==n&&(this.slow_=new V.default(n,g.getEstimate(),g.getTotalWeight())),this.fast_.halfLife!==I&&(this.fast_=new V.default(I,f.getEstimate(),f.getTotalWeight()))},K.sample=function(n,I){n=Math.max(n,this.minDelayMs_);var g=8*I,f=n/1e3,h=g/f;this.fast_.sample(f,h),this.slow_.sample(f,h)},K.canEstimate=function(){var n=this.fast_;return n&&n.getTotalWeight()>=this.minWeight_},K.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},K.destroy=function(){},O}();z.default=N},"./src/utils/ewma.ts":function(J,z,D){"use strict";D.r(z);var V=function(){function N(K,W,n){W===void 0&&(W=0),n===void 0&&(n=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=K,this.alpha_=K?Math.exp(Math.log(.5)/K):0,this.estimate_=W,this.totalWeight_=n}var O=N.prototype;return O.sample=function(W,n){var I=Math.pow(this.alpha_,W);this.estimate_=n*(1-I)+I*this.estimate_,this.totalWeight_+=W},O.getTotalWeight=function(){return this.totalWeight_},O.getEstimate=function(){if(this.alpha_){var W=1-Math.pow(this.alpha_,this.totalWeight_);if(W)return this.estimate_/W}return this.estimate_},N}();z.default=V},"./src/utils/fetch-loader.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"fetchSupported",function(){return s});var V=D("./src/polyfills/number.ts"),N=D("./src/loader/load-stats.ts"),O=D("./src/demux/chunk-cache.ts");function K(o,T){o.prototype=Object.create(T.prototype),o.prototype.constructor=o,f(o,T)}function W(o){var T=typeof Map=="function"?new Map:void 0;return W=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 T!="undefined"){if(T.has(x))return T.get(x);T.set(x,L)}function L(){return n(x,arguments,h(this).constructor)}return L.prototype=Object.create(x.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),f(L,x)},W(o)}function n(o,T,w){return I()?n=Reflect.construct:n=function(L,A,_){var b=[null];b.push.apply(b,A);var m=Function.bind.apply(L,b),p=new m;return _&&f(p,_.prototype),p},n.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(o){return!1}}function g(o){return Function.toString.call(o).indexOf("[native code]")!==-1}function f(o,T){return f=Object.setPrototypeOf||function(x,L){return x.__proto__=L,x},f(o,T)}function h(o){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(w){return w.__proto__||Object.getPrototypeOf(w)},h(o)}function c(){return c=Object.assign||function(o){for(var T=1;T<arguments.length;T++){var w=arguments[T];for(var x in w)Object.prototype.hasOwnProperty.call(w,x)&&(o[x]=w[x])}return o},c.apply(this,arguments)}function s(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(o){}return!1}var d=function(){function o(w){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=w.fetchSetup||a,this.controller=new self.AbortController,this.stats=new N.LoadStats}var T=o.prototype;return T.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},T.abortInternal=function(){var x=this.response;(!x||!x.ok)&&(this.stats.aborted=!0,this.controller.abort())},T.abort=function(){var x;this.abortInternal(),(x=this.callbacks)!==null&&x!==void 0&&x.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},T.load=function(x,L,A){var _=this,b=this.stats;if(b.loading.start)throw new Error("Loader can only be used once.");b.loading.start=self.performance.now();var m=i(x,this.controller.signal),p=A.onProgress,C=x.responseType==="arraybuffer",E=C?"byteLength":"length";this.context=x,this.config=L,this.callbacks=A,this.request=this.fetchSetup(x,m),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){_.abortInternal(),A.onTimeout(b,x,_.response)},L.timeout),self.fetch(this.request).then(function(v){if(_.response=_.loader=v,!v.ok){var P=v.status,F=v.statusText;throw new r(F||"fetch, bad network response",P,v)}return b.loading.first=Math.max(self.performance.now(),b.loading.start),b.total=parseInt(v.headers.get("Content-Length")||"0"),p&&Object(V.isFiniteNumber)(L.highWaterMark)?_.loadProgressively(v,b,x,L.highWaterMark,p):C?v.arrayBuffer():v.text()}).then(function(v){var P=_.response;self.clearTimeout(_.requestTimeout),b.loading.end=Math.max(self.performance.now(),b.loading.first),b.loaded=b.total=v[E];var F={url:P.url,data:v};p&&!Object(V.isFiniteNumber)(L.highWaterMark)&&p(b,x,v,P),A.onSuccess(F,b,x,P)}).catch(function(v){if(self.clearTimeout(_.requestTimeout),b.aborted)return;var P=v.code||0;A.onError({code:P,text:v.message},x,v.details)})},T.getCacheAge=function(){var x=null;if(this.response){var L=this.response.headers.get("age");x=L?parseFloat(L):null}return x},T.loadProgressively=function(x,L,A,_,b){_===void 0&&(_=0);var m=new O.default,p=x.body.getReader(),C=function E(){return p.read().then(function(v){if(v.done)return m.dataLength&&b(L,A,m.flush(),x),Promise.resolve(new ArrayBuffer(0));var P=v.value,F=P.length;return L.loaded+=F,F<_||m.dataLength?(m.push(P),m.dataLength>=_&&b(L,A,m.flush(),x)):b(L,A,P,x),E()}).catch(function(){return Promise.reject()})};return C()},o}();function i(o,T){var w={method:"GET",mode:"cors",credentials:"same-origin",signal:T,headers:new self.Headers(c({},o.headers))};return o.rangeEnd&&w.headers.set("Range","bytes="+o.rangeStart+"-"+String(o.rangeEnd-1)),w}function a(o,T){return new self.Request(o.url,T)}var r=function(o){K(T,o);function T(w,x,L){var A;return A=o.call(this,w)||this,A.code=void 0,A.details=void 0,A.code=x,A.details=L,A}return T}(W(Error));z.default=d},"./src/utils/imsc1-ttml-parser.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"IMSC1_CODEC",function(){return g}),D.d(z,"parseIMSC1",function(){return s});var V=D("./src/utils/mp4-tools.ts"),N=D("./src/utils/vttparser.ts"),O=D("./src/utils/vttcue.ts"),K=D("./src/demux/id3.ts"),W=D("./src/utils/timescale-conversion.ts"),n=D("./src/utils/webvtt-parser.ts");function I(){return I=Object.assign||function(_){for(var b=1;b<arguments.length;b++){var m=arguments[b];for(var p in m)Object.prototype.hasOwnProperty.call(m,p)&&(_[p]=m[p])}return _},I.apply(this,arguments)}var g="stpp.ttml.im1t",f=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,h=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,c={left:"start",center:"center",right:"end",start:"start",end:"end"};function s(_,b,m,p,C){var E=Object(V.findBox)(new Uint8Array(_),["mdat"]);if(E.length===0){C(new Error("Could not parse IMSC1 mdat"));return}var v=E[0],P=Object(K.utf8ArrayToStr)(new Uint8Array(_,v.start,v.end-v.start)),F=Object(W.toTimescaleFromScale)(b,1,m);try{p(d(P,F))}catch(R){C(R)}}function d(_,b){var m=new DOMParser,p=m.parseFromString(_,"text/xml"),C=p.getElementsByTagName("tt")[0];if(!C)throw new Error("Invalid ttml");var E={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},v=Object.keys(E).reduce(function(U,S){return U[S]=C.getAttribute("ttp:"+S)||E[S],U},{}),P=C.getAttribute("xml:space")!=="preserve",F=a(i(C,"styling","style")),R=a(i(C,"layout","region")),H=i(C,"body","[begin]");return[].map.call(H,function(U){var S=r(U,P);if(!S||!U.hasAttribute("begin"))return null;var G=x(U.getAttribute("begin"),v),Q=x(U.getAttribute("dur"),v),se=x(U.getAttribute("end"),v);if(G===null)throw w(U);if(se===null){if(Q===null)throw w(U);se=G+Q}var fe=new O.default(G-b,se-b,S);fe.id=Object(n.generateCueId)(fe.startTime,fe.endTime,fe.text);var we=R[U.getAttribute("region")],be=F[U.getAttribute("style")];fe.position=10,fe.size=80;var Se=o(we,be),Ae=Se.textAlign;if(Ae){var De=c[Ae];De&&(fe.lineAlign=De),fe.align=Ae}return I(fe,Se),fe}).filter(function(U){return U!==null})}function i(_,b,m){var p=_.getElementsByTagName(b)[0];return p?[].slice.call(p.querySelectorAll(m)):[]}function a(_){return _.reduce(function(b,m){var p=m.getAttribute("xml:id");return p&&(b[p]=m),b},{})}function r(_,b){return[].slice.call(_.childNodes).reduce(function(m,p,C){var E;return p.nodeName==="br"&&C?m+`
`:(E=p.childNodes)!==null&&E!==void 0&&E.length?r(p,b):b?m+p.textContent.trim().replace(/\s+/g," "):m+p.textContent},"")}function o(_,b){var m="http://www.w3.org/ns/ttml#styling",p=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return p.reduce(function(C,E){var v=T(b,m,E)||T(_,m,E);return v&&(C[E]=v),C},{})}function T(_,b,m){return _.hasAttributeNS(b,m)?_.getAttributeNS(b,m):null}function w(_){return new Error("Could not parse ttml timestamp "+_)}function x(_,b){if(!_)return null;var m=Object(N.parseTimeStamp)(_);return m===null&&(f.test(_)?m=L(_,b):h.test(_)&&(m=A(_,b))),m}function L(_,b){var m=f.exec(_),p=(m[4]|0)+(m[5]|0)/b.subFrameRate;return(m[1]|0)*3600+(m[2]|0)*60+(m[3]|0)+p/b.frameRate}function A(_,b){var m=h.exec(_),p=Number(m[1]),C=m[2];switch(C){case"h":return p*3600;case"m":return p*60;case"ms":return p*1e3;case"f":return p/b.frameRate;case"t":return p/b.tickRate}return p}},"./src/utils/logger.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"enableLogs",function(){return n}),D.d(z,"logger",function(){return I});var V=function(){},N={trace:V,debug:V,log:V,warn:V,info:V,error:V},O=N;function K(g){var f=self.console[g];return f?f.bind(self.console,"["+g+"] >"):V}function W(g){for(var f=arguments.length,h=new Array(f>1?f-1:0),c=1;c<f;c++)h[c-1]=arguments[c];h.forEach(function(s){O[s]=g[s]?g[s].bind(g):K(s)})}function n(g){if(self.console&&g===!0||typeof g=="object"){W(g,"debug","log","info","warn","error");try{O.log()}catch(f){O=N}}else O=N}var I=O},"./src/utils/mediakeys-helper.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"KeySystems",function(){return V}),D.d(z,"requestMediaKeySystemAccess",function(){return N});var V;(function(O){O.WIDEVINE="com.widevine.alpha",O.PLAYREADY="com.microsoft.playready"})(V||(V={}));var N=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"getMediaSource",function(){return V});function V(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"bin2str",function(){return W}),D.d(z,"readUint16",function(){return n}),D.d(z,"readUint32",function(){return I}),D.d(z,"writeUint32",function(){return g}),D.d(z,"findBox",function(){return f}),D.d(z,"parseSegmentIndex",function(){return h}),D.d(z,"parseInitSegment",function(){return c}),D.d(z,"getStartDTS",function(){return s}),D.d(z,"getDuration",function(){return d}),D.d(z,"computeRawDurationFromSamples",function(){return i}),D.d(z,"offsetStartDTS",function(){return a}),D.d(z,"segmentValidRange",function(){return r}),D.d(z,"appendUint8Array",function(){return o});var V=D("./src/utils/typed-array.ts"),N=D("./src/loader/fragment.ts"),O=Math.pow(2,32)-1,K=[].push;function W(T){return String.fromCharCode.apply(null,T)}function n(T,w){"data"in T&&(w+=T.start,T=T.data);var x=T[w]<<8|T[w+1];return x<0?65536+x:x}function I(T,w){"data"in T&&(w+=T.start,T=T.data);var x=T[w]<<24|T[w+1]<<16|T[w+2]<<8|T[w+3];return x<0?4294967296+x:x}function g(T,w,x){"data"in T&&(w+=T.start,T=T.data),T[w]=x>>24,T[w+1]=x>>16&255,T[w+2]=x>>8&255,T[w+3]=x&255}function f(T,w){var x=[];if(!w.length)return x;var L,A,_;"data"in T?(L=T.data,A=T.start,_=T.end):(L=T,A=0,_=L.byteLength);for(var b=A;b<_;){var m=I(L,b),p=W(L.subarray(b+4,b+8)),C=m>1?b+m:_;if(p===w[0])if(w.length===1)x.push({data:L,start:b+8,end:C});else{var E=f({data:L,start:b+8,end:C},w.slice(1));E.length&&K.apply(x,E)}b=C}return x}function h(T){var w=f(T,["moov"]),x=w[0],L=x?x.end:null,A=f(T,["sidx"]);if(!A||!A[0])return null;var _=[],b=A[0],m=b.data[0],p=m===0?8:16,C=I(b,p);p+=4;var E=0,v=0;m===0?p+=8:p+=16,p+=2;var P=b.end+v,F=n(b,p);p+=2;for(var R=0;R<F;R++){var H=p,U=I(b,H);H+=4;var S=U&2147483647,G=(U&2147483648)>>>31;if(G===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var Q=I(b,H);H+=4,_.push({referenceSize:S,subsegmentDuration:Q,info:{duration:Q/C,start:P,end:P+S-1}}),P+=S,H+=4,p=H}return{earliestPresentationTime:E,timescale:C,version:m,referencesCount:F,references:_,moovEndOffset:L}}function c(T){for(var w=[],x=f(T,["moov","trak"]),L=0;L<x.length;L++){var A=x[L],_=f(A,["tkhd"])[0];if(_){var b=_.data[_.start],m=b===0?12:20,p=I(_,m),C=f(A,["mdia","mdhd"])[0];if(C){b=C.data[C.start],m=b===0?12:20;var E=I(C,m),v=f(A,["mdia","hdlr"])[0];if(v){var P=W(v.data.subarray(v.start+8,v.start+12)),F={soun:N.ElementaryStreamTypes.AUDIO,vide:N.ElementaryStreamTypes.VIDEO}[P];if(F){var R=f(A,["mdia","minf","stbl","stsd"])[0],H=void 0;R&&(H=W(R.data.subarray(R.start+12,R.start+16))),w[p]={timescale:E,type:F},w[F]={timescale:E,id:p,codec:H}}}}}}var U=f(T,["moov","mvex","trex"]);return U.forEach(function(S){var G=I(S,4),Q=w[G];Q&&(Q.default={duration:I(S,12),flags:I(S,20)})}),w}function s(T,w){return f(w,["moof","traf"]).reduce(function(x,L){var A=f(L,["tfdt"])[0],_=A.data[A.start],b=f(L,["tfhd"]).reduce(function(m,p){var C=I(p,4),E=T[C];if(E){var v=I(A,4);_===1&&(v*=Math.pow(2,32),v+=I(A,8));var P=E.timescale||9e4,F=v/P;if(isFinite(F)&&(m===null||F<m))return F}return m},null);return b!==null&&isFinite(b)&&(x===null||b<x)?b:x},null)||0}function d(T,w){for(var x=0,L=0,A=0,_=f(T,["moof","traf"]),b=0;b<_.length;b++){var m=_[b],p=f(m,["tfhd"])[0],C=I(p,4),E=w[C];if(!E)continue;var v=E.default,P=I(p,0)|(v==null?void 0:v.flags),F=v==null?void 0:v.duration;P&8&&(P&2?F=I(p,12):F=I(p,8));for(var R=E.timescale||9e4,H=f(m,["trun"]),U=0;U<H.length;U++){if(F){var S=I(H[U],4);x=F*S}else x=i(H[U]);E.type===N.ElementaryStreamTypes.VIDEO?L+=x/R:E.type===N.ElementaryStreamTypes.AUDIO&&(A+=x/R)}}if(L===0&&A===0){var G=h(T);if(G!=null&&G.references)return G.references.reduce(function(Q,se){return Q+se.info.duration||0},0)}return L||A}function i(T){var w=I(T,0),x=8;w&1&&(x+=4),w&4&&(x+=4);for(var L=0,A=I(T,4),_=0;_<A;_++){if(w&256){var b=I(T,x);L+=b,x+=4}w&512&&(x+=4),w&1024&&(x+=4),w&2048&&(x+=4)}return L}function a(T,w,x){f(w,["moof","traf"]).forEach(function(L){f(L,["tfhd"]).forEach(function(A){var _=I(A,4),b=T[_];if(!b)return;var m=b.timescale||9e4;f(L,["tfdt"]).forEach(function(p){var C=p.data[p.start],E=I(p,4);if(C===0)g(p,4,E-x*m);else{E*=Math.pow(2,32),E+=I(p,8),E-=x*m,E=Math.max(E,0);var v=Math.floor(E/(O+1)),P=Math.floor(E%(O+1));g(p,4,v),g(p,8,P)}})})})}function r(T){var w={valid:null,remainder:null},x=f(T,["moof"]);if(x){if(x.length<2)return w.remainder=T,w}else return w;var L=x[x.length-1];return w.valid=Object(V.sliceUint8)(T,0,L.start-8),w.remainder=Object(V.sliceUint8)(T,L.start-8),w}function o(T,w){var x=new Uint8Array(T.length+w.length);return x.set(T),x.set(w,T.length),x}},"./src/utils/output-filter.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"default",function(){return V});var V=function(){function N(K,W){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=K,this.trackName=W}var O=N.prototype;return O.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},O.newCue=function(W,n,I){(this.startTime===null||this.startTime>W)&&(this.startTime=W),this.endTime=n,this.screen=I,this.timelineController.createCaptionsTrack(this.trackName)},O.reset=function(){this.cueRanges=[]},N}()},"./src/utils/texttrack-utils.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"sendAddTrackEvent",function(){return N}),D.d(z,"addCueToTrack",function(){return O}),D.d(z,"clearCurrentCues",function(){return K}),D.d(z,"removeCuesInRange",function(){return W}),D.d(z,"getCuesInRange",function(){return I});var V=D("./src/utils/logger.ts");function N(g,f){var h;try{h=new Event("addtrack")}catch(c){h=document.createEvent("Event"),h.initEvent("addtrack",!1,!1)}h.track=g,f.dispatchEvent(h)}function O(g,f){var h=g.mode;if(h==="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){V.logger.debug("[texttrack-utils]: "+s);var c=new self.TextTrackCue(f.startTime,f.endTime,f.text);c.id=f.id,g.addCue(c)}h==="disabled"&&(g.mode=h)}function K(g){var f=g.mode;if(f==="disabled"&&(g.mode="hidden"),g.cues)for(var h=g.cues.length;h--;)g.removeCue(g.cues[h]);f==="disabled"&&(g.mode=f)}function W(g,f,h){var c=g.mode;if(c==="disabled"&&(g.mode="hidden"),g.cues&&g.cues.length>0)for(var s=I(g.cues,f,h),d=0;d<s.length;d++)g.removeCue(s[d]);c==="disabled"&&(g.mode=c)}function n(g,f){if(f<g[0].startTime)return 0;var h=g.length-1;if(f>g[h].endTime)return-1;for(var c=0,s=h;c<=s;){var d=Math.floor((s+c)/2);if(f<g[d].startTime)s=d-1;else if(f>g[d].startTime&&c<h)c=d+1;else return d}return g[c].startTime-f<f-g[s].startTime?c:s}function I(g,f,h){var c=[],s=n(g,f);if(s>-1)for(var d=s,i=g.length;d<i;d++){var a=g[d];if(a.startTime>=f&&a.endTime<=h)c.push(a);else if(a.startTime>h)return c}return c}},"./src/utils/time-ranges.ts":function(J,z,D){"use strict";D.r(z);var V={toString:function(O){for(var K="",W=O.length,n=0;n<W;n++)K+="["+O.start(n).toFixed(3)+","+O.end(n).toFixed(3)+"]";return K}};z.default=V},"./src/utils/timescale-conversion.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"toTimescaleFromBase",function(){return N}),D.d(z,"toTimescaleFromScale",function(){return O}),D.d(z,"toMsFromMpegTsClock",function(){return K}),D.d(z,"toMpegTsClockFromTimescale",function(){return W});var V=9e4;function N(n,I,g,f){g===void 0&&(g=1),f===void 0&&(f=!1);var h=n*I*g;return f?Math.round(h):h}function O(n,I,g,f){return g===void 0&&(g=1),f===void 0&&(f=!1),N(n,I,1/g,f)}function K(n,I){return I===void 0&&(I=!1),N(n,1e3,1/V,I)}function W(n,I){return I===void 0&&(I=1),N(n,V,1/I)}},"./src/utils/typed-array.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"sliceUint8",function(){return V});function V(N,O,K){return Uint8Array.prototype.slice?N.slice(O,K):new Uint8Array(Array.prototype.slice.call(N,O,K))}},"./src/utils/vttcue.ts":function(J,z,D){"use strict";D.r(z),z.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var V=["","lr","rl"],N=["start","middle","end","left","right"];function O(g,f){if(typeof f!="string")return!1;if(!Array.isArray(g))return!1;var h=f.toLowerCase();return~g.indexOf(h)?h:!1}function K(g){return O(V,g)}function W(g){return O(N,g)}function n(g){for(var f=arguments.length,h=new Array(f>1?f-1:0),c=1;c<f;c++)h[c-1]=arguments[c];for(var s=1;s<arguments.length;s++){var d=arguments[s];for(var i in d)g[i]=d[i]}return g}function I(g,f,h){var c=this,s={enumerable:!0};c.hasBeenReset=!1;var d="",i=!1,a=g,r=f,o=h,T=null,w="",x=!0,L="auto",A="start",_=50,b="middle",m=50,p="middle";Object.defineProperty(c,"id",n({},s,{get:function(){return d},set:function(E){d=""+E}})),Object.defineProperty(c,"pauseOnExit",n({},s,{get:function(){return i},set:function(E){i=!!E}})),Object.defineProperty(c,"startTime",n({},s,{get:function(){return a},set:function(E){if(typeof E!="number")throw new TypeError("Start time must be set to a number.");a=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"endTime",n({},s,{get:function(){return r},set:function(E){if(typeof E!="number")throw new TypeError("End time must be set to a number.");r=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"text",n({},s,{get:function(){return o},set:function(E){o=""+E,this.hasBeenReset=!0}})),Object.defineProperty(c,"region",n({},s,{get:function(){return T},set:function(E){T=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"vertical",n({},s,{get:function(){return w},set:function(E){var v=K(E);if(v===!1)throw new SyntaxError("An invalid or illegal string was specified.");w=v,this.hasBeenReset=!0}})),Object.defineProperty(c,"snapToLines",n({},s,{get:function(){return x},set:function(E){x=!!E,this.hasBeenReset=!0}})),Object.defineProperty(c,"line",n({},s,{get:function(){return L},set:function(E){if(typeof E!="number"&&E!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");L=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"lineAlign",n({},s,{get:function(){return A},set:function(E){var v=W(E);if(!v)throw new SyntaxError("An invalid or illegal string was specified.");A=v,this.hasBeenReset=!0}})),Object.defineProperty(c,"position",n({},s,{get:function(){return _},set:function(E){if(E<0||E>100)throw new Error("Position must be between 0 and 100.");_=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"positionAlign",n({},s,{get:function(){return b},set:function(E){var v=W(E);if(!v)throw new SyntaxError("An invalid or illegal string was specified.");b=v,this.hasBeenReset=!0}})),Object.defineProperty(c,"size",n({},s,{get:function(){return m},set:function(E){if(E<0||E>100)throw new Error("Size must be between 0 and 100.");m=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"align",n({},s,{get:function(){return p},set:function(E){var v=W(E);if(!v)throw new SyntaxError("An invalid or illegal string was specified.");p=v,this.hasBeenReset=!0}})),c.displayState=void 0}return I.prototype.getCueAsHTML=function(){var g=self.WebVTT;return g.convertCueToDOMTree(self,this.text)},I}()},"./src/utils/vttparser.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"parseTimeStamp",function(){return O}),D.d(z,"fixLineBreaks",function(){return f}),D.d(z,"VTTParser",function(){return h});var V=D("./src/utils/vttcue.ts"),N=function(){function c(){}var s=c.prototype;return s.decode=function(i,a){if(!i)return"";if(typeof i!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(i))},c}();function O(c){function s(i,a,r,o){return(i|0)*3600+(a|0)*60+(r|0)+parseFloat(o||0)}var d=c.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return d?parseFloat(d[2])>59?s(d[2],d[3],0,d[4]):s(d[1],d[2],d[3],d[4]):null}var K=function(){function c(){this.values=Object.create(null)}var s=c.prototype;return s.set=function(i,a){!this.get(i)&&a!==""&&(this.values[i]=a)},s.get=function(i,a,r){return r?this.has(i)?this.values[i]:a[r]:this.has(i)?this.values[i]:a},s.has=function(i){return i in this.values},s.alt=function(i,a,r){for(var o=0;o<r.length;++o)if(a===r[o]){this.set(i,a);break}},s.integer=function(i,a){/^-?\d+$/.test(a)&&this.set(i,parseInt(a,10))},s.percent=function(i,a){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(a)){var r=parseFloat(a);if(r>=0&&r<=100)return this.set(i,r),!0}return!1},c}();function W(c,s,d,i){var a=i?c.split(i):[c];for(var r in a){if(typeof a[r]!="string")continue;var o=a[r].split(d);if(o.length!==2)continue;var T=o[0],w=o[1];s(T,w)}}var n=new V.default(0,0,""),I=n.align==="middle"?"middle":"center";function g(c,s,d){var i=c;function a(){var T=O(c);if(T===null)throw new Error("Malformed timestamp: "+i);return c=c.replace(/^[^\sa-zA-Z-]+/,""),T}function r(T,w){var x=new K;W(T,function(_,b){var m;switch(_){case"region":for(var p=d.length-1;p>=0;p--)if(d[p].id===b){x.set(_,d[p].region);break}break;case"vertical":x.alt(_,b,["rl","lr"]);break;case"line":m=b.split(","),x.integer(_,m[0]),x.percent(_,m[0])&&x.set("snapToLines",!1),x.alt(_,m[0],["auto"]),m.length===2&&x.alt("lineAlign",m[1],["start",I,"end"]);break;case"position":m=b.split(","),x.percent(_,m[0]),m.length===2&&x.alt("positionAlign",m[1],["start",I,"end","line-left","line-right","auto"]);break;case"size":x.percent(_,b);break;case"align":x.alt(_,b,["start",I,"end","left","right"]);break}},/:/,/\s/),w.region=x.get("region",null),w.vertical=x.get("vertical","");var L=x.get("line","auto");L==="auto"&&n.line===-1&&(L=-1),w.line=L,w.lineAlign=x.get("lineAlign","start"),w.snapToLines=x.get("snapToLines",!0),w.size=x.get("size",100),w.align=x.get("align",I);var A=x.get("position","auto");A==="auto"&&n.position===50&&(A=w.align==="start"||w.align==="left"?0:w.align==="end"||w.align==="right"?100:50),w.position=A}function o(){c=c.replace(/^\s+/,"")}if(o(),s.startTime=a(),o(),c.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+i);c=c.substr(3),o(),s.endTime=a(),o(),r(c,s)}function f(c){return c.replace(/<br(?: \/)?>/gi,`
`)}var h=function(){function c(){this.state="INITIAL",this.buffer="",this.decoder=new N,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var s=c.prototype;return s.parse=function(i){var a=this;i&&(a.buffer+=a.decoder.decode(i,{stream:!0}));function r(){var A=a.buffer,_=0;for(A=f(A);_<A.length&&A[_]!=="\r"&&A[_]!==`
`;)++_;var b=A.substr(0,_);return A[_]==="\r"&&++_,A[_]===`
`&&++_,a.buffer=A.substr(_),b}function o(A){W(A,function(_,b){},/:/)}try{var T="";if(a.state==="INITIAL"){if(!/\r\n|\n/.test(a.buffer))return this;T=r();var w=T.match(/^()?WEBVTT([ \t].*)?$/);if(!w||!w[0])throw new Error("Malformed WebVTT signature.");a.state="HEADER"}for(var x=!1;a.buffer;){if(!/\r\n|\n/.test(a.buffer))return this;x?x=!1:T=r();switch(a.state){case"HEADER":/:/.test(T)?o(T):T||(a.state="ID");continue;case"NOTE":T||(a.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(T)){a.state="NOTE";break}if(!T)continue;if(a.cue=new V.default(0,0,""),a.state="CUE",T.indexOf("-->")===-1){a.cue.id=T;continue}case"CUE":if(!a.cue){a.state="BADCUE";continue}try{g(T,a.cue,a.regionList)}catch(A){a.cue=null,a.state="BADCUE";continue}a.state="CUETEXT";continue;case"CUETEXT":{var L=T.indexOf("-->")!==-1;if(!T||L&&(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+=T}continue;case"BADCUE":T||(a.state="ID")}}}catch(A){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 i=this;try{if((i.cue||i.state==="HEADER")&&(i.buffer+=`
`,i.parse()),i.state==="INITIAL"||i.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(a){i.onparsingerror&&i.onparsingerror(a)}return i.onflush&&i.onflush(),this},c}()},"./src/utils/webvtt-parser.ts":function(J,z,D){"use strict";D.r(z),D.d(z,"generateCueId",function(){return h}),D.d(z,"parseWebVTT",function(){return s});var V=D("./src/polyfills/number.ts"),N=D("./src/utils/vttparser.ts"),O=D("./src/demux/id3.ts"),K=D("./src/utils/timescale-conversion.ts"),W=D("./src/remux/mp4-remuxer.ts"),n=/\r\n|\n\r|\n|\r/g,I=function(i,a,r){return r===void 0&&(r=0),i.substr(r,a.length)===a},g=function(i){var a=parseInt(i.substr(-3)),r=parseInt(i.substr(-6,2)),o=parseInt(i.substr(-9,2)),T=i.length>9?parseInt(i.substr(0,i.indexOf(":"))):0;if(!Object(V.isFiniteNumber)(a)||!Object(V.isFiniteNumber)(r)||!Object(V.isFiniteNumber)(o)||!Object(V.isFiniteNumber)(T))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+i);return a+=1e3*r,a+=60*1e3*o,a+=60*60*1e3*T,a},f=function(i){for(var a=5381,r=i.length;r;)a=a*33^i.charCodeAt(--r);return(a>>>0).toString()};function h(d,i,a){return f(d.toString())+f(i.toString())+f(a)}var c=function(i,a,r){var o=i[a],T=i[o.prevCC];if(!T||!T.new&&o.new){i.ccOffset=i.presentationOffset=o.start,o.new=!1;return}for(;(w=T)!==null&&w!==void 0&&w.new;){var w;i.ccOffset+=o.start-T.start,o.new=!1,o=T,T=i[o.prevCC]}i.presentationOffset=r};function s(d,i,a,r,o,T,w,x){var L=new N.VTTParser,A=Object(O.utf8ArrayToStr)(new Uint8Array(d)).trim().replace(n,`
`).split(`
`),_=[],b=Object(K.toMpegTsClockFromTimescale)(i,a),m="00:00.000",p=0,C=0,E,v=!0,P=!1;L.oncue=function(F){var R=r[o],H=r.ccOffset,U=(p-b)/9e4;if(R!=null&&R.new&&(C!==void 0?H=r.ccOffset=R.start:c(r,o,U)),U&&(H=U-r.presentationOffset),P){var S=F.endTime-F.startTime,G=Object(W.normalizePts)((F.startTime+H-C)*9e4,T*9e4)/9e4;F.startTime=G,F.endTime=G+S}var Q=F.text.trim();F.text=decodeURIComponent(encodeURIComponent(Q)),F.id||(F.id=h(F.startTime,F.endTime,Q)),F.endTime>0&&_.push(F)},L.onparsingerror=function(F){E=F},L.onflush=function(){if(E){x(E);return}w(_)},A.forEach(function(F){if(v)if(I(F,"X-TIMESTAMP-MAP=")){v=!1,P=!0,F.substr(16).split(",").forEach(function(R){I(R,"LOCAL:")?m=R.substr(6):I(R,"MPEGTS:")&&(p=parseInt(R.substr(7)))});try{C=g(m)/1e3}catch(R){P=!1,E=R}return}else F===""&&(v=!1);L.parse(F+`
`)}),L.flush()}},"./src/utils/xhr-loader.ts":function(J,z,D){"use strict";D.r(z);var V=D("./src/utils/logger.ts"),N=D("./src/loader/load-stats.ts"),O=/^age:\s*[\d.]+\s*$/m,K=function(){function W(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 N.LoadStats,this.retryDelay=0}var n=W.prototype;return n.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},n.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()))},n.abort=function(){var g;this.abortInternal(),(g=this.callbacks)!==null&&g!==void 0&&g.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},n.load=function(g,f,h){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=h,this.retryDelay=f.retryDelay,this.loadInternal()},n.loadInternal=function(){var g=this.config,f=this.context;if(!g)return;var h=this.loader=new self.XMLHttpRequest,c=this.stats;c.loading.first=0,c.loaded=0;var s=this.xhrSetup;try{if(s)try{s(h,f.url)}catch(a){h.open("GET",f.url,!0),s(h,f.url)}h.readyState||h.open("GET",f.url,!0);var d=this.context.headers;if(d)for(var i in d)h.setRequestHeader(i,d[i])}catch(a){this.callbacks.onError({code:h.status,text:a.message},f,h);return}f.rangeEnd&&h.setRequestHeader("Range","bytes="+f.rangeStart+"-"+(f.rangeEnd-1)),h.onreadystatechange=this.readystatechange.bind(this),h.onprogress=this.loadprogress.bind(this),h.responseType=f.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),g.timeout),h.send()},n.readystatechange=function(){var g=this.context,f=this.loader,h=this.stats;if(!g||!f)return;var c=f.readyState,s=this.config;if(h.aborted)return;if(c>=2)if(self.clearTimeout(this.requestTimeout),h.loading.first===0&&(h.loading.first=Math.max(self.performance.now(),h.loading.start)),c===4){f.onreadystatechange=null,f.onprogress=null;var d=f.status;if(d>=200&&d<300){h.loading.end=Math.max(self.performance.now(),h.loading.first);var i,a;if(g.responseType==="arraybuffer"?(i=f.response,a=i.byteLength):(i=f.responseText,a=i.length),h.loaded=h.total=a,!this.callbacks)return;var r=this.callbacks.onProgress;if(r&&r(h,g,i,f),!this.callbacks)return;var o={url:f.responseURL,data:i};this.callbacks.onSuccess(o,h,g,f)}else h.retry>=s.maxRetry||d>=400&&d<499?(V.logger.error(d+" while loading "+g.url),this.callbacks.onError({code:d,text:f.statusText},g,f)):(V.logger.warn(d+" 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),h.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.timeout)},n.loadtimeout=function(){V.logger.warn("timeout while loading "+this.context.url);var g=this.callbacks;g&&(this.abortInternal(),g.onTimeout(this.stats,this.context,this.loader))},n.loadprogress=function(g){var f=this.stats;f.loaded=g.loaded,g.lengthComputable&&(f.total=g.total)},n.getCacheAge=function(){var g=null;if(this.loader&&O.test(this.loader.getAllResponseHeaders())){var f=this.loader.getResponseHeader("age");g=f?parseFloat(f):null}return g},W}();z.default=K}}).default})},vHTk:function(Ue,de,M){Ue.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(Ue,de,M){"use strict";M.d(de,"a",function(){return ut});var J=M("rePB"),z=M("VTBJ"),D=M("KQm4"),V=M("U8pU"),N=M("ODXe"),O=M("q1tI"),K=M("TSYQ"),W=M.n(K),n=M("Gytx"),I=M.n(n),g=M("Kwbf"),f=M("t23M"),h=M("qx4F"),c=M("6eGT"),s=M("IBYe"),d=M("Ff2n"),i=M("c+Xe"),a=M("fyJ8"),r=M("biw7");function o(Ie,Re,$e,Ze,ue){var q=$e[Ie]||{},te=$e[Re]||{},ae,ce;q.fixed==="left"?ae=Ze.left[Ie]:te.fixed==="right"&&(ce=Ze.right[Re]);var ie=!1,oe=!1,he=!1,ge=!1,_e=$e[Re+1],Oe=$e[Ie-1];if(ue==="rtl"){if(ae!==void 0){var Ge=Oe&&Oe.fixed==="left";ge=!Ge}else if(ce!==void 0){var et=_e&&_e.fixed==="right";he=!et}}else if(ae!==void 0){var ct=_e&&_e.fixed==="left";ie=!ct}else if(ce!==void 0){var st=Oe&&Oe.fixed==="right";oe=!st}return{fixLeft:ae,fixRight:ce,lastFixLeft:ie,firstFixRight:oe,lastFixRight:he,firstFixLeft:ge,isSticky:Ze.isSticky}}var T=M("sR1s");function w(Ie){var Re=Ie.cells,$e=Ie.stickyOffsets,Ze=Ie.flattenColumns,ue=Ie.rowComponent,q=Ie.cellComponent,te=Ie.onHeaderRow,ae=Ie.index,ce=O.useContext(r.a),ie=ce.prefixCls,oe=ce.direction,he;te&&(he=te(Re.map(function(_e){return _e.column}),ae));var ge=Object(T.a)(Re.map(function(_e){return _e.column}));return O.createElement(ue,Object.assign({},he),Re.map(function(_e,Oe){var Ge=_e.column,et=o(_e.colStart,_e.colEnd,Ze,$e,oe),ct;return Ge&&Ge.onHeaderCell&&(ct=_e.column.onHeaderCell(Ge)),O.createElement(a.a,Object.assign({},_e,{ellipsis:Ge.ellipsis,align:Ge.align,component:q,prefixCls:ie,key:ge[Oe]},et,{additionalProps:ct,rowType:"header"}))}))}w.displayName="HeaderRow";var x=w;function L(Ie){var Re=[];function $e(te,ae){var ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Re[ce]=Re[ce]||[];var ie=ae,oe=te.filter(Boolean).map(function(he){var ge={key:he.key,className:he.className||"",children:he.title,column:he,colStart:ie},_e=1,Oe=he.children;return Oe&&Oe.length>0&&(_e=$e(Oe,ie,ce+1).reduce(function(Ge,et){return Ge+et},0),ge.hasSubColumns=!0),"colSpan"in he&&(_e=he.colSpan),"rowSpan"in he&&(ge.rowSpan=he.rowSpan),ge.colSpan=_e,ge.colEnd=ge.colStart+_e-1,Re[ce].push(ge),ie+=_e,_e});return oe}$e(Ie,0);for(var Ze=Re.length,ue=function(ae){Re[ae].forEach(function(ce){!("rowSpan"in ce)&&!ce.hasSubColumns&&(ce.rowSpan=Ze-ae)})},q=0;q<Ze;q+=1)ue(q);return Re}function A(Ie){var Re=Ie.stickyOffsets,$e=Ie.columns,Ze=Ie.flattenColumns,ue=Ie.onHeaderRow,q=O.useContext(r.a),te=q.prefixCls,ae=q.getComponent,ce=O.useMemo(function(){return L($e)},[$e]),ie=ae(["header","wrapper"],"thead"),oe=ae(["header","row"],"tr"),he=ae(["header","cell"],"th");return O.createElement(ie,{className:"".concat(te,"-thead")},ce.map(function(ge,_e){var Oe=O.createElement(x,{key:_e,flattenColumns:Ze,cells:ge,stickyOffsets:Re,rowComponent:oe,cellComponent:he,onHeaderRow:ue,index:_e});return Oe}))}var _=A,b=M("hW8S");function m(Ie){for(var Re=Ie.colWidths,$e=Ie.columns,Ze=Ie.columCount,ue=[],q=Ze||$e.length,te=!1,ae=q-1;ae>=0;ae-=1){var ce=Re[ae],ie=$e&&$e[ae],oe=ie&&ie[b.a];(ce||oe||te)&&(ue.unshift(O.createElement("col",Object.assign({key:ae,style:{width:ce,minWidth:ce}},oe))),te=!0)}return O.createElement("colgroup",null,ue)}var p=m;function C(Ie,Re){return Object(O.useMemo)(function(){for(var $e=[],Ze=0;Ze<Re;Ze+=1){var ue=Ie[Ze];if(ue!==void 0)$e[Ze]=ue;else return null}return $e},[Ie.join("_"),Re])}var E=O.forwardRef(function(Ie,Re){var $e=Ie.noData,Ze=Ie.columns,ue=Ie.flattenColumns,q=Ie.colWidths,te=Ie.columCount,ae=Ie.stickyOffsets,ce=Ie.direction,ie=Ie.fixHeader,oe=Ie.offsetHeader,he=Ie.stickyClassName,ge=Ie.onScroll,_e=Object(d.a)(Ie,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),Oe=O.useContext(r.a),Ge=Oe.prefixCls,et=Oe.scrollbarSize,ct=Oe.isSticky,st=ct&&!ie?0:et,nt=O.useRef(null),We=O.useCallback(function(it){Object(i.b)(Re,it),Object(i.b)(nt,it)},[]);O.useEffect(function(){var it;function ot(Ke){var Je=Ke.currentTarget,Qe=Ke.deltaX;Qe&&(ge({currentTarget:Je,scrollLeft:Je.scrollLeft+Qe}),Ke.preventDefault())}return(it=nt.current)===null||it===void 0||it.addEventListener("wheel",ot),function(){var Ke;(Ke=nt.current)===null||Ke===void 0||Ke.removeEventListener("wheel",ot)}},[]);var Ve=ue[ue.length-1],Ne={fixed:Ve?Ve.fixed:null,onHeaderCell:function(){return{className:"".concat(Ge,"-cell-scrollbar")}}},pe=Object(O.useMemo)(function(){return st?[].concat(Object(D.a)(Ze),[Ne]):Ze},[st,Ze]),xe=Object(O.useMemo)(function(){return st?[].concat(Object(D.a)(ue),[Ne]):ue},[st,ue]),Xe=Object(O.useMemo)(function(){var it=ae.right,ot=ae.left;return Object(z.a)(Object(z.a)({},ae),{},{left:ce==="rtl"?[].concat(Object(D.a)(ot.map(function(Ke){return Ke+st})),[0]):ot,right:ce==="rtl"?it:[].concat(Object(D.a)(it.map(function(Ke){return Ke+st})),[0]),isSticky:ct})},[st,ae,ct]),je=C(q,te);return O.createElement("div",{style:Object(z.a)({overflow:"hidden"},ct?{top:oe}:{}),ref:We,className:W()("".concat(Ge,"-header"),Object(J.a)({},he,!!he))},O.createElement("table",{style:{tableLayout:"fixed",visibility:$e||je?null:"hidden"}},O.createElement(p,{colWidths:je?[].concat(Object(D.a)(je),[st]):[],columCount:te+1,columns:xe}),O.createElement(_,Object.assign({},_e,{stickyOffsets:Xe,columns:pe,flattenColumns:xe}))))});E.displayName="FixedHeader";var v=E,P=O.createContext(null),F=P;function R(Ie){var Re=Ie.prefixCls,$e=Ie.children,Ze=Ie.component,ue=Ie.cellComponent,q=Ie.fixHeader,te=Ie.fixColumn,ae=Ie.horizonScroll,ce=Ie.className,ie=Ie.expanded,oe=Ie.componentWidth,he=Ie.colSpan,ge=O.useContext(r.a),_e=ge.scrollbarSize;return O.useMemo(function(){var Oe=$e;return te&&(Oe=O.createElement("div",{style:{width:oe-(q?_e:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Re,"-expanded-row-fixed")},Oe)),O.createElement(Ze,{className:ce,style:{display:ie?null:"none"}},O.createElement(a.a,{component:ue,prefixCls:Re,colSpan:he},Oe))},[$e,Ze,q,ae,ce,ie,oe,he,_e])}var H=R;function U(Ie){var Re=Ie.className,$e=Ie.style,Ze=Ie.record,ue=Ie.index,q=Ie.rowKey,te=Ie.getRowKey,ae=Ie.rowExpandable,ce=Ie.expandedKeys,ie=Ie.onRow,oe=Ie.indent,he=oe===void 0?0:oe,ge=Ie.rowComponent,_e=Ie.cellComponent,Oe=Ie.childrenColumnName,Ge=O.useContext(r.a),et=Ge.prefixCls,ct=Ge.fixedInfoList,st=O.useContext(F),nt=st.fixHeader,We=st.fixColumn,Ve=st.horizonScroll,Ne=st.componentWidth,pe=st.flattenColumns,xe=st.expandableType,Xe=st.expandRowByClick,je=st.onTriggerExpand,it=st.rowClassName,ot=st.expandedRowClassName,Ke=st.indentSize,Je=st.expandIcon,Qe=st.expandedRowRender,pt=st.expandIconColumnIndex,dt=O.useState(!1),Vt=Object(N.a)(dt,2),rn=Vt[0],an=Vt[1],ft=ce&&ce.has(Ie.recordKey);O.useEffect(function(){ft&&an(!0)},[ft]);var Wt=xe==="row"&&(!ae||ae(Ze)),Xt=xe==="nest",Ot=Oe&&Ze&&Ze[Oe],Mt=Wt||Xt,Ft;ie&&(Ft=ie(Ze,ue));var On=function(Dt){if(Xe&&Mt&&je(Ze,Dt),Ft&&Ft.onClick){for(var ze,Fe=arguments.length,Pt=new Array(Fe>1?Fe-1:0),Yt=1;Yt<Fe;Yt++)Pt[Yt-1]=arguments[Yt];(ze=Ft).onClick.apply(ze,[Dt].concat(Pt))}},vn;typeof it=="string"?vn=it:typeof it=="function"&&(vn=it(Ze,ue,he));var rt=Object(T.a)(pe),vt=O.createElement(ge,Object.assign({},Ft,{"data-row-key":q,className:W()(Re,"".concat(et,"-row"),"".concat(et,"-row-level-").concat(he),vn,Ft&&Ft.className),style:Object(z.a)(Object(z.a)({},$e),Ft?Ft.style:null),onClick:On}),pe.map(function(Wn,Dt){var ze=Wn.render,Fe=Wn.dataIndex,Pt=Wn.className,Yt=rt[Dt],Tn=ct[Dt],yn;Dt===(pt||0)&&Xt&&(yn=O.createElement(O.Fragment,null,O.createElement("span",{style:{paddingLeft:"".concat(Ke*he,"px")},className:"".concat(et,"-row-indent indent-level-").concat(he)}),Je({prefixCls:et,expanded:ft,expandable:Ot,record:Ze,onExpand:je})));var cn;return Wn.onCell&&(cn=Wn.onCell(Ze,ue)),O.createElement(a.a,Object.assign({className:Pt,ellipsis:Wn.ellipsis,align:Wn.align,component:_e,prefixCls:et,key:Yt,record:Ze,index:ue,dataIndex:Fe,render:ze,shouldCellUpdate:Wn.shouldCellUpdate},Tn,{appendNode:yn,additionalProps:cn}))})),zn;if(Wt&&(rn||ft)){var Tr=Qe(Ze,ue,he+1,ft),vr=ot&&ot(Ze,ue,he);zn=O.createElement(H,{expanded:ft,className:W()("".concat(et,"-expanded-row"),"".concat(et,"-expanded-row-level-").concat(he+1),vr),prefixCls:et,fixHeader:nt,fixColumn:We,horizonScroll:Ve,component:ge,componentWidth:Ne,cellComponent:_e,colSpan:pe.length},Tr)}var Fr;return Ot&&ft&&(Fr=(Ze[Oe]||[]).map(function(Wn,Dt){var ze=te(Wn,Dt);return O.createElement(U,Object.assign({},Ie,{key:ze,rowKey:ze,record:Wn,recordKey:ze,index:Dt,indent:he+1}))})),O.createElement(O.Fragment,null,vt,zn,Fr)}U.displayName="BodyRow";var S=U,G=O.createContext(null),Q=G;function se(Ie){var Re=Ie.columnKey,$e=Ie.onColumnResize,Ze=O.useRef();return O.useEffect(function(){Ze.current&&$e(Re,Ze.current.offsetWidth)},[]),O.createElement(f.a,{onResize:function(q){var te=q.offsetWidth;$e(Re,te)}},O.createElement("td",{ref:Ze,style:{padding:0,border:0,height:0}},O.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function fe(Ie){var Re=Ie.data,$e=Ie.getRowKey,Ze=Ie.measureColumnWidth,ue=Ie.expandedKeys,q=Ie.onRow,te=Ie.rowExpandable,ae=Ie.emptyNode,ce=Ie.childrenColumnName,ie=O.useContext(Q),oe=ie.onColumnResize,he=O.useContext(r.a),ge=he.prefixCls,_e=he.getComponent,Oe=O.useContext(F),Ge=Oe.fixHeader,et=Oe.horizonScroll,ct=Oe.flattenColumns,st=Oe.componentWidth;return O.useMemo(function(){var nt=_e(["body","wrapper"],"tbody"),We=_e(["body","row"],"tr"),Ve=_e(["body","cell"],"td"),Ne;Re.length?Ne=Re.map(function(xe,Xe){var je=$e(xe,Xe);return O.createElement(S,{key:je,rowKey:je,record:xe,recordKey:je,index:Xe,rowComponent:We,cellComponent:Ve,expandedKeys:ue,onRow:q,getRowKey:$e,rowExpandable:te,childrenColumnName:ce})}):Ne=O.createElement(H,{expanded:!0,className:"".concat(ge,"-placeholder"),prefixCls:ge,fixHeader:Ge,fixColumn:et,horizonScroll:et,component:We,componentWidth:st,cellComponent:Ve,colSpan:ct.length},ae);var pe=Object(T.a)(ct);return O.createElement(nt,{className:"".concat(ge,"-tbody")},Ze&&O.createElement("tr",{"aria-hidden":"true",className:"".concat(ge,"-measure-row"),style:{height:0}},pe.map(function(xe){return O.createElement(se,{key:xe,columnKey:xe,onColumnResize:oe})})),Ne)},[Re,ge,q,Ze,ue,$e,_e,st,ae,ct])}var we=O.memo(fe);we.displayName="Body";var be=we,Se=M("wRmb"),Ae=M("xEkU"),De=M.n(Ae);function ve(Ie){var Re=Object(O.useRef)(Ie),$e=Object(O.useState)({}),Ze=Object(N.a)($e,2),ue=Ze[1],q=Object(O.useRef)(null),te=Object(O.useRef)([]);function ae(ce){q.current===null&&(te.current=[],q.current=De()(function(){te.current.forEach(function(ie){Re.current=ie(Re.current)}),q.current=null,ue({})})),te.current.push(ce)}return Object(O.useEffect)(function(){return function(){De.a.cancel(q.current)}},[]),[Re.current,ae]}function Y(Ie){var Re=Object(O.useRef)(Ie),$e=Object(O.useRef)(null);function Ze(){window.clearTimeout($e.current)}function ue(te){Re.current=te,Ze(),$e.current=window.setTimeout(function(){Re.current=null,$e.current=null},100)}function q(){return Re.current}return Object(O.useEffect)(function(){return Ze},[]),[ue,q]}function k(Ie,Re,$e){var Ze=Object(O.useMemo)(function(){for(var ue=[],q=[],te=0,ae=0,ce=0;ce<Re;ce+=1)if($e==="rtl"){q[ce]=ae,ae+=Ie[ce]||0;var ie=Re-ce-1;ue[ie]=te,te+=Ie[ie]||0}else{ue[ce]=te,te+=Ie[ce]||0;var oe=Re-ce-1;q[oe]=ae,ae+=Ie[oe]||0}return{left:ue,right:q}},[Ie,Re,$e]);return Ze}var B=k;function Z(Ie){var Re=Ie.className,$e=Ie.children;return O.createElement("div",{className:Re},$e)}var re=Z,X=M("n6Qo");function ye(Ie){var Re,$e=Ie.prefixCls,Ze=Ie.record,ue=Ie.onExpand,q=Ie.expanded,te=Ie.expandable,ae="".concat($e,"-row-expand-icon");if(!te)return O.createElement("span",{className:W()(ae,"".concat($e,"-row-spaced"))});var ce=function(oe){ue(Ze,oe),oe.stopPropagation()};return O.createElement("span",{className:W()(ae,(Re={},Object(J.a)(Re,"".concat($e,"-row-expanded"),q),Object(J.a)(Re,"".concat($e,"-row-collapsed"),!q),Re)),onClick:ce})}function Me(Ie,Re,$e){var Ze=[];function ue(q){(q||[]).forEach(function(te,ae){Ze.push(Re(te,ae)),ue(te[$e])})}return ue(Ie),Ze}var He=M("zT1h"),me=M("y0+3"),Ee=function(Re,$e){var Ze,ue,q=Re.scrollBodyRef,te=Re.onScroll,ae=Re.offsetScroll,ce=O.useContext(r.a),ie=ce.prefixCls,oe=((Ze=q.current)===null||Ze===void 0?void 0:Ze.scrollWidth)||0,he=((ue=q.current)===null||ue===void 0?void 0:ue.clientWidth)||0,ge=oe&&he*(he/oe),_e=O.useRef(),Oe=ve({scrollLeft:0,isHiddenScrollBar:!1}),Ge=Object(N.a)(Oe,2),et=Ge[0],ct=Ge[1],st=O.useRef({delta:0,x:0}),nt=O.useState(!1),We=Object(N.a)(nt,2),Ve=We[0],Ne=We[1],pe=function(){Ne(!1)},xe=function(Ke){Ke.persist(),st.current.delta=Ke.pageX-et.scrollLeft,st.current.x=0,Ne(!0),Ke.preventDefault()},Xe=function(Ke){var Je,Qe=Ke||((Je=window)===null||Je===void 0?void 0:Je.event),pt=Qe.buttons;if(!Ve||pt===0){Ve&&Ne(!1);return}var dt=st.current.x+Ke.pageX-st.current.x-st.current.delta;dt<=0&&(dt=0),dt+ge>=he&&(dt=he-ge),te({scrollLeft:dt/he*(oe+2)}),st.current.x=Ke.pageX},je=function(){var Ke=Object(me.b)(q.current).top,Je=Ke+q.current.offsetHeight,Qe=document.documentElement.scrollTop+window.innerHeight;Je-Object(h.a)()<=Qe||Ke>=Qe-ae?ct(function(pt){return Object(z.a)(Object(z.a)({},pt),{},{isHiddenScrollBar:!0})}):ct(function(pt){return Object(z.a)(Object(z.a)({},pt),{},{isHiddenScrollBar:!1})})},it=function(Ke){ct(function(Je){return Object(z.a)(Object(z.a)({},Je),{},{scrollLeft:Ke/oe*he||0})})};return O.useImperativeHandle($e,function(){return{setScrollLeft:it}}),O.useEffect(function(){var ot=Object(He.a)(document.body,"mouseup",pe,!1),Ke=Object(He.a)(document.body,"mousemove",Xe,!1);return je(),function(){ot.remove(),Ke.remove()}},[ge,Ve]),O.useEffect(function(){var ot=Object(He.a)(window,"scroll",je,!1),Ke=Object(He.a)(window,"resize",je,!1);return function(){ot.remove(),Ke.remove()}},[]),O.useEffect(function(){et.isHiddenScrollBar||ct(function(ot){var Ke,Je;return Object(z.a)(Object(z.a)({},ot),{},{scrollLeft:q.current.scrollLeft/((Ke=q.current)===null||Ke===void 0?void 0:Ke.scrollWidth)*((Je=q.current)===null||Je===void 0?void 0:Je.clientWidth)})})},[et.isHiddenScrollBar]),oe<=he||!ge||et.isHiddenScrollBar?null:O.createElement("div",{style:{height:Object(h.a)(),width:he,bottom:ae},className:"".concat(ie,"-sticky-scroll")},O.createElement("div",{onMouseDown:xe,ref:_e,className:W()("".concat(ie,"-sticky-scroll-bar"),Object(J.a)({},"".concat(ie,"-sticky-scroll-bar-active"),Ve)),style:{width:"".concat(ge,"px"),transform:"translate3d(".concat(et.scrollLeft,"px, 0, 0)")}}))},Le=O.forwardRef(Ee);function Pe(Ie,Re){return O.useMemo(function(){var $e=!!Ie;return{isSticky:$e,stickyClassName:$e?"".concat(Re,"-sticky-header"):"",offsetHeader:Object(V.a)(Ie)==="object"&&Ie.offsetHeader||0,offsetScroll:Object(V.a)(Ie)==="object"&&Ie.offsetScroll||0}},[Ie,Re])}var Ye=[],tt={},ut="rc-table-internal-hook",lt=O.memo(function(Ie){var Re=Ie.children;return Re},function(Ie,Re){return I()(Ie.props,Re.props)?Ie.pingLeft!==Re.pingLeft||Ie.pingRight!==Re.pingRight:!1});function gt(Ie){var Re,$e=Ie.prefixCls,Ze=Ie.className,ue=Ie.rowClassName,q=Ie.style,te=Ie.data,ae=Ie.rowKey,ce=Ie.scroll,ie=Ie.tableLayout,oe=Ie.direction,he=Ie.title,ge=Ie.footer,_e=Ie.summary,Oe=Ie.id,Ge=Ie.showHeader,et=Ie.components,ct=Ie.emptyText,st=Ie.onRow,nt=Ie.onHeaderRow,We=Ie.internalHooks,Ve=Ie.transformColumns,Ne=Ie.internalRefs,pe=Ie.sticky,xe=te||Ye,Xe=!!xe.length,je=O.useState(0),it=Object(N.a)(je,2),ot=it[0],Ke=it[1];O.useEffect(function(){Ke(Object(h.a)())});var Je=O.useMemo(function(){return Object(T.c)(et,{})},[et]),Qe=O.useCallback(function(xn,dn){return Object(T.b)(Je,xn)||dn},[Je]),pt=O.useMemo(function(){return typeof ae=="function"?ae:function(xn){var dn=xn&&xn[ae];return dn}},[ae]),dt=Object(b.c)(Ie),Vt=dt.expandIcon,rn=dt.expandedRowKeys,an=dt.defaultExpandedRowKeys,ft=dt.defaultExpandAllRows,Wt=dt.expandedRowRender,Xt=dt.onExpand,Ot=dt.onExpandedRowsChange,Mt=dt.expandRowByClick,Ft=dt.rowExpandable,On=dt.expandIconColumnIndex,vn=dt.expandedRowClassName,rt=dt.childrenColumnName,vt=dt.indentSize,zn=Vt||ye,Tr=rt||"children",vr=O.useMemo(function(){return Wt?"row":Ie.expandable&&We===ut&&Ie.expandable.__PARENT_RENDER_ICON__||xe.some(function(xn){return xn&&Object(V.a)(xn)==="object"&&xn[Tr]})?"nest":!1},[!!Wt,xe]),Fr=O.useState(function(){return an||(ft?Me(xe,pt,Tr):[])}),Wn=Object(N.a)(Fr,2),Dt=Wn[0],ze=Wn[1],Fe=O.useMemo(function(){return new Set(rn||Dt||[])},[rn,Dt]),Pt=O.useCallback(function(xn){var dn=pt(xn,xe.indexOf(xn)),fn,pr=Fe.has(dn);pr?(Fe.delete(dn),fn=Object(D.a)(Fe)):fn=[].concat(Object(D.a)(Fe),[dn]),ze(fn),Xt&&Xt(!pr,xn),Ot&&Ot(fn)},[pt,Fe,xe,Xt,Ot]),Yt=O.useState(0),Tn=Object(N.a)(Yt,2),yn=Tn[0],cn=Tn[1],$t=Object(Se.b)(Object(z.a)(Object(z.a)(Object(z.a)({},Ie),dt),{},{expandable:!!Wt,expandedKeys:Fe,getRowKey:pt,onTriggerExpand:Pt,expandIcon:zn,expandIconColumnIndex:On,direction:oe}),We===ut?Ve:null),It=Object(N.a)($t,2),Nt=It[0],Ht=It[1],kt=O.useMemo(function(){return{columns:Nt,flattenColumns:Ht}},[Nt,Ht]),on=O.useRef(),yt=O.useRef(),mn=O.useRef(),tn=O.useState(!1),kn=Object(N.a)(tn,2),jt=kn[0],Nn=kn[1],jn=O.useState(!1),Ln=Object(N.a)(jn,2),Sn=Ln[0],Mn=Ln[1],ir=ve(new Map),cr=Object(N.a)(ir,2),Yn=cr[0],An=cr[1],dr=Object(T.a)(Ht),gn=dr.map(function(xn){return Yn.get(xn)}),bn=O.useMemo(function(){return gn},[gn.join("_")]),_n=B(bn,Ht.length,oe),Jt=ce&&Object(T.d)(ce.y),wt=ce&&Object(T.d)(ce.x),Kt=wt&&Ht.some(function(xn){var dn=xn.fixed;return dn}),xt=O.useRef(),sn=Pe(pe,$e),Bt=sn.isSticky,ar=sn.offsetHeader,Un=sn.offsetScroll,hr=sn.stickyClassName,Zr,Pr,zr;Jt&&(Pr={overflowY:"scroll",maxHeight:ce.y}),wt&&(Zr={overflowX:"auto"},Jt||(Pr={overflowY:"hidden"}),zr={width:ce.x===!0?"auto":ce.x,minWidth:"100%"});var kr=O.useCallback(function(xn,dn){An(function(fn){var pr=new Map(fn);return pr.set(xn,dn),pr})},[]),Ar=Y(null),Kr=Object(N.a)(Ar,2),Hn=Kr[0],Rt=Kr[1];function Vr(xn,dn){if(!dn)return;typeof dn=="function"?dn(xn):dn.scrollLeft!==xn&&(dn.scrollLeft=xn)}var yr=function(dn){var fn=dn.currentTarget,pr=dn.scrollLeft,Qr=typeof pr=="number"?pr:fn.scrollLeft,qr=fn||tt;if(!Rt()||Rt()===qr){var ri;Hn(qr),Vr(Qr,yt.current),Vr(Qr,mn.current),Vr(Qr,(ri=xt.current)===null||ri===void 0?void 0:ri.setScrollLeft)}if(fn){var Ti=fn.scrollWidth,nn=fn.clientWidth;Nn(Qr>0),Mn(Qr<Ti-nn)}},ni=function(){mn.current&&yr({currentTarget:mn.current})},Ct=function(dn){var fn=dn.width;ni(),cn(on.current?on.current.offsetWidth:fn)};O.useEffect(function(){return ni},[]),O.useEffect(function(){wt&&ni()},[wt]),O.useEffect(function(){We===ut&&Ne&&(Ne.body.current=mn.current)});var Gt=Qe(["table"],"table"),Lt=O.useMemo(function(){return ie||(Kt?ce.x==="max-content"?"auto":"fixed":Jt||Ht.some(function(xn){var dn=xn.ellipsis;return dn})?"fixed":"auto")},[Jt,Kt,Ht,ie]),Zt,qt={colWidths:bn,columCount:Ht.length,stickyOffsets:_n,onHeaderRow:nt,fixHeader:Jt},wn=O.useMemo(function(){return Xe?null:typeof ct=="function"?ct():ct},[Xe,ct]),ln=O.createElement(be,{data:xe,measureColumnWidth:Jt||wt||Bt,expandedKeys:Fe,rowExpandable:Ft,getRowKey:pt,onRow:st,emptyNode:wn,childrenColumnName:Tr}),Fn=O.createElement(p,{colWidths:Ht.map(function(xn){var dn=xn.width;return dn}),columns:Ht}),tr=_e&&O.createElement(X.b,null,_e(xe)),Qt=Qe(["body"]);if(Jt||Bt){var br;typeof Qt=="function"?(br=Qt(xe,{scrollbarSize:ot,ref:mn,onScroll:yr}),qt.colWidths=Ht.map(function(xn,dn){var fn=xn.width,pr=dn===Nt.length-1?fn-ot:fn;return typeof pr=="number"&&!Number.isNaN(pr)?pr:(Object(g.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):br=O.createElement("div",{style:Object(z.a)(Object(z.a)({},Zr),Pr),onScroll:yr,ref:mn,className:W()("".concat($e,"-body"))},O.createElement(Gt,{style:Object(z.a)(Object(z.a)({},zr),{},{tableLayout:Lt})},Fn,ln,tr),Bt&&O.createElement(Le,{ref:xt,offsetScroll:Un,scrollBodyRef:mn,onScroll:yr})),Zt=O.createElement(O.Fragment,null,Ge!==!1&&O.createElement(v,Object.assign({noData:!xe.length},qt,kt,{direction:oe,offsetHeader:ar,stickyClassName:hr,ref:yt,onScroll:yr})),br)}else Zt=O.createElement("div",{style:Object(z.a)(Object(z.a)({},Zr),Pr),className:W()("".concat($e,"-content")),onScroll:yr,ref:mn},O.createElement(Gt,{style:Object(z.a)(Object(z.a)({},zr),{},{tableLayout:Lt})},Fn,Ge!==!1&&O.createElement(_,Object.assign({},qt,kt)),ln,tr));var En=Object(b.b)(Ie),$n=O.createElement("div",Object.assign({className:W()($e,Ze,(Re={},Object(J.a)(Re,"".concat($e,"-rtl"),oe==="rtl"),Object(J.a)(Re,"".concat($e,"-ping-left"),jt),Object(J.a)(Re,"".concat($e,"-ping-right"),Sn),Object(J.a)(Re,"".concat($e,"-layout-fixed"),ie==="fixed"),Object(J.a)(Re,"".concat($e,"-fixed-header"),Jt),Object(J.a)(Re,"".concat($e,"-fixed-column"),Kt),Object(J.a)(Re,"".concat($e,"-scroll-horizontal"),wt),Object(J.a)(Re,"".concat($e,"-has-fix-left"),Ht[0]&&Ht[0].fixed),Object(J.a)(Re,"".concat($e,"-has-fix-right"),Ht[Ht.length-1]&&Ht[Ht.length-1].fixed==="right"),Re)),style:q,id:Oe,ref:on},En),O.createElement(lt,{pingLeft:jt,pingRight:Sn,props:Object(z.a)(Object(z.a)({},Ie),{},{stickyOffsets:_n,mergedExpandedKeys:Fe})},he&&O.createElement(re,{className:"".concat($e,"-title")},he(xe)),O.createElement("div",{className:"".concat($e,"-container")},Zt),ge&&O.createElement(re,{className:"".concat($e,"-footer")},ge(xe))));wt&&($n=O.createElement(f.a,{onResize:Ct},$n));var Jn=O.useMemo(function(){return{prefixCls:$e,getComponent:Qe,scrollbarSize:ot,direction:oe,fixedInfoList:Ht.map(function(xn,dn){return o(dn,dn,Ht,_n,oe)}),isSticky:Bt}},[$e,Qe,ot,oe,Ht,_n,oe,Bt]),fr=O.useMemo(function(){return Object(z.a)(Object(z.a)({},kt),{},{tableLayout:Lt,rowClassName:ue,expandedRowClassName:vn,componentWidth:yn,fixHeader:Jt,fixColumn:Kt,horizonScroll:wt,expandIcon:zn,expandableType:vr,expandRowByClick:Mt,expandedRowRender:Wt,onTriggerExpand:Pt,expandIconColumnIndex:On,indentSize:vt})},[kt,Lt,ue,vn,yn,Jt,Kt,wt,zn,vr,Mt,Wt,Pt,On,vt]),Wi=O.useMemo(function(){return{onColumnResize:kr}},[kr]);return O.createElement(r.a.Provider,{value:Jn},O.createElement(F.Provider,{value:fr},O.createElement(Q.Provider,{value:Wi},$n)))}gt.Column=s.a,gt.ColumnGroup=c.a,gt.Summary=X.a,gt.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var ht=de.b=gt},wRmb:function(Ue,de,M){"use strict";M.d(de,"a",function(){return I});var J=M("rePB"),z=M("KQm4"),D=M("VTBJ"),V=M("Ff2n"),N=M("q1tI"),O=M.n(N),K=M("Kwbf"),W=M("Zm9Q"),n=M("hW8S");function I(s){return Object(W.a)(s).filter(function(d){return N.isValidElement(d)}).map(function(d){var i=d.key,a=d.props,r=a.children,o=Object(V.a)(a,["children"]),T=Object(D.a)({key:i},o);return r&&(T.children=I(r)),T})}function g(s){return s.reduce(function(d,i){var a=i.fixed,r=a===!0?"left":a,o=i.children;return o&&o.length>0?[].concat(Object(z.a)(d),Object(z.a)(g(o).map(function(T){return Object(D.a)({fixed:r},T)}))):[].concat(Object(z.a)(d),[Object(D.a)(Object(D.a)({},i),{},{fixed:r})])},[])}function f(s){for(var d=!0,i=0;i<s.length;i+=1){var a=s[i];if(d&&a.fixed!=="left")d=!1;else if(!d&&a.fixed==="left"){Object(K.a)(!1,"Index ".concat(i-1," of `columns` missing `fixed='left'` prop."));break}}for(var r=!0,o=s.length-1;o>=0;o-=1){var T=s[o];if(r&&T.fixed!=="right")r=!1;else if(!r&&T.fixed==="right"){Object(K.a)(!1,"Index ".concat(o+1," of `columns` missing `fixed='right'` prop."));break}}}function h(s){return s.map(function(d){var i=d.fixed,a=Object(V.a)(d,["fixed"]),r=i;return i==="left"?r="right":i==="right"&&(r="left"),Object(D.a)({fixed:r},a)})}function c(s,d){var i=s.prefixCls,a=s.columns,r=s.children,o=s.expandable,T=s.expandedKeys,w=s.getRowKey,x=s.onTriggerExpand,L=s.expandIcon,A=s.rowExpandable,_=s.expandIconColumnIndex,b=s.direction,m=s.expandRowByClick,p=N.useMemo(function(){return a||I(r)},[a,r]),C=N.useMemo(function(){if(o){var P,F=_||0,R=p[F],H=(P={},Object(J.a)(P,n.a,{className:"".concat(i,"-expand-icon-col")}),Object(J.a)(P,"title",""),Object(J.a)(P,"fixed",R?R.fixed:null),Object(J.a)(P,"className","".concat(i,"-row-expand-icon-cell")),Object(J.a)(P,"render",function(G,Q,se){var fe=w(Q,se),we=T.has(fe),be=A?A(Q):!0,Se=L({prefixCls:i,expanded:we,expandable:be,record:Q,onExpand:x});return m?N.createElement("span",{onClick:function(De){return De.stopPropagation()}},Se):Se}),P),U=p.slice();return F>=0&&U.splice(F,0,H),U}return p},[o,p,w,T,L,b]),E=N.useMemo(function(){var P=C;return d&&(P=d(P)),P.length||(P=[{render:function(){return null}}]),P},[d,C,b]),v=N.useMemo(function(){return b==="rtl"?h(g(E)):g(E)},[E,b]);return[E,v]}de.b=c},"y0+3":function(Ue,de,M){"use strict";M.d(de,"a",function(){return g}),M.d(de,"b",function(){return h});var J=/margin|padding|width|height|max|min|offset/,z={left:!0,top:!0},D={cssFloat:1,styleFloat:1,float:1};function V(c){return c.nodeType===1?c.ownerDocument.defaultView.getComputedStyle(c,null):{}}function N(c,s,d){if(s=s.toLowerCase(),d==="auto"){if(s==="height")return c.offsetHeight;if(s==="width")return c.offsetWidth}return s in z||(z[s]=J.test(s)),z[s]?parseFloat(d)||0:d}function O(c,s){var d=arguments.length,i=V(c);return s=D[s]?"cssFloat"in c.style?"cssFloat":"styleFloat":s,d===1?i:N(c,s,i[s]||c.style[s])}function K(c,s,d){var i=arguments.length;if(s=D[s]?"cssFloat"in c.style?"cssFloat":"styleFloat":s,i===3)return typeof d=="number"&&J.test(s)&&(d="".concat(d,"px")),c.style[s]=d,d;for(var a in s)s.hasOwnProperty(a)&&K(c,a,s[a]);return V(c)}function W(c){return c===document.body?document.documentElement.clientWidth:c.offsetWidth}function n(c){return c===document.body?window.innerHeight||document.documentElement.clientHeight:c.offsetHeight}function I(){var c=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),s=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:c,height:s}}function g(){var c=document.documentElement.clientWidth,s=window.innerHeight||document.documentElement.clientHeight;return{width:c,height:s}}function f(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function h(c){var s=c.getBoundingClientRect(),d=document.documentElement;return{left:s.left+(window.pageXOffset||d.scrollLeft)-(d.clientLeft||document.body.clientLeft||0),top:s.top+(window.pageYOffset||d.scrollTop)-(d.clientTop||document.body.clientTop||0)}}},ynwM:function(Ue,de,M){var J=M("MFOe"),z=J.Global;Ue.exports={name:"oldFF-globalStorage",read:V,write:N,each:O,remove:K,clearAll:W};var D=z.globalStorage;function V(n){return D[n]}function N(n,I){D[n]=I}function O(n){for(var I=D.length-1;I>=0;I--){var g=D.key(I);n(D[g],g)}}function K(n){return D.removeItem(n)}function W(){O(function(n,I){delete D[n]})}}}]);