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.
446 lines
1.3 MiB
446 lines
1.3 MiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[192,3,5,7,8,20],{"+NIl":function(je,oe,k){(function(Z){Z(k("VrN/"))})(function(Z){"use strict";Z.defineMode("stex",function(X,P){"use strict";function V(c,o){c.cmdState.push(o)}function U(c){return c.cmdState.length>0?c.cmdState[c.cmdState.length-1]:null}function M(c){var o=c.cmdState.pop();o&&o.closeBracket()}function G(c){for(var o=c.cmdState,d=o.length-1;d>=0;d--){var i=o[d];if(i.name=="DEFAULT")continue;return i}return{styleIdentifier:function(){return null}}}function W(c,o,d){return function(){this.name=c,this.bracketNo=0,this.style=o,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 D(c,o){c.f=o}function m(c,o){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(o,d),D(o,h),d.style}if(c.match(/^\\[$&%#{}_]/))return"tag";if(c.match(/^\\[,;!\/\\]/))return"tag";if(c.match("\\["))return D(o,function(r,s){return f(r,s,"\\]")}),"keyword";if(c.match("\\("))return D(o,function(r,s){return f(r,s,"\\)")}),"keyword";if(c.match("$$"))return D(o,function(r,s){return f(r,s,"$$")}),"keyword";if(c.match("$"))return D(o,function(r,s){return f(r,s,"$")}),"keyword";var a=c.next();if(a=="%")return c.skipToEnd(),"comment";if(a=="}"||a=="]"){if(d=U(o),d)d.closeBracket(a),D(o,h);else return"error";return"bracket"}else return a=="{"||a=="["?(d=n.DEFAULT,d=new d,V(o,d),"bracket"):/\d/.test(a)?(c.eatWhile(/[\w.%]/),"atom"):(c.eatWhile(/[\w\-_]/),d=G(o),d.name=="begin"&&(d.argument=c.current()),d.styleIdentifier())}function f(c,o,d){if(c.eatSpace())return null;if(d&&c.match(d))return D(o,m),"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,o){var d=c.peek(),i;return d=="{"||d=="["?(i=U(o),i.openBracket(d),c.eat(d),D(o,m),"bracket"):/[ \t\r]/.test(d)?(c.eat(d),null):(D(o,m),M(o),m(c,o))}return{startState:function(){var c=P.inMathMode?function(o,d){return f(o,d)}:m;return{cmdState:[],f:c}},copyState:function(c){return{cmdState:c.cmdState.slice(),f:c.f}},token:function(c,o){return o.f(c,o)},blankLine:function(c){c.f=m,c.cmdState.length=0},lineComment:"%"}}),Z.defineMIME("text/x-stex","stex"),Z.defineMIME("text/x-latex","stex")})},"+aKw":function(je,oe,k){"use strict";var Z=k("tJVT"),X=k("q1tI"),P=k.n(X),V=function(G){return String(G).length===1?"0".concat(G):G},U=function(G){var W=G.className,n=W===void 0?"":W,D=G.onChange,m=G.defaultValue,f=m===void 0?0:m,h=Object(X.useState)(f),c=Object(Z.a)(h,2),o=c[0],d=c[1];Object(X.useEffect)(function(){var s=setTimeout(function(){d(o+1e3)},1e3);return D(o+1e3),function(){clearInterval(s)}},[o]);var i=parseInt(o/(60*6e4))||"00",a=parseInt(o%(60*6e4)/6e4)||"00",r=parseInt(o%6e4/1e3)||"00";return P.a.createElement("div",{className:n},V(i),":",V(a),":",V(r))};oe.a=U},"+k/U":function(je,oe,k){je.exports={pagination:"pagination___2XcQw",info:"info___12Y4R"}},"+ua5":function(je,oe,k){},"/cxE":function(je,oe,k){"use strict";k.d(oe,"f",function(){return P}),k.d(oe,"g",function(){return V}),k.d(oe,"h",function(){return U}),k.d(oe,"e",function(){return G}),k.d(oe,"b",function(){return W}),k.d(oe,"c",function(){return n}),k.d(oe,"d",function(){return D}),k.d(oe,"a",function(){return m});class Z{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 X=new Z;function P(f){G(f)||X.onUnexpectedError(f);return}function V(f){G(f)||X.onUnexpectedExternalError(f);return}function U(f){if(f instanceof Error){let{name:h,message:c}=f;const o=f.stacktrace||f.stack;return{$isError:!0,name:h,message:c,stack:o}}return f}const M="Canceled";function G(f){return f instanceof Error&&f.name===M&&f.message===M}function W(){const f=new Error(M);return f.name=f.message,f}function n(f){return f?new Error(`Illegal argument: ${f}`):new Error("Illegal argument")}function D(f){return f?new Error(`Illegal state: ${f}`):new Error("Illegal state")}class m extends Error{constructor(f){super("NotSupported");f&&(this.message=f)}}},"07cG":function(je,oe,k){je.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},"19Vz":function(je,oe,k){(function(Z){Z(k("VrN/"))})(function(Z){Z.defineOption("placeholder","",function(W,n,D){var m=D&&D!=Z.Init;if(n&&!m)W.on("blur",U),W.on("change",M),W.on("swapDoc",M),Z.on(W.getInputField(),"compositionupdate",W.state.placeholderCompose=function(){V(W)}),M(W);else if(!n&&m){W.off("blur",U),W.off("change",M),W.off("swapDoc",M),Z.off(W.getInputField(),"compositionupdate",W.state.placeholderCompose),X(W);var f=W.getWrapperElement();f.className=f.className.replace(" CodeMirror-empty","")}n&&!W.hasFocus()&&U(W)});function X(W){W.state.placeholder&&(W.state.placeholder.parentNode.removeChild(W.state.placeholder),W.state.placeholder=null)}function P(W){X(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 D=W.getOption("placeholder");typeof D=="string"&&(D=document.createTextNode(D)),n.appendChild(D),W.display.lineSpace.insertBefore(n,W.display.lineSpace.firstChild)}function V(W){setTimeout(function(){var n=!1,D=W.getInputField();D.nodeName=="TEXTAREA"?n=!D.value:W.lineCount()==1&&(n=!/[^\u200b]/.test(D.querySelector(".CodeMirror-line").textContent)),n?P(W):X(W)},20)}function U(W){G(W)&&P(W)}function M(W){var n=W.getWrapperElement(),D=G(W);n.className=n.className.replace(" CodeMirror-empty","")+(D?" CodeMirror-empty":""),D?P(W):X(W)}function G(W){return W.lineCount()===1&&W.getLine(0)===""}})},"1eCo":function(je,oe,k){(function(Z){Z(k("VrN/"))})(function(Z){"use strict";var X={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},P={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};Z.defineMode("xml",function(V,U){var M=V.indentUnit,G={},W=U.htmlMode?X:P;for(var n in W)G[n]=W[n];for(var n in U)G[n]=U[n];var D,m;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(o("atom","]]>")):null:p.match("--")?E(o("comment","-->")):p.match("DOCTYPE",!0,!0)?(p.eatWhile(/[\w\._\-]/),E(d(1))):null:p.eat("?")?(p.eatWhile(/[\w\._\-]/),C.tokenize=o("meta","?>"),"meta"):(D=p.eat("/")?"closeTag":"openTag",C.tokenize=h,"tag bracket");if(v=="&"){var N;return p.eat("#")?p.eat("x")?N=p.eatWhile(/[a-fA-F\d]/)&&p.eat(";"):N=p.eatWhile(/[\d]/)&&p.eat(";"):N=p.eatWhile(/[\w\.\-:]/)&&p.eat(";"),N?"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,D=E==">"?"endTag":"selfcloseTag","tag bracket";if(E=="=")return D="equals",null;if(E=="<"){C.tokenize=f,C.state=s,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 o(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,(G.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,!G.contextGrabbers.hasOwnProperty(E)||!G.contextGrabbers[E].hasOwnProperty(C))return;a(p)}}function s(p,C,E){return p=="openTag"?(E.tagStart=C.column(),S):p=="closeTag"?w:s}function S(p,C,E){return p=="word"?(E.tagName=C.current(),m="tag",O):G.allowMissingTagName&&p=="endTag"?(m="tag bracket",O(p,C,E)):(m="error",S)}function w(p,C,E){if(p=="word"){var v=C.current();return E.context&&E.context.tagName!=v&&G.implicitlyClosed.hasOwnProperty(E.context.tagName)&&a(E),E.context&&E.context.tagName==v||G.matchClosing===!1?(m="tag",x):(m="tag error",L)}else return G.allowMissingTagName&&p=="endTag"?(m="tag bracket",x(p,C,E)):(m="error",L)}function x(p,C,E){return p!="endTag"?(m="error",x):(a(E),s)}function L(p,C,E){return m="error",x(p,C,E)}function O(p,C,E){if(p=="word")return m="attribute",_;if(p=="endTag"||p=="selfcloseTag"){var v=E.tagName,N=E.tagStart;return E.tagName=E.tagStart=null,p=="selfcloseTag"||G.autoSelfClosers.hasOwnProperty(v)?r(E,v):(r(E,v),E.context=new i(E,v,N==E.indented)),s}return m="error",O}function _(p,C,E){return p=="equals"?b:(G.allowMissing||(m="error"),O(p,C,E))}function b(p,C,E){return p=="string"?g:p=="word"&&G.allowUnquoted?(m="string",O):(m="error",O(p,C,E))}function g(p,C,E){return p=="string"?g:O(p,C,E)}return{startState:function(p){var C={tokenize:f,state:s,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;D=null;var E=C.tokenize(p,C);return(E||D)&&E!="comment"&&(m=null,C.state=C.state(D||E,p,C),m&&(E=m=="error"?E+" error":m)),E},indent:function(p,C,E){var v=p.context;if(p.tokenize.isInAttribute)return p.tagStart==p.indented?p.stringStartCol+1:p.indented+M;if(v&&v.noIndent)return Z.Pass;if(p.tokenize!=h&&p.tokenize!=f)return E?E.match(/^(\s*)/)[0].length:0;if(p.tagName)return G.multilineTagIndentPastTag!==!1?p.tagStart+p.tagName.length+2:p.tagStart+M*(G.multilineTagIndentFactor||1);if(G.alignCDATA&&/<!\[CDATA\[/.test(C))return 0;var N=C&&/^<(\/)?([\w_:\.-]*)/.exec(C);if(N&&N[1])for(;v;)if(v.tagName==N[2]){v=v.prev;break}else if(G.implicitlyClosed.hasOwnProperty(v.tagName))v=v.prev;else break;else if(N)for(;v;){var F=G.contextGrabbers[v.tagName];if(F&&F.hasOwnProperty(N[2]))v=v.prev;else break}for(;v&&v.prev&&!v.startOfLine;)v=v.prev;return v?v.indent+M:p.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:G.htmlMode?"html":"xml",helperType:G.htmlMode?"html":"xml",skipAttribute:function(p){p.state==b&&(p.state=O)},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()}}}),Z.defineMIME("text/xml","xml"),Z.defineMIME("application/xml","xml"),Z.mimeModes.hasOwnProperty("text/html")||Z.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1j5w":function(je,oe,k){"use strict";k.d(oe,"d",function(){return qe}),k.d(oe,"b",function(){return Te}),k.d(oe,"c",function(){return $e}),k.d(oe,"a",function(){return Ot});var Z=k("VTBJ"),X=k("1OyB"),P=k("vuIU"),V=k("JX7q"),U=k("Ji7U"),M=k("LK+K"),G=k("q1tI"),W=k("I8Z2"),n=k("BGR+"),D=k("wx14"),m=k("rePB"),f=k("4IlW"),h=k("2GS6"),c=k("Gytx"),o=k.n(c),d=k("TSYQ"),i=k.n(d),a=k("U8pU"),r=k("ODXe"),s=/iPhone/i,S=/iPod/i,w=/iPad/i,x=/\bAndroid(?:.+)Mobile\b/i,L=/Android/i,O=/\bAndroid(?:.+)SD4930UR\b/i,_=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,b=/Windows Phone/i,g=/\bWindows(?:.+)ARM\b/i,p=/BlackBerry/i,C=/BB10/i,E=/Opera Mini/i,v=/\b(CriOS|Chrome)(?:.+)Mobile/i,N=/Mobile(?:.+)Firefox\b/i;function F(st,Ke){return st.test(Ke)}function A(st){var Ke=st||(typeof navigator!="undefined"?navigator.userAgent:""),Ge=Ke.split("[FBAN");if(typeof Ge[1]!="undefined"){var Ue=Ge,le=Object(r.a)(Ue,1);Ke=le[0]}if(Ge=Ke.split("Twitter"),typeof Ge[1]!="undefined"){var _e=Ge,Xe=Object(r.a)(_e,1);Ke=Xe[0]}var Be={apple:{phone:F(s,Ke)&&!F(b,Ke),ipod:F(S,Ke),tablet:!F(s,Ke)&&F(w,Ke)&&!F(b,Ke),device:(F(s,Ke)||F(S,Ke)||F(w,Ke))&&!F(b,Ke)},amazon:{phone:F(O,Ke),tablet:!F(O,Ke)&&F(_,Ke),device:F(O,Ke)||F(_,Ke)},android:{phone:!F(b,Ke)&&F(O,Ke)||!F(b,Ke)&&F(x,Ke),tablet:!F(b,Ke)&&!F(O,Ke)&&!F(x,Ke)&&(F(_,Ke)||F(L,Ke)),device:!F(b,Ke)&&(F(O,Ke)||F(_,Ke)||F(x,Ke)||F(L,Ke))||F(/\bokhttp\b/i,Ke)},windows:{phone:F(b,Ke),tablet:F(g,Ke),device:F(b,Ke)||F(g,Ke)},other:{blackberry:F(p,Ke),blackberry10:F(C,Ke),opera:F(E,Ke),firefox:F(N,Ke),chrome:F(v,Ke),device:F(p,Ke)||F(C,Ke)||F(E,Ke)||F(N,Ke)||F(v,Ke)},any:null,phone:null,tablet:null};return Be.any=Be.apple.device||Be.android.device||Be.windows.device||Be.other.device,Be.phone=Be.apple.phone||Be.android.phone||Be.windows.phone,Be.tablet=Be.apple.tablet||Be.android.tablet||Be.windows.tablet,Be}var H=Object(Z.a)(Object(Z.a)({},A()),{},{isMobile:A}),j=H;function T(){}function z(st,Ke,Ge){var Ue=Ke||"";return st.key||"".concat(Ue,"item_").concat(Ge)}function Q(st){return"".concat(st,"-menu-")}function ne(st,Ke){var Ge=-1;G.Children.forEach(st,function(Ue){Ge+=1,Ue&&Ue.type&&Ue.type.isMenuItemGroup?G.Children.forEach(Ue.props.children,function(le){Ge+=1,Ke(le,Ge)}):Ke(Ue,Ge)})}function se(st,Ke,Ge){if(!st||Ge.find)return;G.Children.forEach(st,function(Ue){if(Ue){var le=Ue.type;if(!le||!(le.isSubMenu||le.isMenuItem||le.isMenuItemGroup))return;Ke.indexOf(Ue.key)!==-1?Ge.find=!0:Ue.props.children&&se(Ue.props.children,Ke,Ge)}})}var xe=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],ge=function(Ke){var Ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ue=Ke&&typeof Ke.getBoundingClientRect=="function"&&Ke.getBoundingClientRect().width;if(Ue){if(Ge){var le=getComputedStyle(Ke),_e=le.marginLeft,Xe=le.marginRight;Ue+=+_e.replace("px","")+ +Xe.replace("px","")}Ue=+Ue.toFixed(6)}return Ue||0},ve=function(Ke,Ge,Ue){Ke&&Object(a.a)(Ke.style)==="object"&&(Ke.style[Ge]=Ue)},Oe=function(){return j.any},Re=k("KQm4"),he=k("Ff2n"),ue=k("i8i4"),Me=k("bdgK"),et=k("uciX"),it=k("8XRh"),nt={adjustX:1,adjustY:1},at={topLeft:{points:["bl","tl"],overflow:nt,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:nt,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:nt,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:nt,offset:[4,0]}},ze={topLeft:{points:["bl","tl"],overflow:nt,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:nt,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:nt,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:nt,offset:[4,0]}},Ze=at,ot=0,de={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Se=function(Ke,Ge,Ue){var le=Q(Ge),_e=Ke.getState();Ke.setState({defaultActiveFirst:Object(Z.a)(Object(Z.a)({},_e.defaultActiveFirst),{},Object(m.a)({},le,Ue))})},Le=function(st){Object(U.a)(Ge,st);var Ke=Object(M.a)(Ge);function Ge(Ue){var le;Object(X.a)(this,Ge),le=Ke.call(this,Ue),le.onDestroy=function(Ie){le.props.onDestroy(Ie)},le.onKeyDown=function(Ie){var Je=Ie.keyCode,tt=le.menuInstance,_t=le.props,Tt=_t.isOpen,Zt=_t.store;if(Je===f.a.ENTER)return le.onTitleClick(Ie),Se(Zt,le.props.eventKey,!0),!0;if(Je===f.a.RIGHT)return Tt?tt.onKeyDown(Ie):(le.triggerOpenChange(!0),Se(Zt,le.props.eventKey,!0)),!0;if(Je===f.a.LEFT){var nn;if(Tt)nn=tt.onKeyDown(Ie);else return;return nn||(le.triggerOpenChange(!1),nn=!0),nn}return Tt&&(Je===f.a.UP||Je===f.a.DOWN)?tt.onKeyDown(Ie):void 0},le.onOpenChange=function(Ie){le.props.onOpenChange(Ie)},le.onPopupVisibleChange=function(Ie){le.triggerOpenChange(Ie,Ie?"mouseenter":"mouseleave")},le.onMouseEnter=function(Ie){var Je=le.props,tt=Je.eventKey,_t=Je.onMouseEnter,Tt=Je.store;Se(Tt,le.props.eventKey,!1),_t({key:tt,domEvent:Ie})},le.onMouseLeave=function(Ie){var Je=le.props,tt=Je.parentMenu,_t=Je.eventKey,Tt=Je.onMouseLeave;tt.subMenuInstance=Object(V.a)(le),Tt({key:_t,domEvent:Ie})},le.onTitleMouseEnter=function(Ie){var Je=le.props,tt=Je.eventKey,_t=Je.onItemHover,Tt=Je.onTitleMouseEnter;_t({key:tt,hover:!0}),Tt({key:tt,domEvent:Ie})},le.onTitleMouseLeave=function(Ie){var Je=le.props,tt=Je.parentMenu,_t=Je.eventKey,Tt=Je.onItemHover,Zt=Je.onTitleMouseLeave;tt.subMenuInstance=Object(V.a)(le),Tt({key:_t,hover:!1}),Zt({key:_t,domEvent:Ie})},le.onTitleClick=function(Ie){var Je=Object(V.a)(le),tt=Je.props;if(tt.onTitleClick({key:tt.eventKey,domEvent:Ie}),tt.triggerSubMenuAction==="hover")return;le.triggerOpenChange(!tt.isOpen,"click"),Se(tt.store,le.props.eventKey,!1)},le.onSubMenuClick=function(Ie){typeof le.props.onClick=="function"&&le.props.onClick(le.addKeyPath(Ie))},le.onSelect=function(Ie){le.props.onSelect(Ie)},le.onDeselect=function(Ie){le.props.onDeselect(Ie)},le.getPrefixCls=function(){return"".concat(le.props.rootPrefixCls,"-submenu")},le.getActiveClassName=function(){return"".concat(le.getPrefixCls(),"-active")},le.getDisabledClassName=function(){return"".concat(le.getPrefixCls(),"-disabled")},le.getSelectedClassName=function(){return"".concat(le.getPrefixCls(),"-selected")},le.getOpenClassName=function(){return"".concat(le.props.rootPrefixCls,"-submenu-open")},le.saveMenuInstance=function(Ie){le.menuInstance=Ie},le.addKeyPath=function(Ie){return Object(Z.a)(Object(Z.a)({},Ie),{},{keyPath:(Ie.keyPath||[]).concat(le.props.eventKey)})},le.triggerOpenChange=function(Ie,Je){var tt=le.props.eventKey,_t=function(){le.onOpenChange({key:tt,item:Object(V.a)(le),trigger:Je,open:Ie})};Je==="mouseenter"?le.mouseenterTimeout=setTimeout(function(){_t()},0):_t()},le.isChildrenSelected=function(){var Ie={find:!1};return se(le.props.children,le.props.selectedKeys,Ie),Ie.find},le.isOpen=function(){return le.props.openKeys.indexOf(le.props.eventKey)!==-1},le.adjustWidth=function(){if(!le.subMenuTitle||!le.menuInstance)return;var Ie=ue.findDOMNode(le.menuInstance);if(Ie.offsetWidth>=le.subMenuTitle.offsetWidth)return;Ie.style.minWidth="".concat(le.subMenuTitle.offsetWidth,"px")},le.saveSubMenuTitle=function(Ie){le.subMenuTitle=Ie},le.getBaseProps=function(){var Ie=Object(V.a)(le),Je=Ie.props;return{mode:Je.mode==="horizontal"?"vertical":Je.mode,visible:le.props.isOpen,level:Je.level+1,inlineIndent:Je.inlineIndent,focusable:!1,onClick:le.onSubMenuClick,onSelect:le.onSelect,onDeselect:le.onDeselect,onDestroy:le.onDestroy,selectedKeys:Je.selectedKeys,eventKey:"".concat(Je.eventKey,"-menu-"),openKeys:Je.openKeys,motion:Je.motion,onOpenChange:le.onOpenChange,subMenuOpenDelay:Je.subMenuOpenDelay,parentMenu:Object(V.a)(le),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:le.internalMenuId,manualRef:le.saveMenuInstance,itemIcon:Je.itemIcon,expandIcon:Je.expandIcon,direction:Je.direction}},le.getMotion=function(Ie,Je){var tt=Object(V.a)(le),_t=tt.haveRendered,Tt=le.props,Zt=Tt.motion,nn=Tt.rootPrefixCls,Qt=Object(Z.a)(Object(Z.a)({},Zt),{},{leavedClassName:"".concat(nn,"-hidden"),removeOnLeave:!1,motionAppear:_t||!Je||Ie!=="inline"});return Qt};var _e=Ue.store,Xe=Ue.eventKey,Be=_e.getState(),ct=Be.defaultActiveFirst;le.isRootMenu=!1;var ft=!1;return ct&&(ft=ct[Xe]),Se(_e,Xe,ft),le}return Object(P.a)(Ge,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var le=this,_e=this.props,Xe=_e.mode,Be=_e.parentMenu,ct=_e.manualRef;if(ct&&ct(this),Xe!=="horizontal"||!Be.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return le.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var le=this.props,_e=le.onDestroy,Xe=le.eventKey;_e&&_e(Xe),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(le){var _e=this,Xe=this.getBaseProps(),Be=this.getMotion(Xe.mode,Xe.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||Xe.visible||Xe.forceSubMenuRender,!this.haveOpened)return G.createElement("div",null);var ct=Xe.direction;return G.createElement(it.default,Object.assign({visible:Xe.visible},Be),function(ft){var Ie=ft.className,Je=ft.style,tt=i()("".concat(Xe.prefixCls,"-sub"),Ie,Object(m.a)({},"".concat(Xe.prefixCls,"-rtl"),ct==="rtl"));return G.createElement(be,Object.assign({},Xe,{id:_e.internalMenuId,className:tt,style:Je}),le)})}},{key:"render",value:function(){var le,_e=Object(Z.a)({},this.props),Xe=_e.isOpen,Be=this.getPrefixCls(),ct=_e.mode==="inline",ft=i()(Be,"".concat(Be,"-").concat(_e.mode),(le={},Object(m.a)(le,_e.className,!!_e.className),Object(m.a)(le,this.getOpenClassName(),Xe),Object(m.a)(le,this.getActiveClassName(),_e.active||Xe&&!ct),Object(m.a)(le,this.getDisabledClassName(),_e.disabled),Object(m.a)(le,this.getSelectedClassName(),this.isChildrenSelected()),le));this.internalMenuId||(_e.eventKey?this.internalMenuId="".concat(_e.eventKey,"$Menu"):(ot+=1,this.internalMenuId="$__$".concat(ot,"$Menu")));var Ie={},Je={},tt={};_e.disabled||(Ie={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},Je={onClick:this.onTitleClick},tt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var _t={},Tt=_e.direction;ct&&(Tt==="rtl"?_t.paddingRight=_e.inlineIndent*_e.level:_t.paddingLeft=_e.inlineIndent*_e.level);var Zt={};this.props.isOpen&&(Zt={"aria-owns":this.internalMenuId});var nn=null;_e.mode!=="horizontal"&&(nn=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(nn=G.createElement(this.props.expandIcon,Object(Z.a)({},this.props))));var Qt=G.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:_t,className:"".concat(Be,"-title"),role:"button"},tt,Je,{"aria-expanded":Xe},Zt,{"aria-haspopup":"true",title:typeof _e.title=="string"?_e.title:void 0}),_e.title,nn||G.createElement("i",{className:"".concat(Be,"-arrow")})),Lt=this.renderChildren(_e.children),On=_e.parentMenu.isRootMenu?_e.parentMenu.props.getPopupContainer:function(ur){return ur.parentNode},un=de[_e.mode],fn=_e.popupOffset?{offset:_e.popupOffset}:{},Xt=_e.mode==="inline"?"":_e.popupClassName;Xt+=Tt==="rtl"?" ".concat(Be,"-rtl"):"";var mn=_e.disabled,Pn=_e.triggerSubMenuAction,zn=_e.subMenuOpenDelay,dt=_e.forceSubMenuRender,Rt=_e.subMenuCloseDelay,Vn=_e.builtinPlacements;xe.forEach(function(ur){return delete _e[ur]}),delete _e.onClick;var pr=Tt==="rtl"?Object.assign({},ze,Vn):Object.assign({},at,Vn);return delete _e.direction,G.createElement("li",Object.assign({},_e,Ie,{className:ft,role:"menuitem"}),ct&&Qt,ct&&Lt,!ct&&G.createElement(et.a,{prefixCls:Be,popupClassName:i()("".concat(Be,"-popup"),Xt),getPopupContainer:On,builtinPlacements:pr,popupPlacement:un,popupVisible:Xe,popupAlign:fn,popup:Lt,action:mn?[]:[Pn],mouseEnterDelay:zn,mouseLeaveDelay:Rt,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:dt},Qt))}}]),Ge}(G.Component);Le.defaultProps={onMouseEnter:T,onMouseLeave:T,onTitleMouseEnter:T,onTitleMouseLeave:T,onTitleClick:T,manualRef:T,mode:"vertical",title:""};var De=Object(W.b)(function(st,Ke){var Ge=st.openKeys,Ue=st.activeKey,le=st.selectedKeys,_e=Ke.eventKey,Xe=Ke.subMenuKey;return{isOpen:Ge.indexOf(_e)>-1,active:Ue[Xe]===_e,selectedKeys:le}})(Le);De.isSubMenu=!0;var qe=De,lt="menuitem-overflowed",mt=.5,gt=function(st){Object(U.a)(Ge,st);var Ke=Object(M.a)(Ge);function Ge(){var Ue;return Object(X.a)(this,Ge),Ue=Ke.apply(this,arguments),Ue.resizeObserver=null,Ue.mutationObserver=null,Ue.originalTotalWidth=0,Ue.overflowedItems=[],Ue.menuItemSizes=[],Ue.cancelFrameId=null,Ue.state={lastVisibleIndex:void 0},Ue.getMenuItemNodes=function(){var le=Ue.props.prefixCls,_e=ue.findDOMNode(Object(V.a)(Ue));return _e?[].slice.call(_e.children).filter(function(Xe){return Xe.className.split(" ").indexOf("".concat(le,"-overflowed-submenu"))<0}):[]},Ue.getOverflowedSubMenuItem=function(le,_e,Xe){var Be=Ue.props,ct=Be.overflowedIndicator,ft=Be.level,Ie=Be.mode,Je=Be.prefixCls,tt=Be.theme;if(ft!==1||Ie!=="horizontal")return null;var _t=Ue.props.children[0],Tt=_t.props,Zt=Tt.children,nn=Tt.title,Qt=Tt.style,Lt=Object(he.a)(Tt,["children","title","style"]),On=Object(Z.a)({},Qt),un="".concat(le,"-overflowed-indicator"),fn="".concat(le,"-overflowed-indicator");_e.length===0&&Xe!==!0?On=Object(Z.a)(Object(Z.a)({},On),{},{display:"none"}):Xe&&(On=Object(Z.a)(Object(Z.a)({},On),{},{visibility:"hidden",position:"absolute"}),un="".concat(un,"-placeholder"),fn="".concat(fn,"-placeholder"));var Xt=tt?"".concat(Je,"-").concat(tt):"",mn={};return xe.forEach(function(Pn){Lt[Pn]!==void 0&&(mn[Pn]=Lt[Pn])}),G.createElement(qe,Object.assign({title:ct,className:"".concat(Je,"-overflowed-submenu"),popupClassName:Xt},mn,{key:un,eventKey:fn,disabled:!1,style:On}),_e)},Ue.setChildrenWidthAndResize=function(){if(Ue.props.mode!=="horizontal")return;var le=ue.findDOMNode(Object(V.a)(Ue));if(!le)return;var _e=le.children;if(!_e||_e.length===0)return;var Xe=le.children[_e.length-1];ve(Xe,"display","inline-block");var Be=Ue.getMenuItemNodes(),ct=Be.filter(function(ft){return ft.className.split(" ").indexOf(lt)>=0});ct.forEach(function(ft){ve(ft,"display","inline-block")}),Ue.menuItemSizes=Be.map(function(ft){return ge(ft,!0)}),ct.forEach(function(ft){ve(ft,"display","none")}),Ue.overflowedIndicatorWidth=ge(le.children[le.children.length-1],!0),Ue.originalTotalWidth=Ue.menuItemSizes.reduce(function(ft,Ie){return ft+Ie},0),Ue.handleResize(),ve(Xe,"display","none")},Ue.handleResize=function(){if(Ue.props.mode!=="horizontal")return;var le=ue.findDOMNode(Object(V.a)(Ue));if(!le)return;var _e=ge(le);Ue.overflowedItems=[];var Xe=0,Be;Ue.originalTotalWidth>_e+mt&&(Be=-1,Ue.menuItemSizes.forEach(function(ct){Xe+=ct,Xe+Ue.overflowedIndicatorWidth<=_e&&(Be+=1)})),Ue.setState({lastVisibleIndex:Be})},Ue}return Object(P.a)(Ge,[{key:"componentDidMount",value:function(){var le=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var _e=ue.findDOMNode(this);if(!_e)return;this.resizeObserver=new Me.default(function(Xe){Xe.forEach(function(){var Be=le.cancelFrameId;cancelAnimationFrame(Be),le.cancelFrameId=requestAnimationFrame(le.setChildrenWidthAndResize)})}),[].slice.call(_e.children).concat(_e).forEach(function(Xe){le.resizeObserver.observe(Xe)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){le.resizeObserver.disconnect(),[].slice.call(_e.children).concat(_e).forEach(function(Xe){le.resizeObserver.observe(Xe)}),le.setChildrenWidthAndResize()}),this.mutationObserver.observe(_e,{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(le){var _e=this,Xe=this.state.lastVisibleIndex;return(le||[]).reduce(function(Be,ct,ft){var Ie=ct;if(_e.props.mode==="horizontal"){var Je=_e.getOverflowedSubMenuItem(ct.props.eventKey,[]);Xe!==void 0&&_e.props.className.indexOf("".concat(_e.props.prefixCls,"-root"))!==-1&&(ft>Xe&&(Ie=G.cloneElement(ct,{style:{display:"none"},eventKey:"".concat(ct.props.eventKey,"-hidden"),className:"".concat(lt)})),ft===Xe+1&&(_e.overflowedItems=le.slice(Xe+1).map(function(_t){return G.cloneElement(_t,{key:_t.props.eventKey,mode:"vertical-left"})}),Je=_e.getOverflowedSubMenuItem(ct.props.eventKey,_e.overflowedItems)));var tt=[].concat(Object(Re.a)(Be),[Je,Ie]);return ft===le.length-1&&tt.push(_e.getOverflowedSubMenuItem(ct.props.eventKey,[],!0)),tt}return[].concat(Object(Re.a)(Be),[Ie])},[])}},{key:"render",value:function(){var le=this.props,_e=le.visible,Xe=le.prefixCls,Be=le.overflowedIndicator,ct=le.mode,ft=le.level,Ie=le.tag,Je=le.children,tt=le.theme,_t=Object(he.a)(le,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),Tt=Ie;return G.createElement(Tt,Object.assign({},_t),this.renderChildren(Je))}}]),Ge}(G.Component);gt.defaultProps={tag:"div",className:""};var Ct=gt;function xt(st){return st.length?st.every(function(Ke){return!!Ke.props.disabled}):!0}function Ae(st,Ke,Ge){var Ue=st.getState();st.setState({activeKey:Object(Z.a)(Object(Z.a)({},Ue.activeKey),{},Object(m.a)({},Ke,Ge))})}function Ce(st){return st.eventKey||"0-menu-"}function Ve(st,Ke){var Ge=Ke,Ue=st.children,le=st.eventKey;if(Ge){var _e;if(ne(Ue,function(Xe,Be){Xe&&Xe.props&&!Xe.props.disabled&&Ge===z(Xe,le,Be)&&(_e=!0)}),_e)return Ge}return Ge=null,st.defaultActiveFirst&&ne(Ue,function(Xe,Be){!Ge&&Xe&&!Xe.props.disabled&&(Ge=z(Xe,le,Be))}),Ge}function Qe(st){if(st){var Ke=this.instanceArray.indexOf(st);Ke!==-1?this.instanceArray[Ke]=st:this.instanceArray.push(st)}}var Pe=function(st){Object(U.a)(Ge,st);var Ke=Object(M.a)(Ge);function Ge(Ue){var le;return Object(X.a)(this,Ge),le=Ke.call(this,Ue),le.onKeyDown=function(_e,Xe){var Be=_e.keyCode,ct;if(le.getFlatInstanceArray().forEach(function(Ie){Ie&&Ie.props.active&&Ie.onKeyDown&&(ct=Ie.onKeyDown(_e))}),ct)return 1;var ft=null;return(Be===f.a.UP||Be===f.a.DOWN)&&(ft=le.step(Be===f.a.UP?-1:1)),ft?(_e.preventDefault(),Ae(le.props.store,Ce(le.props),ft.props.eventKey),typeof Xe=="function"&&Xe(ft),1):void 0},le.onItemHover=function(_e){var Xe=_e.key,Be=_e.hover;Ae(le.props.store,Ce(le.props),Be?Xe:null)},le.onDeselect=function(_e){le.props.onDeselect(_e)},le.onSelect=function(_e){le.props.onSelect(_e)},le.onClick=function(_e){le.props.onClick(_e)},le.onOpenChange=function(_e){le.props.onOpenChange(_e)},le.onDestroy=function(_e){le.props.onDestroy(_e)},le.getFlatInstanceArray=function(){return le.instanceArray},le.step=function(_e){var Xe=le.getFlatInstanceArray(),Be=le.props.store.getState().activeKey[Ce(le.props)],ct=Xe.length;if(!ct)return null;_e<0&&(Xe=Xe.concat().reverse());var ft=-1;if(Xe.every(function(_t,Tt){return _t&&_t.props.eventKey===Be?(ft=Tt,!1):!0}),!le.props.defaultActiveFirst&&ft!==-1&&xt(Xe.slice(ft,ct-1)))return;var Ie=(ft+1)%ct,Je=Ie;do{var tt=Xe[Je];if(!tt||tt.props.disabled)Je=(Je+1)%ct;else return tt}while(Je!==Ie);return null},le.renderCommonMenuItem=function(_e,Xe,Be){var ct=le.props.store.getState(),ft=Object(V.a)(le),Ie=ft.props,Je=z(_e,Ie.eventKey,Xe),tt=_e.props;if(!tt||typeof _e.type=="string")return _e;var _t=Je===ct.activeKey,Tt=Object(Z.a)(Object(Z.a)({mode:tt.mode||Ie.mode,level:Ie.level,inlineIndent:Ie.inlineIndent,renderMenuItem:le.renderMenuItem,rootPrefixCls:Ie.prefixCls,index:Xe,parentMenu:Ie.parentMenu,manualRef:tt.disabled?void 0:Object(h.a)(_e.ref,Qe.bind(Object(V.a)(le))),eventKey:Je,active:!tt.disabled&&_t,multiple:Ie.multiple,onClick:function(nn){(tt.onClick||T)(nn),le.onClick(nn)},onItemHover:le.onItemHover,motion:Ie.motion,subMenuOpenDelay:Ie.subMenuOpenDelay,subMenuCloseDelay:Ie.subMenuCloseDelay,forceSubMenuRender:Ie.forceSubMenuRender,onOpenChange:le.onOpenChange,onDeselect:le.onDeselect,onSelect:le.onSelect,builtinPlacements:Ie.builtinPlacements,itemIcon:tt.itemIcon||le.props.itemIcon,expandIcon:tt.expandIcon||le.props.expandIcon},Be),{},{direction:Ie.direction});return(Ie.mode==="inline"||Oe())&&(Tt.triggerSubMenuAction="click"),G.cloneElement(_e,Tt)},le.renderMenuItem=function(_e,Xe,Be){if(!_e)return null;var ct=le.props.store.getState(),ft={openKeys:ct.openKeys,selectedKeys:ct.selectedKeys,triggerSubMenuAction:le.props.triggerSubMenuAction,subMenuKey:Be};return le.renderCommonMenuItem(_e,Xe,ft)},Ue.store.setState({activeKey:Object(Z.a)(Object(Z.a)({},Ue.store.getState().activeKey),{},Object(m.a)({},Ue.eventKey,Ve(Ue,Ue.activeKey)))}),le.instanceArray=[],le}return Object(P.a)(Ge,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(le){return this.props.visible||le.visible||this.props.className!==le.className||!o()(this.props.style,le.style)}},{key:"componentDidUpdate",value:function(le){var _e=this.props,Xe="activeKey"in _e?_e.activeKey:_e.store.getState().activeKey[Ce(_e)],Be=Ve(_e,Xe);if(Be!==Xe)Ae(_e.store,Ce(_e),Be);else if("activeKey"in le){var ct=Ve(le,le.activeKey);Be!==ct&&Ae(_e.store,Ce(_e),Be)}}},{key:"render",value:function(){var le=this,_e=Object(D.a)({},this.props);this.instanceArray=[];var Xe=i()(_e.prefixCls,_e.className,"".concat(_e.prefixCls,"-").concat(_e.mode)),Be={className:Xe,role:_e.role||"menu"};_e.id&&(Be.id=_e.id),_e.focusable&&(Be.tabIndex=0,Be.onKeyDown=this.onKeyDown);var ct=_e.prefixCls,ft=_e.eventKey,Ie=_e.visible,Je=_e.level,tt=_e.mode,_t=_e.overflowedIndicator,Tt=_e.theme;return xe.forEach(function(Zt){return delete _e[Zt]}),delete _e.onClick,G.createElement(Ct,Object.assign({},_e,{prefixCls:ct,mode:tt,tag:"ul",level:Je,theme:Tt,visible:Ie,overflowedIndicator:_t},Be),G.Children.map(_e.children,function(Zt,nn){return le.renderMenuItem(Zt,nn,ft||"0-menu-")}))}}]),Ge}(G.Component);Pe.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:T};var Fe=Object(W.b)()(Pe),be=Fe,fe=k("Kwbf");function pe(st,Ke,Ge){var Ue=st.prefixCls,le=st.motion,_e=st.defaultMotions,Xe=_e===void 0?{}:_e,Be=st.openAnimation,ct=st.openTransitionName,ft=Ke.switchingModeFromInline;if(le)return le;if(Object(a.a)(Be)==="object"&&Be)Object(fe.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof Be=="string")return{motionName:"".concat(Ue,"-open-").concat(Be)};if(ct)return{motionName:ct};var Ie=Xe[Ge];return Ie||(ft?null:Xe.other)}var ie=function(st){Object(U.a)(Ge,st);var Ke=Object(M.a)(Ge);function Ge(Ue){var le;Object(X.a)(this,Ge),le=Ke.call(this,Ue),le.inlineOpenKeys=[],le.onSelect=function(Be){var ct=Object(V.a)(le),ft=ct.props;if(ft.selectable){var Ie=le.store.getState(),Je=Ie.selectedKeys,tt=Be.key;ft.multiple?Je=Je.concat([tt]):Je=[tt],"selectedKeys"in ft||le.store.setState({selectedKeys:Je}),ft.onSelect(Object(Z.a)(Object(Z.a)({},Be),{},{selectedKeys:Je}))}},le.onClick=function(Be){var ct=le.getRealMenuMode(),ft=Object(V.a)(le),Ie=ft.store,Je=ft.props.onOpenChange;ct!=="inline"&&!("openKeys"in le.props)&&(Ie.setState({openKeys:[]}),Je([])),le.props.onClick(Be)},le.onKeyDown=function(Be,ct){le.innerMenu.getWrappedInstance().onKeyDown(Be,ct)},le.onOpenChange=function(Be){var ct=Object(V.a)(le),ft=ct.props,Ie=le.store.getState().openKeys.concat(),Je=!1,tt=function(Tt){var Zt=!1;if(Tt.open)Zt=Ie.indexOf(Tt.key)===-1,Zt&&Ie.push(Tt.key);else{var nn=Ie.indexOf(Tt.key);Zt=nn!==-1,Zt&&Ie.splice(nn,1)}Je=Je||Zt};Array.isArray(Be)?Be.forEach(tt):tt(Be),Je&&("openKeys"in le.props||le.store.setState({openKeys:Ie}),ft.onOpenChange(Ie))},le.onDeselect=function(Be){var ct=Object(V.a)(le),ft=ct.props;if(ft.selectable){var Ie=le.store.getState().selectedKeys.concat(),Je=Be.key,tt=Ie.indexOf(Je);tt!==-1&&Ie.splice(tt,1),"selectedKeys"in ft||le.store.setState({selectedKeys:Ie}),ft.onDeselect(Object(Z.a)(Object(Z.a)({},Be),{},{selectedKeys:Ie}))}},le.onMouseEnter=function(Be){le.restoreModeVerticalFromInline();var ct=le.props.onMouseEnter;ct&&ct(Be)},le.onTransitionEnd=function(Be){var ct=Be.propertyName==="width"&&Be.target===Be.currentTarget,ft=Be.target.className,Ie=Object.prototype.toString.call(ft)==="[object SVGAnimatedString]"?ft.animVal:ft,Je=Be.propertyName==="font-size"&&Ie.indexOf("anticon")>=0;(ct||Je)&&le.restoreModeVerticalFromInline()},le.setInnerMenu=function(Be){le.innerMenu=Be},le.isRootMenu=!0;var _e=Ue.defaultSelectedKeys,Xe=Ue.defaultOpenKeys;return"selectedKeys"in Ue&&(_e=Ue.selectedKeys||[]),"openKeys"in Ue&&(Xe=Ue.openKeys||[]),le.store=Object(W.c)({selectedKeys:_e,openKeys:Xe,activeKey:{"0-menu-":Ve(Ue,Ue.activeKey)}}),le.state={switchingModeFromInline:!1},le}return Object(P.a)(Ge,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(le){this.updateOpentKeysWhenSwitchMode(le),this.updateMiniStore();var _e=this.props,Xe=_e.siderCollapsed,Be=_e.inlineCollapsed,ct=_e.onOpenChange;(!le.inlineCollapsed&&Be||!le.siderCollapsed&&Xe)&&ct([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(le){var _e=this.props,Xe=this.store,Be=this.inlineOpenKeys,ct=Xe.getState(),ft={};le.mode==="inline"&&_e.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in _e||((_e.inlineCollapsed&&!le.inlineCollapsed||_e.siderCollapsed&&!le.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=ct.openKeys.concat(),ft.openKeys=[]),(!_e.inlineCollapsed&&le.inlineCollapsed||!_e.siderCollapsed&&le.siderCollapsed)&&(ft.openKeys=Be,this.inlineOpenKeys=[])),Object.keys(ft).length&&Xe.setState(ft)}},{key:"updateMenuDisplay",value:function(){var le=this.props.collapsedWidth,_e=this.store,Xe=this.prevOpenKeys,Be=this.getInlineCollapsed()&&(le===0||le==="0"||le==="0px");Be?(this.prevOpenKeys=_e.getState().openKeys.concat(),this.store.setState({openKeys:[]})):Xe&&(this.store.setState({openKeys:Xe}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var le=this.props.mode,_e=this.state.switchingModeFromInline,Xe=this.getInlineCollapsed();return _e&&Xe?"inline":Xe?"vertical":le}},{key:"getInlineCollapsed",value:function(){var le=this.props,_e=le.inlineCollapsed,Xe=le.siderCollapsed;return Xe!==void 0?Xe:_e}},{key:"restoreModeVerticalFromInline",value:function(){var le=this.state.switchingModeFromInline;le&&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 le=Object(Z.a)({},Object(n.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),_e=this.getRealMenuMode();return le.className+=" ".concat(le.prefixCls,"-root"),le.direction==="rtl"&&(le.className+=" ".concat(le.prefixCls,"-rtl")),le=Object(Z.a)(Object(Z.a)({},le),{},{mode:_e,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:pe(this.props,this.state,_e)}),delete le.openAnimation,delete le.openTransitionName,G.createElement(W.a,{store:this.store},G.createElement(be,Object.assign({},le,{ref:this.setInnerMenu}),this.props.children))}}]),Ge}(G.Component);ie.defaultProps={selectable:!0,onClick:T,onSelect:T,onOpenChange:T,onDeselect:T,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:G.createElement("span",null,"\xB7\xB7\xB7")};var ae=ie,ce=function(st){Object(U.a)(Ge,st);var Ke=Object(M.a)(Ge);function Ge(){var Ue;return Object(X.a)(this,Ge),Ue=Ke.apply(this,arguments),Ue.onKeyDown=function(le){var _e=le.keyCode;return _e===f.a.ENTER?(Ue.onClick(le),!0):void 0},Ue.onMouseLeave=function(le){var _e=Ue.props,Xe=_e.eventKey,Be=_e.onItemHover,ct=_e.onMouseLeave;Be({key:Xe,hover:!1}),ct({key:Xe,domEvent:le})},Ue.onMouseEnter=function(le){var _e=Ue.props,Xe=_e.eventKey,Be=_e.onItemHover,ct=_e.onMouseEnter;Be({key:Xe,hover:!0}),ct({key:Xe,domEvent:le})},Ue.onClick=function(le){var _e=Ue.props,Xe=_e.eventKey,Be=_e.multiple,ct=_e.onClick,ft=_e.onSelect,Ie=_e.onDeselect,Je=_e.isSelected,tt={key:Xe,keyPath:[Xe],item:Object(V.a)(Ue),domEvent:le};ct(tt),Be?Je?Ie(tt):ft(tt):Je||ft(tt)},Ue.saveNode=function(le){Ue.node=le},Ue}return Object(P.a)(Ge,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var le=this.props;le.onDestroy&&le.onDestroy(le.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 le,_e=Object(Z.a)({},this.props),Xe=i()(this.getPrefixCls(),_e.className,(le={},Object(m.a)(le,this.getActiveClassName(),!_e.disabled&&_e.active),Object(m.a)(le,this.getSelectedClassName(),_e.isSelected),Object(m.a)(le,this.getDisabledClassName(),_e.disabled),le)),Be=Object(Z.a)(Object(Z.a)({},_e.attribute),{},{title:typeof _e.title=="string"?_e.title:void 0,className:Xe,role:_e.role||"menuitem","aria-disabled":_e.disabled});_e.role==="option"?Be=Object(Z.a)(Object(Z.a)({},Be),{},{role:"option","aria-selected":_e.isSelected}):(_e.role===null||_e.role==="none")&&(Be.role="none");var ct={onClick:_e.disabled?null:this.onClick,onMouseLeave:_e.disabled?null:this.onMouseLeave,onMouseEnter:_e.disabled?null:this.onMouseEnter},ft=Object(Z.a)({},_e.style);_e.mode==="inline"&&(_e.direction==="rtl"?ft.paddingRight=_e.inlineIndent*_e.level:ft.paddingLeft=_e.inlineIndent*_e.level),xe.forEach(function(Je){return delete _e[Je]}),delete _e.direction;var Ie=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Ie=G.createElement(this.props.itemIcon,this.props)),G.createElement("li",Object.assign({},Object(n.default)(_e,["onClick","onMouseEnter","onMouseLeave","onSelect"]),Be,ct,{style:ft,ref:this.saveNode}),_e.children,Ie)}}]),Ge}(G.Component);ce.isMenuItem=!0,ce.defaultProps={onSelect:T,onMouseEnter:T,onMouseLeave:T,manualRef:T};var me=Object(W.b)(function(st,Ke){var Ge=st.activeKey,Ue=st.selectedKeys,le=Ke.eventKey,_e=Ke.subMenuKey;return{active:Ge[_e]===le,isSelected:Ue.indexOf(le)!==-1}})(ce),Te=me,ke=function(st){Object(U.a)(Ge,st);var Ke=Object(M.a)(Ge);function Ge(){var Ue;return Object(X.a)(this,Ge),Ue=Ke.apply(this,arguments),Ue.renderInnerMenuItem=function(le){var _e=Ue.props,Xe=_e.renderMenuItem,Be=_e.index;return Xe(le,Be,Ue.props.subMenuKey)},Ue}return Object(P.a)(Ge,[{key:"render",value:function(){var le=Object(D.a)({},this.props),_e=le.className,Xe=_e===void 0?"":_e,Be=le.rootPrefixCls,ct="".concat(Be,"-item-group-title"),ft="".concat(Be,"-item-group-list"),Ie=le.title,Je=le.children;return xe.forEach(function(tt){return delete le[tt]}),delete le.onClick,delete le.direction,G.createElement("li",Object.assign({},le,{className:"".concat(Xe," ").concat(Be,"-item-group")}),G.createElement("div",{className:ct,title:typeof Ie=="string"?Ie:void 0},Ie),G.createElement("ul",{className:ft},G.Children.map(Je,this.renderInnerMenuItem)))}}]),Ge}(G.Component);ke.isMenuItemGroup=!0,ke.defaultProps={disabled:!0};var $e=ke,pt=function(Ke){var Ge=Ke.className,Ue=Ke.rootPrefixCls,le=Ke.style;return G.createElement("li",{className:"".concat(Ge," ").concat(Ue,"-item-divider"),style:le})};pt.defaultProps={disabled:!0,className:"",style:{}};var Ot=pt,vt=oe.e=ae},"24hK":function(je,oe,k){"use strict";k.d(oe,"a",function(){return X});class Z{constructor(P){this.element=P,this.next=Z.Undefined,this.prev=Z.Undefined}}Z.Undefined=new Z(void 0);class X{constructor(){this._first=Z.Undefined,this._last=Z.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Z.Undefined}clear(){let P=this._first;for(;P!==Z.Undefined;){const V=P.next;P.prev=Z.Undefined,P.next=Z.Undefined,P=V}this._first=Z.Undefined,this._last=Z.Undefined,this._size=0}unshift(P){return this._insert(P,!1)}push(P){return this._insert(P,!0)}_insert(P,V){const U=new Z(P);if(this._first===Z.Undefined)this._first=U,this._last=U;else if(V){const G=this._last;this._last=U,U.prev=G,G.next=U}else{const G=this._first;this._first=U,U.next=G,G.prev=U}this._size+=1;let M=!1;return()=>{M||(M=!0,this._remove(U))}}shift(){if(this._first===Z.Undefined)return;{const P=this._first.element;return this._remove(this._first),P}}pop(){if(this._last===Z.Undefined)return;{const P=this._last.element;return this._remove(this._last),P}}_remove(P){if(P.prev!==Z.Undefined&&P.next!==Z.Undefined){const V=P.prev;V.next=P.next,P.next.prev=V}else P.prev===Z.Undefined&&P.next===Z.Undefined?(this._first=Z.Undefined,this._last=Z.Undefined):P.next===Z.Undefined?(this._last=this._last.prev,this._last.next=Z.Undefined):P.prev===Z.Undefined&&(this._first=this._first.next,this._first.prev=Z.Undefined);this._size-=1}*[Symbol.iterator](){let P=this._first;for(;P!==Z.Undefined;)yield P.element,P=P.next}}},"3/fG":function(je,oe,k){"use strict";k.d(oe,"a",function(){return X});function Z(P,V){let U;return V.length===0?U=P:U=P.replace(/\{(\d+)\}/g,function(M,G){const W=G[0];return typeof V[W]!="undefined"?V[W]:M}),U}function X(P,V,...U){return Z(V,U)}},"55Ip":function(je,oe,k){"use strict";k.d(oe,"a",function(){return r});var Z=k("Ty5D"),X=k("dI71"),P=k("q1tI"),V=k.n(P),U=k("YS25"),M=k("17x9"),G=k.n(M),W=k("wx14"),n=k("zLVn"),D=k("9R94"),m=function(b){Object(X.a)(g,b);function g(){for(var C,E=arguments.length,v=new Array(E),N=0;N<E;N++)v[N]=arguments[N];return C=b.call.apply(b,[this].concat(v))||this,C.history=Object(U.a)(C.props),C}var p=g.prototype;return p.render=function(){return V.a.createElement(Z.c,{history:this.history,children:this.props.children})},g}(V.a.Component),f=function(b){Object(X.a)(g,b);function g(){for(var C,E=arguments.length,v=new Array(E),N=0;N<E;N++)v[N]=arguments[N];return C=b.call.apply(b,[this].concat(v))||this,C.history=Object(U.b)(C.props),C}var p=g.prototype;return p.render=function(){return V.a.createElement(Z.c,{history:this.history,children:this.props.children})},g}(V.a.Component),h=function(g,p){return typeof g=="function"?g(p):g},c=function(g,p){return typeof g=="string"?Object(U.c)(g,null,null,p):g},o=function(g){return g},d=V.a.forwardRef;typeof d=="undefined"&&(d=o);function i(b){return!!(b.metaKey||b.altKey||b.ctrlKey||b.shiftKey)}var a=d(function(b,g){var p=b.innerRef,C=b.navigate,E=b.onClick,v=Object(n.a)(b,["innerRef","navigate","onClick"]),N=v.target,F=Object(W.a)({},v,{onClick:function(H){try{E&&E(H)}catch(j){throw H.preventDefault(),j}!H.defaultPrevented&&H.button===0&&(!N||N==="_self")&&!i(H)&&(H.preventDefault(),C())}});return o!==d?F.ref=g||p:F.ref=p,V.a.createElement("a",F)}),r=d(function(b,g){var p=b.component,C=p===void 0?a:p,E=b.replace,v=b.to,N=b.innerRef,F=Object(n.a)(b,["component","replace","to","innerRef"]);return V.a.createElement(Z.e.Consumer,null,function(A){A||Object(D.a)(!1);var H=A.history,j=c(h(v,A.location),A.location),T=j?H.createHref(j):"",z=Object(W.a)({},F,{href:T,navigate:function(){var ne=h(v,A.location),se=E?H.replace:H.push;se(ne)}});return o!==d?z.ref=g||N:z.innerRef=N,V.a.createElement(C,z)})});if(!1)var s,S;var w=function(g){return g},x=V.a.forwardRef;typeof x=="undefined"&&(x=w);function L(){for(var b=arguments.length,g=new Array(b),p=0;p<b;p++)g[p]=arguments[p];return g.filter(function(C){return C}).join(" ")}var O=x(function(b,g){var p=b["aria-current"],C=p===void 0?"page":p,E=b.activeClassName,v=E===void 0?"active":E,N=b.activeStyle,F=b.className,A=b.exact,H=b.isActive,j=b.location,T=b.sensitive,z=b.strict,Q=b.style,ne=b.to,se=b.innerRef,xe=Object(n.a)(b,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return V.a.createElement(Z.e.Consumer,null,function(ge){ge||Object(D.a)(!1);var ve=j||ge.location,Oe=c(h(ne,ve),ve),Re=Oe.pathname,he=Re&&Re.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),ue=he?Object(Z.f)(ve.pathname,{path:he,exact:A,sensitive:T,strict:z}):null,Me=!!(H?H(ue,ve):ue),et=Me?L(F,v):F,it=Me?Object(W.a)({},Q,{},N):Q,nt=Object(W.a)({"aria-current":Me&&C||null,className:et,style:it,to:Oe},xe);return w!==x?nt.ref=g||se:nt.innerRef=se,V.a.createElement(r,nt)})});if(!1)var _},"5VLF":function(je,oe,k){"use strict";var Z,X;function P(V,U,M){var G=function(W,n){return V.js_beautify(W,n)};return G.js=V.js_beautify,G.css=U.css_beautify,G.html=M.html_beautify,G.js_beautify=V.js_beautify,G.css_beautify=U.css_beautify,G.html_beautify=M.html_beautify,G}!(Z=[k("6UM0"),k("TXwP"),k("psGv")],X=function(V,U,M){return P(V,U,M)}.apply(oe,Z),X!==void 0&&(je.exports=X))},"5Y4S":function(je,oe,k){"use strict";k.d(oe,"a",function(){return P});var Z=k("MNsG");const X=Z.b.performance&&typeof Z.b.performance.now=="function";class P{constructor(V){this._highResolution=X&&V,this._startTime=this._now(),this._stopTime=-1}static create(V=!0){return new P(V)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?Z.b.performance.now():Date.now()}}},"5nXd":function(je,oe,k){var Z=k("MFOe"),X=Z.slice,P=Z.pluck,V=Z.each,U=Z.bind,M=Z.create,G=Z.isList,W=Z.isFunction,n=Z.isObject;je.exports={createStore:f};var D={version:"2.0.12",enabled:!1,get:function(h,c){var o=this.storage.read(this._namespacePrefix+h);return this._deserialize(o,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(o,d){h.call(c,c._deserialize(o),(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 m(){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,o){o||(o=""),h&&!G(h)&&(h=[h]),c&&!G(c)&&(c=[c]);var d=o?"__storejs_"+o+"_":"",i=o?new RegExp("^"+d):null,a=/^[a-zA-Z0-9_\-]*$/;if(!a.test(o))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var r={_namespacePrefix:d,_namespaceRegexp:i,_testStorage:function(S){try{var w="__storejs__test__";S.write(w,w);var x=S.read(w)===w;return S.remove(w),x}catch(L){return!1}},_assignPluginFnProp:function(S,w){var x=this[w];this[w]=function(){var O=X(arguments,0),_=this;function b(){return x?(V(arguments,function(p,C){O[C]=p}),x.apply(_,O)):void 0}var g=[b].concat(O);return S.apply(_,g)}},_serialize:function(S){return JSON.stringify(S)},_deserialize:function(S,w){if(!S)return w;var x="";try{x=JSON.parse(S)}catch(L){x=S}return x!==void 0?x:w},_addStorage:function(S){if(this.enabled)return;this._testStorage(S)&&(this.storage=S,this.enabled=!0)},_addPlugin:function(S){var w=this;if(G(S)){V(S,function(O){w._addPlugin(O)});return}var x=P(this.plugins,function(O){return S===O});if(x)return;if(this.plugins.push(S),!W(S))throw new Error("Plugins must be function values that return objects");var L=S.call(this);if(!n(L))throw new Error("Plugins must return an object of function properties");V(L,function(O,_){if(!W(O))throw new Error("Bad plugin property: "+_+" from plugin "+S.name+". Plugins should only return functions.");w._assignPluginFnProp(O,_)})},addStorage:function(S){m("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(S)}},s=M(r,D,{plugins:[]});return s.raw={},V(s,function(S,w){W(S)&&(s.raw[w]=U(s,S))}),V(h,function(S){s._addStorage(S)}),V(c,function(S){s._addPlugin(S)}),s}},"6+eU":function(je,oe,k){"use strict";k.d(oe,"a",function(){return x});var Z=k("wx14"),X=k("rePB"),P=k("VTBJ"),V=k("1OyB"),U=k("vuIU"),M=k("Ji7U"),G=k("LK+K"),W=k("q1tI"),n=k.n(W),D=k("TSYQ"),m=k.n(D),f=function(O){var _,b="".concat(O.rootPrefixCls,"-item"),g=m()(b,"".concat(b,"-").concat(O.page),(_={},Object(X.a)(_,"".concat(b,"-active"),O.active),Object(X.a)(_,O.className,!!O.className),Object(X.a)(_,"".concat(b,"-disabled"),!O.page),_)),p=function(){O.onClick(O.page)},C=function(v){O.onKeyPress(v,O.onClick,O.page)};return n.a.createElement("li",{title:O.showTitle?O.page:null,className:g,onClick:p,onKeyPress:C,tabIndex:"0"},O.itemRender(O.page,"page",n.a.createElement("a",{rel:"nofollow"},O.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},o=function(L){Object(M.a)(_,L);var O=Object(G.a)(_);function _(){var b;Object(V.a)(this,_);for(var g=arguments.length,p=new Array(g),C=0;C<g;C++)p[C]=arguments[C];return b=O.call.apply(O,[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,N=v.goButton,F=v.quickGo,A=v.rootPrefixCls,H=b.state.goInputText;if(N||H==="")return;if(E.relatedTarget&&(E.relatedTarget.className.indexOf("".concat(A,"-prev"))>=0||E.relatedTarget.className.indexOf("".concat(A,"-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(U.a)(_,[{key:"getValidValue",value:function(){var g=this.state,p=g.goInputText,C=g.current;return!p||isNaN(p)?C:Number(p)}},{key:"getPageSizeOptions",value:function(){var g=this.props,p=g.pageSize,C=g.pageSizeOptions;return C.some(function(E){return E.toString()===p.toString()})?C:C.concat([p.toString()]).sort(function(E,v){var N=isNaN(Number(E))?0:Number(E),F=isNaN(Number(v))?0:Number(v);return N-F})}},{key:"render",value:function(){var g=this,p=this.props,C=p.pageSize,E=p.locale,v=p.rootPrefixCls,N=p.changeSize,F=p.quickGo,A=p.goButton,H=p.selectComponentClass,j=p.buildOptionText,T=p.selectPrefixCls,z=p.disabled,Q=this.state.goInputText,ne="".concat(v,"-options"),se=H,xe=null,ge=null,ve=null;if(!N&&!F)return null;var Oe=this.getPageSizeOptions();if(N&&se){var Re=Oe.map(function(he,ue){return n.a.createElement(se.Option,{key:ue,value:he.toString()},(j||g.buildOptionText)(he))});xe=n.a.createElement(se,{disabled:z,prefixCls:T,showSearch:!1,className:"".concat(ne,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(C||Oe[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ue){return ue.parentNode}},Re)}return F&&(A&&(ve=typeof A=="boolean"?n.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:z,className:"".concat(ne,"-quick-jumper-button")},E.jump_to_confirm):n.a.createElement("span",{onClick:this.go,onKeyUp:this.go},A)),ge=n.a.createElement("div",{className:"".concat(ne,"-quick-jumper")},E.jump_to,n.a.createElement("input",{disabled:z,type:"text",value:Q,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),E.page,ve)),n.a.createElement("li",{className:"".concat(ne)},xe,ge)}}]),_}(n.a.Component);o.defaultProps={pageSizeOptions:["10","20","50","100"]};var d=o,i=k("N2Kk");function a(){}function r(L){return typeof L=="number"&&isFinite(L)&&Math.floor(L)===L}function s(L,O,_){return _}function S(L,O,_){var b=typeof L=="undefined"?O.pageSize:L;return Math.floor((_.total-1)/b)+1}var w=function(L){Object(M.a)(_,L);var O=Object(G.a)(_);function _(b){var g;Object(V.a)(this,_),g=O.call(this,b),g.getJumpPrevPage=function(){return Math.max(1,g.state.current-(g.props.showLessItems?3:5))},g.getJumpNextPage=function(){return Math.min(S(void 0,g.state,g.props),g.state.current+(g.props.showLessItems?3:5))},g.getItemIcon=function(N,F){var A=g.props.prefixCls,H=N||n.a.createElement("button",{type:"button","aria-label":F,className:"".concat(A,"-item-link")});return typeof N=="function"&&(H=n.a.createElement(N,Object(P.a)({},g.props))),H},g.savePaginationNode=function(N){g.paginationNode=N},g.isValid=function(N){return r(N)&&N!==g.state.current},g.shouldDisplayQuickJumper=function(){var N=g.props,F=N.showQuickJumper,A=N.pageSize,H=N.total;return H<=A?!1:F},g.handleKeyDown=function(N){(N.keyCode===c.ARROW_UP||N.keyCode===c.ARROW_DOWN)&&N.preventDefault()},g.handleKeyUp=function(N){var F=g.getValidValue(N),A=g.state.currentInputValue;F!==A&&g.setState({currentInputValue:F}),N.keyCode===c.ENTER?g.handleChange(F):N.keyCode===c.ARROW_UP?g.handleChange(F-1):N.keyCode===c.ARROW_DOWN&&g.handleChange(F+1)},g.changePageSize=function(N){var F=g.state.current,A=S(N,g.state,g.props);F=F>A?A:F,A===0&&(F=g.state.current),typeof N=="number"&&("pageSize"in g.props||g.setState({pageSize:N}),"current"in g.props||g.setState({current:F,currentInputValue:F})),g.props.onShowSizeChange(F,N),"onChange"in g.props&&g.props.onChange&&g.props.onChange(F,N)},g.handleChange=function(N){var F=g.props.disabled,A=N;if(g.isValid(A)&&!F){var H=S(void 0,g.state,g.props);A>H?A=H:A<1&&(A=1),"current"in g.props||g.setState({current:A,currentInputValue:A});var j=g.state.pageSize;return g.props.onChange(A,j),A}return g.state.current},g.prev=function(){g.hasPrev()&&g.handleChange(g.state.current-1)},g.next=function(){g.hasNext()&&g.handleChange(g.state.current+1)},g.jumpPrev=function(){g.handleChange(g.getJumpPrevPage())},g.jumpNext=function(){g.handleChange(g.getJumpNextPage())},g.hasPrev=function(){return g.state.current>1},g.hasNext=function(){return g.state.current<S(void 0,g.state,g.props)},g.runIfEnter=function(N,F){if(N.key==="Enter"||N.charCode===13){for(var A=arguments.length,H=new Array(A>2?A-2:0),j=2;j<A;j++)H[j-2]=arguments[j];F.apply(void 0,H)}},g.runIfEnterPrev=function(N){g.runIfEnter(N,g.prev)},g.runIfEnterNext=function(N){g.runIfEnter(N,g.next)},g.runIfEnterJumpPrev=function(N){g.runIfEnter(N,g.jumpPrev)},g.runIfEnterJumpNext=function(N){g.runIfEnter(N,g.jumpNext)},g.handleGoTO=function(N){(N.keyCode===c.ENTER||N.type==="click")&&g.handleChange(g.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,S(v,void 0,b)),g.state={current:E,currentInputValue:E,pageSize:v},g}return Object(U.a)(_,[{key:"componentDidUpdate",value:function(g,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(g){var p=g.target.value,C=S(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 g=this.props,p=g.showSizeChanger,C=g.total,E=g.totalBoundaryShowSizeChanger;return typeof p!="undefined"?p:C>E}},{key:"renderPrev",value:function(g){var p=this.props,C=p.prevIcon,E=p.itemRender,v=E(g,"prev",this.getItemIcon(C,"prev page")),N=!this.hasPrev();return Object(W.isValidElement)(v)?Object(W.cloneElement)(v,{disabled:N}):v}},{key:"renderNext",value:function(g){var p=this.props,C=p.nextIcon,E=p.itemRender,v=E(g,"next",this.getItemIcon(C,"next page")),N=!this.hasNext();return Object(W.isValidElement)(v)?Object(W.cloneElement)(v,{disabled:N}):v}},{key:"render",value:function(){var g=this,p=this.props,C=p.prefixCls,E=p.className,v=p.style,N=p.disabled,F=p.hideOnSinglePage,A=p.total,H=p.locale,j=p.showQuickJumper,T=p.showLessItems,z=p.showTitle,Q=p.showTotal,ne=p.simple,se=p.itemRender,xe=p.showPrevNextJumpers,ge=p.jumpPrevIcon,ve=p.jumpNextIcon,Oe=p.selectComponentClass,Re=p.selectPrefixCls,he=p.pageSizeOptions,ue=this.state,Me=ue.current,et=ue.pageSize,it=ue.currentInputValue;if(F===!0&&A<=et)return null;var nt=S(void 0,this.state,this.props),at=[],ze=null,Ze=null,ot=null,de=null,Se=null,Le=j&&j.goButton,De=T?1:2,qe=Me-1>0?Me-1:0,lt=Me+1<nt?Me+1:nt,mt=Object.keys(this.props).reduce(function(ie,ae){return(ae.substr(0,5)==="data-"||ae.substr(0,5)==="aria-"||ae==="role")&&(ie[ae]=g.props[ae]),ie},{});if(ne)return Le&&(typeof Le=="boolean"?Se=n.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},H.jump_to_confirm):Se=n.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Le),Se=n.a.createElement("li",{title:z?"".concat(H.jump_to).concat(Me,"/").concat(nt):null,className:"".concat(C,"-simple-pager")},Se)),n.a.createElement("ul",Object(Z.a)({className:m()(C,"".concat(C,"-simple"),Object(X.a)({},"".concat(C,"-disabled"),N),E),style:v,ref:this.savePaginationNode},mt),n.a.createElement("li",{title:z?H.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:m()("".concat(C,"-prev"),Object(X.a)({},"".concat(C,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(qe)),n.a.createElement("li",{title:z?"".concat(Me,"/").concat(nt):null,className:"".concat(C,"-simple-pager")},n.a.createElement("input",{type:"text",value:it,disabled:N,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),n.a.createElement("span",{className:"".concat(C,"-slash")},"/"),nt),n.a.createElement("li",{title:z?H.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:m()("".concat(C,"-next"),Object(X.a)({},"".concat(C,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(lt)),Se);if(nt<=3+De*2){var gt={locale:H,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:z,itemRender:se};nt||at.push(n.a.createElement(h,Object(Z.a)({},gt,{key:"noPager",page:nt,className:"".concat(C,"-disabled")})));for(var Ct=1;Ct<=nt;Ct+=1){var xt=Me===Ct;at.push(n.a.createElement(h,Object(Z.a)({},gt,{key:Ct,page:Ct,active:xt})))}}else{var Ae=T?H.prev_3:H.prev_5,Ce=T?H.next_3:H.next_5;xe&&(ze=n.a.createElement("li",{title:z?Ae:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:m()("".concat(C,"-jump-prev"),Object(X.a)({},"".concat(C,"-jump-prev-custom-icon"),!!ge))},se(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(ge,"prev page"))),Ze=n.a.createElement("li",{title:z?Ce:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:m()("".concat(C,"-jump-next"),Object(X.a)({},"".concat(C,"-jump-next-custom-icon"),!!ve))},se(this.getJumpNextPage(),"jump-next",this.getItemIcon(ve,"next page")))),de=n.a.createElement(h,{locale:H,last:!0,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:nt,page:nt,active:!1,showTitle:z,itemRender:se}),ot=n.a.createElement(h,{locale:H,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:z,itemRender:se});var Ve=Math.max(1,Me-De),Qe=Math.min(Me+De,nt);Me-1<=De&&(Qe=1+De*2),nt-Me<=De&&(Ve=nt-De*2);for(var Pe=Ve;Pe<=Qe;Pe+=1){var Fe=Me===Pe;at.push(n.a.createElement(h,{locale:H,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Pe,page:Pe,active:Fe,showTitle:z,itemRender:se}))}Me-1>=De*2&&Me!==1+2&&(at[0]=Object(W.cloneElement)(at[0],{className:"".concat(C,"-item-after-jump-prev")}),at.unshift(ze)),nt-Me>=De*2&&Me!==nt-2&&(at[at.length-1]=Object(W.cloneElement)(at[at.length-1],{className:"".concat(C,"-item-before-jump-next")}),at.push(Ze)),Ve!==1&&at.unshift(ot),Qe!==nt&&at.push(de)}var be=null;Q&&(be=n.a.createElement("li",{className:"".concat(C,"-total-text")},Q(A,[A===0?0:(Me-1)*et+1,Me*et>A?A:Me*et])));var fe=!this.hasPrev()||!nt,pe=!this.hasNext()||!nt;return n.a.createElement("ul",Object(Z.a)({className:m()(C,E,Object(X.a)({},"".concat(C,"-disabled"),N)),style:v,unselectable:"unselectable",ref:this.savePaginationNode},mt),be,n.a.createElement("li",{title:z?H.prev_page:null,onClick:this.prev,tabIndex:fe?null:0,onKeyPress:this.runIfEnterPrev,className:m()("".concat(C,"-prev"),Object(X.a)({},"".concat(C,"-disabled"),fe)),"aria-disabled":fe},this.renderPrev(qe)),at,n.a.createElement("li",{title:z?H.next_page:null,onClick:this.next,tabIndex:pe?null:0,onKeyPress:this.runIfEnterNext,className:m()("".concat(C,"-next"),Object(X.a)({},"".concat(C,"-disabled"),pe)),"aria-disabled":pe},this.renderNext(lt)),n.a.createElement(d,{disabled:N,locale:H,rootPrefixCls:C,selectComponentClass:Oe,selectPrefixCls:Re,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Me,pageSize:et,pageSizeOptions:he,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Le}))}}],[{key:"getDerivedStateFromProps",value:function(g,p){var C={};if("current"in g&&(C.current=g.current,g.current!==p.current&&(C.currentInputValue=C.current)),"pageSize"in g&&g.pageSize!==p.pageSize){var E=p.current,v=S(g.pageSize,p,g);E=E>v?v:E,"current"in g||(C.current=E,C.currentInputValue=E),C.pageSize=g.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:s,totalBoundaryShowSizeChanger:50};var x=w},"6RRn":function(je,oe,k){"use strict";var Z=k("wCXF"),X=k("n6Qo");k.d(oe,"b",function(){return X.a});var P=k("IBYe"),V=k("6eGT"),U=k("hW8S");k.d(oe,"a",function(){return U.a}),oe.c=Z.b},"6UM0":function(je,oe,k){var Z,X;(function(){var P;(function(){"use strict";var U=[function(n,D,m){var f=m(1).Beautifier,h=m(5).Options;function c(o,d){var i=new f(o,d);return i.beautify()}n.exports=c,n.exports.defaultOptions=function(){return new h}},function(n,D,m){var f=m(2).Output,h=m(3).Token,c=m(4),o=m(5).Options,d=m(7).Tokenizer,i=m(7).line_starters,a=m(7).positionable_operators,r=m(7).TOKEN;function s(T,z){return z.indexOf(T)!==-1}function S(T){return T.replace(/^\s+/g,"")}function w(T){for(var z={},Q=0;Q<T.length;Q++)z[T[Q].replace(/-/g,"_")]=T[Q];return z}function x(T,z){return T&&T.type===r.RESERVED&&T.text===z}function L(T,z){return T&&T.type===r.RESERVED&&s(T.text,z)}var O=["case","return","do","if","throw","else","await","break","continue","async"],_=["before-newline","after-newline","preserve-newline"],b=w(_),g=[b.before_newline,b.preserve_newline],p={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function C(T,z){if(z.multiline_frame||z.mode===p.ForInitializer||z.mode===p.Conditional)return;T.remove_indent(z.start_line_index)}function E(T){T=T.replace(c.allLineBreaks,`
|
|
`);for(var z=[],Q=T.indexOf(`
|
|
`);Q!==-1;)z.push(T.substring(0,Q)),T=T.substring(Q+1),Q=T.indexOf(`
|
|
`);return T.length&&z.push(T),z}function v(T){return T===p.ArrayLiteral}function N(T){return s(T,[p.Expression,p.ForInitializer,p.Conditional])}function F(T,z){for(var Q=0;Q<T.length;Q++){var ne=T[Q].trim();if(ne.charAt(0)!==z)return!1}return!0}function A(T,z){for(var Q=0,ne=T.length,se;Q<ne;Q++)if(se=T[Q],se&&se.indexOf(z)!==0)return!1;return!0}function H(T,z){z=z||{},this._source_text=T||"",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 o(z)}H.prototype.create_flags=function(T,z){var Q=0;T&&(Q=T.indentation_level,!this._output.just_added_newline()&&T.line_indent_level>Q&&(Q=T.line_indent_level));var ne={mode:z,parent:T,last_token:T?T.last_token:new h(r.START_BLOCK,""),last_word:T?T.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:T?T.line_indent_level:Q,start_line_index:this._output.get_line_number(),ternary_depth:0};return ne},H.prototype._reset=function(T){var z=T.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new f(this._options,z),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(p.BlockStatement);var Q=new d(T,this._options);return this._tokens=Q.tokenize(),T},H.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var T,z=this._reset(this._source_text),Q=this._options.eol;this._options.eol==="auto"&&(Q=`
|
|
`,z&&c.lineBreak.test(z||"")&&(Q=z.match(c.lineBreak)[0]));for(var ne=this._tokens.next();ne;)this.handle_token(ne),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ne,ne=this._tokens.next();return T=this._output.get_code(Q),T},H.prototype.handle_token=function(T,z){T.type===r.START_EXPR?this.handle_start_expr(T):T.type===r.END_EXPR?this.handle_end_expr(T):T.type===r.START_BLOCK?this.handle_start_block(T):T.type===r.END_BLOCK?this.handle_end_block(T):T.type===r.WORD?this.handle_word(T):T.type===r.RESERVED?this.handle_word(T):T.type===r.SEMICOLON?this.handle_semicolon(T):T.type===r.STRING?this.handle_string(T):T.type===r.EQUALS?this.handle_equals(T):T.type===r.OPERATOR?this.handle_operator(T):T.type===r.COMMA?this.handle_comma(T):T.type===r.BLOCK_COMMENT?this.handle_block_comment(T,z):T.type===r.COMMENT?this.handle_comment(T,z):T.type===r.DOT?this.handle_dot(T):T.type===r.EOF?this.handle_eof(T):T.type===r.UNKNOWN?this.handle_unknown(T,z):this.handle_unknown(T,z)},H.prototype.handle_whitespace_and_comments=function(T,z){var Q=T.newlines,ne=this._options.keep_array_indentation&&v(this._flags.mode);if(T.comments_before)for(var se=T.comments_before.next();se;)this.handle_whitespace_and_comments(se,z),this.handle_token(se,z),se=T.comments_before.next();if(ne)for(var xe=0;xe<Q;xe+=1)this.print_newline(xe>0,z);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,z);for(var ge=1;ge<Q;ge+=1)this.print_newline(!0,z)}};var j=["async","break","continue","return","throw","yield"];H.prototype.allow_wrap_or_preserved_newline=function(T,z){if(z=z===void 0?!1:z,this._output.just_added_newline())return;var Q=this._options.preserve_newlines&&T.newlines||z,ne=s(this._flags.last_token.text,a)||s(T.text,a);if(ne){var se=s(this._flags.last_token.text,a)&&s(this._options.operator_position,g)||s(T.text,a);Q=Q&&se}if(Q)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(L(this._flags.last_token,j))return;this._output.set_wrap_point()}},H.prototype.print_newline=function(T,z){if(!z&&(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(T)&&(this._flags.multiline_frame=!0)},H.prototype.print_token_line_indentation=function(T){this._output.just_added_newline()&&(this._options.keep_array_indentation&&T.newlines&&(T.text==="["||v(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(T.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(T){if(this._output.raw){this._output.add_raw_token(T);return}if(this._options.comma_first&&T.previous&&T.previous.type===r.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var z=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(z),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(T),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(T),this._output.non_breaking_space=!0,this._output.add_token(T.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(T){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,T),this._flags=this.create_flags(this._previous_flags,T),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(T){var z=!1;return z=z||L(this._flags.last_token,["var","let","const"])&&T.type===r.WORD,z=z||x(this._flags.last_token,"do"),z=z||!(this._flags.parent.mode===p.ObjectLiteral&&this._flags.mode===p.Statement)&&L(this._flags.last_token,j)&&!T.newlines,z=z||x(this._flags.last_token,"else")&&!(x(T,"if")&&!T.comments_before),z=z||this._flags.last_token.type===r.END_EXPR&&(this._previous_flags.mode===p.ForInitializer||this._previous_flags.mode===p.Conditional),z=z||this._flags.last_token.type===r.WORD&&this._flags.mode===p.BlockStatement&&!this._flags.in_case&&!(T.text==="--"||T.text==="++")&&this._last_last_text!=="function"&&T.type!==r.WORD&&T.type!==r.RESERVED,z=z||this._flags.mode===p.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||L(this._flags.last_token,["get","set"])),z?(this.set_mode(p.Statement),this.indent(),this.handle_whitespace_and_comments(T,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(T,L(T,["do","for","if","while"])),!0):!1},H.prototype.handle_start_expr=function(T){this.start_of_statement(T)||this.handle_whitespace_and_comments(T);var z=p.Expression;if(T.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(T),this.set_mode(z),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}z=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())),s(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,z=p.ForInitializer):s(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,z=p.Conditional):s(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&T.whitespace_before===""?this._output.space_before_token=!1:(s(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(T);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 ne=this._tokens.peek(-4);L(Q,["async","function"])||Q.text==="*"&&L(ne,["async","function"])?this._output.space_before_token=!0:this._flags.mode===p.ObjectLiteral?(Q.text==="{"||Q.text===","||Q.text==="*"&&(ne.text==="{"||ne.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(T);(this._flags.last_token.type===r.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(s(this._last_last_text,["function","yield"])||this._flags.mode===p.ObjectLiteral&&s(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(T,T.newlines),this.print_token(T),this.set_mode(z),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},H.prototype.handle_end_expr=function(T){for(;this._flags.mode===p.Statement;)this.restore_mode();this.handle_whitespace_and_comments(T),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(T,T.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(T),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(T){this.handle_whitespace_and_comments(T);var z=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&&(s(Q.text,[":",","])&&s(z.type,[r.STRING,r.WORD,r.RESERVED])||s(z.text,["get","set","..."])&&s(Q.type,[r.WORD,r.RESERVED]))?s(this._last_last_text,["class","interface"])&&!s(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):s(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 ne=!z.comments_before&&z.text==="}",se=ne&&this._flags.last_word==="function"&&this._flags.last_token.type===r.END_EXPR;if(this._options.brace_preserve_inline){var xe=0,ge=null;this._flags.inline_frame=!0;do if(xe+=1,ge=this._tokens.peek(xe-1),ge.newlines){this._flags.inline_frame=!1;break}while(ge.type!==r.EOF&&!(ge.type===r.END_BLOCK&&ge.opened===T))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&T.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==r.OPERATOR&&(se||this._flags.last_token.type===r.EQUALS||L(this._flags.last_token,O)&&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(T),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(T),this.indent(),!ne&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},H.prototype.handle_end_block=function(T){for(this.handle_whitespace_and_comments(T);this._flags.mode===p.Statement;)this.restore_mode();var z=this._flags.last_token.type===r.START_BLOCK;this._flags.inline_frame&&!z?this._output.space_before_token=!0:this._options.brace_style==="expand"?z||this.print_newline():z||(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(T)},H.prototype.handle_word=function(T){if(T.type===r.RESERVED){if(s(T.text,["set","get"])&&this._flags.mode!==p.ObjectLiteral)T.type=r.WORD;else if(T.text==="import"&&s(this._tokens.peek().text,["(","."]))T.type=r.WORD;else if(s(T.text,["as","from"])&&!this._flags.import_block)T.type=r.WORD;else if(this._flags.mode===p.ObjectLiteral){var z=this._tokens.peek();z.text===":"&&(T.type=r.WORD)}}if(this.start_of_statement(T)?L(this._flags.last_token,["var","let","const"])&&T.type===r.WORD&&(this._flags.declaration_statement=!0):T.newlines&&!N(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(T),this.print_newline()):this.handle_whitespace_and_comments(T),this._flags.do_block&&!this._flags.do_while)if(x(T,"while")){this._output.space_before_token=!0,this.print_token(T),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(T,"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(T,["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(T),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(T)),x(T,"function")){(s(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(s(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===r.OPERATOR))&&(!this._output.just_added_blankline()&&!T.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,j)?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&&(N(this._flags.mode)||v(this._flags.mode))||this.print_newline(),this.print_token(T),this._flags.last_word=T.text;return}var Q="NONE";if(this._flags.last_token.type===r.END_BLOCK?this._previous_flags.inline_frame?Q="SPACE":L(T,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&T.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&&N(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==="*"&&(s(this._last_last_text,["function","yield"])||this._flags.mode===p.ObjectLiteral&&s(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(T,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(T,["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"&&T.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ne=this._output.current_line;ne.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else Q==="NEWLINE"?L(this._flags.last_token,O)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&L(T,["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(T,["var","let","const"]))&&this._flags.last_token.text!==":"&&(x(T,"if")&&x(T.previous,"else")?this._output.space_before_token=!0:this.print_newline()):L(T,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);T.previous&&(T.previous.type===r.WORD||T.previous.type===r.RESERVED)&&(this._output.space_before_token=!0),this.print_token(T),this._flags.last_word=T.text,T.type===r.RESERVED&&(T.text==="do"?this._flags.do_block=!0:T.text==="if"?this._flags.if_block=!0:T.text==="import"?this._flags.import_block=!0:this._flags.import_block&&x(T,"from")&&(this._flags.import_block=!1))},H.prototype.handle_semicolon=function(T){this.start_of_statement(T)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(T);for(var z=this._tokens.peek();this._flags.mode===p.Statement&&!(this._flags.if_block&&x(z,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(T)},H.prototype.handle_string=function(T){T.text.startsWith("`")&&T.newlines===0&&T.whitespace_before===""&&(T.previous.text===")"||this._flags.last_token.type===r.WORD)||(this.start_of_statement(T)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(T),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(T):T.text.startsWith("`")&&this._flags.last_token.type===r.END_EXPR&&(T.previous.text==="]"||T.previous.text===")")&&T.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(T)},H.prototype.handle_equals=function(T){this.start_of_statement(T)||this.handle_whitespace_and_comments(T),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(T),this._output.space_before_token=!0},H.prototype.handle_comma=function(T){this.handle_whitespace_and_comments(T,!0),this.print_token(T),this._output.space_before_token=!0,this._flags.declaration_statement?(N(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(T)):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(T)},H.prototype.handle_operator=function(T){var z=T.text==="*"&&(L(this._flags.last_token,["function","yield"])||s(this._flags.last_token.type,[r.START_BLOCK,r.COMMA,r.END_BLOCK,r.SEMICOLON])),Q=s(T.text,["-","+"])&&(s(this._flags.last_token.type,[r.START_BLOCK,r.START_EXPR,r.EQUALS,r.OPERATOR])||s(this._flags.last_token.text,i)||this._flags.last_token.text===",");if(!this.start_of_statement(T)){var ne=!z;this.handle_whitespace_and_comments(T,ne)}if(T.text==="*"&&this._flags.last_token.type===r.DOT){this.print_token(T);return}if(T.text==="::"){this.print_token(T);return}if(this._flags.last_token.type===r.OPERATOR&&s(this._options.operator_position,g)&&this.allow_wrap_or_preserved_newline(T),T.text===":"&&this._flags.in_case){this.print_token(T),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 se=!0,xe=!0,ge=!1;if(T.text===":"?this._flags.ternary_depth===0?se=!1:(this._flags.ternary_depth-=1,ge=!0):T.text==="?"&&(this._flags.ternary_depth+=1),!Q&&!z&&this._options.preserve_newlines&&s(T.text,a)){var ve=T.text===":",Oe=ve&&ge,Re=ve&&!ge;switch(this._options.operator_position){case b.before_newline:this._output.space_before_token=!Re,this.print_token(T),(!ve||Oe)&&this.allow_wrap_or_preserved_newline(T),this._output.space_before_token=!0;return;case b.after_newline:this._output.space_before_token=!0,!ve||Oe?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(T):this._output.space_before_token=!1,this.print_token(T),this._output.space_before_token=!0;return;case b.preserve_newline:Re||this.allow_wrap_or_preserved_newline(T),se=!(this._output.just_added_newline()||Re),this._output.space_before_token=se,this.print_token(T),this._output.space_before_token=!0;return}}if(z){this.allow_wrap_or_preserved_newline(T),se=!1;var he=this._tokens.peek();xe=he&&s(he.type,[r.WORD,r.RESERVED])}else if(T.text==="...")this.allow_wrap_or_preserved_newline(T),se=this._flags.last_token.type===r.START_BLOCK,xe=!1;else if(s(T.text,["--","++","!","~"])||Q){if((this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.START_EXPR)&&this.allow_wrap_or_preserved_newline(T),se=!1,xe=!1,T.newlines&&(T.text==="--"||T.text==="++"||T.text==="~")){var ue=L(this._flags.last_token,O)&&T.newlines;ue&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ue,!0)}this._flags.last_token.text===";"&&N(this._flags.mode)&&(se=!0),this._flags.last_token.type===r.RESERVED?se=!0:this._flags.last_token.type===r.END_EXPR?se=!(this._flags.last_token.text==="]"&&(T.text==="--"||T.text==="++")):this._flags.last_token.type===r.OPERATOR&&(se=s(T.text,["--","-","++","+"])&&s(this._flags.last_token.text,["--","-","++","+"]),s(T.text,["+","-"])&&s(this._flags.last_token.text,["--","++"])&&(xe=!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||se,this.print_token(T),this._output.space_before_token=xe},H.prototype.handle_block_comment=function(T,z){if(this._output.raw){this._output.add_raw_token(T),T.directives&&T.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(T.directives){this.print_newline(!1,z),this.print_token(T),T.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!c.newline.test(T.text)&&!T.newlines){this._output.space_before_token=!0,this.print_token(T),this._output.space_before_token=!0;return}else this.print_block_commment(T,z)},H.prototype.print_block_commment=function(T,z){var Q=E(T.text),ne,se=!1,xe=!1,ge=T.whitespace_before,ve=ge.length;if(this.print_newline(!1,z),this.print_token_line_indentation(T),this._output.add_token(Q[0]),this.print_newline(!1,z),Q.length>1){for(Q=Q.slice(1),se=F(Q,"*"),xe=A(Q,ge),se&&(this._flags.alignment=1),ne=0;ne<Q.length;ne++)se?(this.print_token_line_indentation(T),this._output.add_token(S(Q[ne]))):xe&&Q[ne]?(this.print_token_line_indentation(T),this._output.add_token(Q[ne].substring(ve))):(this._output.current_line.set_indent(-1),this._output.add_token(Q[ne])),this.print_newline(!1,z);this._flags.alignment=0}},H.prototype.handle_comment=function(T,z){T.newlines?this.print_newline(!1,z):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(T),this.print_newline(!1,z)},H.prototype.handle_dot=function(T){this.start_of_statement(T)||this.handle_whitespace_and_comments(T,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),L(this._flags.last_token,O)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(T,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(T)},H.prototype.handle_unknown=function(T,z){this.print_token(T),T.text[T.text.length-1]===`
|
|
`&&this.print_newline(!1,z)},H.prototype.handle_eof=function(T){for(;this._flags.mode===p.Statement;)this.restore_mode();this.handle_whitespace_and_comments(T)},n.exports.Beautifier=H},function(n){function D(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=[]}D.prototype.clone_empty=function(){var h=new D(this.__parent);return h.set_indent(this.__indent_count,this.__alignment_count),h},D.prototype.item=function(h){return h<0?this.__items[this.__items.length+h]:this.__items[h]},D.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},D.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))},D.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)},D.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},D.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},D.prototype.is_empty=function(){return this.__items.length===0},D.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},D.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},D.prototype.pop=function(){var h=null;return this.is_empty()||(h=this.__items.pop(),this.__character_count-=h.length),h},D.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},D.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},D.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},D.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 m(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}m.prototype.get_indent_size=function(h,c){var o=this.__base_string_length;return c=c||0,h<0&&(o=0),o+=h*this.__indent_size,o+=c,o},m.prototype.get_indent_string=function(h,c){var o=this.__base_string;return c=c||0,h<0&&(h=0,o=""),c+=h*this.__indent_size,this.__ensure_cache(c),o+=this.__cache[c],o},m.prototype.__ensure_cache=function(h){for(;h>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var h=this.__cache.length,c=0,o="";this.__indent_size&&h>=this.__indent_size&&(c=Math.floor(h/this.__indent_size),h-=c*this.__indent_size,o=new Array(c+1).join(this.__indent_string)),h&&(o+=new Array(h+1).join(" ")),this.__cache.push(o)};function f(h,c){this.__indent_cache=new m(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 D(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 o=this.__lines.join(`
|
|
`);return h!==`
|
|
`&&(o=o.replace(/[\n]/g,h)),o},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 o=this.__lines.length-2;o>=0;){var d=this.__lines[o];if(d.is_empty())break;if(d.item(0).indexOf(h)!==0&&d.item(-1)!==c){this.__lines.splice(o+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},n.exports.Output=f},function(n){function D(m,f,h,c){this.type=m,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=D},function(n,D){var m="\\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",o="(?:\\\\u[0-9a-fA-F]{4}|["+m+h+"])",d="(?:\\\\u[0-9a-fA-F]{4}|["+f+h+c+"])*";D.identifier=new RegExp(o+d,"g"),D.identifierStart=new RegExp(o),D.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+f+h+c+"])+");var i=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;D.newline=/[\n\r\u2028\u2029]/,D.lineBreak=new RegExp(`\r
|
|
|`+D.newline.source),D.allLineBreaks=new RegExp(D.lineBreak.source,"g")},function(n,D,m){var f=m(6).Options,h=["before-newline","after-newline","preserve-newline"];function c(o){f.call(this,o,"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 D(h,c){this.raw_options=m(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"])}D.prototype._get_array=function(h,c){var o=this.raw_options[h],d=c||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(d=o.concat()):typeof o=="string"&&(d=o.split(/[^a-zA-Z0-9_\/\-]+/)),d},D.prototype._get_boolean=function(h,c){var o=this.raw_options[h],d=o===void 0?!!c:!!o;return d},D.prototype._get_characters=function(h,c){var o=this.raw_options[h],d=c||"";return typeof o=="string"&&(d=o.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),d},D.prototype._get_number=function(h,c){var o=this.raw_options[h];c=parseInt(c,10),isNaN(c)&&(c=0);var d=parseInt(o,10);return isNaN(d)&&(d=c),d},D.prototype._get_selection=function(h,c,o){var d=this._get_selection_list(h,c,o);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]},D.prototype._get_selection_list=function(h,c,o){if(!c||c.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[c[0]],!this._is_valid_selection(o,c))throw new Error("Invalid Default Value!");var d=this._get_array(h,o);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},D.prototype._is_valid_selection=function(h,c){return h.length&&c.length&&!h.some(function(o){return c.indexOf(o)===-1})};function m(h,c){var o={};h=f(h);var d;for(d in h)d!==c&&(o[d]=h[d]);if(c&&h[c])for(d in h[c])o[d]=h[c][d];return o}function f(h){var c={},o;for(o in h){var d=o.replace(/-/g,"_");c[d]=h[o]}return c}n.exports.Options=D,n.exports.normalizeOpts=f,n.exports.mergeOpts=m},function(n,D,m){var f=m(8).InputScanner,h=m(9).Tokenizer,c=m(9).TOKEN,o=m(13).Directives,d=m(4),i=m(12).Pattern,a=m(14).TemplatablePattern;function r(F,A){return A.indexOf(F)!==-1}var s={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},S=new o(/\/\*/,/\*\//),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\.]/,O=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),_=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";_=_.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),_="\\?\\.(?!\\d) "+_,_=_.replace(/ /g,"|");var b=new RegExp(_),g="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),p=g.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,A){h.call(this,F,A),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),j=new a(this._input).read_options(this._options);this.__patterns={template:j,identifier:j.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:j.until(/['\\\n\r\u2028\u2029]/),double_quote:j.until(/["\\\n\r\u2028\u2029]/),template_text:j.until(/[`\\$]/),template_expression:j.until(/[`}\\]/)}};v.prototype=new h,v.prototype._is_comment=function(F){return F.type===s.COMMENT||F.type===s.BLOCK_COMMENT||F.type===s.UNKNOWN},v.prototype._is_opening=function(F){return F.type===s.START_BLOCK||F.type===s.START_EXPR},v.prototype._is_closing=function(F,A){return(F.type===s.END_BLOCK||F.type===s.END_EXPR)&&A&&(F.text==="]"&&A.text==="["||F.text===")"&&A.text==="("||F.text==="}"&&A.text==="{")},v.prototype._reset=function(){E=!1},v.prototype._get_next_token=function(F,A){var H=null;this._readWhitespace();var j=this._input.peek();return j===null?this._create_token(s.EOF,""):(H=H||this._read_non_javascript(j),H=H||this._read_string(j),H=H||this._read_word(F),H=H||this._read_singles(j),H=H||this._read_comment(j),H=H||this._read_regexp(j,F),H=H||this._read_xml(j,F),H=H||this._read_punctuation(),H=H||this._create_token(s.UNKNOWN,this._input.next()),H)},v.prototype._read_word=function(F){var A;if(A=this.__patterns.identifier.read(),A!=="")return A=A.replace(d.allLineBreaks,`
|
|
`),!(F.type===s.DOT||F.type===s.RESERVED&&(F.text==="set"||F.text==="get"))&&C.test(A)?(A==="in"||A==="of")&&(F.type===s.WORD||F.type===s.STRING)?this._create_token(s.OPERATOR,A):this._create_token(s.RESERVED,A):this._create_token(s.WORD,A);if(A=this.__patterns.number.read(),A!=="")return this._create_token(s.WORD,A)},v.prototype._read_singles=function(F){var A=null;return F==="("||F==="["?A=this._create_token(s.START_EXPR,F):F===")"||F==="]"?A=this._create_token(s.END_EXPR,F):F==="{"?A=this._create_token(s.START_BLOCK,F):F==="}"?A=this._create_token(s.END_BLOCK,F):F===";"?A=this._create_token(s.SEMICOLON,F):F==="."&&L.test(this._input.peek(1))?A=this._create_token(s.DOT,F):F===","&&(A=this._create_token(s.COMMA,F)),A&&this._input.next(),A},v.prototype._read_punctuation=function(){var F=this.__patterns.punct.read();if(F!=="")return F==="="?this._create_token(s.EQUALS,F):F==="?."?this._create_token(s.DOT,F):this._create_token(s.OPERATOR,F)},v.prototype._read_non_javascript=function(F){var A="";if(F==="#"){if(this._is_first_token()&&(A=this.__patterns.shebang.read(),A))return this._create_token(s.UNKNOWN,A.trim()+`
|
|
`);if(A=this.__patterns.include.read(),A)return this._create_token(s.UNKNOWN,A.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(s.WORD,H)}this._input.back()}else if(F==="<"&&this._is_first_token()){if(A=this.__patterns.html_comment_start.read(),A){for(;this._input.hasNext()&&!this._input.testChar(d.newline);)A+=this._input.next();return E=!0,this._create_token(s.COMMENT,A)}}else if(E&&F==="-"&&(A=this.__patterns.html_comment_end.read(),A))return E=!1,this._create_token(s.COMMENT,A);return null},v.prototype._read_comment=function(F){var A=null;if(F==="/"){var H="";if(this._input.peek(1)==="*"){H=this.__patterns.block_comment.read();var j=S.get_directives(H);j&&j.ignore==="start"&&(H+=S.readIgnored(this._input)),H=H.replace(d.allLineBreaks,`
|
|
`),A=this._create_token(s.BLOCK_COMMENT,H),A.directives=j}else this._input.peek(1)==="/"&&(H=this.__patterns.comment.read(),A=this._create_token(s.COMMENT,H))}return A},v.prototype._read_string=function(F){if(F==="`"||F==="'"||F==='"'){var A=this._input.next();return this.has_char_escapes=!1,F==="`"?A+=this._read_string_recursive("`",!0,"${"):A+=this._read_string_recursive(F),this.has_char_escapes&&this._options.unescape_strings&&(A=N(A)),this._input.peek()===F&&(A+=this._input.next()),A=A.replace(d.allLineBreaks,`
|
|
`),this._create_token(s.STRING,A)}return null},v.prototype._allow_regexp_or_xml=function(F){return F.type===s.RESERVED&&r(F.text,["return","case","throw","else","do","typeof","yield"])||F.type===s.END_EXPR&&F.text===")"&&F.opened.previous.type===s.RESERVED&&r(F.opened.previous.text,["if","while","for"])||r(F.type,[s.COMMENT,s.START_EXPR,s.START_BLOCK,s.START,s.END_BLOCK,s.OPERATOR,s.EQUALS,s.EOF,s.SEMICOLON,s.COMMA])},v.prototype._read_regexp=function(F,A){if(F==="/"&&this._allow_regexp_or_xml(A)){for(var H=this._input.next(),j=!1,T=!1;this._input.hasNext()&&(j||T||this._input.peek()!==F)&&!this._input.testChar(d.newline);)H+=this._input.peek(),j?j=!1:(j=this._input.peek()==="\\",this._input.peek()==="["?T=!0:this._input.peek()==="]"&&(T=!1)),this._input.next();return this._input.peek()===F&&(H+=this._input.next(),H+=this._input.read(d.identifier)),this._create_token(s.STRING,H)}return null},v.prototype._read_xml=function(F,A){if(this._options.e4x&&F==="<"&&this._allow_regexp_or_xml(A)){var H="",j=this.__patterns.xml.read_match();if(j){for(var T=j[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),z=T.indexOf("{")===0,Q=0;j;){var ne=!!j[1],se=j[2],xe=!!j[j.length-1]||se.slice(0,8)==="![CDATA[";if(!xe&&(se===T||z&&se.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ne?--Q:++Q),H+=j[0],Q<=0)break;j=this.__patterns.xml.read_match()}return j||(H+=this._input.match(/[\s\S]*/g)[0]),H=H.replace(d.allLineBreaks,`
|
|
`),this._create_token(s.STRING,H)}}return null};function N(F){for(var A="",H=0,j=new f(F),T=null;j.hasNext();)if(T=j.match(/([\s]|[^\\]|\\\\)+/g),T&&(A+=T[0]),j.peek()==="\\"){if(j.next(),j.peek()==="x")T=j.match(/x([0-9A-Fa-f]{2})/g);else if(j.peek()==="u")T=j.match(/u([0-9A-Fa-f]{4})/g);else{A+="\\",j.hasNext()&&(A+=j.next());continue}if(!T)return F;if(H=parseInt(T[1],16),H>126&&H<=255&&T[0].indexOf("x")===0)return F;if(H>=0&&H<32){A+="\\"+T[0];continue}else H===34||H===39||H===92?A+="\\"+String.fromCharCode(H):A+=String.fromCharCode(H)}return A}v.prototype._read_string_recursive=function(F,A,H){var j,T;F==="'"?T=this.__patterns.single_quote:F==='"'?T=this.__patterns.double_quote:F==="`"?T=this.__patterns.template_text:F==="}"&&(T=this.__patterns.template_expression);for(var z=T.read(),Q="";this._input.hasNext();){if(Q=this._input.next(),Q===F||!A&&d.newline.test(Q)){this._input.back();break}else Q==="\\"&&this._input.hasNext()?(j=this._input.peek(),j==="x"||j==="u"?this.has_char_escapes=!0:j==="\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("}",A,"`"):Q+=this._read_string_recursive("`",A,"${"),this._input.hasNext()&&(Q+=this._input.next())));Q+=T.read(),z+=Q}return z},n.exports.Tokenizer=v,n.exports.TOKEN=s,n.exports.positionable_operators=O.slice(),n.exports.line_starters=g.slice()},function(n){var D=RegExp.prototype.hasOwnProperty("sticky");function m(f){this.__input=f||"",this.__input_length=this.__input.length,this.__position=0}m.prototype.restart=function(){this.__position=0},m.prototype.back=function(){this.__position>0&&(this.__position-=1)},m.prototype.hasNext=function(){return this.__position<this.__input_length},m.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__input.charAt(this.__position),this.__position+=1),f},m.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},m.prototype.__match=function(f,h){f.lastIndex=h;var c=f.exec(this.__input);return c&&!(D&&f.sticky)&&(c.index!==h&&(c=null)),c},m.prototype.test=function(f,h){return h=h||0,h+=this.__position,h>=0&&h<this.__input_length?!!this.__match(f,h):!1},m.prototype.testChar=function(f,h){var c=this.peek(h);return f.lastIndex=0,c!==null&&f.test(c)},m.prototype.match=function(f){var h=this.__match(f,this.__position);return h?this.__position+=h[0].length:h=null,h},m.prototype.read=function(f,h,c){var o="",d;return f&&(d=this.match(f),d&&(o+=d[0])),h&&(d||!f)&&(o+=this.readUntil(h,c)),o},m.prototype.readUntil=function(f,h){var c="",o=this.__position;f.lastIndex=this.__position;var d=f.exec(this.__input);return d?(o=d.index,h&&(o+=d[0].length)):o=this.__input_length,c=this.__input.substring(this.__position,o),this.__position=o,c},m.prototype.readUntilAfter=function(f){return this.readUntil(f,!0)},m.prototype.get_regexp=function(f,h){var c=null,o="g";return h&&D&&(o="y"),typeof f=="string"&&f!==""?c=new RegExp(f,o):f&&(c=new RegExp(f.source,o)),c},m.prototype.get_literal_regexp=function(f){return RegExp(f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},m.prototype.peekUntilAfter=function(f){var h=this.__position,c=this.readUntilAfter(f);return this.__position=h,c},m.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=m},function(n,D,m){var f=m(8).InputScanner,h=m(3).Token,c=m(10).TokenStream,o=m(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 o(this._input)};i.prototype.tokenize=function(){this._input.restart(),this.__tokens=new c,this._reset();for(var a,r=new h(d.START,""),s=null,S=[],w=new c;r.type!==d.EOF;){for(a=this._get_next_token(r,s);this._is_comment(a);)w.add(a),a=this._get_next_token(r,s);w.isEmpty()||(a.comments_before=w,w=new c),a.parent=s,this._is_opening(a)?(S.push(s),s=a):s&&this._is_closing(a,s)&&(a.opened=s,s.closed=a,s=S.pop(),a.parent=s),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 s=this._input.read(/.+/g);return s?this._create_token(d.RAW,s):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 s=new h(a,r,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return s},i.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},n.exports.Tokenizer=i,n.exports.TOKEN=d},function(n){function D(m){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=m}D.prototype.restart=function(){this.__position=0},D.prototype.isEmpty=function(){return this.__tokens_length===0},D.prototype.hasNext=function(){return this.__position<this.__tokens_length},D.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__tokens[this.__position],this.__position+=1),m},D.prototype.peek=function(m){var f=null;return m=m||0,m+=this.__position,m>=0&&m<this.__tokens_length&&(f=this.__tokens[m]),f},D.prototype.add=function(m){this.__parent_token&&(m.parent=this.__parent_token),this.__tokens.push(m),this.__tokens_length+=1},n.exports.TokenStream=D},function(n,D,m){var f=m(12).Pattern;function h(c,o){f.call(this,c,o),o?this._line_regexp=this._input.get_regexp(o._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,o){c+="\\t ",o+="\\n\\r",this._match_pattern=this._input.get_regexp("["+c+o+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+o+"]")},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 o=this.__split(this._newline_regexp,c);this.newline_count=o.length-1,this.whitespace_before_token=o[this.newline_count]}return c},h.prototype.matching=function(c,o){var d=this._create();return d.__set_whitespace_patterns(c,o),d._update(),d},h.prototype._create=function(){return new h(this._input,this)},h.prototype.__split=function(c,o){c.lastIndex=0;for(var d=0,i=[],a=c.exec(o);a;)i.push(o.substring(d,a.index)),d=a.index+a[0].length,a=c.exec(o);return d<o.length?i.push(o.substring(d,o.length)):i.push(""),i},n.exports.WhitespacePattern=h},function(n){function D(m,f){this._input=m,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)}D.prototype.read=function(){var m=this._input.read(this._starting_pattern);return(!this._starting_pattern||m)&&(m+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),m},D.prototype.read_match=function(){return this._input.match(this._match_pattern)},D.prototype.until_after=function(m){var f=this._create();return f._until_after=!0,f._until_pattern=this._input.get_regexp(m),f._update(),f},D.prototype.until=function(m){var f=this._create();return f._until_after=!1,f._until_pattern=this._input.get_regexp(m),f._update(),f},D.prototype.starting_with=function(m){var f=this._create();return f._starting_pattern=this._input.get_regexp(m,!0),f._update(),f},D.prototype.matching=function(m){var f=this._create();return f._match_pattern=this._input.get_regexp(m,!0),f._update(),f},D.prototype._create=function(){return new D(this._input,this)},D.prototype._update=function(){},n.exports.Pattern=D},function(n){function D(m,f){m=typeof m=="string"?m:m.source,f=typeof f=="string"?f:f.source,this.__directives_block_pattern=new RegExp(m+/ beautify( \w+[:]\w+)+ /.source+f,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(m+/\sbeautify\signore:end\s/.source+f,"g")}D.prototype.get_directives=function(m){if(!m.match(this.__directives_block_pattern))return null;var f={};this.__directive_pattern.lastIndex=0;for(var h=this.__directive_pattern.exec(m);h;)f[h[1]]=h[2],h=this.__directive_pattern.exec(m);return f},D.prototype.readIgnored=function(m){return m.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=D},function(n,D,m){var f=m(12).Pattern,h={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function c(o,d){f.call(this,o,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(o);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(o){var d=this._create();return d._disabled[o]=!0,d._update(),d},c.prototype.read_options=function(o){var d=this._create();for(var i in h)d._disabled[i]=o.templating.indexOf(i)===-1;return d._update(),d},c.prototype.exclude=function(o){var d=this._create();return d._excluded[o]=!0,d._update(),d},c.prototype.read=function(){var o="";this._match_pattern?o=this._input.read(this._starting_pattern):o=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),o+=d,d=this._read_template();return this._until_after&&(o+=this._input.readUntilAfter(this._until_pattern)),o},c.prototype.__set_templated_pattern=function(){var o=[];this._disabled.php||o.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||o.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||o.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(o.push(this.__patterns.django._starting_pattern.source),o.push(this.__patterns.django_value._starting_pattern.source),o.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||o.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&o.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+o.join("|")+")")},c.prototype._read_template=function(){var o="",d=this._input.peek();if(d==="<"){var i=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&i==="?"&&(o=o||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&i==="%"&&(o=o||this.__patterns.erb.read())}else d==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(o=o||this.__patterns.handlebars_comment.read(),o=o||this.__patterns.handlebars_unescaped.read(),o=o||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(o=o||this.__patterns.django_value.read()),this._excluded.django||(o=o||this.__patterns.django_comment.read(),o=o||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(o=o||this.__patterns.smarty_comment.read(),o=o||this.__patterns.smarty_literal.read(),o=o||this.__patterns.smarty.read()));return o},n.exports.TemplatablePattern=c}],M={};function G(n){var D=M[n];if(D!==void 0)return D.exports;var m=M[n]={exports:{}};return U[n](m,m.exports,G),m.exports}var W=G(0);P=W})();var V=P;!(Z=[],X=function(){return{js_beautify:V}}.apply(oe,Z),X!==void 0&&(je.exports=X))})()},"6eGT":function(je,oe,k){"use strict";function Z(X){return null}oe.a=Z},"746U":function(je,oe,k){"use strict";k.d(oe,"f",function(){return Z}),k.d(oe,"l",function(){return X}),k.d(oe,"k",function(){return P}),k.d(oe,"j",function(){return V}),k.d(oe,"g",function(){return U}),k.d(oe,"m",function(){return M}),k.d(oe,"h",function(){return G}),k.d(oe,"n",function(){return W}),k.d(oe,"c",function(){return n}),k.d(oe,"a",function(){return D}),k.d(oe,"i",function(){return m}),k.d(oe,"o",function(){return f}),k.d(oe,"e",function(){return o}),k.d(oe,"d",function(){return d}),k.d(oe,"p",function(){return i}),k.d(oe,"b",function(){return a});function Z(r){return Array.isArray(r)}function X(r){return typeof r=="string"}function P(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 U(r){return r===!0||r===!1}function M(r){return typeof r=="undefined"}function G(r){return!W(r)}function W(r){return M(r)||r===null}function n(r,s){if(!r)throw new Error(s?`Unexpected type, expected '${s}'`:"Unexpected type")}function D(r){if(W(r))throw new Error("Assertion Failed: argument is undefined or null");return r}function m(r){return typeof r=="function"}function f(r,s){const S=Math.min(r.length,s.length);for(let w=0;w<S;w++)h(r[w],s[w])}function h(r,s){if(X(s)){if(typeof r!==s)throw new Error(`argument does not match constraint: typeof ${s}`)}else if(m(s)){try{if(r instanceof s)return}catch(S){}if(!W(r)&&r.constructor===s)return;if(s.length===1&&s.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 s=[],S=Object.getPrototypeOf(r);for(;Object.prototype!==S;)s=s.concat(Object.getOwnPropertyNames(S)),S=Object.getPrototypeOf(S);return s}function o(r){const s=[];for(const S of c(r))typeof r[S]=="function"&&s.push(S);return s}function d(r,s){const S=x=>function(){const L=Array.prototype.slice.call(arguments,0);return s(x,L)};let w={};for(const x of r)w[x]=S(x);return w}function i(r){return r===null?void 0:r}function a(r,s="Unreachable"){throw new Error(s)}},"7Cbv":function(je,oe,k){"use strict";var Z=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),X=new Uint8Array(16);function P(){if(!Z)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Z(X)}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 U(h){return typeof h=="string"&&V.test(h)}for(var M=U,G=[],W=0;W<256;++W)G.push((W+256).toString(16).substr(1));function n(h){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=(G[h[c+0]]+G[h[c+1]]+G[h[c+2]]+G[h[c+3]]+"-"+G[h[c+4]]+G[h[c+5]]+"-"+G[h[c+6]]+G[h[c+7]]+"-"+G[h[c+8]]+G[h[c+9]]+"-"+G[h[c+10]]+G[h[c+11]]+G[h[c+12]]+G[h[c+13]]+G[h[c+14]]+G[h[c+15]]).toLowerCase();if(!M(o))throw TypeError("Stringified UUID is invalid");return o}var D=n;function m(h,c,o){h=h||{};var d=h.random||(h.rng||P)();if(d[6]=d[6]&15|64,d[8]=d[8]&63|128,c){o=o||0;for(var i=0;i<16;++i)c[o+i]=d[i];return c}return D(d)}var f=oe.a=m},"7ahc":function(je,oe,k){"use strict";k.d(oe,"a",function(){return S});var Z=k("k1fw"),X=k("0Owb"),P=k("+L6B"),V=k("2/Rp"),U=k("y8nQ"),M=k("Vl3Y"),G=k("tJVT"),W=k("OaEy"),n=k("2fM7"),D=k("q1tI"),m=k.n(D),f=k("VrN/"),h=k.n(f),c=k("p77/"),o=k.n(c),d=k("c5Ni"),i=k.n(d),a=n.a.Option,r={labelCol:{span:4},wrapperCol:{span:20}},s={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"]};oe.b=function(w){var x=w.callback,L=w.onCancel,O=Object(D.useState)("python"),_=Object(G.a)(O,2),b=_[0],g=_[1];function p(E){g(s[E][1])}function C(E){x(E)}return m.a.createElement(M.a,Object(X.a)({},r,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:C}),m.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},m.a.createElement(n.a,{onChange:p},Object.keys(s).map(function(E){return m.a.createElement(a,{key:E,value:E},s[E][0])}))),m.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},m.a.createElement(S,{mode:b})),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(V.a,{type:"ghost",onClick:L},"\u53D6\u6D88")))};function S(w){var x=w.value,L=w.onChange,O=w.mode,_=w.options,b=_===void 0?{}:_,g=Object(D.useRef)(),p=Object(D.useState)(),C=Object(G.a)(p,2),E=C[0],v=C[1];return Object(D.useEffect)(function(){if(E){function N(F){var A=F.getValue();L&&L(A)}return E.on("change",N),function(){E.off("change",N)}}},[E,L]),Object(D.useEffect)(function(){E&&E.setOption("mode",O)},[E,O]),Object(D.useEffect)(function(){E&&((x!==E.getValue()||x==="")&&setTimeout(function(){E.setValue(x||" ")},300))},[E,x]),Object(D.useEffect)(function(){if(g.current&&!E){var N=h.a.fromTextArea(g.current,Object(Z.a)({mode:O,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},b));v(N)}},[g.current,E]),m.a.createElement("div",{className:"my-codemirror-container"},m.a.createElement("textarea",{ref:g}))}},"7ixt":function(je,oe,k){"use strict";k.d(oe,"a",function(){return P});var Z={adjustX:1,adjustY:1},X=[0,0],P={left:{points:["cr","cl"],overflow:Z,offset:[-4,0],targetOffset:X},right:{points:["cl","cr"],overflow:Z,offset:[4,0],targetOffset:X},top:{points:["bc","tc"],overflow:Z,offset:[0,-4],targetOffset:X},bottom:{points:["tc","bc"],overflow:Z,offset:[0,4],targetOffset:X},topLeft:{points:["bl","tl"],overflow:Z,offset:[0,-4],targetOffset:X},leftTop:{points:["tr","tl"],overflow:Z,offset:[-4,0],targetOffset:X},topRight:{points:["br","tr"],overflow:Z,offset:[0,-4],targetOffset:X},rightTop:{points:["tl","tr"],overflow:Z,offset:[4,0],targetOffset:X},bottomRight:{points:["tr","br"],overflow:Z,offset:[0,4],targetOffset:X},rightBottom:{points:["bl","br"],overflow:Z,offset:[4,0],targetOffset:X},bottomLeft:{points:["tl","bl"],overflow:Z,offset:[0,4],targetOffset:X},leftBottom:{points:["br","bl"],overflow:Z,offset:[-4,0],targetOffset:X}},V=P},"815F":function(je,oe,k){"use strict";k.d(oe,"e",function(){return G}),k.d(oe,"c",function(){return n}),k.d(oe,"d",function(){return D}),k.d(oe,"a",function(){return f}),k.d(oe,"f",function(){return h}),k.d(oe,"b",function(){return c});var Z=k("KQm4"),X=k("VTBJ"),P=k("Ff2n"),V=k("Zm9Q"),U=k("Kwbf"),M=k("OZM5");function G(o,d){return o!=null?o:d}function W(){var o=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(s){var S=s.key,w=s.children;Object(U.a)(S!=null,"Tree node must have a certain key: [".concat(r).concat(S,"]"));var x=String(S);Object(U.a)(!d.has(x)||S===null||S===void 0,"Same 'key' exist in the Tree: ".concat(x)),d.set(x,!0),i(w,"".concat(r).concat(x," > "))})}i(o)}function n(o){function d(i){var a=Object(V.a)(i);return a.map(function(r){if(!Object(M.i)(r))return Object(U.a)(!r,"Tree/TreeNode can only accept TreeNode as children."),null;var s=r.key,S=r.props,w=S.children,x=Object(P.a)(S,["children"]),L=Object(X.a)({key:s},x),O=d(w);return O.length&&(L.children=O),L}).filter(function(r){return r})}return d(o)}function D(){var o=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(s){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return s.map(function(w,x){var L=Object(M.h)(S?S.pos:"0",x),O=G(w.key,L),_=Object(X.a)(Object(X.a)({},w),{},{parent:S,pos:L,children:null,data:w,isStart:[].concat(Object(Z.a)(S?S.isStart:[]),[x===0]),isEnd:[].concat(Object(Z.a)(S?S.isEnd:[]),[x===s.length-1])});return a.push(_),d===!0||i.has(O)?_.children=r(w.children||[],_):_.children=[],_})}return r(o),a}function m(o,d,i){var a;i?typeof i=="string"?a=function(S){return S[i]}:typeof i=="function"&&(a=function(S){return i(S)}):a=function(S,w){return G(S.key,w)};function r(s,S,w){var x=s?s.children:o,L=s?Object(M.h)(w.pos,S):"0";if(s){var O=a(s,L),_={node:s,index:S,pos:L,key:O,parentPos:w.node?w.pos:null,level:w.level+1};d(_)}x&&x.forEach(function(b,g){r(b,g,{node:s,pos:L,level:w?w.level+1:-1})})}r(null)}function f(o){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=d.initWrapper,a=d.processEntity,r=d.onProcessFinished,s=arguments.length>2?arguments[2]:void 0,S={},w={},x={posEntities:S,keyEntities:w};return i&&(x=i(x)||x),m(o,function(L){var O=L.node,_=L.index,b=L.pos,g=L.key,p=L.parentPos,C=L.level,E={node:O,index:_,key:g,pos:b,level:C},v=G(g,b);S[b]=E,w[v]=E,E.parent=S[p],E.parent&&(E.parent.children=E.parent.children||[],E.parent.children.push(E)),a&&a(E,x)},s),r&&r(x),x}function h(o,d){var i=d.expandedKeys,a=d.selectedKeys,r=d.loadedKeys,s=d.loadingKeys,S=d.checkedKeys,w=d.halfCheckedKeys,x=d.dragOverNodeKey,L=d.dropPosition,O=d.keyEntities,_=O[o],b={eventKey:o,expanded:i.indexOf(o)!==-1,selected:a.indexOf(o)!==-1,loaded:r.indexOf(o)!==-1,loading:s.indexOf(o)!==-1,checked:S.indexOf(o)!==-1,halfChecked:w.indexOf(o)!==-1,pos:String(_?_.pos:""),dragOver:x===o&&L===0,dragOverGapTop:x===o&&L===-1,dragOverGapBottom:x===o&&L===1};return b}function c(o){var d=o.data,i=o.expanded,a=o.selected,r=o.checked,s=o.loaded,S=o.loading,w=o.halfChecked,x=o.dragOver,L=o.dragOverGapTop,O=o.dragOverGapBottom,_=o.pos,b=o.active,g=Object(X.a)(Object(X.a)({},d),{},{expanded:i,selected:a,checked:r,loaded:s,loading:S,halfChecked:w,dragOver:x,dragOverGapTop:L,dragOverGapBottom:O,pos:_,active:b});return"props"in g||Object.defineProperty(g,"props",{get:function(){return Object(U.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),o}}),g}},"8EBN":function(je,oe,k){(function(Z){Z(k("VrN/"))})(function(Z){"use strict";Z.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 X=0;X<Z.modeInfo.length;X++){var P=Z.modeInfo[X];P.mimes&&(P.mime=P.mimes[0])}Z.findModeByMIME=function(V){V=V.toLowerCase();for(var U=0;U<Z.modeInfo.length;U++){var M=Z.modeInfo[U];if(M.mime==V)return M;if(M.mimes){for(var G=0;G<M.mimes.length;G++)if(M.mimes[G]==V)return M}}if(/\+xml$/.test(V))return Z.findModeByMIME("application/xml");if(/\+json$/.test(V))return Z.findModeByMIME("application/json")},Z.findModeByExtension=function(V){V=V.toLowerCase();for(var U=0;U<Z.modeInfo.length;U++){var M=Z.modeInfo[U];if(M.ext){for(var G=0;G<M.ext.length;G++)if(M.ext[G]==V)return M}}},Z.findModeByFileName=function(V){for(var U=0;U<Z.modeInfo.length;U++){var M=Z.modeInfo[U];if(M.file&&M.file.test(V))return M}var G=V.lastIndexOf("."),W=G>-1&&V.substring(G+1,V.length);if(W)return Z.findModeByExtension(W)},Z.findModeByName=function(V){V=V.toLowerCase();for(var U=0;U<Z.modeInfo.length;U++){var M=Z.modeInfo[U];if(M.name.toLowerCase()==V)return M;if(M.alias){for(var G=0;G<M.alias.length;G++)if(M.alias[G].toLowerCase()==V)return M}}}})},"8HAY":function(je,oe,k){"use strict";k.d(oe,"a",function(){return U}),k.d(oe,"b",function(){return M}),k.d(oe,"d",function(){return G}),k.d(oe,"e",function(){return W}),k.d(oe,"c",function(){return n});var Z=k("MI8n"),X=k("pmY6"),P=k("3/fG"),V=function(D,m,f,h){function c(o){return o instanceof f?o:new f(function(d){d(o)})}return new(f||(f=Promise))(function(o,d){function i(s){try{r(h.next(s))}catch(S){d(S)}}function a(s){try{r(h.throw(s))}catch(S){d(S)}}function r(s){s.done?o(s.value):c(s.value).then(i,a)}r((h=h.apply(D,m||[])).next())})};class U extends X.a{constructor(D,m="",f="",h=!0,c){super();this._onDidChange=this._register(new Z.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=D,this._label=m,this._cssClass=f,this._enabled=h,this._actionCallback=c}get id(){return this._id}get label(){return this._label}set label(D){this._setLabel(D)}_setLabel(D){this._label!==D&&(this._label=D,this._onDidChange.fire({label:D}))}get tooltip(){return this._tooltip||""}set tooltip(D){this._setTooltip(D)}_setTooltip(D){this._tooltip!==D&&(this._tooltip=D,this._onDidChange.fire({tooltip:D}))}get class(){return this._cssClass}set class(D){this._setClass(D)}_setClass(D){this._cssClass!==D&&(this._cssClass=D,this._onDidChange.fire({class:D}))}get enabled(){return this._enabled}set enabled(D){this._setEnabled(D)}_setEnabled(D){this._enabled!==D&&(this._enabled=D,this._onDidChange.fire({enabled:D}))}get checked(){return this._checked}set checked(D){this._setChecked(D)}_setChecked(D){this._checked!==D&&(this._checked=D,this._onDidChange.fire({checked:D}))}run(D,m){return V(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(D))})}}class M extends X.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new Z.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new Z.b),this.onDidRun=this._onDidRun.event}run(D,m){return V(this,void 0,void 0,function*(){if(!D.enabled)return;this._onBeforeRun.fire({action:D});let f;try{yield this.runAction(D,m)}catch(h){f=h}this._onDidRun.fire({action:D,error:f})})}runAction(D,m){return V(this,void 0,void 0,function*(){yield D.run(m)})}}class G extends U{constructor(D){super(G.ID,D,D?"separator text":"separator");this.checked=!1,this.enabled=!1}}G.ID="vs.actions.separator";class W{constructor(D,m,f,h){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=D,this.label=m,this.class=h,this._actions=f}get actions(){return this._actions}dispose(){}run(){return V(this,void 0,void 0,function*(){})}}class n extends U{constructor(){super(n.ID,P.a("submenu.empty","(empty)"),void 0,!1)}}n.ID="vs.actions.empty"},"8hTe":function(je,oe,k){je.exports={button:"button___1wy9m"}},"9Bee":function(je,oe,k){"use strict";var Z=k("DYRE"),X=k("zeV3"),P=k("+L6B"),V=k("2/Rp"),U=k("k1fw"),M=k("9og8"),G=k("tJVT"),W=k("WmNS"),n=k.n(W),D=k("q1tI"),m=k.n(D),f=k("vg9a"),h=k("DlQD"),c=k.n(h),o=k("rUJ1");function d(J,I){var R=J.match(/^(\s+)(?:```)/);if(R===null)return I;var K=R[1];return I.split(`
|
|
`).map(function(ee){var Y=ee.match(/^\s+/);if(Y===null)return ee;var Ee=Object(G.a)(Y,1),Ye=Ee[0];return Ye.length>=K.length?ee.slice(K.length):ee}).join(`
|
|
`)}var i=[],a=["<ul>"],r=new c.a.Renderer,s=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function S(){i.length=0,a=["<ul>"]}var w={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function x(J,I,R,K){if(I>=J.length||J[I].level<=R)return I;var ee=J[I];K.push("<li><a href='#"+ee.anchor+"'>"+ee.text+"</a>"),I++;var Y=[];return I=x(J,I,ee.level,Y),Y.length>0&&(K.push("<ul>"),Y.forEach(function(Ee){K.push(Ee)}),K.push("</ul>")),K.push("</li>"),I=x(J,I,R,K),I}function L(){return x(i,0,0,a),a.push("</ul>"),a.join("")}var O={heading:function(I){var R=s.exec(I);if(R)return{type:"heading",raw:R[0],depth:R[1].length,text:R[2]}},fences:function(I){var R=this.rules.block.fences.exec(I);if(R){var K=R[0],ee=d(K,R[3]||""),Y=R[2]?R[2].trim():R[2];if(["latex","katex","math"].indexOf(Y)>=0){var Ee=g(),Ye=ee;ee=Ee,p[Ee]={type:"block",expression:Ye}}return{type:"code",raw:K,lang:Y,text:ee}}}},_=/(?:\${2})([^\n`]+?)(?:\${2})/gi,b=0,g=function(){return"__special_katext_id_".concat(b++,"__")},p={};function C(){return p}function E(){b=0,p={}}function v(J){return J=J.replace(_,function(I,R){var K=g();return p[K]={type:"inline",expression:R},K}),J}var N=r.listitem;r.listitem=function(J){return N(v(J))};var F=r.paragraph;r.paragraph=function(J){return F(v(J))};var A=r.tablecell;r.tablecell=function(J,I){return A(v(J),I)},r.code=function(J,I,R){var K=(I||"").match(/\S*/)[0];return K?["latex","katex","math"].indexOf(K)>=0?"<p class='editormd-tex'>".concat(J,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(I,'">').concat(R?J:Object(o.escape)(J,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(R?J:Object(o.escape)(J,!0))+"</code></pre>"},r.heading=function(J,I,R){var K=this.options.headerPrefix+R.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return i.push({anchor:K,level:I,text:J}),"<h"+I+' id="'+K+'">'+J+"</h"+I+">"},c.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),c.a.use({tokenizer:O,renderer:r});var H=c.a,j=k("SJMd"),T=k("ulZh"),z=k.n(T),Q=k("m3rI"),ne=k("Oy/b"),se=k("p5ED"),xe=k("ErOA");/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var ge=function(J,I){return(ge=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(R,K){R.__proto__=K}||function(R,K){for(var ee in K)Object.prototype.hasOwnProperty.call(K,ee)&&(R[ee]=K[ee])})(J,I)};function ve(J,I){function R(){this.constructor=J}ge(J,I),J.prototype=I===null?Object.create(I):(R.prototype=I.prototype,new R)}function Oe(J,I,R,K){return new(R||(R=Promise))(function(ee,Y){function Ee(yt){try{ut(K.next(yt))}catch(He){Y(He)}}function Ye(yt){try{ut(K.throw(yt))}catch(He){Y(He)}}function ut(yt){var He;yt.done?ee(yt.value):(He=yt.value,He instanceof R?He:new R(function(Et){Et(He)})).then(Ee,Ye)}ut((K=K.apply(J,I||[])).next())})}function Re(J,I){var R,K,ee,Y,Ee={label:0,sent:function(){if(1&ee[0])throw ee[1];return ee[1]},trys:[],ops:[]};return Y={next:Ye(0),throw:Ye(1),return:Ye(2)},typeof Symbol=="function"&&(Y[Symbol.iterator]=function(){return this}),Y;function Ye(ut){return function(yt){return function(He){if(R)throw new TypeError("Generator is already executing.");for(;Ee;)try{if(R=1,K&&(ee=2&He[0]?K.return:He[0]?K.throw||((ee=K.return)&&ee.call(K),0):K.next)&&!(ee=ee.call(K,He[1])).done)return ee;switch(K=0,ee&&(He=[2&He[0],ee.value]),He[0]){case 0:case 1:ee=He;break;case 4:return Ee.label++,{value:He[1],done:!1};case 5:Ee.label++,K=He[1],He=[0];continue;case 7:He=Ee.ops.pop(),Ee.trys.pop();continue;default:if(!(ee=Ee.trys,(ee=ee.length>0&&ee[ee.length-1])||He[0]!==6&&He[0]!==2)){Ee=0;continue}if(He[0]===3&&(!ee||He[1]>ee[0]&&He[1]<ee[3])){Ee.label=He[1];break}if(He[0]===6&&Ee.label<ee[1]){Ee.label=ee[1],ee=He;break}if(ee&&Ee.label<ee[2]){Ee.label=ee[2],Ee.ops.push(He);break}ee[2]&&Ee.ops.pop(),Ee.trys.pop();continue}He=I.call(J,Ee)}catch(Et){He=[6,Et],K=0}finally{R=ee=0}if(5&He[0])throw He[1];return{value:He[0]?He[1]:void 0,done:!0}}([ut,yt])}}}function he(){for(var J=0,I=0,R=arguments.length;I<R;I++)J+=arguments[I].length;var K=Array(J),ee=0;for(I=0;I<R;I++)for(var Y=arguments[I],Ee=0,Ye=Y.length;Ee<Ye;Ee++,ee++)K[ee]=Y[Ee];return K}var ue=function(){function J(){}return J.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},J.setAttributes=function(I,R){for(var K=0,ee=R;K<ee.length;K++){var Y=ee[K],Ee=Y[0],Ye=Y[1];I.setAttribute(Ee,Ye)}},J.createRect=function(I,R,K){var ee=document.createElementNS("http://www.w3.org/2000/svg","rect");return ee.setAttribute("width",I.toString()),ee.setAttribute("height",R.toString()),K&&J.setAttributes(ee,K),ee},J.createLine=function(I,R,K,ee,Y){var Ee=document.createElementNS("http://www.w3.org/2000/svg","line");return Ee.setAttribute("x1",I.toString()),Ee.setAttribute("y1",R.toString()),Ee.setAttribute("x2",K.toString()),Ee.setAttribute("y2",ee.toString()),Y&&J.setAttributes(Ee,Y),Ee},J.createPolygon=function(I,R){var K=document.createElementNS("http://www.w3.org/2000/svg","polygon");return K.setAttribute("points",I),R&&J.setAttributes(K,R),K},J.createCircle=function(I,R){var K=document.createElementNS("http://www.w3.org/2000/svg","circle");return K.setAttribute("cx",(I/2).toString()),K.setAttribute("cy",(I/2).toString()),K.setAttribute("r",I.toString()),R&&J.setAttributes(K,R),K},J.createEllipse=function(I,R,K){var ee=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ee.setAttribute("cx",(I/2).toString()),ee.setAttribute("cy",(R/2).toString()),ee.setAttribute("rx",(I/2).toString()),ee.setAttribute("ry",(R/2).toString()),K&&J.setAttributes(ee,K),ee},J.createGroup=function(I){var R=document.createElementNS("http://www.w3.org/2000/svg","g");return I&&J.setAttributes(R,I),R},J.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},J.createMarker=function(I,R,K,ee,Y,Ee,Ye){var ut=document.createElementNS("http://www.w3.org/2000/svg","marker");return J.setAttributes(ut,[["id",I],["orient",R],["markerWidth",K.toString()],["markerHeight",ee.toString()],["refX",Y.toString()],["refY",Ee.toString()]]),ut.appendChild(Ye),ut},J.createText=function(I){var R=document.createElementNS("http://www.w3.org/2000/svg","text");return R.setAttribute("x","0"),R.setAttribute("y","0"),I&&J.setAttributes(R,I),R},J.createTSpan=function(I,R){var K=document.createElementNS("http://www.w3.org/2000/svg","tspan");return K.textContent=I,R&&J.setAttributes(K,R),K},J.createImage=function(I){var R=document.createElementNS("http://www.w3.org/2000/svg","image");return I&&J.setAttributes(R,I),R},J.createPoint=function(I,R){var K=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return K.x=I,K.y=R,K},J.createPath=function(I,R){var K=document.createElementNS("http://www.w3.org/2000/svg","path");return K.setAttribute("d",I),R&&J.setAttributes(K,R),K},J}(),Me=function(){function J(){}return J.addKey=function(I){J.key=I},Object.defineProperty(J,"isLicensed",{get:function(){return!!J.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(J.key)},enumerable:!1,configurable:!0}),J}(),et=function(){function J(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return J.prototype.rasterize=function(I,R,K){var ee=this;return new Promise(function(Y){var Ee=K!==void 0?K:document.createElement("canvas");I===null&&(ee.markersOnly=!0,ee.naturalSize=!1);var Ye=document.createElementNS("http://www.w3.org/2000/svg","svg");Ye.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ye.setAttribute("width",R.width.baseVal.valueAsString),Ye.setAttribute("height",R.height.baseVal.valueAsString),Ye.setAttribute("viewBox","0 0 "+R.viewBox.baseVal.width.toString()+" "+R.viewBox.baseVal.height.toString()),Ye.innerHTML=R.innerHTML,ee.naturalSize===!0?(Ye.width.baseVal.value=I.naturalWidth,Ye.height.baseVal.value=I.naturalHeight):ee.width!==void 0&&ee.height!==void 0&&(Ye.width.baseVal.value=ee.width,Ye.height.baseVal.value=ee.height),Ee.width=Ye.width.baseVal.value,Ee.height=Ye.height.baseVal.value;var ut=Ye.outerHTML,yt=Ee.getContext("2d");ee.markersOnly!==!0&&yt.drawImage(I,0,0,Ee.width,Ee.height);var He=window.URL,Et=new Image(Ee.width,Ee.height);Et.setAttribute("crossOrigin","anonymous");var It=new Blob([ut],{type:"image/svg+xml"}),Pt=He.createObjectURL(It);Et.onload=function(){yt.drawImage(Et,0,0),He.revokeObjectURL(Pt);var qt=Ee.toDataURL(ee.imageType,ee.imageQuality);Y(qt)},Et.src=Pt})},J}(),it=function(){},nt=function(){function J(I){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+I+"_"}return Object.defineProperty(J.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(J.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(J.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),J.prototype.addClass=function(I){return this.styleSheet===void 0&&this.addStyleSheet(),I.name=""+this.classNamePrefix+I.localName,this.classes.push(I),this.styleSheet.sheet.insertRule("."+I.name+" {"+I.style+"}",this.styleSheet.sheet.cssRules.length),I},J.prototype.addRule=function(I){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(I),this.styleSheet.sheet.insertRule(I.selector+" {"+I.style+"}",this.styleSheet.sheet.cssRules.length)},J.prototype.addStyleSheet=function(){var I;this.styleSheet=document.createElement("style"),((I=this.styleSheetRoot)!==null&&I!==void 0?I:document.head).appendChild(this.styleSheet),this.addRule(new at("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new at("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new at("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new ze("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new ze("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},J.prototype.removeStyleSheet=function(){var I;this.styleSheet&&(((I=this.styleSheetRoot)!==null&&I!==void 0?I:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},J}(),at=function(J,I){this.selector=J,this.style=I},ze=function(J,I){this.localName=J,this.style=I},Ze=function(){function J(I,R,K,ee,Y){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=I,this.displayMode=R,this.markerItems=K,this.uiStyleSettings=ee,this.styles=Y,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return J.prototype.show=function(I){var R=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=I,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var K=document.createElement("div");K.className=this.toolbarBlockStyleClass.name,K.style.whiteSpace="nowrap",this.uiContainer.appendChild(K),this.addActionButton(K,'<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(K,'<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(K,'<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(K,'<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(K,'<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(K,'<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(K,'<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(K,'<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(Y){var Ee=document.createElement("div");Ee.className=""+R.toolbarButtonStyleClass.name,Ee.setAttribute("data-type-name",Y.typeName),Ee.innerHTML=Y.icon,Ee.addEventListener("click",function(){R.markerToolbarButtonClicked(Ee,Y)}),R.buttons.push(Ee),R.markerButtons.push(Ee)}),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 ee=document.createElement("div");ee.className=this.toolbarBlockStyleClass.name,ee.style.whiteSpace="nowrap",ee.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ee),this.addActionButton(ee,'<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(ee,'<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()},J.prototype.addButtonClickListener=function(I){this.buttonClickListeners.push(I)},J.prototype.removeButtonClickListener=function(I){this.buttonClickListeners.indexOf(I)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(I),1)},J.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},J.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var I=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var R=0;R<this.markerButtons.length;R++)R<I||R===I&&this.markerButtons.length-1===I?this.markerButtonBlock.appendChild(this.markerButtons[R]):(R===I&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[R]))}},J.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")},J.prototype.resetButtonStyles=function(){var I=this;this.buttons.forEach(function(R){R.className=R.className.replace(I.uiStyleSettings.toolbarButtonStyleColorsClassName?I.uiStyleSettings.toolbarButtonStyleColorsClassName:I.toolbarButtonStyleColorsClass.name,"").trim(),R.className=R.className.replace(I.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?I.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:I.toolbarActiveButtonStyleColorsClass.name,"").trim(),R.className+=" "+(I.uiStyleSettings.toolbarButtonStyleColorsClassName?I.uiStyleSettings.toolbarButtonStyleColorsClassName:I.toolbarButtonStyleColorsClass.name)})},J.prototype.addActionButton=function(I,R,K){var ee=this,Y=document.createElement("div");switch(Y.className=""+this.toolbarButtonStyleClass.name,Y.innerHTML=R,Y.setAttribute("data-action",K),Y.addEventListener("click",function(){ee.actionToolbarButtonClicked(Y,K)}),K){case"select":Y.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":Y.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":Y.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":Y.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":Y.style.fill=this.uiStyleSettings.closeButtonColor}I.appendChild(Y),this.buttons.push(Y)},J.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ze("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 ze("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ze("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new ze("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 ze("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var I=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ze("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*I)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*I)+`px;
|
|
padding: `+I+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ze("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ze("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new at("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new at("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},J.prototype.markerToolbarButtonClicked=function(I,R){this.setActiveButton(I),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(K){return K("marker",R)}),this.markerButtonOverflowBlock.style.display="none"},J.prototype.actionToolbarButtonClicked=function(I,R){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(K){return K("action",R)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},J.prototype.setActiveButton=function(I){this.resetButtonStyles(),I.className=I.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),I.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},J.prototype.setActiveMarkerButton=function(I){var R=this.markerButtons.find(function(K){return K.getAttribute("data-type-name")===I});R&&this.setActiveButton(R)},J.prototype.setCurrentMarker=function(I){var R=this;this.currentMarker=I,this.buttons.filter(function(K){return/delete|notes/.test(K.getAttribute("data-action"))}).forEach(function(K){R.currentMarker===void 0?(K.style.fillOpacity="0.4",K.style.pointerEvents="none"):(K.style.fillOpacity="1",K.style.pointerEvents="all")})},J}(),ot=function(){function J(I,R,K,ee){this.panels=[],this.panelButtons=[],this.markerjsContainer=I,this.displayMode=R,this.uiStyleSettings=K,this.styles=ee,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return J.prototype.addStyles=function(){var I;this.toolboxStyleClass=this.styles.addClass(new ze("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 ze("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var R=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new ze("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new ze("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new ze("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 ze("toolbox-panel-row_colors",`
|
|
background-color: `+((I=this.uiStyleSettings.toolboxBackgroundColor)!==null&&I!==void 0?I:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new ze("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*R)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*R)+`px;
|
|
padding: `+R+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new ze("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new ze("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new at("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new at("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},J.prototype.show=function(I){var R;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=I,this.uiContainer.className=this.toolboxStyleClass.name+" "+((R=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&R!==void 0?R:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},J.prototype.setPanelButtons=function(I){var R,K,ee=this;this.panels=I,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((R=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&R!==void 0?R:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((K=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&K!==void 0?K:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(Y){var Ee;Y.uiStyleSettings=ee.uiStyleSettings;var Ye=document.createElement("div");Ye.className=ee.toolboxButtonStyleClass.name+" "+((Ee=ee.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ee!==void 0?Ee:ee.toolboxButtonStyleColorsClass.name),Ye.innerHTML=Y.icon,Ye.title=Y.title,Ye.addEventListener("click",function(){ee.panelButtonClick(Y)}),ee.panelButtons.push(Ye),ee.buttonRow.appendChild(Ye)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},J.prototype.panelButtonClick=function(I){var R=this,K=-1;if(I!==this.activePanel){K=this.panels.indexOf(I),this.panelRow.innerHTML="";var ee=I.getUi();ee.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ee),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=I}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){R.displayMode==="inline"?R.panelRow.style.display="none":R.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(Y,Ee){var Ye,ut;Y.className=R.toolboxButtonStyleClass.name+" "+(Ee===K?""+((Ye=R.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ye!==void 0?Ye:R.toolboxActiveButtonStyleColorsClass.name):""+((ut=R.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ut!==void 0?ut:R.toolboxButtonStyleColorsClass.name))})},J}(),de=function(J,I){this.title=J,this.icon=I},Se=function(J){function I(R,K,ee,Y){var Ee=J.call(this,R,Y||'<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 Ee.colors=[],Ee.addTransparent=!1,Ee.colorBoxes=[],Ee.colors=K,Ee.currentColor=ee,Ee.setCurrentColor=Ee.setCurrentColor.bind(Ee),Ee.getColorBox=Ee.getColorBox.bind(Ee),Ee}return ve(I,J),I.prototype.getUi=function(){var R=this,K=document.createElement("div");return K.style.overflow="hidden",K.style.whiteSpace="nowrap",this.colors.forEach(function(ee){var Y=R.getColorBox(ee);K.appendChild(Y),R.colorBoxes.push(Y)}),K},I.prototype.getColorBox=function(R){var K=this,ee=this.uiStyleSettings.toolbarHeight/4,Y=this.uiStyleSettings.toolbarHeight-ee,Ee=document.createElement("div");Ee.style.display="inline-block",Ee.style.boxSizing="content-box",Ee.style.width=Y-2+"px",Ee.style.height=Y-2+"px",Ee.style.padding="1px",Ee.style.marginRight="2px",Ee.style.marginBottom="2px",Ee.style.borderWidth="2px",Ee.style.borderStyle="solid",Ee.style.borderRadius=(Y+2)/2+"px",Ee.style.borderColor=R===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Ee.addEventListener("click",function(){K.setCurrentColor(R,Ee)});var Ye=document.createElement("div");return Ye.style.display="inline-block",Ye.style.width=Y-2+"px",Ye.style.height=Y-2+"px",Ye.style.backgroundColor=R,Ye.style.borderRadius=Y/2+"px",R==="transparent"&&(Ye.style.fill=this.uiStyleSettings.toolboxAccentColor,Ye.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>`),Ee.appendChild(Ye),Ee},I.prototype.setCurrentColor=function(R,K){var ee=this;this.currentColor=R,this.colorBoxes.forEach(function(Y){Y.style.borderColor=Y===K?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(R)},I}(de),Le=function(){function J(I,R,K){this._state="new",this._isSelected=!1,this._container=I,this._overlayContainer=R,this.globalSettings=K,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(J.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),J.prototype.ownsTarget=function(I){return!1},Object.defineProperty(J.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),J.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},J.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},J.prototype.pointerDown=function(I,R){},J.prototype.dblClick=function(I,R){},J.prototype.manipulate=function(I){},J.prototype.pointerUp=function(I){this.stateChanged()},J.prototype.dispose=function(){},J.prototype.addMarkerVisualToContainer=function(I){this.container.childNodes.length>0?this.container.insertBefore(I,this.container.childNodes[0]):this.container.appendChild(I)},J.prototype.getState=function(){return{typeName:J.typeName,state:this.state,notes:this.notes}},J.prototype.restoreState=function(I){this._state=I.state,this.notes=I.notes},J.prototype.scale=function(I,R){},J.prototype.colorChanged=function(I){this.onColorChanged&&this.onColorChanged(I),this.stateChanged()},J.prototype.fillColorChanged=function(I){this.onFillColorChanged&&this.onFillColorChanged(I),this.stateChanged()},J.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var I=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),I.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(I)&&this.onStateChanged(this)}},J.typeName="MarkerBase",J}(),De=function(){function J(){this.findGripByVisual=this.findGripByVisual.bind(this)}return J.prototype.findGripByVisual=function(I){return this.topLeft.ownsTarget(I)?this.topLeft:this.topCenter.ownsTarget(I)?this.topCenter:this.topRight.ownsTarget(I)?this.topRight:this.centerLeft.ownsTarget(I)?this.centerLeft:this.centerRight.ownsTarget(I)?this.centerRight:this.bottomLeft.ownsTarget(I)?this.bottomLeft:this.bottomCenter.ownsTarget(I)?this.bottomCenter:this.bottomRight.ownsTarget(I)?this.bottomRight:void 0},J}(),qe=function(){function J(){this.GRIP_SIZE=10,this.visual=ue.createGroup(),this.visual.appendChild(ue.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ue.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return J.prototype.ownsTarget=function(I){return I===this.visual||I===this.visual.childNodes[0]||I===this.visual.childNodes[1]},J}(),lt=function(){function J(){}return J.toITransformMatrix=function(I){return{a:I.a,b:I.b,c:I.c,d:I.d,e:I.e,f:I.f}},J.toSVGMatrix=function(I,R){return I.a=R.a,I.b=R.b,I.c=R.c,I.d=R.d,I.e=R.e,I.f=R.f,I},J}(),mt=function(J){function I(R,K,ee){var Y=J.call(this,R,K,ee)||this;return Y.left=0,Y.top=0,Y.width=0,Y.height=0,Y.defaultSize={x:50,y:20},Y.offsetX=0,Y.offsetY=0,Y.rotationAngle=0,Y.CB_DISTANCE=10,Y._suppressMarkerCreateEvent=!1,Y.container.transform.baseVal.appendItem(ue.createTransform()),Y.setupControlBox(),Y}return ve(I,J),Object.defineProperty(I.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"visual",{get:function(){return this._visual},set:function(R){this._visual=R;var K=ue.createTransform();this._visual.transform.baseVal.appendItem(K)},enumerable:!1,configurable:!0}),I.prototype.ownsTarget=function(R){return!!J.prototype.ownsTarget.call(this,R)||!!(this.controlGrips.findGripByVisual(R)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(R))},I.prototype.pointerDown=function(R,K){J.prototype.pointerDown.call(this,R,K),this.state==="new"&&(this.left=R.x,this.top=R.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ee=this.unrotatePoint(R);if(this.manipulationStartX=ee.x,this.manipulationStartY=ee.y,this.offsetX=ee.x-this.left,this.offsetY=ee.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(K),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(K)){this.activeGrip=this.rotatorGrip;var Y=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=Y.x-this.width/2,this.top=Y.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Ee=this.container.transform.baseVal.getItem(0);Ee.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Ee,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},I.prototype.pointerUp=function(R){var K=this.state;J.prototype.pointerUp.call(this,R),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(R),this._state="select",K==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},I.prototype.moveVisual=function(R){this.visual.style.transform="translate("+R.x+"px, "+R.y+"px)"},I.prototype.manipulate=function(R){var K=this.unrotatePoint(R);this.state==="creating"?this.resize(R):this.state==="move"?(this.left=this.manipulationStartLeft+(K.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(K.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(K):this.state==="rotate"&&this.rotate(R)},I.prototype.resize=function(R){var K=this.manipulationStartLeft,ee=this.manipulationStartWidth,Y=this.manipulationStartTop,Ee=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:K=this.manipulationStartLeft+R.x-this.manipulationStartX,ee=this.manipulationStartWidth+this.manipulationStartLeft-K;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ee=this.manipulationStartWidth+R.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:Y=this.manipulationStartTop+R.y-this.manipulationStartY,Ee=this.manipulationStartHeight+this.manipulationStartTop-Y;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Ee=this.manipulationStartHeight+R.y-this.manipulationStartY}ee>=0?(this.left=K,this.width=ee):(this.left=K+ee,this.width=-ee),Ee>=0?(this.top=Y,this.height=Ee):(this.top=Y+Ee,this.height=-Ee),this.setSize()},I.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},I.prototype.rotate=function(R){if(Math.abs(R.x-this.centerX)>.1){var K=Math.sign(R.x-this.centerX);this.rotationAngle=180*Math.atan((R.y-this.centerY)/(R.x-this.centerX))/Math.PI+90*K,this.applyRotation()}},I.prototype.applyRotation=function(){var R=this.container.transform.baseVal.getItem(0);R.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(R,0)},I.prototype.rotatePoint=function(R){if(this.rotationAngle===0)return R;var K=this.container.getCTM(),ee=ue.createPoint(R.x,R.y);return{x:(ee=ee.matrixTransform(K)).x,y:ee.y}},I.prototype.unrotatePoint=function(R){if(this.rotationAngle===0)return R;var K=this.container.getCTM();K=K.inverse();var ee=ue.createPoint(R.x,R.y);return{x:(ee=ee.matrixTransform(K)).x,y:ee.y}},I.prototype.select=function(){J.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},I.prototype.deselect=function(){J.prototype.deselect.call(this),this.controlBox.style.display="none"},I.prototype.setupControlBox=function(){this.controlBox=ue.createGroup();var R=ue.createTransform();R.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(R),this.container.appendChild(this.controlBox),this.controlRect=ue.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=ue.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 De,this.addControlGrips(),this.controlBox.style.display="none"},I.prototype.adjustControlBox=function(){var R=this.controlBox.transform.baseVal.getItem(0);R.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(R,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()},I.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()},I.prototype.createGrip=function(){var R=new qe;return R.visual.transform.baseVal.appendItem(ue.createTransform()),this.controlBox.appendChild(R.visual),R},I.prototype.positionGrips=function(){var R=this.controlGrips.topLeft.GRIP_SIZE,K=-R/2,ee=K,Y=(this.width+this.CB_DISTANCE)/2-R/2,Ee=(this.height+this.CB_DISTANCE)/2-R/2,Ye=this.height+this.CB_DISTANCE-R/2,ut=this.width+this.CB_DISTANCE-R/2;this.positionGrip(this.controlGrips.topLeft.visual,K,ee),this.positionGrip(this.controlGrips.topCenter.visual,Y,ee),this.positionGrip(this.controlGrips.topRight.visual,ut,ee),this.positionGrip(this.controlGrips.centerLeft.visual,K,Ee),this.positionGrip(this.controlGrips.centerRight.visual,ut,Ee),this.positionGrip(this.controlGrips.bottomLeft.visual,K,Ye),this.positionGrip(this.controlGrips.bottomCenter.visual,Y,Ye),this.positionGrip(this.controlGrips.bottomRight.visual,ut,Ye),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,Y,ee-3*this.CB_DISTANCE)},I.prototype.positionGrip=function(R,K,ee){var Y=R.transform.baseVal.getItem(0);Y.setTranslate(K,ee),R.transform.baseVal.replaceItem(Y,0)},I.prototype.hideControlBox=function(){this.controlBox.style.display="none"},I.prototype.showControlBox=function(){this.controlBox.style.display=""},I.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:lt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:lt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},J.prototype.getState.call(this))},I.prototype.restoreState=function(R){J.prototype.restoreState.call(this,R);var K=R;this.left=K.left,this.top=K.top,this.width=K.width,this.height=K.height,this.rotationAngle=K.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(lt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,K.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(lt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,K.containerTransformMatrix))},I.prototype.scale=function(R,K){J.prototype.scale.call(this,R,K);var ee=this.rotatePoint({x:this.left,y:this.top}),Y=this.unrotatePoint({x:ee.x*R,y:ee.y*K});this.left=Y.x,this.top=Y.y,this.width=this.width*R,this.height=this.height*K,this.adjustControlBox()},I}(Le),gt=function(J){function I(R,K,ee){var Y=J.call(this,R,K,ee)||this;return Y.fillColor="transparent",Y.strokeColor="transparent",Y.strokeWidth=0,Y.strokeDasharray="",Y.opacity=1,Y.setStrokeColor=Y.setStrokeColor.bind(Y),Y.setFillColor=Y.setFillColor.bind(Y),Y.setStrokeWidth=Y.setStrokeWidth.bind(Y),Y.setStrokeDasharray=Y.setStrokeDasharray.bind(Y),Y.createVisual=Y.createVisual.bind(Y),Y}return ve(I,J),I.prototype.ownsTarget=function(R){return!(!J.prototype.ownsTarget.call(this,R)&&R!==this.visual)},I.prototype.createVisual=function(){this.visual=ue.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)},I.prototype.pointerDown=function(R,K){J.prototype.pointerDown.call(this,R,K),this.state==="new"&&(this.createVisual(),this.moveVisual(R),this._state="creating")},I.prototype.manipulate=function(R){J.prototype.manipulate.call(this,R)},I.prototype.resize=function(R){J.prototype.resize.call(this,R),this.setSize()},I.prototype.setSize=function(){J.prototype.setSize.call(this),ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},I.prototype.pointerUp=function(R){J.prototype.pointerUp.call(this,R),this.setSize()},I.prototype.setStrokeColor=function(R){this.strokeColor=R,this.visual&&ue.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(R),this.stateChanged()},I.prototype.setFillColor=function(R){this.fillColor=R,this.visual&&ue.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},I.prototype.setStrokeWidth=function(R){this.strokeWidth=R,this.visual&&ue.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},I.prototype.setStrokeDasharray=function(R){this.strokeDasharray=R,this.visual&&ue.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},I.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},J.prototype.getState.call(this))},I.prototype.restoreState=function(R){var K=R;this.fillColor=K.fillColor,this.strokeColor=K.strokeColor,this.strokeWidth=K.strokeWidth,this.strokeDasharray=K.strokeDasharray,this.opacity=K.opacity,this.createVisual(),J.prototype.restoreState.call(this,R),this.setSize()},I.prototype.scale=function(R,K){J.prototype.scale.call(this,R,K),this.setSize()},I.title="Rectangle marker",I}(mt),Ct=function(J){function I(R,K,ee,Y){var Ee=J.call(this,R,Y||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Ee.widths=[],Ee.widthBoxes=[],Ee.widths=K,Ee.currentWidth=ee,Ee.setCurrentWidth=Ee.setCurrentWidth.bind(Ee),Ee}return ve(I,J),I.prototype.getUi=function(){var R=this,K=document.createElement("div");return K.style.display="flex",K.style.overflow="hidden",K.style.flexGrow="2",this.widths.forEach(function(ee){var Y=document.createElement("div");Y.style.display="flex",Y.style.flexGrow="2",Y.style.alignItems="center",Y.style.justifyContent="space-between",Y.style.padding="5px",Y.style.borderWidth="2px",Y.style.borderStyle="solid",Y.style.borderColor=ee===R.currentWidth?R.uiStyleSettings.toolboxAccentColor:"transparent",Y.addEventListener("click",function(){R.setCurrentWidth(ee,Y)}),K.appendChild(Y);var Ee=document.createElement("div");Ee.innerText=ee.toString(),Ee.style.marginRight="5px",Y.appendChild(Ee);var Ye=document.createElement("div");Ye.style.minHeight="20px",Ye.style.flexGrow="2",Ye.style.display="flex",Ye.style.alignItems="center";var ut=document.createElement("hr");ut.style.minWidth="20px",ut.style.border="0px",ut.style.borderTop=ee+"px solid "+R.uiStyleSettings.toolboxColor,ut.style.flexGrow="2",Ye.appendChild(ut),Y.appendChild(Ye),R.widthBoxes.push(Y)}),K},I.prototype.setCurrentWidth=function(R,K){var ee=this;this.currentWidth=R,this.widthBoxes.forEach(function(Y){Y.style.borderColor=Y===K?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},I}(de),xt=function(J){function I(R,K,ee,Y){var Ee=J.call(this,R,Y||'<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 Ee.styles=[],Ee.styleBoxes=[],Ee.styles=K,Ee.currentStyle=ee,Ee.setCurrentStyle=Ee.setCurrentStyle.bind(Ee),Ee}return ve(I,J),I.prototype.getUi=function(){var R=this,K=document.createElement("div");return K.style.display="flex",K.style.overflow="hidden",K.style.flexGrow="2",this.styles.forEach(function(ee){var Y=document.createElement("div");Y.style.display="flex",Y.style.alignItems="center",Y.style.justifyContent="space-between",Y.style.padding="5px",Y.style.borderWidth="2px",Y.style.borderStyle="solid",Y.style.overflow="hidden",Y.style.maxWidth=100/R.styles.length-5+"%",Y.style.borderColor=ee===R.currentStyle?R.uiStyleSettings.toolboxAccentColor:"transparent",Y.addEventListener("click",function(){R.setCurrentStyle(ee,Y)}),K.appendChild(Y);var Ee=document.createElement("div");Ee.style.minHeight="20px",Ee.style.flexGrow="2",Ee.style.overflow="hidden";var Ye=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+R.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(ee!==""?'stroke-dasharray="'+ee+'"':"")+` />
|
|
</svg>`;Ee.innerHTML=Ye,Y.appendChild(Ee),R.styleBoxes.push(Y)}),K},I.prototype.setCurrentStyle=function(R,K){var ee=this;this.currentStyle=R,this.styleBoxes.forEach(function(Y){Y.style.borderColor=Y===K?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},I}(de),Ae=function(J){function I(R,K,ee){var Y=J.call(this,R,K,ee)||this;return Y.strokeColor=ee.defaultColor,Y.strokeWidth=ee.defaultStrokeWidth,Y.strokeDasharray=ee.defaultStrokeDasharray,Y.strokePanel=new Se("Line color",ee.defaultColorSet,ee.defaultColor),Y.strokePanel.onColorChanged=Y.setStrokeColor,Y.strokeWidthPanel=new Ct("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),Y.strokeWidthPanel.onWidthChanged=Y.setStrokeWidth,Y.strokeStylePanel=new xt("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),Y.strokeStylePanel.onStyleChanged=Y.setStrokeDasharray,Y}return ve(I,J),Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var R=J.prototype.getState.call(this);return R.typeName=I.typeName,R},I.typeName="FrameMarker",I.title="Frame marker",I.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',I}(gt),Ce=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},Ve=function(J){function I(R,K,ee){var Y=J.call(this,R,K,ee)||this;return Y.x1=0,Y.y1=0,Y.x2=0,Y.y2=0,Y.defaultLength=50,Y.manipulationStartX=0,Y.manipulationStartY=0,Y.manipulationStartX1=0,Y.manipulationStartY1=0,Y.manipulationStartX2=0,Y.manipulationStartY2=0,Y.setupControlBox(),Y}return ve(I,J),I.prototype.ownsTarget=function(R){return!!J.prototype.ownsTarget.call(this,R)||!(!this.grip1.ownsTarget(R)&&!this.grip2.ownsTarget(R))},I.prototype.pointerDown=function(R,K){J.prototype.pointerDown.call(this,R,K),this.manipulationStartX=R.x,this.manipulationStartY=R.y,this.state==="new"&&(this.x1=R.x,this.y1=R.y,this.x2=R.x,this.y2=R.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(K)?this.activeGrip=this.grip1:this.grip2.ownsTarget(K)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},I.prototype.pointerUp=function(R){var K=this.state;J.prototype.pointerUp.call(this,R),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(R),this._state="select",K==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},I.prototype.adjustVisual=function(){},I.prototype.manipulate=function(R){this.state==="creating"?this.resize(R):this.state==="move"?(this.x1=this.manipulationStartX1+R.x-this.manipulationStartX,this.y1=this.manipulationStartY1+R.y-this.manipulationStartY,this.x2=this.manipulationStartX2+R.x-this.manipulationStartX,this.y2=this.manipulationStartY2+R.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(R)},I.prototype.resize=function(R){switch(this.activeGrip){case this.grip1:this.x1=R.x,this.y1=R.y;break;case this.grip2:case void 0:this.x2=R.x,this.y2=R.y}this.adjustVisual(),this.adjustControlBox()},I.prototype.select=function(){J.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},I.prototype.deselect=function(){J.prototype.deselect.call(this),this.controlBox.style.display="none"},I.prototype.setupControlBox=function(){this.controlBox=ue.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},I.prototype.adjustControlBox=function(){this.positionGrips()},I.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},I.prototype.createGrip=function(){var R=new qe;return R.visual.transform.baseVal.appendItem(ue.createTransform()),this.controlBox.appendChild(R.visual),R},I.prototype.positionGrips=function(){var R=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-R/2,this.y1-R/2),this.positionGrip(this.grip2.visual,this.x2-R/2,this.y2-R/2)},I.prototype.positionGrip=function(R,K,ee){var Y=R.transform.baseVal.getItem(0);Y.setTranslate(K,ee),R.transform.baseVal.replaceItem(Y,0)},I.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},J.prototype.getState.call(this))},I.prototype.restoreState=function(R){J.prototype.restoreState.call(this,R);var K=R;this.x1=K.x1,this.y1=K.y1,this.x2=K.x2,this.y2=K.y2},I.prototype.scale=function(R,K){J.prototype.scale.call(this,R,K),this.x1=this.x1*R,this.y1=this.y1*K,this.x2=this.x2*R,this.y2=this.y2*K,this.adjustVisual(),this.adjustControlBox()},I}(Le),Qe=function(J){function I(R,K,ee){var Y=J.call(this,R,K,ee)||this;return Y.strokeColor="transparent",Y.strokeWidth=0,Y.strokeDasharray="",Y.setStrokeColor=Y.setStrokeColor.bind(Y),Y.setStrokeWidth=Y.setStrokeWidth.bind(Y),Y.setStrokeDasharray=Y.setStrokeDasharray.bind(Y),Y.strokeColor=ee.defaultColor,Y.strokeWidth=ee.defaultStrokeWidth,Y.strokeDasharray=ee.defaultStrokeDasharray,Y.strokePanel=new Se("Line color",ee.defaultColorSet,ee.defaultColor),Y.strokePanel.onColorChanged=Y.setStrokeColor,Y.strokeWidthPanel=new Ct("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),Y.strokeWidthPanel.onWidthChanged=Y.setStrokeWidth,Y.strokeStylePanel=new xt("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),Y.strokeStylePanel.onStyleChanged=Y.setStrokeDasharray,Y}return ve(I,J),I.prototype.ownsTarget=function(R){return!(!J.prototype.ownsTarget.call(this,R)&&R!==this.visual&&R!==this.selectorLine&&R!==this.visibleLine)},I.prototype.createVisual=function(){this.visual=ue.createGroup(),this.selectorLine=ue.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ue.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)},I.prototype.pointerDown=function(R,K){J.prototype.pointerDown.call(this,R,K),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},I.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()),ue.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ue.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ue.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},I.prototype.setStrokeColor=function(R){this.strokeColor=R,this.adjustVisual(),this.colorChanged(R)},I.prototype.setStrokeWidth=function(R){this.strokeWidth=R,this.adjustVisual()},I.prototype.setStrokeDasharray=function(R){this.strokeDasharray=R,this.adjustVisual(),this.stateChanged()},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var R=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},J.prototype.getState.call(this));return R.typeName=I.typeName,R},I.prototype.restoreState=function(R){J.prototype.restoreState.call(this,R);var K=R;this.strokeColor=K.strokeColor,this.strokeWidth=K.strokeWidth,this.strokeDasharray=K.strokeDasharray,this.createVisual(),this.adjustVisual()},I.typeName="LineMarker",I.title="Line marker",I.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',I}(Ve),Pe=function(J){function I(R,K,ee,Y){var Ee=J.call(this,R,Y||'<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 Ee.fonts=[],Ee.fontBoxes=[],Ee.fonts=K,Ee.currentFont=ee,Ee.setCurrentFont=Ee.setCurrentFont.bind(Ee),Ee}return ve(I,J),I.prototype.getUi=function(){var R=this,K=document.createElement("div");return K.style.overflow="hidden",K.style.flexGrow="2",this.fonts.forEach(function(ee){var Y=document.createElement("div");Y.style.display="inline-block",Y.style.alignItems="center",Y.style.justifyContent="space-between",Y.style.padding="5px",Y.style.borderWidth="2px",Y.style.borderStyle="solid",Y.style.overflow="hidden",Y.style.maxWidth=100/R.fonts.length-5+"%",Y.style.borderColor=ee===R.currentFont?R.uiStyleSettings.toolboxAccentColor:"transparent",Y.addEventListener("click",function(){R.setCurrentFont(ee,Y)}),K.appendChild(Y);var Ee=document.createElement("div");Ee.style.display="flex",Ee.style.minHeight="20px",Ee.style.flexGrow="2",Ee.style.fontFamily=ee,Ee.style.overflow="hidden";var Ye=document.createElement("div");Ye.style.whiteSpace="nowrap",Ye.style.overflow="hidden",Ye.style.textOverflow="ellipsis",Ye.innerHTML="The quick brown fox jumps over the lazy dog",Ee.appendChild(Ye),Y.appendChild(Ee),R.fontBoxes.push(Y)}),K},I.prototype.setCurrentFont=function(R,K){var ee=this;this.currentFont=R,this.fontBoxes.forEach(function(Y){Y.style.borderColor=Y===K?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},I}(de),Fe=function(J){function I(R,K,ee){var Y=J.call(this,R,K,ee)||this;return Y.color="transparent",Y.padding=5,Y.DEFAULT_TEXT="your text here",Y.text=Y.DEFAULT_TEXT,Y.isMoved=!1,Y.color=ee.defaultColor,Y.fontFamily=ee.defaultFontFamily,Y.defaultSize={x:100,y:30},Y.setColor=Y.setColor.bind(Y),Y.setFont=Y.setFont.bind(Y),Y.renderText=Y.renderText.bind(Y),Y.sizeText=Y.sizeText.bind(Y),Y.textEditDivClicked=Y.textEditDivClicked.bind(Y),Y.showTextEditor=Y.showTextEditor.bind(Y),Y.setSize=Y.setSize.bind(Y),Y.positionTextEditor=Y.positionTextEditor.bind(Y),Y.colorPanel=new Se("Color",ee.defaultColorSet,ee.defaultColor),Y.colorPanel.onColorChanged=Y.setColor,Y.fontFamilyPanel=new Pe("Font",ee.defaultFontFamilies,ee.defaultFontFamily),Y.fontFamilyPanel.onFontChanged=Y.setFont,Y}return ve(I,J),I.prototype.ownsTarget=function(R){if(J.prototype.ownsTarget.call(this,R)||R===this.visual||R===this.textElement||R===this.bgRectangle)return!0;var K=!1;return this.textElement.childNodes.forEach(function(ee){ee===R&&(K=!0)}),K},I.prototype.createVisual=function(){this.visual=ue.createGroup(),this.bgRectangle=ue.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ue.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ue.createTransform()),this.textElement.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},I.prototype.pointerDown=function(R,K){J.prototype.pointerDown.call(this,R,K),this.isMoved=!1,this.pointerDownPoint=R,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(R),this._state="creating")},I.prototype.renderText=function(){var R=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(K){R.textElement.appendChild(ue.createTSpan(K.trim()===""?" ":K.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},I.prototype.getTextScale=function(){var R=this.textElement.getBBox(),K=1;if(R.width>0&&R.height>0){var ee=(1*this.width-this.width*this.padding*2/100)/R.width,Y=(1*this.height-this.height*this.padding*2/100)/R.height;K=Math.min(ee,Y)}return K},I.prototype.getTextPosition=function(R){var K=this.textElement.getBBox(),ee=0,Y=0;return K.width>0&&K.height>0&&(ee=(this.width-K.width*R)/2,Y=this.height/2-K.height*R/2),{x:ee,y:Y}},I.prototype.sizeText=function(){var R=this.textElement.getBBox(),K=this.getTextScale(),ee=this.getTextPosition(K);ee.y-=R.y*K,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ee.x+"px, "+ee.y+"px) scale("+K+", "+K+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ee.x,ee.y),this.textElement.transform.baseVal.getItem(1).setScale(K,K))},I.prototype.manipulate=function(R){J.prototype.manipulate.call(this,R),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(R.x-this.pointerDownPoint.x)>5||Math.abs(R.y-this.pointerDownPoint.y)>5)},I.prototype.resize=function(R){J.prototype.resize.call(this,R),this.isMoved=!0,this.setSize(),this.sizeText()},I.prototype.setSize=function(){J.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},I.prototype.pointerUp=function(R){var K=this.state;K==="creating"&&(this._suppressMarkerCreateEvent=!0),J.prototype.pointerUp.call(this,R),this.setSize(),(K==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},I.prototype.showTextEditor=function(){var R=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(K){K.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var K=Number.parseFloat(R.textEditor.style.fontSize);R.textEditor.clientWidth>=Number.parseInt(R.textEditor.style.maxWidth)&&K>.9;)K-=.1,R.textEditor.style.fontSize=Math.max(K,.9)+"em"}),this.textEditor.addEventListener("keyup",function(K){K.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(K){if(K.clipboardData){var ee=K.clipboardData.getData("text"),Y=window.getSelection();if(!Y.rangeCount)return!1;Y.deleteFromDocument(),Y.getRangeAt(0).insertNode(document.createTextNode(ee)),K.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){R.textEditDivClicked(R.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},I.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var R=this.getTextScale(),K=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ee=this.textElement.getBBox(),Y={x:ee.width*R,y:ee.height*R};K.x-=Y.x/2,K.y-=Y.y/2,this.textEditor.style.top=K.y+"px",this.textEditor.style.left=K.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-K.x+"px",this.textEditor.style.fontSize=Math.max(16*R,12)+"px",this.textElement.style.display="none"}},I.prototype.textEditDivClicked=function(R){this.text=R.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},I.prototype.select=function(){J.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},I.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),J.prototype.deselect.call(this)},I.prototype.dblClick=function(R,K){J.prototype.dblClick.call(this,R,K),this.showTextEditor()},I.prototype.setColor=function(R){this.textElement&&ue.setAttributes(this.textElement,[["fill",R]]),this.color=R,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(R)},I.prototype.setFont=function(R){this.textElement&&ue.setAttributes(this.textElement,[["font-family",R]]),this.fontFamily=R,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},I.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},I.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var R=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},J.prototype.getState.call(this));return R.typeName=I.typeName,R},I.prototype.restoreState=function(R){var K=R;this.color=K.color,this.fontFamily=K.fontFamily,this.padding=K.padding,this.text=K.text,this.createVisual(),J.prototype.restoreState.call(this,R),this.setSize()},I.prototype.scale=function(R,K){J.prototype.scale.call(this,R,K),this.setSize(),this.sizeText(),this.positionTextEditor()},I.typeName="TextMarker",I.title="Text marker",I.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>',I}(mt),be=function(J){function I(R,K,ee){var Y=J.call(this,R,K,ee)||this;return Y.color="transparent",Y.lineWidth=3,Y.drawing=!1,Y.pixelRatio=1,Y.color=ee.defaultColor,Y.lineWidth=ee.defaultStrokeWidth,Y.pixelRatio=ee.freehandPixelRatio,Y.setColor=Y.setColor.bind(Y),Y.addCanvas=Y.addCanvas.bind(Y),Y.finishCreation=Y.finishCreation.bind(Y),Y.setLineWidth=Y.setLineWidth.bind(Y),Y.colorPanel=new Se("Color",ee.defaultColorSet,ee.defaultColor),Y.colorPanel.onColorChanged=Y.setColor,Y.lineWidthPanel=new Ct("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),Y.lineWidthPanel.onWidthChanged=Y.setLineWidth,Y}return ve(I,J),I.prototype.ownsTarget=function(R){return!(!J.prototype.ownsTarget.call(this,R)&&R!==this.visual&&R!==this.drawingImage)},I.prototype.createVisual=function(){this.visual=ue.createGroup(),this.drawingImage=ue.createImage(),this.visual.appendChild(this.drawingImage);var R=ue.createTransform();this.visual.transform.baseVal.appendItem(R),this.addMarkerVisualToContainer(this.visual)},I.prototype.pointerDown=function(R,K){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(R.x,R.y),this.drawing=!0):J.prototype.pointerDown.call(this,R,K)},I.prototype.manipulate=function(R){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(R.x,R.y),this.canvasContext.stroke()):J.prototype.manipulate.call(this,R)},I.prototype.resize=function(R){J.prototype.resize.call(this,R),ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},I.prototype.pointerUp=function(R){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):J.prototype.pointerUp.call(this,R)},I.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)},I.prototype.select=function(){this.state==="creating"&&this.finishCreation(),J.prototype.select.call(this)},I.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),J.prototype.deselect.call(this)},I.prototype.finishCreation=function(){for(var R=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),K=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ee=K[0],Y=K[1],Ee=K[2],Ye=K[3],ut=!1,yt=0;yt<this.canvasElement.height;yt++)for(var He=0;He<this.canvasElement.width;He++)R.data[yt*this.canvasElement.width*4+4*He+3]>0&&(ut=!0,yt<Y&&(Y=yt),He<ee&&(ee=He),yt>Ye&&(Ye=yt),He>Ee&&(Ee=He));if(ut){this.left=ee/this.pixelRatio,this.top=Y/this.pixelRatio,this.width=(Ee-ee)/this.pixelRatio,this.height=(Ye-Y)/this.pixelRatio;var Et=document.createElement("canvas");Et.width=Ee-ee,Et.height=Ye-Y,Et.getContext("2d").putImageData(this.canvasContext.getImageData(ee,Y,Ee-ee,Ye-Y),0,0),this.drawingImgUrl=Et.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},I.prototype.setDrawingImage=function(){ue.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},I.prototype.setColor=function(R){this.color=R,this.colorChanged(R)},I.prototype.setLineWidth=function(R){this.lineWidth=R},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var R=Object.assign({drawingImgUrl:this.drawingImgUrl},J.prototype.getState.call(this));return R.typeName=I.typeName,R},I.prototype.restoreState=function(R){this.createVisual(),J.prototype.restoreState.call(this,R),this.drawingImgUrl=R.drawingImgUrl,this.setDrawingImage()},I.prototype.scale=function(R,K){J.prototype.scale.call(this,R,K),this.setDrawingImage()},I.typeName="FreehandMarker",I.title="Freehand marker",I.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>',I}(mt),fe=function(J){function I(R,K,ee){var Y=J.call(this,R,ee||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return Y.typeBoxes=[],Y.currentType=K,Y.setCurrentType=Y.setCurrentType.bind(Y),Y}return ve(I,J),I.prototype.getUi=function(){var R=this,K=document.createElement("div");K.style.display="flex",K.style.overflow="hidden",K.style.flexGrow="2";for(var ee=function(Ye){var ut="both";switch(Ye){case 0:ut="both";break;case 1:ut="start";break;case 2:ut="end";break;case 3:ut="none"}var yt=document.createElement("div");if(yt.style.display="flex",yt.style.flexGrow="2",yt.style.alignItems="center",yt.style.justifyContent="space-between",yt.style.padding="5px",yt.style.borderWidth="2px",yt.style.borderStyle="solid",yt.style.borderColor=ut===Y.currentType?Y.uiStyleSettings.toolboxAccentColor:"transparent",yt.addEventListener("click",function(){R.setCurrentType(ut,yt)}),K.appendChild(yt),ut==="both"||ut==="start"){var He=document.createElement("div");He.style.display="flex",He.style.alignItems="center",He.style.minHeight="20px",He.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="`+(Y.uiStyleSettings!==void 0?Y.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,He.style.marginLeft="5px",yt.appendChild(He)}var Et=document.createElement("div");Et.style.display="flex",Et.style.alignItems="center",Et.style.minHeight="20px",Et.style.flexGrow="2";var It=document.createElement("hr");if(It.style.minWidth="20px",It.style.border="0px",It.style.borderTop="3px solid "+(Y.uiStyleSettings!==void 0?Y.uiStyleSettings.toolboxColor:"#eeeeee"),It.style.flexGrow="2",Et.appendChild(It),yt.appendChild(Et),ut==="both"||ut==="end"){var Pt=document.createElement("div");Pt.style.display="flex",Pt.style.alignItems="center",Pt.style.minHeight="20px",Pt.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="`+(Y.uiStyleSettings!==void 0?Y.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Pt.style.marginRight="5px",yt.appendChild(Pt)}Y.typeBoxes.push(yt)},Y=this,Ee=0;Ee<4;Ee++)ee(Ee);return K},I.prototype.setCurrentType=function(R,K){var ee=this;this.currentType=R,this.typeBoxes.forEach(function(Y){Y.style.borderColor=Y===K?ee.uiStyleSettings!==void 0?ee.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},I}(de),pe=function(J){function I(R,K,ee){var Y=J.call(this,R,K,ee)||this;return Y.arrowType="end",Y.arrowBaseHeight=10,Y.arrowBaseWidth=10,Y.getArrowPoints=Y.getArrowPoints.bind(Y),Y.setArrowType=Y.setArrowType.bind(Y),Y.arrowTypePanel=new fe("Arrow type","end"),Y.arrowTypePanel.onArrowTypeChanged=Y.setArrowType,Y}return ve(I,J),I.prototype.ownsTarget=function(R){return!(!J.prototype.ownsTarget.call(this,R)&&R!==this.arrow1&&R!==this.arrow2)},I.prototype.getArrowPoints=function(R,K){var ee=this.arrowBaseWidth+2*this.strokeWidth,Y=this.arrowBaseHeight+2*this.strokeWidth;return R-ee/2+","+(K+Y/2)+" "+R+","+(K-Y/2)+" "+(R+ee/2)+","+(K+Y/2)},I.prototype.createTips=function(){this.arrow1=ue.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ue.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.arrow2)},I.prototype.pointerDown=function(R,K){J.prototype.pointerDown.call(this,R,K),this.state==="creating"&&this.createTips()},I.prototype.adjustVisual=function(){if(J.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",ue.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ue.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var R=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),K=this.arrow1.transform.baseVal.getItem(0);K.setRotate(R,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(K,0);var ee=this.arrow2.transform.baseVal.getItem(0);ee.setRotate(R+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ee,0)}},I.prototype.setArrowType=function(R){this.arrowType=R,this.adjustVisual(),this.stateChanged()},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var R=Object.assign({arrowType:this.arrowType},J.prototype.getState.call(this));return R.typeName=I.typeName,R},I.prototype.restoreState=function(R){J.prototype.restoreState.call(this,R);var K=R;this.arrowType=K.arrowType,this.createTips(),this.adjustVisual()},I.typeName="ArrowMarker",I.title="Arrow marker",I.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',I}(Qe),ie=function(J){function I(R,K,ee){var Y=J.call(this,R,K,ee)||this;return Y.fillColor=ee.defaultFillColor,Y.strokeWidth=0,Y.fillPanel=new Se("Color",ee.defaultColorSet,ee.defaultFillColor),Y.fillPanel.onColorChanged=Y.setFillColor,Y}return ve(I,J),Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var R=J.prototype.getState.call(this);return R.typeName=I.typeName,R},I.typeName="CoverMarker",I.title="Cover marker",I.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',I}(gt),ae=function(J){function I(R,K,ee,Y){var Ee=J.call(this,R,Y||'<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 Ee.opacities=[],Ee.opacityBoxes=[],Ee.opacities=K,Ee.currentOpacity=ee,Ee.setCurrentOpacity=Ee.setCurrentOpacity.bind(Ee),Ee}return ve(I,J),I.prototype.getUi=function(){var R=this,K=document.createElement("div");return K.style.display="flex",K.style.overflow="hidden",K.style.flexGrow="2",K.style.justifyContent="space-between",this.opacities.forEach(function(ee){var Y=document.createElement("div");Y.style.display="flex",Y.style.alignItems="center",Y.style.justifyContent="center",Y.style.padding="5px",Y.style.borderWidth="2px",Y.style.borderStyle="solid",Y.style.borderColor=ee===R.currentOpacity?R.uiStyleSettings.toolboxAccentColor:"transparent",Y.addEventListener("click",function(){R.setCurrentOpacity(ee,Y)}),K.appendChild(Y);var Ee=document.createElement("div");Ee.innerText=100*ee+"%",Y.appendChild(Ee),R.opacityBoxes.push(Y)}),K},I.prototype.setCurrentOpacity=function(R,K){var ee=this;this.currentOpacity=R,this.opacityBoxes.forEach(function(Y){Y.style.borderColor=Y===K?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},I}(de),ce=function(J){function I(R,K,ee){var Y=J.call(this,R,K,ee)||this;return Y.setOpacity=Y.setOpacity.bind(Y),Y.fillColor=ee.defaultHighlightColor,Y.strokeWidth=0,Y.opacity=ee.defaultHighlightOpacity,Y.fillPanel=new Se("Color",ee.defaultColorSet,Y.fillColor),Y.fillPanel.onColorChanged=Y.setFillColor,Y.opacityPanel=new ae("Opacity",ee.defaultOpacitySteps,Y.opacity),Y.opacityPanel.onOpacityChanged=Y.setOpacity,Y}return ve(I,J),I.prototype.setOpacity=function(R){this.opacity=R,this.visual&&ue.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var R=J.prototype.getState.call(this);return R.typeName=I.typeName,R},I.typeName="HighlightMarker",I.title="Highlight marker",I.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>',I}(ie),me='<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>',Te=function(J){function I(R,K,ee){var Y=J.call(this,R,K,ee)||this;return Y.bgColor="transparent",Y.tipPosition={x:0,y:0},Y.tipBase1Position={x:0,y:0},Y.tipBase2Position={x:0,y:0},Y.tipMoving=!1,Y.color=ee.defaultStrokeColor,Y.bgColor=ee.defaultFillColor,Y.fontFamily=ee.defaultFontFamily,Y.defaultSize={x:100,y:30},Y.setBgColor=Y.setBgColor.bind(Y),Y.getTipPoints=Y.getTipPoints.bind(Y),Y.positionTip=Y.positionTip.bind(Y),Y.setTipPoints=Y.setTipPoints.bind(Y),Y.colorPanel=new Se("Text color",ee.defaultColorSet,Y.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>'),Y.colorPanel.onColorChanged=Y.setColor,Y.bgColorPanel=new Se("Fill color",ee.defaultColorSet,Y.bgColor,me),Y.bgColorPanel.onColorChanged=Y.setBgColor,Y.fontFamilyPanel=new Pe("Font",ee.defaultFontFamilies,ee.defaultFontFamily),Y.fontFamilyPanel.onFontChanged=Y.setFont,Y.tipGrip=new qe,Y.tipGrip.visual.transform.baseVal.appendItem(ue.createTransform()),Y.controlBox.appendChild(Y.tipGrip.visual),Y}return ve(I,J),I.prototype.ownsTarget=function(R){return J.prototype.ownsTarget.call(this,R)||this.tipGrip.ownsTarget(R)||this.tip===R},I.prototype.createTip=function(){ue.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ue.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},I.prototype.pointerDown=function(R,K){this.state==="new"&&J.prototype.pointerDown.call(this,R,K),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(K)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):J.prototype.pointerDown.call(this,R,K)},I.prototype.pointerUp=function(R){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,J.prototype.pointerUp.call(this,R);else{var K=this.state==="creating";J.prototype.pointerUp.call(this,R),this.setTipPoints(K),this.positionTip()}},I.prototype.manipulate=function(R){if(this.tipMoving){var K=this.unrotatePoint(R);this.tipPosition={x:K.x-this.manipulationStartLeft,y:K.y-this.manipulationStartTop},this.positionTip()}else J.prototype.manipulate.call(this,R)},I.prototype.setBgColor=function(R){this.bgRectangle&&this.tip&&(ue.setAttributes(this.bgRectangle,[["fill",R]]),ue.setAttributes(this.tip,[["fill",R]])),this.bgColor=R,this.fillColorChanged(R)},I.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},I.prototype.setTipPoints=function(R){R===void 0&&(R=!1);var K=Math.min(this.height/2,15),ee=this.height/5;R&&(this.tipPosition={x:K+ee/2,y:this.height+20});var Y=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?Y<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(ee=this.width/5,K=Math.min(this.width/2,15),this.tipBase1Position={x:K,y:0},this.tipBase2Position={x:K+ee,y:0}):(this.tipBase1Position={x:0,y:K},this.tipBase2Position={x:0,y:K+ee}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?Y<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(ee=this.width/5,K=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-K-ee,y:0},this.tipBase2Position={x:this.width-K,y:0}):(this.tipBase1Position={x:this.width,y:K},this.tipBase2Position={x:this.width,y:K+ee}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?Y<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(ee=this.width/5,K=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-K-ee,y:this.height},this.tipBase2Position={x:this.width-K,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-K-ee},this.tipBase2Position={x:this.width,y:this.height-K}):Y<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(ee=this.width/5,K=Math.min(this.width/2,15),this.tipBase1Position={x:K,y:this.height},this.tipBase2Position={x:K+ee,y:this.height}):(this.tipBase1Position={x:0,y:this.height-K},this.tipBase2Position={x:0,y:this.height-K-ee})},I.prototype.resize=function(R){J.prototype.resize.call(this,R),this.positionTip()},I.prototype.positionTip=function(){ue.setAttributes(this.tip,[["points",this.getTipPoints()]]);var R=this.tipGrip.visual.transform.baseVal.getItem(0);R.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(R,0)},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),I.prototype.select=function(){this.positionTip(),J.prototype.select.call(this)},I.prototype.getState=function(){var R=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},J.prototype.getState.call(this));return R.typeName=I.typeName,R},I.prototype.restoreState=function(R){var K=R;this.bgColor=K.bgColor,this.tipPosition=K.tipPosition,J.prototype.restoreState.call(this,R),this.createTip(),this.setTipPoints()},I.prototype.scale=function(R,K){J.prototype.scale.call(this,R,K),this.tipPosition={x:this.tipPosition.x*R,y:this.tipPosition.y*K},this.positionTip()},I.typeName="CalloutMarker",I.title="Callout marker",I.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>',I}(Fe),ke=function(J){function I(R,K,ee){var Y=J.call(this,R,K,ee)||this;return Y.fillColor="transparent",Y.strokeColor="transparent",Y.strokeWidth=0,Y.strokeDasharray="",Y.opacity=1,Y.strokeColor=ee.defaultColor,Y.strokeWidth=ee.defaultStrokeWidth,Y.strokeDasharray=ee.defaultStrokeDasharray,Y.fillColor=ee.defaultFillColor,Y.setStrokeColor=Y.setStrokeColor.bind(Y),Y.setFillColor=Y.setFillColor.bind(Y),Y.setStrokeWidth=Y.setStrokeWidth.bind(Y),Y.setStrokeDasharray=Y.setStrokeDasharray.bind(Y),Y.setOpacity=Y.setOpacity.bind(Y),Y.createVisual=Y.createVisual.bind(Y),Y.strokePanel=new Se("Line color",he(ee.defaultColorSet,["transparent"]),ee.defaultColor),Y.strokePanel.onColorChanged=Y.setStrokeColor,Y.fillPanel=new Se("Fill color",he(ee.defaultColorSet,["transparent"]),Y.fillColor,me),Y.fillPanel.onColorChanged=Y.setFillColor,Y.strokeWidthPanel=new Ct("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),Y.strokeWidthPanel.onWidthChanged=Y.setStrokeWidth,Y.strokeStylePanel=new xt("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),Y.strokeStylePanel.onStyleChanged=Y.setStrokeDasharray,Y.opacityPanel=new ae("Opacity",ee.defaultOpacitySteps,Y.opacity),Y.opacityPanel.onOpacityChanged=Y.setOpacity,Y}return ve(I,J),I.prototype.ownsTarget=function(R){return!(!J.prototype.ownsTarget.call(this,R)&&R!==this.visual)},I.prototype.createVisual=function(){this.visual=ue.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)},I.prototype.pointerDown=function(R,K){J.prototype.pointerDown.call(this,R,K),this.state==="new"&&(this.createVisual(),this.moveVisual(R),this._state="creating")},I.prototype.manipulate=function(R){J.prototype.manipulate.call(this,R)},I.prototype.resize=function(R){J.prototype.resize.call(this,R),this.setSize()},I.prototype.setSize=function(){J.prototype.setSize.call(this),ue.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},I.prototype.pointerUp=function(R){J.prototype.pointerUp.call(this,R),this.setSize()},I.prototype.setStrokeColor=function(R){this.strokeColor=R,this.visual&&ue.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(R),this.stateChanged()},I.prototype.setFillColor=function(R){this.fillColor=R,this.visual&&ue.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(R),this.stateChanged()},I.prototype.setStrokeWidth=function(R){this.strokeWidth=R,this.visual&&ue.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},I.prototype.setStrokeDasharray=function(R){this.strokeDasharray=R,this.visual&&ue.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},I.prototype.setOpacity=function(R){this.opacity=R,this.visual&&ue.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var R=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},J.prototype.getState.call(this));return R.typeName=I.typeName,R},I.prototype.restoreState=function(R){var K=R;this.fillColor=K.fillColor,this.strokeColor=K.strokeColor,this.strokeWidth=K.strokeWidth,this.strokeDasharray=K.strokeDasharray,this.opacity=K.opacity,this.createVisual(),J.prototype.restoreState.call(this,R),this.setSize()},I.prototype.scale=function(R,K){J.prototype.scale.call(this,R,K),this.setSize()},I.typeName="EllipseMarker",I.title="Ellipse marker",I.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>',I}(mt),$e=function(J){function I(R,K,ee){return J.call(this,R,K,ee)||this}return ve(I,J),Object.defineProperty(I.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),I.prototype.ownsTarget=function(R){return!(!J.prototype.ownsTarget.call(this,R)&&R!==this.tip1&&R!==this.tip2)},I.prototype.createTips=function(){this.tip1=ue.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(ue.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ue.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(ue.createTransform()),this.visual.appendChild(this.tip2)},I.prototype.pointerDown=function(R,K){J.prototype.pointerDown.call(this,R,K),this.state==="creating"&&this.createTips()},I.prototype.adjustVisual=function(){if(J.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ue.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()]]),ue.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 R=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),K=this.tip1.transform.baseVal.getItem(0);K.setRotate(R,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(K,0);var ee=this.tip2.transform.baseVal.getItem(0);ee.setRotate(R+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ee,0)}},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var R=J.prototype.getState.call(this);return R.typeName=I.typeName,R},I.prototype.restoreState=function(R){J.prototype.restoreState.call(this,R),this.createTips(),this.adjustVisual()},I.typeName="MeasurementMarker",I.title="Measurement marker",I.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>',I}(Qe),pt=function(J){function I(R,K,ee){var Y=J.call(this,R,K,ee)||this;return Y.strokePanel.colors=ee.defaultColorSet,Y.fillColor="transparent",Y}return ve(I,J),Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var R=J.prototype.getState.call(this);return R.typeName=I.typeName,R},I.typeName="EllipseFrameMarker",I.title="Ellipse frame marker",I.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>',I}(ke),Ot=function(){function J(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(J.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),J.prototype.addUndoStep=function(I){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(I)||(this.undoStack.push(I),JSON.stringify(this.lastRedoStep)!==JSON.stringify(I)&&this.redoStack.splice(0,this.redoStack.length))},J.prototype.replaceLastUndoStep=function(I){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=I)},J.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},J.prototype.undo=function(){if(this.undoStack.length>1){var I=this.undoStack.pop();return I!==void 0&&this.redoStack.push(I),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},J.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},J}(),vt=function(J){function I(R,K,ee){var Y=J.call(this,R,K,ee)||this;return Y.strokeColor="transparent",Y.strokeWidth=0,Y.strokeDasharray="",Y.curveX=0,Y.curveY=0,Y.manipulationStartCurveX=0,Y.manipulationStartCurveY=0,Y.setStrokeColor=Y.setStrokeColor.bind(Y),Y.setStrokeWidth=Y.setStrokeWidth.bind(Y),Y.setStrokeDasharray=Y.setStrokeDasharray.bind(Y),Y.positionGrips=Y.positionGrips.bind(Y),Y.addControlGrips=Y.addControlGrips.bind(Y),Y.adjustVisual=Y.adjustVisual.bind(Y),Y.setupControlBox=Y.setupControlBox.bind(Y),Y.resize=Y.resize.bind(Y),Y.strokeColor=ee.defaultColor,Y.strokeWidth=ee.defaultStrokeWidth,Y.strokeDasharray=ee.defaultStrokeDasharray,Y.strokePanel=new Se("Line color",ee.defaultColorSet,ee.defaultColor),Y.strokePanel.onColorChanged=Y.setStrokeColor,Y.strokeWidthPanel=new Ct("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),Y.strokeWidthPanel.onWidthChanged=Y.setStrokeWidth,Y.strokeStylePanel=new xt("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),Y.strokeStylePanel.onStyleChanged=Y.setStrokeDasharray,Y}return ve(I,J),I.prototype.ownsTarget=function(R){return!(!J.prototype.ownsTarget.call(this,R)&&R!==this.visual&&R!==this.selectorCurve&&R!==this.visibleCurve&&!this.curveGrip.ownsTarget(R))},I.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},I.prototype.createVisual=function(){this.visual=ue.createGroup(),this.selectorCurve=ue.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ue.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)},I.prototype.pointerDown=function(R,K){J.prototype.pointerDown.call(this,R,K),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=R.x,this.curveY=R.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(K)&&(this.activeGrip=this.curveGrip,this._state="resize")},I.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ue.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ue.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ue.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},I.prototype.setupControlBox=function(){J.prototype.setupControlBox.call(this),this.curveControlLine1=ue.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ue.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)},I.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,J.prototype.addControlGrips.call(this)},I.prototype.positionGrips=function(){J.prototype.positionGrips.call(this);var R=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-R/2,this.curveY-R/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()))},I.prototype.manipulate=function(R){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+R.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+R.y-this.manipulationStartY),J.prototype.manipulate.call(this,R)},I.prototype.resize=function(R){this.activeGrip===this.curveGrip&&(this.curveX=R.x,this.curveY=R.y),J.prototype.resize.call(this,R),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},I.prototype.setStrokeColor=function(R){this.strokeColor=R,this.adjustVisual(),this.colorChanged(R)},I.prototype.setStrokeWidth=function(R){this.strokeWidth=R,this.adjustVisual()},I.prototype.setStrokeDasharray=function(R){this.strokeDasharray=R,this.adjustVisual()},I.prototype.scale=function(R,K){this.curveX=this.curveX*R,this.curveY=this.curveY*K,J.prototype.scale.call(this,R,K)},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var R=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},J.prototype.getState.call(this));return R.typeName=I.typeName,R},I.prototype.restoreState=function(R){J.prototype.restoreState.call(this,R);var K=R;this.strokeColor=K.strokeColor,this.strokeWidth=K.strokeWidth,this.strokeDasharray=K.strokeDasharray,this.curveX=K.curveX,this.curveY=K.curveY,this.createVisual(),this.adjustVisual()},I.typeName="CurveMarker",I.title="Curve marker",I.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>',I}(Ve),st=function(){function J(I,R){R===void 0&&(R=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=I,this.cancelable=R}return Object.defineProperty(J.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),J.prototype.preventDefault=function(){this._defaultPrevented=!0},J}(),Ke=function(J){function I(R,K,ee){var Y=J.call(this,R,!1)||this;return Y.dataUrl=K,Y.state=ee,Y}return ve(I,J),I}(st),Ge=function(J){function I(R,K,ee){ee===void 0&&(ee=!1);var Y=J.call(this,R,ee)||this;return Y.marker=K,Y}return ve(I,J),I}(st),Ue=function(){function J(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return J.prototype.addEventListener=function(I,R){this[I].push(R)},J.prototype.removeEventListener=function(I,R){var K=this[I].indexOf(R);K>-1&&this[I].splice(K,1)},J}(),le=function(){function J(I){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ce,this._isOpen=!1,this.undoRedoManager=new Ot,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 Ue,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=J.instanceCounter++,this.styles=new nt(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=I,this.targetRoot=document.body,this.width=I.clientWidth,this.height=I.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(J.prototype,"ALL_MARKER_TYPES",{get:function(){return[Ae,be,pe,Fe,pt,ke,ce,Te,$e,ie,Qe,vt]},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Ae,be,pe,Fe,ke,ce,Te]},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Ae,be,pe,Fe,ce]},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(I){var R=this;this._availableMarkerTypes.splice(0),I.forEach(function(K){if(typeof K=="string"){var ee=R.ALL_MARKER_TYPES.find(function(Y){return Y.typeName===K});ee!==void 0&&R._availableMarkerTypes.push(ee)}else R._availableMarkerTypes.push(K)})},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(I){this._zoomLevel=I,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),J.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Me.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},J.prototype.show=function(){var I=this;this.styles.styleSheetRoot===void 0&&it.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=it.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(R){return R(new st(I))})},J.prototype.render=function(){return Oe(this,void 0,void 0,function(){var I;return Re(this,function(R){switch(R.label){case 0:return this.setCurrentMarker(),(I=new et).naturalSize=this.renderAtNaturalSize,I.imageType=this.renderImageType,I.imageQuality=this.renderImageQuality,I.markersOnly=this.renderMarkersOnly,I.width=this.renderWidth,I.height=this.renderHeight,[4,I.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return R.sent(),[4,I.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,R.sent()]}})})},J.prototype.close=function(I){var R=this;if(I===void 0&&(I=!1),this.isOpen){var K=!1;I||this.eventListeners.beforeclose.forEach(function(ee){var Y=new st(R,!0);ee(Y),Y.defaultPrevented&&(K=!0)}),K||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(ee){return ee(new st(R))}),this.detachEvents(),this._isOpen=!1)}},J.prototype.addMarkersToToolbar=function(){for(var I,R=[],K=0;K<arguments.length;K++)R[K]=arguments[K];(I=this._availableMarkerTypes).push.apply(I,R)},J.prototype.addRenderEventListener=function(I){this.addEventListener("render",function(R){I(R.dataUrl,R.state)})},J.prototype.removeRenderEventListener=function(I){},J.prototype.addCloseEventListener=function(I){this.addEventListener("close",function(){I()})},J.prototype.removeCloseEventListener=function(I){},J.prototype.setupResizeObserver=function(){var I=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){I.resize(I.target.clientWidth,I.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return I.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},J.prototype.onPopupTargetResize=function(){var I=1*this.target.clientWidth/this.target.clientHeight,R=this.editorCanvas.clientWidth/I>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*I:this.editorCanvas.clientWidth,K=R<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/I;this.resize(R,K)},J.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},J.prototype.resize=function(I,R){this._isResizing=!0;var K=I/this.imageWidth,ee=R/this.imageHeight;this.imageWidth=Math.round(I),this.imageHeight=Math.round(R),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(K,ee),this._isResizing=!1},J.prototype.scaleMarkers=function(I,R){var K,ee=this;this._currentMarker&&this._currentMarker instanceof Fe?this._currentMarker.scale(I,R):(K=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(Y){Y!==ee._currentMarker&&Y.scale(I,R)}),K!==void 0&&this.setCurrentMarker(K)},J.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"},J.prototype.setTopLeft=function(){var I=this.editingTarget.getBoundingClientRect(),R=this.editorCanvas.getBoundingClientRect();this.left=I.left-R.left,this.top=I.top-R.top},J.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)},J.prototype.addDefs=function(){for(var I,R=[],K=0;K<arguments.length;K++)R[K]=arguments[K];this.defs=ue.createDefs(),this.addDefsToImage(),(I=this.defs).append.apply(I,R)},J.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},J.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)},J.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},J.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},J.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)},J.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},J.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)},J.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 I=document.createElement("a");I.href="https://markerjs.com/",I.target="_blank",I.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>',I.title="Powered by marker.js",I.style.display="grid",I.style.alignItems="center",I.style.justifyItems="center",I.style.padding="3px",I.style.width="20px",I.style.height="20px",this.logoUI.appendChild(I),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},J.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},J.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},J.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},J.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var I=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=I+"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 Ze(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 ot(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},J.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},J.prototype.removeMarker=function(I){this.markerImage.removeChild(I.container),this.markers.indexOf(I)>-1&&this.markers.splice(this.markers.indexOf(I),1),I.dispose()},J.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},J.prototype.toolbarButtonClicked=function(I,R){if(I==="marker"&&R!==void 0)this.createNewMarker(R);else if(I==="action")switch(R){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},J.prototype.deleteSelectedMarker=function(){var I=this;if(this._currentMarker!==void 0){var R=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ee){var Y=new Ge(I,I._currentMarker,!0);ee(Y),Y.defaultPrevented&&(R=!0)}),!R){var K=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(ee){return ee(new Ge(I,K))})}}},J.prototype.clear=function(){var I=this,R=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Ee){var Ye=new Ge(I,void 0,!0);Ee(Ye),Ye.defaultPrevented&&(R=!0)}),!R)){this.setCurrentMarker();for(var K=function(Ee){var Ye=ee.markers[Ee];ee.setCurrentMarker(ee.markers[Ee]),ee._currentMarker.dispose(),ee.markerImage.removeChild(ee._currentMarker.container),ee.markers.splice(ee.markers.indexOf(ee._currentMarker),1),ee.eventListeners.markerdelete.forEach(function(ut){return ut(new Ge(I,Ye))})},ee=this,Y=this.markers.length-1;Y>=0;Y--)K(Y);this.addUndoStep()}},Object.defineProperty(J.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),J.prototype.showNotesEditor=function(){var I;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=(I=this._currentMarker.notes)!==null&&I!==void 0?I:"",this.overlayContainer.appendChild(this.notesArea))},J.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},J.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},J.prototype.addUndoStep=function(){var I=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var R=this.getState(),K=this.undoRedoManager.getLastUndoStep();if(!K||K.width===R.width&&K.height===R.height){var ee=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(R),ee<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(Y){return Y(new st(I))})}else this.undoRedoManager.replaceLastUndoStep(R),this.eventListeners.statechange.forEach(function(Y){return Y(new st(I))})}},J.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},J.prototype.undoStep=function(){var I=this,R=this.undoRedoManager.undo();R!==void 0&&(this.restoreState(R),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(K){return K(new st(I))}))},J.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},J.prototype.redoStep=function(){var I=this,R=this.undoRedoManager.redo();R!==void 0&&(this.restoreState(R),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(K){return K(new st(I))}))},J.prototype.stepZoom=function(){var I=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=I<this.zoomSteps.length-1?this.zoomSteps[I+1]:this.zoomSteps[0]},J.prototype.panTo=function(I){this.contentDiv.scrollBy({left:this.prevPanPoint.x-I.x,top:this.prevPanPoint.y-I.y}),this.prevPanPoint=I},J.prototype.startRenderAndClose=function(){return Oe(this,void 0,void 0,function(){var I,R,K=this;return Re(this,function(ee){switch(ee.label){case 0:return[4,this.render()];case 1:return I=ee.sent(),R=this.getState(),this.eventListeners.render.forEach(function(Y){return Y(new Ke(K,I,R))}),this.close(!0),[2]}})})},J.prototype.getState=function(I){I===!0&&this.setCurrentMarker();var R={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(K){return R.markers.push(K.getState())}),R},J.prototype.restoreState=function(I){var R=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);I.markers.forEach(function(K){var ee=R._availableMarkerTypes.find(function(Ee){return Ee.typeName===K.typeName});if(ee!==void 0){var Y=R.addNewMarker(ee);Y.restoreState(K),R.markers.push(Y)}}),I.width&&I.height&&(I.width!==this.imageWidth||I.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/I.width,this.imageHeight/I.height),this.eventListeners.restorestate.forEach(function(K){return K(new st(R))})},J.prototype.addNewMarker=function(I){var R=ue.createGroup();return this.markerImage.appendChild(R),new I(R,this.overlayContainer,this.settings)},J.prototype.createNewMarker=function(I){var R,K=this;(R=typeof I=="string"?this._availableMarkerTypes.find(function(ee){return ee.typeName===I}):I)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(R),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(R.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(ee){return ee(new Ge(K,K._currentMarker))}))},J.prototype.markerCreated=function(I){var R=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(I),this.setCurrentMarker(I),I instanceof be&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(be):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(K){return K(new Ge(R,R._currentMarker))})},J.prototype.colorChanged=function(I){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=I,this.settings.defaultStrokeColor=I)},J.prototype.fillColorChanged=function(I){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=I)},J.prototype.markerStateChanged=function(I){var R=this;this.eventListeners.markerchange.forEach(function(K){return K(new Ge(R,I))})},J.prototype.setCurrentMarker=function(I){var R=this;this._currentMarker!==I&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(K){return K(new Ge(R,R._currentMarker))})),this._currentMarker=I,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(K){return K(new Ge(R,R._currentMarker))}))},J.prototype.onPointerDown=function(I){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||I.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var R=this.markers.find(function(K){return K.ownsTarget(I.target)});R!==void 0?(this.setCurrentMarker(R),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(I.clientX,I.clientY),I.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:I.clientX,y:I.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(I.clientX,I.clientY))},J.prototype.onDblClick=function(I){if(this._isFocused||this.focus(),this.mode==="select"){var R=this.markers.find(function(K){return K.ownsTarget(I.target)});R!==void 0&&R!==this._currentMarker&&this.setCurrentMarker(R),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(I.clientX,I.clientY),I.target):this.setCurrentMarker()}},J.prototype.onPointerMove=function(I){this.touchPoints!==1&&I.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||I.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(I.clientX,I.clientY)):this.zoomLevel>1&&this.panTo({x:I.clientX,y:I.clientY}))},J.prototype.onPointerUp=function(I){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(I.clientX,I.clientY)),this.isDragging=!1,this.addUndoStep()},J.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},J.prototype.onKeyUp=function(I){this._currentMarker===void 0||this.notesArea!==void 0||I.key!=="Delete"&&I.key!=="Backspace"||this.deleteSelectedMarker()},J.prototype.clientToLocalCoordinates=function(I,R){var K=this.markerImage.getBoundingClientRect();return{x:(I-K.left)/this.zoomLevel,y:(R-K.top)/this.zoomLevel}},J.prototype.onWindowResize=function(){this.positionUI()},J.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var I=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=I+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},J.prototype.addLicenseKey=function(I){Me.addKey(I)},J.prototype.addEventListener=function(I,R){this.eventListeners.addEventListener(I,R)},J.prototype.removeEventListener=function(I,R){this.eventListeners.removeEventListener(I,R)},J.prototype.renderState=function(I){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(I),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(J.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),J.prototype.focus=function(){var I=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(R){return R(new st(I))}))},J.prototype.blur=function(){var I=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(R){return R(new st(I))}))},J.instanceCounter=0,J}();/* **********************************
|
|
cropro version 1.2.0
|
|
@license SEE LICENSE IN LICENSE
|
|
|
|
copyright Alan Mendelevich
|
|
see README and LICENSE for details
|
|
********************************** *//*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var _e=function(J,I){return(_e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(R,K){R.__proto__=K}||function(R,K){for(var ee in K)Object.prototype.hasOwnProperty.call(K,ee)&&(R[ee]=K[ee])})(J,I)};function Xe(J,I){if(typeof I!="function"&&I!==null)throw new TypeError("Class extends value "+String(I)+" is not a constructor or null");function R(){this.constructor=J}_e(J,I),J.prototype=I===null?Object.create(I):(R.prototype=I.prototype,new R)}function Be(J,I,R,K){return new(R||(R=Promise))(function(ee,Y){function Ee(yt){try{ut(K.next(yt))}catch(He){Y(He)}}function Ye(yt){try{ut(K.throw(yt))}catch(He){Y(He)}}function ut(yt){var He;yt.done?ee(yt.value):(He=yt.value,He instanceof R?He:new R(function(Et){Et(He)})).then(Ee,Ye)}ut((K=K.apply(J,I||[])).next())})}function ct(J,I){var R,K,ee,Y,Ee={label:0,sent:function(){if(1&ee[0])throw ee[1];return ee[1]},trys:[],ops:[]};return Y={next:Ye(0),throw:Ye(1),return:Ye(2)},typeof Symbol=="function"&&(Y[Symbol.iterator]=function(){return this}),Y;function Ye(ut){return function(yt){return function(He){if(R)throw new TypeError("Generator is already executing.");for(;Ee;)try{if(R=1,K&&(ee=2&He[0]?K.return:He[0]?K.throw||((ee=K.return)&&ee.call(K),0):K.next)&&!(ee=ee.call(K,He[1])).done)return ee;switch(K=0,ee&&(He=[2&He[0],ee.value]),He[0]){case 0:case 1:ee=He;break;case 4:return Ee.label++,{value:He[1],done:!1};case 5:Ee.label++,K=He[1],He=[0];continue;case 7:He=Ee.ops.pop(),Ee.trys.pop();continue;default:if(!(ee=Ee.trys,(ee=ee.length>0&&ee[ee.length-1])||He[0]!==6&&He[0]!==2)){Ee=0;continue}if(He[0]===3&&(!ee||He[1]>ee[0]&&He[1]<ee[3])){Ee.label=He[1];break}if(He[0]===6&&Ee.label<ee[1]){Ee.label=ee[1],ee=He;break}if(ee&&Ee.label<ee[2]){Ee.label=ee[2],Ee.ops.push(He);break}ee[2]&&Ee.ops.pop(),Ee.trys.pop();continue}He=I.call(J,Ee)}catch(Et){He=[6,Et],K=0}finally{R=ee=0}if(5&He[0])throw He[1];return{value:He[0]?He[1]:void 0,done:!0}}([ut,yt])}}}var ft=function(){function J(){}return J.addKey=function(I){J.key=I},Object.defineProperty(J,"isLicensed",{get:function(){return!!J.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(J.key)},enumerable:!1,configurable:!0}),J}(),Ie=function(){function J(){}return J.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},J.setAttributes=function(I,R){for(var K=0,ee=R;K<ee.length;K++){var Y=ee[K],Ee=Y[0],Ye=Y[1];I.setAttribute(Ee,Ye)}},J.createRect=function(I,R,K){var ee=document.createElementNS("http://www.w3.org/2000/svg","rect");return ee.setAttribute("width",I.toString()),ee.setAttribute("height",R.toString()),K&&J.setAttributes(ee,K),ee},J.createLine=function(I,R,K,ee,Y){var Ee=document.createElementNS("http://www.w3.org/2000/svg","line");return Ee.setAttribute("x1",I.toString()),Ee.setAttribute("y1",R.toString()),Ee.setAttribute("x2",K.toString()),Ee.setAttribute("y2",ee.toString()),Y&&J.setAttributes(Ee,Y),Ee},J.createPolygon=function(I,R){var K=document.createElementNS("http://www.w3.org/2000/svg","polygon");return K.setAttribute("points",I),R&&J.setAttributes(K,R),K},J.createCircle=function(I,R){var K=document.createElementNS("http://www.w3.org/2000/svg","circle");return K.setAttribute("cx",(I/2).toString()),K.setAttribute("cy",(I/2).toString()),K.setAttribute("r",I.toString()),R&&J.setAttributes(K,R),K},J.createEllipse=function(I,R,K){var ee=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ee.setAttribute("cx",(I/2).toString()),ee.setAttribute("cy",(R/2).toString()),ee.setAttribute("rx",(I/2).toString()),ee.setAttribute("ry",(R/2).toString()),K&&J.setAttributes(ee,K),ee},J.createGroup=function(I){var R=document.createElementNS("http://www.w3.org/2000/svg","g");return I&&J.setAttributes(R,I),R},J.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},J.createMarker=function(I,R,K,ee,Y,Ee,Ye){var ut=document.createElementNS("http://www.w3.org/2000/svg","marker");return J.setAttributes(ut,[["id",I],["orient",R],["markerWidth",K.toString()],["markerHeight",ee.toString()],["refX",Y.toString()],["refY",Ee.toString()]]),ut.appendChild(Ye),ut},J.createText=function(I){var R=document.createElementNS("http://www.w3.org/2000/svg","text");return R.setAttribute("x","0"),R.setAttribute("y","0"),I&&J.setAttributes(R,I),R},J.createTSpan=function(I,R){var K=document.createElementNS("http://www.w3.org/2000/svg","tspan");return K.textContent=I,R&&J.setAttributes(K,R),K},J.createImage=function(I){var R=document.createElementNS("http://www.w3.org/2000/svg","image");return I&&J.setAttributes(R,I),R},J.createPoint=function(I,R){var K=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return K.x=I,K.y=R,K},J.createPath=function(I,R){var K=document.createElementNS("http://www.w3.org/2000/svg","path");return K.setAttribute("d",I),R&&J.setAttributes(K,R),K},J.createElement=function(I,R){var K=document.createElementNS("http://www.w3.org/2000/svg",I);return R&&J.setAttributes(K,R),K},J.getHollowRectanglePath=function(I,R,K,ee,Y,Ee,Ye,ut){return"M"+I+","+R+"V"+(R+ee)+"H"+(I+K)+"V"+R+"H"+Y+"V"+Ee+"H"+(Y+Ye)+"V"+(Ee+ut)+"H"+Y+"V"+R+"Z"},J}(),Je=function(){function J(I){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+I+"_"}return Object.defineProperty(J.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(J.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(J.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),J.prototype.addClass=function(I){return this.styleSheet===void 0&&this.addStyleSheet(),I.name=""+this.classNamePrefix+I.localName,this.classes.push(I),this.styleSheet.sheet.insertRule("."+I.name+" {"+I.style+"}",this.styleSheet.sheet.cssRules.length),I},J.prototype.addRule=function(I){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(I),this.styleSheet.sheet.insertRule(I.selector+" {"+I.style+"}",this.styleSheet.sheet.cssRules.length)},J.prototype.addStyleSheet=function(){var I;this.styleSheet=document.createElement("style"),((I=this.styleSheetRoot)!==null&&I!==void 0?I:document.head).appendChild(this.styleSheet),this.addRule(new tt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new tt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new tt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new _t("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new _t("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},J.prototype.removeStyleSheet=function(){var I;this.styleSheet&&(((I=this.styleSheetRoot)!==null&&I!==void 0?I:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},J}(),tt=function(J,I){this.selector=J,this.style=I},_t=function(J,I){this.localName=J,this.style=I},Tt=function(){function J(){this.blocks=[],this.display=""}return J.prototype.addButtonBlock=function(I){I.className=this.blockClassName,I.buttonClassName=this.buttonClassName,I.buttonColorsClassName=this.buttonColorsClassName,I.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(I)},J.prototype.addElementBlock=function(I){I.className===void 0&&(I.className=this.blockClassName),this.blocks.push(I)},J.prototype.getUI=function(){var I=document.createElement("div");return I.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,I.style.display=this.display,this.blocks.forEach(function(R){return I.appendChild(R.getUI())}),I},J}(),Zt=function(){function J(){}return J.prototype.getUI=function(){var I=document.createElement("div");if(I.className=this.className,this.minWidth!==void 0&&(I.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":I.style.justifyContent="flex-start";break;case"center":I.style.justifyContent="center";break;case"end":I.style.justifyContent="flex-end"}return I.style.whiteSpace="nowrap",I},J}(),nn=function(J){function I(){var R=J!==null&&J.apply(this,arguments)||this;return R.buttons=[],R}return Xe(I,J),I.prototype.addButton=function(R){R.className=this.buttonClassName,R.colorsClassName=this.buttonColorsClassName,R.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(R)},I.prototype.getUI=function(){var R=J.prototype.getUI.call(this);return this.buttons.forEach(function(K){return R.appendChild(K.getUI())}),R},I}(Zt),Qt=function(){function J(I,R){this._isActive=!1,this._isHidden=!1,this._icon=I,this.title=R,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(J.prototype,"icon",{get:function(){return this._icon},set:function(I){this._icon=I,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isActive",{get:function(){return this._isActive},set:function(I){this._isActive=I,this.adjustClassName()},enumerable:!1,configurable:!0}),J.prototype.getUI=function(){var I=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 I.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},J.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,"")))},J.prototype.hide=function(){this._isHidden=!0},J}(),Lt=function(J){function I(){var R=J!==null&&J.apply(this,arguments)||this;return R.elements=[],R}return Xe(I,J),I.prototype.addElement=function(R){this.elements.push(R)},I.prototype.getUI=function(){var R=J.prototype.getUI.call(this);return this.elements.forEach(function(K){return R.appendChild(K)}),R},I}(Zt),On=function(){function J(I,R){this.horizontal=I,this.vertical=R}return Object.defineProperty(J.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),J.prototype.getVerticalLength=function(I){return I/this.ratio},J.prototype.getHorizontalLength=function(I){return I*this.ratio},J}(),un=function(){function J(){}return J.getIcon=function(I,R){if(I>0&&R>0){var K=new On(I,R),ee=K.ratio>=1?20:K.getHorizontalLength(20),Y=K.ratio<1?20:K.getVerticalLength(20),Ee=document.createElementNS("http://www.w3.org/2000/svg","svg");Ee.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ee.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Ee);var Ye=Ie.createDefs();Ee.appendChild(Ye);var ut=Ie.createElement("clipPath",[["id","text-bg-clip"]]);Ye.appendChild(ut);var yt=Ie.createPath(Ie.getHollowRectanglePath((24-ee)/2,(24-Y)/2,ee,Y,(24-ee)/2+2,(24-Y)/2+2,ee-4,Y-4));Ee.appendChild(yt);var He=Ie.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);He.appendChild(Ie.createTSpan(I+":"+R)),Ee.appendChild(He);var Et=He.getBBox();Ie.setAttributes(He,[["x",((24-Et.width)/2).toString()],["y",((24-Et.height)/2-Et.y).toString()]]);var It=Ie.createPath(Ie.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Et.width))/2,(24-Math.ceil(Et.height))/2,Math.ceil(Et.width),Math.ceil(Et.height)));return ut.appendChild(It),Ie.setAttributes(yt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Ee),Ee.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>'},J}(),fn=function(J){function I(R,K,ee){var Y=J.call(this,R,K)||this;return Y.isDropdownOpen=!1,Y.onClick=Y.dropdownButtonClicked,Y.dropdownButtons=ee,Y}return Xe(I,J),I.prototype.setupDropdown=function(){var R=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(K){K.className=R.className,K.colorsClassName=R.colorsClassName,R.dropdownBlock.appendChild(K.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},I.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},I.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},I.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},I.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},I.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},I}(Qt),Xt=function(){function J(I,R){this.GRIP_SIZE=10,this.color=I,this.fillColor=R,this.visual=Ie.createGroup(),this.visual.appendChild(Ie.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Ie.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return J.prototype.ownsTarget=function(I){return I===this.visual||I===this.visual.childNodes[0]||I===this.visual.childNodes[1]},J.prototype.setCenter=function(I,R){this.visual.childNodes.forEach(function(K){return Ie.setAttributes(K,[["cx",I.toString()],["cy",R.toString()]])})},J}(),mn=function(){function J(I,R,K,ee){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=I,this.canvasHeight=R,this.margin=K,this.container=ee,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(J.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(I){this._aspectRatio=I,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(I){this._isGridVisible=I,this.gridContainer&&Ie.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(I){this._zoomFactor=I,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),J.prototype.open=function(){var I=this;this.cropShadeElement=Ie.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Ie.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var R=0;R<this.numberOfGridLines;R++)this.horizontalGridLines.push(Ie.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Ie.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(K){return I.gridContainer.appendChild(K)}),this.verticalGridLines.forEach(function(K){return I.gridContainer.appendChild(K)}),this.cropRectElement=Ie.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Xt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Xt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Xt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Xt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},J.prototype.setCropRectangle=function(I){this.cropRect=I;var R=Object.assign({},this.cropRect);this.zoomFactor!==1&&(R.width=this.cropRect.width*this.zoomFactor,R.height=this.cropRect.height*this.zoomFactor,R.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-R.width/2,R.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-R.height/2),Ie.setAttributes(this.cropRectElement,[["x",R.x.toString()],["y",R.y.toString()],["width",R.width.toString()],["height",R.height.toString()]]);var K=R.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(Y,Ee){var Ye=R.y+K*(Ee+1);Ie.setAttributes(Y,[["x1",""+R.x],["y1",""+Ye],["x2",""+(R.x+R.width)],["y2",""+Ye]])});var ee=R.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(Y,Ee){var Ye=R.x+ee*(Ee+1);Ie.setAttributes(Y,[["x1",""+Ye],["y1",""+R.y],["x2",""+Ye],["y2",""+(R.y+R.height)]])}),Ie.setAttributes(this.cropShadeElement,[["d",Ie.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,R.x,R.y,R.width,R.height)]]),this.topLeftGrip.setCenter(R.x,R.y),this.topRightGrip.setCenter(R.x+R.width,R.y),this.bottomLeftGrip.setCenter(R.x,R.y+R.height),this.bottomRightGrip.setCenter(R.x+R.width,R.y+R.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},J.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},J.prototype.clientToLocalCoordinates=function(I,R){var K=this.container.getBoundingClientRect();return{x:I-K.left+this.margin,y:R-K.top+this.margin}},J.prototype.onPointerDown=function(I){this.container.setPointerCapture(I.pointerId),this.previousPoint=this.clientToLocalCoordinates(I.clientX,I.clientY),this.cropRectElement===I.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(I.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(I.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(I.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(I.target)&&(this.activeGrip=this.bottomRightGrip)},J.prototype.onPointerMove=function(I){if(this.isMoving)this.move(this.clientToLocalCoordinates(I.clientX,I.clientY));else if(this.activeGrip){var R=this.clientToLocalCoordinates(I.clientX,I.clientY);this.resize(R)}I.preventDefault()},J.prototype.onPointerUp=function(I){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(I.pointerId)},J.prototype.move=function(I){var R=I.x-this.previousPoint.x,K=I.y-this.previousPoint.y;this.zoomFactor!==1&&(R=-R/this.zoomFactor,K=-K/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+R),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+K),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=I},J.prototype.resize=function(I){var R=Object.assign({},this.cropRect),K=I.x-this.previousPoint.x,ee=I.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:R.x+K<this.margin&&(K=this.margin-R.x),R.x+=K,R.width=this.cropRect.x+this.cropRect.width-R.x;break;case this.bottomRightGrip:case this.topRightGrip:R.width+K>this.canvasWidth*this.zoomFactor&&(K=this.canvasWidth*this.zoomFactor-R.width),R.width+=K}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(R.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(K),R.height=this.aspectRatio.getVerticalLength(R.width)):(R.y+=ee,R.height=this.cropRect.y+this.cropRect.height-R.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?R.height=this.aspectRatio.getVerticalLength(R.width):R.height+=ee}R.width<10&&(R.x=this.cropRect.x,R.width=10),R.height<10&&(R.y=this.cropRect.y,R.height=10),this.previousPoint=I,R.x>=this.margin&&R.y>=this.margin&&R.x-this.margin+R.width<=this.canvasWidth&&R.y-this.margin+R.height<=this.canvasHeight&&(this.cropRect=R,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},J.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var I=this.cropRect.x+this.cropRect.width/2,R=this.cropRect.y+this.cropRect.height/2,K=this.aspectRatio.getHorizontalLength(this.cropRect.height),ee=this.aspectRatio.getVerticalLength(this.cropRect.width);K/this.canvasWidth<ee/this.canvasHeight?this.cropRect.width=K:this.cropRect.height=ee,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=I-this.cropRect.width/2,this.cropRect.y=R-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},J.prototype.getRescaledRect=function(I,R,K,ee,Y,Ee){var Ye=K/I,ut=ee/R;return{x:(Y.x-Ee)*Ye+Ee,y:(Y.y-Ee)*ut+Ee,width:Y.width*Ye,height:Y.height*ut}},J.prototype.scaleCanvas=function(I,R){var K=this.getRescaledRect(this.canvasWidth,this.canvasHeight,I,R,this.cropRect,this.margin);this.canvasWidth=I,this.canvasHeight=R,this.onCropChange&&this.onCropChange(K),this.setCropRectangle(K)},J}(),Pn=function(){function J(I){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=I,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(J.prototype,"angle",{get:function(){return this._angle},set:function(I){this._angle=I,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),J.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},J.prototype.onPointerDown=function(I){this.controlContainer.setPointerCapture(I.pointerId),this.isDragging=!0,this.previousPoint={x:I.clientX,y:I.clientY}},J.prototype.onPointerMove=function(I){this.isDragging&&(this.onAngleChange&&this.onAngleChange((I.clientX-this.previousPoint.x)/5),this.previousPoint.x=I.clientX)},J.prototype.onPointerUp=function(I){this.isDragging&&this.onAngleChange&&this.onAngleChange((I.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(I.pointerId)},J.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var I=this.angleLabelText.getBBox();Ie.setAttributes(this.angleLabelElement,[["x",((this.width-I.width)/2).toString()],["y",(this.height/2).toString()]])}},J.prototype.positionScaleShape=function(){if(this.scaleShape){var I=this.scaleShape.transform.baseVal.getItem(0);I.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(I,0)}},J.prototype.getVisual=function(){var I=document.createElementNS("http://www.w3.org/2000/svg","svg");I.setAttribute("xmlns","http://www.w3.org/2000/svg"),I.setAttribute("width",this.width+"px"),I.setAttribute("height",this.height+"px"),I.setAttribute("viewBox","0 0 "+this.width+" "+this.height),I.style.flexShrink="0",document.body.appendChild(I);for(var R="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,K=1;K<=this.width/5+10;K++){var ee=K%5==0?this.height/3:this.height/6;R+="h4v"+-ee+"h1v"+ee}R+="v1H0Z",this.scaleShape=Ie.createPath(R);var Y=Ie.createTransform();this.scaleShape.transform.baseVal.appendItem(Y),I.appendChild(this.scaleShape),this.angleLabelElement=Ie.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Ie.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Ee=Ie.createTSpan("");return Ee.innerHTML="°",this.angleLabelElement.appendChild(Ee),I.appendChild(this.angleLabelElement),document.body.removeChild(I),I},J}(),zn=function(){function J(){this.naturalSize=!1,this.imageType="image/png"}return J.prototype.rasterize=function(I,R,K,ee,Y,Ee,Ye){var ut=this;return new Promise(function(yt){var He=document.createElement("canvas");He.width=I.width.baseVal.value-2*ee,He.height=I.height.baseVal.value-2*ee;var Et=1,It=1;ut.naturalSize===!0?(Et=R.naturalWidth/(I.width.baseVal.value-2*ee)/Ee,It=R.naturalHeight/(I.height.baseVal.value-2*ee)/Ye,He.width=R.naturalWidth/Ee,He.height=R.naturalHeight/Ye):ut.width!==void 0&&ut.height!==void 0&&(Et=ut.width/K.width,It=ut.height/K.height,He.width*=Et,He.height*=It);var Pt=He.getContext("2d");Pt.translate(He.width/2,He.height/2),Pt.rotate(Y*Math.PI/180),Pt.scale(Ee,Ye),Pt.translate(-He.width/2,-He.height/2),Pt.drawImage(R,0,0,He.width,He.height);var qt=document.createElement("canvas");qt.width=K.width*Et,qt.height=K.height*It,qt.getContext("2d").putImageData(Pt.getImageData((K.x-ee)*Et,(K.y-ee)*It,K.width*Et,K.height*It),0,0),yt(qt.toDataURL(ut.imageType,ut.imageQuality))})},J}(),dt=function(){function J(I){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=J.instanceCounter++,this.styles=new Je(this.instanceNo),this.target=I,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(J.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(I){this._zoomToCropEnabled=I,I?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(I){this._isGridVisible=I,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"gridLines",{get:function(){return this._gridLines},set:function(I){this._gridLines=I,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(I){this._rotationAngle=I,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"aspectRatio",{get:function(){var I;return(I=this._aspectRatio)!==null&&I!==void 0?I:this.aspectRatios[0]},set:function(I){this._aspectRatio=I},enumerable:!1,configurable:!0}),J.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},J.prototype.show=function(){this.showUI(),this.open()},J.prototype.close=function(I){I===void 0&&(I=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),I||this.closeEventListeners.forEach(function(R){return R()}),this._isOpen=!1)},J.prototype.addRenderEventListener=function(I){this.renderEventListeners.push(I)},J.prototype.removeRenderEventListener=function(I){this.renderEventListeners.indexOf(I)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(I),1)},J.prototype.addCloseEventListener=function(I){this.closeEventListeners.push(I)},J.prototype.removeCloseEventListener=function(I){this.closeEventListeners.indexOf(I)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(I),1)},J.prototype.setupResizeObserver=function(){var I=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){I.resize(I.target.clientWidth,I.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},J.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var I=1*this.target.clientWidth/this.target.clientHeight,R=this.contentDiv.clientWidth/I>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*I:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,K=R+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/I;this.resize(R,K)}},J.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},J.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",Ie.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},J.prototype.resize=function(I,R){this.imageWidth=Math.round(I),this.imageHeight=Math.round(R),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()},J.prototype.setEditingTarget=function(){var I=document.createElement("canvas");I.width=this.target.naturalWidth,I.height=this.target.naturalHeight,I.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var R=I.toDataURL();Ie.setAttributes(this.editingTarget,[["href",R]]),this.setEditingTargetSize()},J.prototype.setTopLeft=function(){var I=this.target.getBoundingClientRect(),R=this.editorCanvas.getBoundingClientRect();this.left=I.left-R.left-this.CANVAS_MARGIN,this.top=I.top-R.top-this.CANVAS_MARGIN},J.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=Ie.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Ie.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Ie.createGroup(),this.editingTargetRotationScaleContainer=Ie.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var I=Ie.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(I);var R=Ie.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(R),this.editingTargetContainer=Ie.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)},J.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},J.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Ie.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new mn(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()},J.prototype.zoomToCrop=function(){if(this.cropRect){var I=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,R=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=I+"px "+R+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-I+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-R+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},J.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)},J.prototype.cropRectChanged=function(I){this.cropRect=I,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},J.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},J.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},J.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},J.prototype.showUI=function(){switch(this.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 I=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,R=this.target.offsetTop>I+this.CANVAS_MARGIN?this.target.offsetTop-(I+this.CANVAS_MARGIN):0;this.coverDiv.style.top=R+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},J.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},J.prototype.addTopToolbar=function(){var I=this;this.topToolbar=new Tt,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 R=new nn;R.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(R);var K=[];this.aspectRatios.forEach(function(It){var Pt=new Qt(un.getIcon(It.horizontal,It.vertical),It.horizontal===0&&It.vertical===0?"FREE":It.horizontal+":"+It.vertical);Pt.onClick=function(){return I.ratioButtonClicked(It)},K.push(Pt)}),this.aspectRatioButton=new fn(un.getIcon(0,0),"Aspect ratio",K),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,R.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var ee=new Qt('<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");ee.isActive=this.isGridVisible,ee.onClick=function(){I.isGridVisible=!I.isGridVisible,ee.isActive=I.isGridVisible},R.addButton(ee);var Y=new Qt('<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(Y.isActive=this.zoomToCropEnabled,Y.onClick=function(){I.zoomToCropEnabled=!I.zoomToCropEnabled,Y.isActive=I.zoomToCropEnabled},R.addButton(Y),!ft.isLicensed){var Ee=new Lt;this.topToolbar.addElementBlock(Ee);var Ye=document.createElement("div");Ye.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var ut=document.createElement("a");ut.style.color="currentColor",ut.href="https://markerjs.com/products/cropro",ut.target="_blank",ut.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>',Ye.appendChild(ut),Ee.addElement(Ye)}var yt=new nn;yt.minWidth=3*this.toolbarHeight+"px",yt.contentAlign="end",this.topToolbar.addButtonBlock(yt);var He=new Qt('<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");He.onClick=this.startRenderAndClose,yt.addButton(He),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(He.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Et=new Qt('<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");Et.onClick=this.close,yt.addButton(Et),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Et.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},J.prototype.addBottomToolbar=function(){var I=this;this.bottomToolbar=new Tt,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 R=new nn;R.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(R);var K=new Qt('<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");K.onClick=this.rotateLeftButtonClicked,R.addButton(K);var ee=new Qt('<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");ee.onClick=this.rotateRightButtonClicked,R.addButton(ee);var Y=new Lt;Y.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(Y),this.straightener=new Pn("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(yt){I.rotateBy(yt),I.straightener.angle=I.rotationAngle},Y.addElement(this.straightener.getUI());var Ee=new nn;Ee.minWidth=2*this.toolbarHeight+"px",Ee.contentAlign="end",this.bottomToolbar.addButtonBlock(Ee);var Ye=new Qt('<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");Ye.onClick=this.flipHorizontallyButtonClicked,Ee.addButton(Ye);var ut=new Qt('<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");ut.onClick=this.flipVerticallyButtonClicked,Ee.addButton(ut)},J.prototype.ratioButtonClicked=function(I){this.aspectRatio=I,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},J.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=un.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},J.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new On(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},J.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},J.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},J.prototype.restoreState=function(I){if(I){var R=this.cropLayer.getRescaledRect(I.width,I.height,this.imageWidth,this.imageHeight,I.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(R),this.cropRectChanged(R),this.flippedHorizontally=I.flippedHorizontally,this.flippedVertically=I.flippedVertically,this.applyFlip(),this.rotationAngle=I.rotationAngle,this.applyRotation()}},J.prototype.clientToLocalCoordinates=function(I,R){var K=this.cropImage.getBoundingClientRect();return{x:I-K.left,y:R-K.top}},J.prototype.onWindowResize=function(){this.positionUI()},J.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var I=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=I+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},J.prototype.rotateLeftButtonClicked=function(){var I=this.rotationAngle-90;this.rotationAngle%90!=0&&(I+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(I)},J.prototype.rotateRightButtonClicked=function(){var I=this.rotationAngle+90;this.rotationAngle%90!=0&&(I-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(I)},J.prototype.rotateTo=function(I){I=(I=I>180?I-360:I)<=-180?I+360:I,this.rotationAngle=I,this.applyRotation()},J.prototype.rotateBy=function(I){this.rotateTo((this.rotationAngle+I)%360)},J.prototype.applyRotation=function(){var I=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var R=this.editingTargetRotationContainer.transform.baseVal.getItem(0);R.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(R,0);var K=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/K.width,this.imageHeight/K.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=I},J.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},J.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},J.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},J.prototype.startRenderAndClose=function(){return Be(this,void 0,void 0,function(){var I,R;return ct(this,function(K){switch(K.label){case 0:return[4,this.render()];case 1:return I=K.sent(),R=this.getState(),this.renderEventListeners.forEach(function(ee){return ee(I,R)}),this.close(!0),[2]}})})},J.prototype.render=function(){return Be(this,void 0,void 0,function(){var I;return ct(this,function(R){switch(R.label){case 0:return(I=new zn).naturalSize=this.renderAtNaturalSize,I.imageType=this.renderImageType,I.imageQuality=this.renderImageQuality,I.width=this.renderWidth,I.height=this.renderHeight,this.unzoomFromCrop(),Ie.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,I.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 R.sent(),[4,I.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,R.sent()]}})})},J.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new _t("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 _t("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new _t("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var I=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new _t("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*I)+`px;
|
|
height: `+(this.toolbarHeight-2*I)+`px;
|
|
padding: `+I+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new _t("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new _t("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new tt("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new tt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new _t("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 _t("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new _t("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 _t("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*I)+`px;
|
|
padding: `+I+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new _t("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},J.instanceCounter=0,J}(),Rt=k("8hTe"),Vn=k.n(Rt),pr=/<pre[^>]*>/g;function ur(J){var I=document.createElement("div");return I.innerHTML=J,I.childNodes.length===0?"":I.childNodes[0].nodeValue}var kr=oe.a=function(J){var I=J.value,R=I===void 0?"":I,K=J.edit,ee=K===void 0?!1:K,Y=J.className,Ee=J.showTextOnly,Ye=J.showLines,ut=J.replaces,yt=J.zoomImg,He=J.hasMask,Et=J.style,It=Et===void 0?{}:Et,Pt=J.stylesPrev,qt=Pt===void 0?{}:Pt,At=String(R),tn=Object(D.useRef)(),en=Object(D.useRef)(),kn=Object(D.useState)(""),Gt=Object(G.a)(kn,2),An=Gt[0],Rn=Gt[1],In=Object(D.useState)("office"),Sn=Object(G.a)(In,2),Dn=Sn[0],Hn=Sn[1],ar=function(){var wt=new dt(en.current);wt.displayMode="popup",wt.addRenderEventListener(function(){var Wt=Object(M.a)(n.a.mark(function bt(Jt){var Nt;return n.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:return tn.current.style.display="none",cn.next=3,Object(xe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Jt}});case 3:Nt=cn.sent,Nt!=null&&Nt.id&&ut(en.current.getAttribute("src").replace(Q.a.API_SERVER,""),"/api/attachments/".concat(Nt==null?void 0:Nt.id,"?type=").concat(Nt.content_type));case 5:case"end":return cn.stop()}},bt)}));return function(bt){return Wt.apply(this,arguments)}}()),wt.show()},Xn=function(){var wt=new le(en.current);wt.settings.displayMode="popup",wt.addEventListener("render",function(){var Wt=Object(M.a)(n.a.mark(function bt(Jt){var Nt;return n.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:if(tn.current.style.display="none",!en.current){cn.next=6;break}return cn.next=4,Object(xe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Jt.dataUrl}});case 4:Nt=cn.sent,Nt!=null&&Nt.id&&ut(en.current.getAttribute("src").replace(Q.a.API_SERVER,""),"/api/attachments/".concat(Nt==null?void 0:Nt.id,"?type=").concat(Nt.content_type));case 6:case"end":return cn.stop()}},bt)}));return function(bt){return Wt.apply(this,arguments)}}()),wt.show(),window.markerArea=wt},xn=Object(D.useMemo)(function(){tn.current&&(tn.current.style.zIndex=-1);try{var zt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,wt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Wt=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;At=At.replace(zt,"("+Q.a.API_SERVER+"/api/attachments/").replace(wt,'"'+Q.a.API_SERVER+"/api/attachments/").replace(Wt,'"'+Q.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
`)}catch(Yn){}var bt=H(At),Jt=C();if(At.match(/\[TOC\]/)&&(bt=bt.replace("<p>[TOC]</p>",L()),S()),bt=bt.replace(/(__special_katext_id_\d+__)/g,function(Yn,cn){var Qn=Jt[cn],Kr=Qn.type,wr=Qn.expression;return Object(ne.renderToString)(ur(wr)||"",{displayMode:Kr==="block",throwOnError:!1,output:"html"})}),bt=bt.replace(/▁/g,"\u2581\u2581\u2581"),E(),Ee){var Nt=document.createElement("div");return Nt.innerHTML=bt,Nt.innerText}return setTimeout(function(){return yn()},500),bt},[At]),Bn=Object(D.useRef)();w.WebkitLineClamp=Ye,Ye&&(It=Object(U.a)(Object(U.a)({},It),w));function pn(zt){var wt=zt.target;if(wt.tagName.toUpperCase()==="IMG"){if(yt){var Wt=wt.getAttribute("src");Rn(Wt),Hn("image")}}else if(wt.tagName.toUpperCase()==="A"){var bt=wt.getAttribute("href");if(bt.indexOf("office")>-1)zt.preventDefault(),Rn(bt),Hn("office");else if(bt.indexOf("application/pdf")>-1)zt.preventDefault(),Rn(bt),Hn("pdf");else if(bt.indexOf("text/html")>-1)zt.preventDefault(),Rn(bt),Hn("html");else if(bt.startsWith("#")){zt.preventDefault();var Jt=document.getElementById(bt.replace("#",""));Jt&&Jt.scrollIntoView(!0)}}}var yn=function(){var wt,Wt=(wt=Bn.current)===null||wt===void 0?void 0:wt.querySelectorAll("video");Wt==null||Wt.forEach(function(bt){if(bt.oncontextmenu=function(){return!1},bt.src.indexOf(".m3u8")>-1&&!bt.canPlayType("application/vnd.apple.mpegurl")){if(z.a.isSupported()){var Jt=new z.a;Jt.loadSource(bt.src),Jt.attachMedia(bt)}}})};Object(D.useEffect)(function(){if(Bn.current&&xn&&(xn.match(pr)&&window.PR.prettyPrint()),Bn.current)return Bn.current.addEventListener("click",pn),function(){Bn.current.removeEventListener("click",pn),E(),S()}},[xn,Bn.current,pn]);var bn=function(wt){if(!ee)return;wt.target.nodeName==="IMG"?(tn.current.style.zIndex=1,tn.current.style.display="flex",tn.current.style.width=wt.target.clientWidth+"px",tn.current.style.height=wt.target.clientHeight+"px",tn.current.style.top=wt.target.offsetTop+"px",tn.current.style.left=wt.target.offsetLeft+"px",en.current.src=wt.target.getAttribute("src")):tn.current.style.display="none"};return m.a.createElement("div",{style:{position:"relative"}},m.a.createElement("div",{ref:Bn,style:Object(U.a)({},It),className:"".concat(Y||""," markdown-body ").concat(Vn.a.mdBody),onMouseOver:bn,dangerouslySetInnerHTML:{__html:xn}}),m.a.createElement("div",{ref:tn,className:Vn.a.button},m.a.createElement(X.a,null,m.a.createElement(V.a,{onClick:function(){return ar()}},"\u88C1\u526A"),m.a.createElement(V.a,{onClick:function(){return Xn()}},"\u7F16\u8F91"))),m.a.createElement("img",{ref:en,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),m.a.createElement(se.a,{close:!0,data:An,type:An!=null&&An.length?Dn:"",style:Object(U.a)({},qt),onClose:function(){return Rn("")}}))}},"9VGf":function(je,oe,k){"use strict";k.d(oe,"a",function(){return P});var Z=k("q1tI"),X=k.n(Z);function P(V,U){var M=Object(Z.useRef)();Object(Z.useEffect)(function(){M.current=V}),Object(Z.useEffect)(function(){function G(){M.current()}if(U!==null){var W=setInterval(G,U);return function(){return clearInterval(W)}}},[U])}},AMnG:function(je,oe,k){"use strict";var Z=k("miYZ"),X=k("tsqr"),P=k("tJVT"),V=k("q1tI"),U=k.n(V),M=k("nWbc"),G=k.n(M),W=k("Ot1p");oe.a=function(n){var D=n.id,m=n.activeDiscussIndex,f=n.onReplyDiscuss,h=Object(V.useState)(""),c=Object(P.a)(h,2),o=c[0],d=c[1];function i(r){d(r)}function a(){if(!o){X.b.info("\u56DE\u590D\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A!");return}f(D,o),d("")}return U.a.createElement("div",{key:D,className:"discuss-item-editor",style:{display:m===D?"block":"none",width:"100%"}},U.a.createElement(W.a,{miniToolbar:!0,startInit:m===D,defaultValue:o,id:D,noStorage:!0,watch:!1,height:155,placeholder:"\u6211\u8981\u56DE\u590D",showResizeBar:!0,onChange:i}),U.a.createElement("a",{onClick:a,className:"btn-send"},"\u53D1\u9001"))}},BU3w:function(je,oe,k){"use strict";k.d(oe,"a",function(){return M});var Z=k("MNnm"),X="rc-util-key";function P(G){if(G.attachTo)return G.attachTo;var W=document.querySelector("head");return W||document.body}function V(G){var W,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(Z.a)())return null;var D=document.createElement("style");if((W=n.csp)===null||W===void 0?void 0:W.nonce){var m;D.nonce=(m=n.csp)===null||m===void 0?void 0:m.nonce}D.innerHTML=G;var f=P(n),h=f.firstChild;return n.prepend&&f.prepend?f.prepend(D):n.prepend&&h?f.insertBefore(D,h):f.appendChild(D),D}var U=new Map;function M(G,W){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},D=P(n);if(!U.has(D)){var m=V("",n),f=m.parentNode;U.set(D,f),f.removeChild(m)}var h=Array.from(U.get(D).children).find(function(a){return a.tagName==="STYLE"&&a[X]===W});if(h){var c,o;if(((c=n.csp)===null||c===void 0?void 0:c.nonce)&&h.nonce!==((o=n.csp)===null||o===void 0?void 0:o.nonce)){var d;h.nonce=(d=n.csp)===null||d===void 0?void 0:d.nonce}return h.innerHTML!==G&&(h.innerHTML=G),h}var i=V(G,n);return i[X]=W,i}},Bd2K:function(je,oe,k){(function(Z){Z(k("VrN/"),k("osHv"))})(function(Z){Z.defineOption("autoCloseTags",!1,function(n,D,m){if(m!=Z.Init&&m&&n.removeKeyMap("autoCloseTags"),!D)return;var f={name:"autoCloseTags"};(typeof D!="object"||D.whenClosing!==!1)&&(f["'/'"]=function(h){return M(h)}),(typeof D!="object"||D.whenOpening!==!1)&&(f["'>'"]=function(h){return V(h)}),n.addKeyMap(f)});var X=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],P=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function V(n){if(n.getOption("disableInput"))return Z.Pass;for(var D=n.listSelections(),m=[],f=n.getOption("autoCloseTags"),h=0;h<D.length;h++){if(!D[h].empty())return Z.Pass;var c=D[h].head,o=n.getTokenAt(c),d=Z.innerMode(n.getMode(),o.state),i=d.state,a=d.mode.xmlCurrentTag&&d.mode.xmlCurrentTag(i),r=a&&a.name;if(!r)return Z.Pass;var s=d.mode.configuration=="html",S=typeof f=="object"&&f.dontCloseTags||s&&X,w=typeof f=="object"&&f.indentTags||s&&P;o.end>c.ch&&(r=r.slice(0,r.length-o.end+c.ch));var x=r.toLowerCase();if(!r||o.type=="string"&&(o.end!=c.ch||!/[\"\']/.test(o.string.charAt(o.string.length-1))||o.string.length==1)||o.type=="tag"&&a.close||o.string.indexOf("/")==c.ch-o.start-1||S&&G(S,x)>-1||W(n,d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(i)||[],r,c,!0))return Z.Pass;var L=typeof f=="object"&&f.emptyTags;if(L&&G(L,r)>-1){m[h]={text:"/>",newPos:Z.Pos(c.line,c.ch+2)};continue}var O=w&&G(w,x)>-1;m[h]={indent:O,text:">"+(O?`
|
|
|
|
`:"")+"</"+r+">",newPos:O?Z.Pos(c.line+1,0):Z.Pos(c.line,c.ch+1)}}for(var _=typeof f=="object"&&f.dontIndentOnAutoClose,h=D.length-1;h>=0;h--){var b=m[h];n.replaceRange(b.text,D[h].head,D[h].anchor,"+insert");var g=n.listSelections().slice(0);g[h]={head:b.newPos,anchor:b.newPos},n.setSelections(g),!_&&b.indent&&(n.indentLine(b.newPos.line,null,!0),n.indentLine(b.newPos.line+1,null,!0))}}function U(n,D){for(var m=n.listSelections(),f=[],h=D?"/":"</",c=n.getOption("autoCloseTags"),o=typeof c=="object"&&c.dontIndentOnSlash,d=0;d<m.length;d++){if(!m[d].empty())return Z.Pass;var i=m[d].head,a=n.getTokenAt(i),r=Z.innerMode(n.getMode(),a.state),s=r.state;if(D&&(a.type=="string"||a.string.charAt(0)!="<"||a.start!=i.ch-1))return Z.Pass;var S,w=r.mode.name!="xml"&&n.getMode().name=="htmlmixed";if(w&&r.mode.name=="javascript")S=h+"script";else if(w&&r.mode.name=="css")S=h+"style";else{var x=r.mode.xmlCurrentContext&&r.mode.xmlCurrentContext(s);if(!x||x.length&&W(n,x,x[x.length-1],i))return Z.Pass;S=h+x[x.length-1]}n.getLine(i.line).charAt(a.end)!=">"&&(S+=">"),f[d]=S}if(n.replaceSelections(f),m=n.listSelections(),!o)for(var d=0;d<m.length;d++)(d==m.length-1||m[d].head.line<m[d+1].head.line)&&n.indentLine(m[d].head.line)}function M(n){return n.getOption("disableInput")?Z.Pass:U(n,!0)}Z.commands.closeTag=function(n){return U(n)};function G(n,D){if(n.indexOf)return n.indexOf(D);for(var m=0,f=n.length;m<f;++m)if(n[m]==D)return m;return-1}function W(n,D,m,f,h){if(!Z.scanForClosingTag)return!1;var c=Math.min(n.lastLine()+1,f.line+500),o=Z.scanForClosingTag(n,f,null,c);if(!o||o.tag!=m)return!1;for(var d=h?1:0,i=D.length-1;i>=0&&D[i]==m;i--)++d;f=o.to;for(var i=1;i<d;i++){var a=Z.scanForClosingTag(n,f,null,c);if(!a||a.tag!=m)return!1;f=a.to}return!0}})},BdwD:function(je,oe,k){"use strict";var Z=k("+L6B"),X=k("2/Rp"),P=k("0Owb"),V=k("k1fw"),U=k("q1tI"),M=k.n(U),G=k("FOrL"),W=k.n(G),n=function(m){var f=m.buttonProps,h=f===void 0?{}:f,c=m.styles,o=c===void 0?{}:c,d=m.customText,i=m.ButtonText,a=m.ButtonClick,r=m.Buttonclass,s=m.ButtonTwo;return M.a.createElement("section",{className:"tc animated fadeIn",style:Object(V.a)(Object(V.a)({},{color:"#999",margin:"200px auto"}),o)},M.a.createElement("img",{src:W.a}),M.a.createElement("p",{className:"mt20 font14"},d||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),i&&M.a.createElement(X.a,Object(P.a)({className:r,onClick:a},h),i),s&&s)};oe.a=n},BjJ7:function(je,oe,k){"use strict";k.d(oe,"d",function(){return X}),k.d(oe,"c",function(){return P}),k.d(oe,"e",function(){return V}),k.d(oe,"b",function(){return U}),k.d(oe,"a",function(){return G});var Z=k("m3rI");function X(W){var n=!0;if(W.length>0){for(var D=0;D<W.length;D++)if(W[D].compile_success==0||!W[D].compile_success){n=!1;break}}else n=!1;return n}function P(W){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",D=[],m=0;m<W.length;m++){var f=W[m],h=n?"".concat(n,"/").concat(f.name):"".concat(f.name);D.push({title:f.name,isLeaf:!(f.type==="tree"),key:h})}return D}function V(W,n,D){for(var m=0;m<W.length;m++){var f=W[m];if(f.key===n){f.children=D;break}f.children&&V(f.children,n,D)}return W}function U(W,n,D){var m;return function(){var f=this,h=arguments,c=function(){m=null,D||W.apply(f,h)},o=D&&!m;clearTimeout(m),m=setTimeout(c,n),o&&W.apply(f,h)}}var M=!0,G=Z.a.API_SERVER},"C+DQ":function(je,oe,k){},"C/vA":function(je,oe,k){"use strict";k.d(oe,"a",function(){return Z});function Z(X){const P=this;let V=!1,U;return function(){return V||(V=!0,U=X.apply(P,arguments)),U}}},"Cg/j":function(je,oe,k){"use strict";k.d(oe,"b",function(){return Z}),k.d(oe,"a",function(){return X}),k.d(oe,"c",function(){return V}),k.d(oe,"d",function(){return U});var Z;(function(M){M.serviceIds=new Map,M.DI_TARGET="$di$target",M.DI_DEPENDENCIES="$di$dependencies";function G(W){return W[M.DI_DEPENDENCIES]||[]}M.getServiceDependencies=G})(Z||(Z={}));const X=V("instantiationService");function P(M,G,W,n){G[Z.DI_TARGET]===G?G[Z.DI_DEPENDENCIES].push({id:M,index:W,optional:n}):(G[Z.DI_DEPENDENCIES]=[{id:M,index:W,optional:n}],G[Z.DI_TARGET]=G)}function V(M){if(Z.serviceIds.has(M))return Z.serviceIds.get(M);const G=function(W,n,D){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");P(G,W,D,!1)};return G.toString=()=>M,Z.serviceIds.set(M,G),G}function U(M){return function(G,W,n){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");P(M,G,n,!0)}}},CrYA:function(je,oe,k){var Z=k("MFOe"),X=Z.Global;je.exports={name:"sessionStorage",read:V,write:U,each:M,remove:G,clearAll:W};function P(){return X.sessionStorage}function V(n){return P().getItem(n)}function U(n,D){return P().setItem(n,D)}function M(n){for(var D=P().length-1;D>=0;D--){var m=P().key(D);n(V(m),m)}}function G(n){return P().removeItem(n)}function W(){return P().clear()}},DlQD:function(je,oe,k){(function(Z,X){je.exports=X()})(this,function(){"use strict";function Z(be,fe){for(var pe=0;pe<fe.length;pe++){var ie=fe[pe];ie.enumerable=ie.enumerable||!1,ie.configurable=!0,"value"in ie&&(ie.writable=!0),Object.defineProperty(be,ie.key,ie)}}function X(be,fe,pe){return fe&&Z(be.prototype,fe),pe&&Z(be,pe),be}function P(be,fe){if(!be)return;if(typeof be=="string")return V(be,fe);var pe=Object.prototype.toString.call(be).slice(8,-1);if(pe==="Object"&&be.constructor&&(pe=be.constructor.name),pe==="Map"||pe==="Set")return Array.from(be);if(pe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(pe))return V(be,fe)}function V(be,fe){(fe==null||fe>be.length)&&(fe=be.length);for(var pe=0,ie=new Array(fe);pe<fe;pe++)ie[pe]=be[pe];return ie}function U(be,fe){var pe;if(typeof Symbol=="undefined"||be[Symbol.iterator]==null){if(Array.isArray(be)||(pe=P(be))||fe&&be&&typeof be.length=="number"){pe&&(be=pe);var ie=0;return function(){return ie>=be.length?{done:!0}:{done:!1,value:be[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 pe=be[Symbol.iterator](),pe.next.bind(pe)}function M(be,fe){return fe={exports:{}},be(fe,fe.exports),fe.exports}var G=M(function(be){function fe(){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 pe(ie){be.exports.defaults=ie}be.exports={defaults:fe(),getDefaults:fe,changeDefaults:pe}}),W=G.defaults,n=G.getDefaults,D=G.changeDefaults,m=/[&<>"']/,f=/[&<>"']/g,h=/[<>"']|&(?!#?\w+;)/,c=/[<>"']|&(?!#?\w+;)/g,o={"&":"&","<":"<",">":">",'"':""","'":"'"},d=function(fe){return o[fe]};function i(be,fe){if(fe){if(m.test(be))return be.replace(f,d)}else if(h.test(be))return be.replace(c,d);return be}var a=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function r(be){return be.replace(a,function(fe,pe){return pe=pe.toLowerCase(),pe==="colon"?":":pe.charAt(0)==="#"?pe.charAt(1)==="x"?String.fromCharCode(parseInt(pe.substring(2),16)):String.fromCharCode(+pe.substring(1)):""})}var s=/(^|[^\[])\^/g;function S(be,fe){be=be.source||be,fe=fe||"";var pe={replace:function(ae,ce){return ce=ce.source||ce,ce=ce.replace(s,"$1"),be=be.replace(ae,ce),pe},getRegex:function(){return new RegExp(be,fe)}};return pe}var w=/[^\w:]/g,x=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function L(be,fe,pe){if(be){var ie;try{ie=decodeURIComponent(r(pe)).replace(w,"").toLowerCase()}catch(ae){return null}if(ie.indexOf("javascript:")===0||ie.indexOf("vbscript:")===0||ie.indexOf("data:")===0)return null}fe&&!x.test(pe)&&(pe=p(fe,pe));try{pe=encodeURI(pe).replace(/%25/g,"%")}catch(ae){return null}return pe}var O={},_=/^[^:]+:\/*[^/]*$/,b=/^([^:]+:)[\s\S]*$/,g=/^([^:]+:\/*[^/]*)[\s\S]*$/;function p(be,fe){O[" "+be]||(_.test(be)?O[" "+be]=be+"/":O[" "+be]=N(be,"/",!0)),be=O[" "+be];var pe=be.indexOf(":")===-1;return fe.substring(0,2)==="//"?pe?fe:be.replace(b,"$1")+fe:fe.charAt(0)==="/"?pe?fe:be.replace(g,"$1")+fe:be+fe}var C={exec:function(){}};function E(be){for(var fe=1,pe,ie;fe<arguments.length;fe++){pe=arguments[fe];for(ie in pe)Object.prototype.hasOwnProperty.call(pe,ie)&&(be[ie]=pe[ie])}return be}function v(be,fe){var pe=be.replace(/\|/g,function(ce,me,Te){for(var ke=!1,$e=me;--$e>=0&&Te[$e]==="\\";)ke=!ke;return ke?"|":" |"}),ie=pe.split(/ \|/),ae=0;if(ie.length>fe)ie.splice(fe);else for(;ie.length<fe;)ie.push("");for(;ae<ie.length;ae++)ie[ae]=ie[ae].trim().replace(/\\\|/g,"|");return ie}function N(be,fe,pe){var ie=be.length;if(ie===0)return"";for(var ae=0;ae<ie;){var ce=be.charAt(ie-ae-1);if(ce===fe&&!pe)ae++;else if(ce!==fe&&pe)ae++;else break}return be.substr(0,ie-ae)}function F(be,fe){if(be.indexOf(fe[1])===-1)return-1;for(var pe=be.length,ie=0,ae=0;ae<pe;ae++)if(be[ae]==="\\")ae++;else if(be[ae]===fe[0])ie++;else if(be[ae]===fe[1]&&(ie--,ie<0))return ae;return-1}function A(be){be&&be.sanitize&&!be.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:S,cleanUrl:L,resolveUrl:p,noopTest:C,merge:E,splitCells:v,rtrim:N,findClosingBracket:F,checkSanitizeDeprecation:A},j=G.defaults,T=H.rtrim,z=H.splitCells,Q=H.escape,ne=H.findClosingBracket;function se(be,fe,pe){var ie=fe.href,ae=fe.title?Q(fe.title):null,ce=be[1].replace(/\\([\[\]])/g,"$1");return be[0].charAt(0)!=="!"?{type:"link",raw:pe,href:ie,title:ae,text:ce}:{type:"image",raw:pe,href:ie,title:ae,text:Q(ce)}}function xe(be,fe){var pe=be.match(/^(\s+)(?:```)/);if(pe===null)return fe;var ie=pe[1];return fe.split(`
|
|
`).map(function(ae){var ce=ae.match(/^\s+/);if(ce===null)return ae;var me=ce[0];return me.length>=ie.length?ae.slice(ie.length):ae}).join(`
|
|
`)}var ge=function(){function be(pe){this.options=pe||j}var fe=be.prototype;return fe.space=function(ie){var ae=this.rules.block.newline.exec(ie);if(ae)return ae[0].length>1?{type:"space",raw:ae[0]}:{raw:`
|
|
`}},fe.code=function(ie,ae){var ce=this.rules.block.code.exec(ie);if(ce){var me=ae[ae.length-1];if(me&&me.type==="paragraph")return{raw:ce[0],text:ce[0].trimRight()};var Te=ce[0].replace(/^ {4}/gm,"");return{type:"code",raw:ce[0],codeBlockStyle:"indented",text:this.options.pedantic?Te:T(Te,`
|
|
`)}}},fe.fences=function(ie){var ae=this.rules.block.fences.exec(ie);if(ae){var ce=ae[0],me=xe(ce,ae[3]||"");return{type:"code",raw:ce,lang:ae[2]?ae[2].trim():ae[2],text:me}}},fe.heading=function(ie){var ae=this.rules.block.heading.exec(ie);if(ae)return{type:"heading",raw:ae[0],depth:ae[1].length,text:ae[2]}},fe.nptable=function(ie){var ae=this.rules.block.nptable.exec(ie);if(ae){var ce={type:"table",header:z(ae[1].replace(/^ *| *\| *$/g,"")),align:ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ae[3]?ae[3].replace(/\n$/,"").split(`
|
|
`):[],raw:ae[0]};if(ce.header.length===ce.align.length){var me=ce.align.length,Te;for(Te=0;Te<me;Te++)/^ *-+: *$/.test(ce.align[Te])?ce.align[Te]="right":/^ *:-+: *$/.test(ce.align[Te])?ce.align[Te]="center":/^ *:-+ *$/.test(ce.align[Te])?ce.align[Te]="left":ce.align[Te]=null;for(me=ce.cells.length,Te=0;Te<me;Te++)ce.cells[Te]=z(ce.cells[Te],ce.header.length);return ce}}},fe.hr=function(ie){var ae=this.rules.block.hr.exec(ie);if(ae)return{type:"hr",raw:ae[0]}},fe.blockquote=function(ie){var ae=this.rules.block.blockquote.exec(ie);if(ae){var ce=ae[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ae[0],text:ce}}},fe.list=function(ie){var ae=this.rules.block.list.exec(ie);if(ae){for(var ce=ae[0],me=ae[2],Te=me.length>1,ke=me[me.length-1]===")",$e={type:"list",raw:ce,ordered:Te,start:Te?+me.slice(0,-1):"",loose:!1,items:[]},pt=ae[0].match(this.rules.block.item),Ot=!1,vt,st,Ke,Ge,Ue,le,_e,Xe=pt.length,Be=0;Be<Xe;Be++)vt=pt[Be],ce=vt,st=vt.length,vt=vt.replace(/^ *([*+-]|\d+[.)]) */,""),~vt.indexOf(`
|
|
`)&&(st-=vt.length,vt=this.options.pedantic?vt.replace(/^ {1,4}/gm,""):vt.replace(new RegExp("^ {1,"+st+"}","gm"),"")),Be!==Xe-1&&(Ke=this.rules.block.bullet.exec(pt[Be+1])[0],(Te?Ke.length===1||!ke&&Ke[Ke.length-1]===")":Ke.length>1||this.options.smartLists&&Ke!==me)&&(Ge=pt.slice(Be+1).join(`
|
|
`),$e.raw=$e.raw.substring(0,$e.raw.length-Ge.length),Be=Xe-1)),Ue=Ot||/\n\n(?!\s*$)/.test(vt),Be!==Xe-1&&(Ot=vt.charAt(vt.length-1)===`
|
|
`,Ue||(Ue=Ot)),Ue&&($e.loose=!0),le=/^\[[ xX]\] /.test(vt),_e=void 0,le&&(_e=vt[1]!==" ",vt=vt.replace(/^\[[ xX]\] +/,"")),$e.items.push({type:"list_item",raw:ce,task:le,checked:_e,loose:Ue,text:vt});return $e}},fe.html=function(ie){var ae=this.rules.block.html.exec(ie);if(ae)return{type:this.options.sanitize?"paragraph":"html",raw:ae[0],pre:!this.options.sanitizer&&(ae[1]==="pre"||ae[1]==="script"||ae[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ae[0]):Q(ae[0]):ae[0]}},fe.def=function(ie){var ae=this.rules.block.def.exec(ie);if(ae){ae[3]&&(ae[3]=ae[3].substring(1,ae[3].length-1));var ce=ae[1].toLowerCase().replace(/\s+/g," ");return{tag:ce,raw:ae[0],href:ae[2],title:ae[3]}}},fe.table=function(ie){var ae=this.rules.block.table.exec(ie);if(ae){var ce={type:"table",header:z(ae[1].replace(/^ *| *\| *$/g,"")),align:ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ae[3]?ae[3].replace(/\n$/,"").split(`
|
|
`):[]};if(ce.header.length===ce.align.length){ce.raw=ae[0];var me=ce.align.length,Te;for(Te=0;Te<me;Te++)/^ *-+: *$/.test(ce.align[Te])?ce.align[Te]="right":/^ *:-+: *$/.test(ce.align[Te])?ce.align[Te]="center":/^ *:-+ *$/.test(ce.align[Te])?ce.align[Te]="left":ce.align[Te]=null;for(me=ce.cells.length,Te=0;Te<me;Te++)ce.cells[Te]=z(ce.cells[Te].replace(/^ *\| *| *\| *$/g,""),ce.header.length);return ce}}},fe.lheading=function(ie){var ae=this.rules.block.lheading.exec(ie);if(ae)return{type:"heading",raw:ae[0],depth:ae[2].charAt(0)==="="?1:2,text:ae[1]}},fe.paragraph=function(ie){var ae=this.rules.block.paragraph.exec(ie);if(ae)return{type:"paragraph",raw:ae[0],text:ae[1].charAt(ae[1].length-1)===`
|
|
`?ae[1].slice(0,-1):ae[1]}},fe.text=function(ie,ae){var ce=this.rules.block.text.exec(ie);if(ce){var me=ae[ae.length-1];return me&&me.type==="text"?{raw:ce[0],text:ce[0]}:{type:"text",raw:ce[0],text:ce[0]}}},fe.escape=function(ie){var ae=this.rules.inline.escape.exec(ie);if(ae)return{type:"escape",raw:ae[0],text:Q(ae[1])}},fe.tag=function(ie,ae,ce){var me=this.rules.inline.tag.exec(ie);if(me)return!ae&&/^<a /i.test(me[0])?ae=!0:ae&&/^<\/a>/i.test(me[0])&&(ae=!1),!ce&&/^<(pre|code|kbd|script)(\s|>)/i.test(me[0])?ce=!0:ce&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(me[0])&&(ce=!1),{type:this.options.sanitize?"text":"html",raw:me[0],inLink:ae,inRawBlock:ce,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):Q(me[0]):me[0]}},fe.link=function(ie){var ae=this.rules.inline.link.exec(ie);if(ae){var ce=ne(ae[2],"()");if(ce>-1){var me=ae[0].indexOf("!")===0?5:4,Te=me+ae[1].length+ce;ae[2]=ae[2].substring(0,ce),ae[0]=ae[0].substring(0,Te).trim(),ae[3]=""}var ke=ae[2],$e="";if(this.options.pedantic){var pt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ke);pt?(ke=pt[1],$e=pt[3]):$e=""}else $e=ae[3]?ae[3].slice(1,-1):"";ke=ke.trim().replace(/^<([\s\S]*)>$/,"$1");var Ot=se(ae,{href:ke&&ke.replace(this.rules.inline._escapes,"$1"),title:$e&&$e.replace(this.rules.inline._escapes,"$1")},ae[0]);return Ot}},fe.reflink=function(ie,ae){var ce;if((ce=this.rules.inline.reflink.exec(ie))||(ce=this.rules.inline.nolink.exec(ie))){var me=(ce[2]||ce[1]).replace(/\s+/g," ");if(me=ae[me.toLowerCase()],!me||!me.href){var Te=ce[0].charAt(0);return{type:"text",raw:Te,text:Te}}var ke=se(ce,me,ce[0]);return ke}},fe.strong=function(ie,ae,ce){ce===void 0&&(ce="");var me=this.rules.inline.strong.start.exec(ie);if(me&&(!me[1]||me[1]&&(ce===""||this.rules.inline.punctuation.exec(ce)))){ae=ae.slice(-1*ie.length);var Te=me[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Te.lastIndex=0;for(var ke;(me=Te.exec(ae))!=null;)if(ke=this.rules.inline.strong.middle.exec(ae.slice(0,me.index+3)),ke)return{type:"strong",raw:ie.slice(0,ke[0].length),text:ie.slice(2,ke[0].length-2)}}},fe.em=function(ie,ae,ce){ce===void 0&&(ce="");var me=this.rules.inline.em.start.exec(ie);if(me&&(!me[1]||me[1]&&(ce===""||this.rules.inline.punctuation.exec(ce)))){ae=ae.slice(-1*ie.length);var Te=me[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Te.lastIndex=0;for(var ke;(me=Te.exec(ae))!=null;)if(ke=this.rules.inline.em.middle.exec(ae.slice(0,me.index+2)),ke)return{type:"em",raw:ie.slice(0,ke[0].length),text:ie.slice(1,ke[0].length-1)}}},fe.codespan=function(ie){var ae=this.rules.inline.code.exec(ie);if(ae){var ce=ae[2].replace(/\n/g," "),me=/[^ ]/.test(ce),Te=ce.startsWith(" ")&&ce.endsWith(" ");return me&&Te&&(ce=ce.substring(1,ce.length-1)),ce=Q(ce,!0),{type:"codespan",raw:ae[0],text:ce}}},fe.br=function(ie){var ae=this.rules.inline.br.exec(ie);if(ae)return{type:"br",raw:ae[0]}},fe.del=function(ie){var ae=this.rules.inline.del.exec(ie);if(ae)return{type:"del",raw:ae[0],text:ae[1]}},fe.autolink=function(ie,ae){var ce=this.rules.inline.autolink.exec(ie);if(ce){var me,Te;return ce[2]==="@"?(me=Q(this.options.mangle?ae(ce[1]):ce[1]),Te="mailto:"+me):(me=Q(ce[1]),Te=me),{type:"link",raw:ce[0],text:me,href:Te,tokens:[{type:"text",raw:me,text:me}]}}},fe.url=function(ie,ae){var ce;if(ce=this.rules.inline.url.exec(ie)){var me,Te;if(ce[2]==="@")me=Q(this.options.mangle?ae(ce[0]):ce[0]),Te="mailto:"+me;else{var ke;do ke=ce[0],ce[0]=this.rules.inline._backpedal.exec(ce[0])[0];while(ke!==ce[0]);me=Q(ce[0]),ce[1]==="www."?Te="http://"+me:Te=me}return{type:"link",raw:ce[0],text:me,href:Te,tokens:[{type:"text",raw:me,text:me}]}}},fe.inlineText=function(ie,ae,ce){var me=this.rules.inline.text.exec(ie);if(me){var Te;return ae?Te=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):Q(me[0]):me[0]:Te=Q(this.options.smartypants?ce(me[0]):me[0]),{type:"text",raw:me[0],text:Te}}},be}(),ve=H.noopTest,Oe=H.edit,Re=H.merge,he={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\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:ve,table:ve,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};he._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,he._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,he.def=Oe(he.def).replace("label",he._label).replace("title",he._title).getRegex(),he.bullet=/(?:[*+-]|\d{1,9}[.)])/,he.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,he.item=Oe(he.item,"gm").replace(/bull/g,he.bullet).getRegex(),he.list=Oe(he.list).replace(/bull/g,he.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+he.def.source+")").getRegex(),he._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",he._comment=/<!--(?!-?>)[\s\S]*?-->/,he.html=Oe(he.html,"i").replace("comment",he._comment).replace("tag",he._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),he.paragraph=Oe(he._paragraph).replace("hr",he.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",he._tag).getRegex(),he.blockquote=Oe(he.blockquote).replace("paragraph",he.paragraph).getRegex(),he.normal=Re({},he),he.gfm=Re({},he.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),he.gfm.nptable=Oe(he.gfm.nptable).replace("hr",he.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",he._tag).getRegex(),he.gfm.table=Oe(he.gfm.table).replace("hr",he.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",he._tag).getRegex(),he.pedantic=Re({},he.normal,{html:Oe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",he._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:ve,paragraph:Oe(he.normal._paragraph).replace("hr",he.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",he.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ue={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ve,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:ve,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ue._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ue.punctuation=Oe(ue.punctuation).replace(/punctuation/g,ue._punctuation).getRegex(),ue._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ue._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ue.em.start=Oe(ue.em.start).replace(/punctuation/g,ue._punctuation).getRegex(),ue.em.middle=Oe(ue.em.middle).replace(/punctuation/g,ue._punctuation).replace(/overlapSkip/g,ue._overlapSkip).getRegex(),ue.em.endAst=Oe(ue.em.endAst,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.em.endUnd=Oe(ue.em.endUnd,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.start=Oe(ue.strong.start).replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.middle=Oe(ue.strong.middle).replace(/punctuation/g,ue._punctuation).replace(/blockSkip/g,ue._blockSkip).getRegex(),ue.strong.endAst=Oe(ue.strong.endAst,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.endUnd=Oe(ue.strong.endUnd,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.blockSkip=Oe(ue._blockSkip,"g").getRegex(),ue.overlapSkip=Oe(ue._overlapSkip,"g").getRegex(),ue._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ue._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ue._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])?)+(?![-_])/,ue.autolink=Oe(ue.autolink).replace("scheme",ue._scheme).replace("email",ue._email).getRegex(),ue._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ue.tag=Oe(ue.tag).replace("comment",he._comment).replace("attribute",ue._attribute).getRegex(),ue._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ue._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ue._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ue.link=Oe(ue.link).replace("label",ue._label).replace("href",ue._href).replace("title",ue._title).getRegex(),ue.reflink=Oe(ue.reflink).replace("label",ue._label).getRegex(),ue.reflinkSearch=Oe(ue.reflinkSearch,"g").replace("reflink",ue.reflink).replace("nolink",ue.nolink).getRegex(),ue.normal=Re({},ue),ue.pedantic=Re({},ue.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Oe(/^!?\[(label)\]\((.*?)\)/).replace("label",ue._label).getRegex(),reflink:Oe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ue._label).getRegex()}),ue.gfm=Re({},ue.normal,{escape:Oe(ue.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),ue.gfm.url=Oe(ue.gfm.url,"i").replace("email",ue.gfm._extended_email).getRegex(),ue.breaks=Re({},ue.gfm,{br:Oe(ue.br).replace("{2,}","*").getRegex(),text:Oe(ue.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Me={block:he,inline:ue},et=G.defaults,it=Me.block,nt=Me.inline;function at(be){return be.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 ze(be){var fe="",pe,ie,ae=be.length;for(pe=0;pe<ae;pe++)ie=be.charCodeAt(pe),Math.random()>.5&&(ie="x"+ie.toString(16)),fe+="&#"+ie+";";return fe}var Ze=function(){function be(pe){this.tokens=[],this.tokens.links=Object.create(null),this.options=pe||et,this.options.tokenizer=this.options.tokenizer||new ge,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ie={block:it.normal,inline:nt.normal};this.options.pedantic?(ie.block=it.pedantic,ie.inline=nt.pedantic):this.options.gfm&&(ie.block=it.gfm,this.options.breaks?ie.inline=nt.breaks:ie.inline=nt.gfm),this.tokenizer.rules=ie}be.lex=function(ie,ae){var ce=new be(ae);return ce.lex(ie)};var fe=be.prototype;return fe.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},fe.blockTokens=function(ie,ae,ce){ae===void 0&&(ae=[]),ce===void 0&&(ce=!0),ie=ie.replace(/^ +$/gm,"");for(var me,Te,ke,$e;ie;){if(me=this.tokenizer.space(ie)){ie=ie.substring(me.raw.length),me.type&&ae.push(me);continue}if(me=this.tokenizer.code(ie,ae)){ie=ie.substring(me.raw.length),me.type?ae.push(me):($e=ae[ae.length-1],$e.raw+=`
|
|
`+me.raw,$e.text+=`
|
|
`+me.text);continue}if(me=this.tokenizer.fences(ie)){ie=ie.substring(me.raw.length),ae.push(me);continue}if(me=this.tokenizer.heading(ie)){ie=ie.substring(me.raw.length),ae.push(me);continue}if(me=this.tokenizer.nptable(ie)){ie=ie.substring(me.raw.length),ae.push(me);continue}if(me=this.tokenizer.hr(ie)){ie=ie.substring(me.raw.length),ae.push(me);continue}if(me=this.tokenizer.blockquote(ie)){ie=ie.substring(me.raw.length),me.tokens=this.blockTokens(me.text,[],ce),ae.push(me);continue}if(me=this.tokenizer.list(ie)){for(ie=ie.substring(me.raw.length),ke=me.items.length,Te=0;Te<ke;Te++)me.items[Te].tokens=this.blockTokens(me.items[Te].text,[],!1);ae.push(me);continue}if(me=this.tokenizer.html(ie)){ie=ie.substring(me.raw.length),ae.push(me);continue}if(ce&&(me=this.tokenizer.def(ie))){ie=ie.substring(me.raw.length),this.tokens.links[me.tag]||(this.tokens.links[me.tag]={href:me.href,title:me.title});continue}if(me=this.tokenizer.table(ie)){ie=ie.substring(me.raw.length),ae.push(me);continue}if(me=this.tokenizer.lheading(ie)){ie=ie.substring(me.raw.length),ae.push(me);continue}if(ce&&(me=this.tokenizer.paragraph(ie))){ie=ie.substring(me.raw.length),ae.push(me);continue}if(me=this.tokenizer.text(ie,ae)){ie=ie.substring(me.raw.length),me.type?ae.push(me):($e=ae[ae.length-1],$e.raw+=`
|
|
`+me.raw,$e.text+=`
|
|
`+me.text);continue}if(ie){var pt="Infinite loop on byte: "+ie.charCodeAt(0);if(this.options.silent){console.error(pt);break}else throw new Error(pt)}}return ae},fe.inline=function(ie){var ae,ce,me,Te,ke,$e,pt=ie.length;for(ae=0;ae<pt;ae++){$e=ie[ae];switch($e.type){case"paragraph":case"text":case"heading":{$e.tokens=[],this.inlineTokens($e.text,$e.tokens);break}case"table":{for($e.tokens={header:[],cells:[]},Te=$e.header.length,ce=0;ce<Te;ce++)$e.tokens.header[ce]=[],this.inlineTokens($e.header[ce],$e.tokens.header[ce]);for(Te=$e.cells.length,ce=0;ce<Te;ce++)for(ke=$e.cells[ce],$e.tokens.cells[ce]=[],me=0;me<ke.length;me++)$e.tokens.cells[ce][me]=[],this.inlineTokens(ke[me],$e.tokens.cells[ce][me]);break}case"blockquote":{this.inline($e.tokens);break}case"list":{for(Te=$e.items.length,ce=0;ce<Te;ce++)this.inline($e.items[ce].tokens);break}}}return ie},fe.inlineTokens=function(ie,ae,ce,me,Te){ae===void 0&&(ae=[]),ce===void 0&&(ce=!1),me===void 0&&(me=!1),Te===void 0&&(Te="");var ke,$e=ie,pt;if(this.tokens.links){var Ot=Object.keys(this.tokens.links);if(Ot.length>0)for(;(pt=this.tokenizer.rules.inline.reflinkSearch.exec($e))!=null;)Ot.includes(pt[0].slice(pt[0].lastIndexOf("[")+1,-1))&&($e=$e.slice(0,pt.index)+"["+"a".repeat(pt[0].length-2)+"]"+$e.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(pt=this.tokenizer.rules.inline.blockSkip.exec($e))!=null;)$e=$e.slice(0,pt.index)+"["+"a".repeat(pt[0].length-2)+"]"+$e.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ie;){if(ke=this.tokenizer.escape(ie)){ie=ie.substring(ke.raw.length),ae.push(ke);continue}if(ke=this.tokenizer.tag(ie,ce,me)){ie=ie.substring(ke.raw.length),ce=ke.inLink,me=ke.inRawBlock,ae.push(ke);continue}if(ke=this.tokenizer.link(ie)){ie=ie.substring(ke.raw.length),ke.type==="link"&&(ke.tokens=this.inlineTokens(ke.text,[],!0,me)),ae.push(ke);continue}if(ke=this.tokenizer.reflink(ie,this.tokens.links)){ie=ie.substring(ke.raw.length),ke.type==="link"&&(ke.tokens=this.inlineTokens(ke.text,[],!0,me)),ae.push(ke);continue}if(ke=this.tokenizer.strong(ie,$e,Te)){ie=ie.substring(ke.raw.length),ke.tokens=this.inlineTokens(ke.text,[],ce,me),ae.push(ke);continue}if(ke=this.tokenizer.em(ie,$e,Te)){ie=ie.substring(ke.raw.length),ke.tokens=this.inlineTokens(ke.text,[],ce,me),ae.push(ke);continue}if(ke=this.tokenizer.codespan(ie)){ie=ie.substring(ke.raw.length),ae.push(ke);continue}if(ke=this.tokenizer.br(ie)){ie=ie.substring(ke.raw.length),ae.push(ke);continue}if(ke=this.tokenizer.del(ie)){ie=ie.substring(ke.raw.length),ke.tokens=this.inlineTokens(ke.text,[],ce,me),ae.push(ke);continue}if(ke=this.tokenizer.autolink(ie,ze)){ie=ie.substring(ke.raw.length),ae.push(ke);continue}if(!ce&&(ke=this.tokenizer.url(ie,ze))){ie=ie.substring(ke.raw.length),ae.push(ke);continue}if(ke=this.tokenizer.inlineText(ie,me,at)){ie=ie.substring(ke.raw.length),Te=ke.raw.slice(-1),ae.push(ke);continue}if(ie){var vt="Infinite loop on byte: "+ie.charCodeAt(0);if(this.options.silent){console.error(vt);break}else throw new Error(vt)}}return ae},X(be,null,[{key:"rules",get:function(){return{block:it,inline:nt}}}]),be}(),ot=G.defaults,de=H.cleanUrl,Se=H.escape,Le=function(){function be(pe){this.options=pe||ot}var fe=be.prototype;return fe.code=function(ie,ae,ce){var me=(ae||"").match(/\S*/)[0];if(this.options.highlight){var Te=this.options.highlight(ie,me);Te!=null&&Te!==ie&&(ce=!0,ie=Te)}return me?'<pre><code class="'+this.options.langPrefix+Se(me,!0)+'">'+(ce?ie:Se(ie,!0))+`</code></pre>
|
|
`:"<pre><code>"+(ce?ie:Se(ie,!0))+`</code></pre>
|
|
`},fe.blockquote=function(ie){return`<blockquote>
|
|
`+ie+`</blockquote>
|
|
`},fe.html=function(ie){return ie},fe.heading=function(ie,ae,ce,me){return this.options.headerIds?"<h"+ae+' id="'+this.options.headerPrefix+me.slug(ce)+'">'+ie+"</h"+ae+`>
|
|
`:"<h"+ae+">"+ie+"</h"+ae+`>
|
|
`},fe.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},fe.list=function(ie,ae,ce){var me=ae?"ol":"ul",Te=ae&&ce!==1?' start="'+ce+'"':"";return"<"+me+Te+`>
|
|
`+ie+"</"+me+`>
|
|
`},fe.listitem=function(ie){return"<li>"+ie+`</li>
|
|
`},fe.checkbox=function(ie){return"<input "+(ie?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},fe.paragraph=function(ie){return"<p>"+ie+`</p>
|
|
`},fe.table=function(ie,ae){return ae&&(ae="<tbody>"+ae+"</tbody>"),`<table>
|
|
<thead>
|
|
`+ie+`</thead>
|
|
`+ae+`</table>
|
|
`},fe.tablerow=function(ie){return`<tr>
|
|
`+ie+`</tr>
|
|
`},fe.tablecell=function(ie,ae){var ce=ae.header?"th":"td",me=ae.align?"<"+ce+' align="'+ae.align+'">':"<"+ce+">";return me+ie+"</"+ce+`>
|
|
`},fe.strong=function(ie){return"<strong>"+ie+"</strong>"},fe.em=function(ie){return"<em>"+ie+"</em>"},fe.codespan=function(ie){return"<code>"+ie+"</code>"},fe.br=function(){return this.options.xhtml?"<br/>":"<br>"},fe.del=function(ie){return"<del>"+ie+"</del>"},fe.link=function(ie,ae,ce){if(ie=de(this.options.sanitize,this.options.baseUrl,ie),ie===null)return ce;var me='<a href="'+Se(ie)+'"';return ae&&(me+=' title="'+ae+'"'),me+=">"+ce+"</a>",me},fe.image=function(ie,ae,ce){if(ie=de(this.options.sanitize,this.options.baseUrl,ie),ie===null)return ce;var me='<img src="'+ie+'" alt="'+ce+'"';return ae&&(me+=' title="'+ae+'"'),me+=this.options.xhtml?"/>":">",me},fe.text=function(ie){return ie},be}(),De=function(){function be(){}var fe=be.prototype;return fe.strong=function(ie){return ie},fe.em=function(ie){return ie},fe.codespan=function(ie){return ie},fe.del=function(ie){return ie},fe.html=function(ie){return ie},fe.text=function(ie){return ie},fe.link=function(ie,ae,ce){return""+ce},fe.image=function(ie,ae,ce){return""+ce},fe.br=function(){return""},be}(),qe=function(){function be(){this.seen={}}var fe=be.prototype;return fe.slug=function(ie){var ae=ie.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ae)){var ce=ae;do this.seen[ce]++,ae=ce+"-"+this.seen[ce];while(this.seen.hasOwnProperty(ae))}return this.seen[ae]=0,ae},be}(),lt=G.defaults,mt=H.unescape,gt=function(){function be(pe){this.options=pe||lt,this.options.renderer=this.options.renderer||new Le,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new De,this.slugger=new qe}be.parse=function(ie,ae){var ce=new be(ae);return ce.parse(ie)};var fe=be.prototype;return fe.parse=function(ie,ae){ae===void 0&&(ae=!0);var ce="",me,Te,ke,$e,pt,Ot,vt,st,Ke,Ge,Ue,le,_e,Xe,Be,ct,ft,Ie,Je=ie.length;for(me=0;me<Je;me++){Ge=ie[me];switch(Ge.type){case"space":continue;case"hr":{ce+=this.renderer.hr();continue}case"heading":{ce+=this.renderer.heading(this.parseInline(Ge.tokens),Ge.depth,mt(this.parseInline(Ge.tokens,this.textRenderer)),this.slugger);continue}case"code":{ce+=this.renderer.code(Ge.text,Ge.lang,Ge.escaped);continue}case"table":{for(st="",vt="",$e=Ge.header.length,Te=0;Te<$e;Te++)vt+=this.renderer.tablecell(this.parseInline(Ge.tokens.header[Te]),{header:!0,align:Ge.align[Te]});for(st+=this.renderer.tablerow(vt),Ke="",$e=Ge.cells.length,Te=0;Te<$e;Te++){for(Ot=Ge.tokens.cells[Te],vt="",pt=Ot.length,ke=0;ke<pt;ke++)vt+=this.renderer.tablecell(this.parseInline(Ot[ke]),{header:!1,align:Ge.align[ke]});Ke+=this.renderer.tablerow(vt)}ce+=this.renderer.table(st,Ke);continue}case"blockquote":{Ke=this.parse(Ge.tokens),ce+=this.renderer.blockquote(Ke);continue}case"list":{for(Ue=Ge.ordered,le=Ge.start,_e=Ge.loose,$e=Ge.items.length,Ke="",Te=0;Te<$e;Te++)Be=Ge.items[Te],ct=Be.checked,ft=Be.task,Xe="",Be.task&&(Ie=this.renderer.checkbox(ct),_e?Be.tokens.length>0&&Be.tokens[0].type==="text"?(Be.tokens[0].text=Ie+" "+Be.tokens[0].text,Be.tokens[0].tokens&&Be.tokens[0].tokens.length>0&&Be.tokens[0].tokens[0].type==="text"&&(Be.tokens[0].tokens[0].text=Ie+" "+Be.tokens[0].tokens[0].text)):Be.tokens.unshift({type:"text",text:Ie}):Xe+=Ie),Xe+=this.parse(Be.tokens,_e),Ke+=this.renderer.listitem(Xe,ft,ct);ce+=this.renderer.list(Ke,Ue,le);continue}case"html":{ce+=this.renderer.html(Ge.text);continue}case"paragraph":{ce+=this.renderer.paragraph(this.parseInline(Ge.tokens));continue}case"text":{for(Ke=Ge.tokens?this.parseInline(Ge.tokens):Ge.text;me+1<Je&&ie[me+1].type==="text";)Ge=ie[++me],Ke+=`
|
|
`+(Ge.tokens?this.parseInline(Ge.tokens):Ge.text);ce+=ae?this.renderer.paragraph(Ke):Ke;continue}default:{var tt='Token with "'+Ge.type+'" type was not found.';if(this.options.silent){console.error(tt);return}else throw new Error(tt)}}}return ce},fe.parseInline=function(ie,ae){ae=ae||this.renderer;var ce="",me,Te,ke=ie.length;for(me=0;me<ke;me++){Te=ie[me];switch(Te.type){case"escape":{ce+=ae.text(Te.text);break}case"html":{ce+=ae.html(Te.text);break}case"link":{ce+=ae.link(Te.href,Te.title,this.parseInline(Te.tokens,ae));break}case"image":{ce+=ae.image(Te.href,Te.title,Te.text);break}case"strong":{ce+=ae.strong(this.parseInline(Te.tokens,ae));break}case"em":{ce+=ae.em(this.parseInline(Te.tokens,ae));break}case"codespan":{ce+=ae.codespan(Te.text);break}case"br":{ce+=ae.br();break}case"del":{ce+=ae.del(this.parseInline(Te.tokens,ae));break}case"text":{ce+=ae.text(Te.text);break}default:{var $e='Token with "'+Te.type+'" type was not found.';if(this.options.silent){console.error($e);return}else throw new Error($e)}}}return ce},be}(),Ct=H.merge,xt=H.checkSanitizeDeprecation,Ae=H.escape,Ce=G.getDefaults,Ve=G.changeDefaults,Qe=G.defaults;function Pe(be,fe,pe){if(typeof be=="undefined"||be===null)throw new Error("marked(): input parameter is undefined or null");if(typeof be!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(be)+", string expected");if(typeof fe=="function"&&(pe=fe,fe=null),fe=Ct({},Pe.defaults,fe||{}),xt(fe),pe){var ie=fe.highlight,ae;try{ae=Ze.lex(be,fe)}catch(ke){return pe(ke)}var ce=function($e){var pt;if(!$e)try{pt=gt.parse(ae,fe)}catch(Ot){$e=Ot}return fe.highlight=ie,$e?pe($e):pe(null,pt)};if(!ie||ie.length<3)return ce();if(delete fe.highlight,!ae.length)return ce();var me=0;Pe.walkTokens(ae,function(ke){ke.type==="code"&&(me++,setTimeout(function(){ie(ke.text,ke.lang,function($e,pt){if($e)return ce($e);pt!=null&&pt!==ke.text&&(ke.text=pt,ke.escaped=!0),me--,me===0&&ce()})},0))}),me===0&&ce();return}try{var Te=Ze.lex(be,fe);return fe.walkTokens&&Pe.walkTokens(Te,fe.walkTokens),gt.parse(Te,fe)}catch(ke){if(ke.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,fe.silent)return"<p>An error occurred:</p><pre>"+Ae(ke.message+"",!0)+"</pre>";throw ke}}Pe.options=Pe.setOptions=function(be){return Ct(Pe.defaults,be),Ve(Pe.defaults),Pe},Pe.getDefaults=Ce,Pe.defaults=Qe,Pe.use=function(be){var fe=Ct({},be);if(be.renderer&&function(){var ie=Pe.defaults.renderer||new Le,ae=function(Te){var ke=ie[Te];ie[Te]=function(){for(var $e=arguments.length,pt=new Array($e),Ot=0;Ot<$e;Ot++)pt[Ot]=arguments[Ot];var vt=be.renderer[Te].apply(ie,pt);return vt===!1&&(vt=ke.apply(ie,pt)),vt}};for(var ce in be.renderer)ae(ce);fe.renderer=ie}(),be.tokenizer&&function(){var ie=Pe.defaults.tokenizer||new ge,ae=function(Te){var ke=ie[Te];ie[Te]=function(){for(var $e=arguments.length,pt=new Array($e),Ot=0;Ot<$e;Ot++)pt[Ot]=arguments[Ot];var vt=be.tokenizer[Te].apply(ie,pt);return vt===!1&&(vt=ke.apply(ie,pt)),vt}};for(var ce in be.tokenizer)ae(ce);fe.tokenizer=ie}(),be.walkTokens){var pe=Pe.defaults.walkTokens;fe.walkTokens=function(ie){be.walkTokens(ie),pe&&pe(ie)}}Pe.setOptions(fe)},Pe.walkTokens=function(be,fe){for(var pe=U(be),ie;!(ie=pe()).done;){var ae=ie.value;fe(ae);switch(ae.type){case"table":{for(var ce=U(ae.tokens.header),me;!(me=ce()).done;){var Te=me.value;Pe.walkTokens(Te,fe)}for(var ke=U(ae.tokens.cells),$e;!($e=ke()).done;)for(var pt=$e.value,Ot=U(pt),vt;!(vt=Ot()).done;){var st=vt.value;Pe.walkTokens(st,fe)}break}case"list":{Pe.walkTokens(ae.items,fe);break}default:ae.tokens&&Pe.walkTokens(ae.tokens,fe)}}},Pe.Parser=gt,Pe.parser=gt.parse,Pe.Renderer=Le,Pe.TextRenderer=De,Pe.Lexer=Ze,Pe.lexer=Ze.lex,Pe.Tokenizer=ge,Pe.Slugger=qe,Pe.parse=Pe;var Fe=Pe;return Fe})},"DlR+":function(je,oe,k){var Z=k("MFOe"),X=Z.Global,P=Z.trim;je.exports={name:"cookieStorage",read:U,write:G,each:M,remove:W,clearAll:n};var V=X.document;function U(m){if(!m||!D(m))return null;var f="(?:^|.*;\\s*)"+escape(m).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(V.cookie.replace(new RegExp(f),"$1"))}function M(m){for(var f=V.cookie.split(/; ?/g),h=f.length-1;h>=0;h--){if(!P(f[h]))continue;var c=f[h].split("="),o=unescape(c[0]),d=unescape(c[1]);m(d,o)}}function G(m,f){if(!m)return;V.cookie=escape(m)+"="+escape(f)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function W(m){if(!m||!D(m))return;V.cookie=escape(m)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function n(){M(function(m,f){W(f)})}function D(m){return new RegExp("(?:^|;\\s*)"+escape(m).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(V.cookie)}},EHPI:function(je,oe,k){"use strict";var Z=k("bbsP"),X=k("/wGt"),P=k("tJVT"),V=k("k1fw"),U=k("q1tI"),M=k.n(U),G=k("ZW9T"),W=k("ZD9Y"),n=k("M8RZ"),D=k("bCnd"),m=k("fcyK"),f=k.n(m),h={theme:Object(D.a)("cmCodeMode","vs-dark"),fontSize:Object(D.a)("cmFontSize",14),showEditorSetting:!1,tabToSpace:Object(D.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 o(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}}oe.a=function(i){var a=i.isLoading,r=i.value,s=i.onChange,S=i.language,w=i.ActionBarRender,x=w===void 0?function(H){return M.a.createElement(d,{onShowCodeSetting:H})}:w,L=Object(U.useReducer)(o,h),O=Object(P.a)(L,2),_=O[0],b=O[1],g=_.theme,p=_.fontSize,C=_.showEditorSetting,E=_.tabToSpace,v={onFontSizeChange:function(j){b({type:c.set_font_size,payload:j}),Object(D.b)("cmFontSize",j)},tabToSpace:E,cmFontSize:p,className:"oj",cmCodeMode:g,onTabToSpace:function(j){b({type:c.on_tab_to_space,payload:j}),Object(D.b)("cmTabToSpace",j)},onCodeModeChange:function(j){b({type:c.set_theme,payload:j}),Object(D.b)("cmCodeMode",j)}};function N(){b({type:c.set_show_editor_setting,payload:!1})}function F(){b({type:c.set_show_editor_setting,payload:!0})}var A={value:r,language:S,onChange:s,theme:g,height:"calc(100% - 56px)",options:{fontSize:p,insertSpaces:E}};return M.a.createElement(U.Fragment,null,M.a.createElement("div",{className:"code-panel-container"},x(F),!a&&M.a.createElement(G.b,A)),M.a.createElement(n.a,null,M.a.createElement(X.a,{className:"oj",title:null,placement:"right",closable:!1,visible:C,onClose:N},M.a.createElement(W.a,v))))};function d(i){var a=i.onShowCodeSetting;return M.a.createElement("div",{className:"action-bar"},M.a.createElement("span",null,"\u5B66\u5458\u521D\u59CB\u4EE3\u7801\u6587\u4EF6"),M.a.createElement("a",{onClick:a},M.a.createElement("i",{className:"iconfont icon-shezhi"})))}},ELLl:function(je,oe,k){(function(Z){Z(k("VrN/"))})(function(Z){var X={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},P=Z.Pos;Z.defineOption("autoCloseBrackets",!1,function(o,d,i){i&&i!=Z.Init&&(o.removeKeyMap(U),o.state.closeBrackets=null),d&&(M(V(d,"pairs")),o.state.closeBrackets=d,o.addKeyMap(U))});function V(o,d){return d=="pairs"&&typeof o=="string"?o:typeof o=="object"&&o[d]!=null?o[d]:X[d]}var U={Backspace:n,Enter:D};function M(o){for(var d=0;d<o.length;d++){var i=o.charAt(d),a="'"+i+"'";U[a]||(U[a]=G(i))}}M(X.pairs+"`");function G(o){return function(d){return f(d,o)}}function W(o){var d=o.state.closeBrackets;if(!d||d.override)return d;var i=o.getModeAt(o.getCursor());return i.closeBrackets||d}function n(o){var d=W(o);if(!d||o.getOption("disableInput"))return Z.Pass;for(var i=V(d,"pairs"),a=o.listSelections(),r=0;r<a.length;r++){if(!a[r].empty())return Z.Pass;var s=h(o,a[r].head);if(!s||i.indexOf(s)%2!=0)return Z.Pass}for(var r=a.length-1;r>=0;r--){var S=a[r].head;o.replaceRange("",P(S.line,S.ch-1),P(S.line,S.ch+1),"+delete")}}function D(o){var d=W(o),i=d&&V(d,"explode");if(!i||o.getOption("disableInput"))return Z.Pass;for(var a=o.listSelections(),r=0;r<a.length;r++){if(!a[r].empty())return Z.Pass;var s=h(o,a[r].head);if(!s||i.indexOf(s)%2!=0)return Z.Pass}o.operation(function(){var S=o.lineSeparator()||`
|
|
`;o.replaceSelection(S+S,null),o.execCommand("goCharLeft"),a=o.listSelections();for(var w=0;w<a.length;w++){var x=a[w].head.line;o.indentLine(x,null,!0),o.indentLine(x+1,null,!0)}})}function m(o){var d=Z.cmpPos(o.anchor,o.head)>0;return{anchor:new P(o.anchor.line,o.anchor.ch+(d?-1:1)),head:new P(o.head.line,o.head.ch+(d?1:-1))}}function f(o,d){var i=W(o);if(!i||o.getOption("disableInput"))return Z.Pass;var a=V(i,"pairs"),r=a.indexOf(d);if(r==-1)return Z.Pass;for(var s=V(i,"closeBefore"),S=V(i,"triples"),w=a.charAt(r+1)==d,x=o.listSelections(),L=r%2==0,O,_=0;_<x.length;_++){var b=x[_],g=b.head,p,C=o.getRange(g,P(g.line,g.ch+1));if(L&&!b.empty())p="surround";else if((w||!L)&&C==d)w&&c(o,g)?p="both":S.indexOf(d)>=0&&o.getRange(g,P(g.line,g.ch+3))==d+d+d?p="skipThree":p="skip";else if(w&&g.ch>1&&S.indexOf(d)>=0&&o.getRange(P(g.line,g.ch-2),g)==d+d){if(g.ch>2&&/\bstring/.test(o.getTokenTypeAt(P(g.line,g.ch-2))))return Z.Pass;p="addFour"}else if(w){var E=g.ch==0?" ":o.getRange(P(g.line,g.ch-1),g);if(!Z.isWordChar(C)&&E!=d&&!Z.isWordChar(E))p="both";else return Z.Pass}else if(L&&(C.length===0||/\s/.test(C)||s.indexOf(C)>-1))p="both";else return Z.Pass;if(!O)O=p;else if(O!=p)return Z.Pass}var v=r%2?a.charAt(r-1):d,N=r%2?d:a.charAt(r+1);o.operation(function(){if(O=="skip")o.execCommand("goCharRight");else if(O=="skipThree")for(var F=0;F<3;F++)o.execCommand("goCharRight");else if(O=="surround"){for(var A=o.getSelections(),F=0;F<A.length;F++)A[F]=v+A[F]+N;o.replaceSelections(A,"around"),A=o.listSelections().slice();for(var F=0;F<A.length;F++)A[F]=m(A[F]);o.setSelections(A)}else O=="both"?(o.replaceSelection(v+N,null),o.triggerElectric(v+N),o.execCommand("goCharLeft")):O=="addFour"&&(o.replaceSelection(v+v+v+v,"before"),o.execCommand("goCharRight"))})}function h(o,d){var i=o.getRange(P(d.line,d.ch-1),P(d.line,d.ch+1));return i.length==2?i:null}function c(o,d){var i=o.getTokenAt(P(d.line,d.ch+1));return/\bstring/.test(i.type)&&i.start==d.ch&&(d.ch==0||!/\bstring/.test(o.getTokenTypeAt(d)))}})},FOrL:function(je,oe,k){je.exports=k.p+"static/nodata.a6b3f948.png"},FWmy:function(je,oe,k){"use strict";k.d(oe,"a",function(){return Z});function Z(X,P){if(!X)throw new Error(P?`Assertion failed (${P})`:"Assertion Failed")}},Gytx:function(je,oe){je.exports=function(Z,X,P,V){var U=P?P.call(V,Z,X):void 0;if(U!==void 0)return!!U;if(Z===X)return!0;if(typeof Z!="object"||!Z||typeof X!="object"||!X)return!1;var M=Object.keys(Z),G=Object.keys(X);if(M.length!==G.length)return!1;for(var W=Object.prototype.hasOwnProperty.bind(X),n=0;n<M.length;n++){var D=M[n];if(!W(D))return!1;var m=Z[D],f=X[D];if(U=P?P.call(V,m,f,D):void 0,U===!1||U===void 0&&m!==f)return!1}return!0}},H2Ag:function(je,oe,k){je.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(je,oe,k){},I8Z2:function(je,oe,k){"use strict";k.d(oe,"a",function(){return V}),k.d(oe,"b",function(){return h}),k.d(oe,"c",function(){return o});var Z=k("q1tI"),X=function(){var d=function(i,a){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var S in s)s.hasOwnProperty(S)&&(r[S]=s[S])},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)}}(),P=Z.createContext(null),V=function(d){X(i,d);function i(){return d!==null&&d.apply(this,arguments)||this}return i.prototype.render=function(){return Z.createElement(P.Provider,{value:this.props.store},this.props.children)},i}(Z.Component),U=k("Gytx"),M=k.n(U),G=k("2mql"),W=k.n(G),n=function(){var d=function(i,a){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var S in s)s.hasOwnProperty(S)&&(r[S]=s[S])},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=function(){return D=Object.assign||function(d){for(var i,a=1,r=arguments.length;a<r;a++){i=arguments[a];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(d[s]=i[s])}return d},D.apply(this,arguments)};function m(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(S){var w=function(L){n(O,L);function O(_,b){var g=L.call(this,_,b)||this;return g.unsubscribe=null,g.handleChange=function(){if(!g.unsubscribe)return;var p=r(g.store.getState(),g.props);g.setState({subscribed:p})},g.store=g.context,g.state={subscribed:r(g.store.getState(),_),store:g.store,props:_},g}return O.getDerivedStateFromProps=function(_,b){return d&&d.length===2&&_!==b.props?{subscribed:r(b.store.getState(),_),props:_}:{props:_}},O.prototype.componentDidMount=function(){this.trySubscribe()},O.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},O.prototype.shouldComponentUpdate=function(_,b){return!M()(this.props,_)||!M()(this.state.subscribed,b.subscribed)},O.prototype.trySubscribe=function(){a&&(this.unsubscribe=this.store.subscribe(this.handleChange),this.handleChange())},O.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},O.prototype.render=function(){var _=D(D(D({},this.props),this.state.subscribed),{store:this.store});return Z.createElement(S,D({},_,{ref:this.props.miniStoreForwardedRef}))},O.displayName="Connect("+m(S)+")",O.contextType=P,O}(Z.Component);if(i.forwardRef){var x=Z.forwardRef(function(L,O){return Z.createElement(w,D({},L,{miniStoreForwardedRef:O}))});return W()(x,S)}return W()(w,S)}}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 s in i)Object.prototype.hasOwnProperty.call(i,s)&&(d[s]=i[s])}return d},c.apply(this,arguments)};function o(d){var i=d,a=[];function r(w){i=c(c({},i),w);for(var x=0;x<a.length;x++)a[x]()}function s(){return i}function S(w){return a.push(w),function(){var L=a.indexOf(w);a.splice(L,1)}}return{setState:r,getState:s,subscribe:S}}},IBYe:function(je,oe,k){"use strict";function Z(X){return null}oe.a=Z},IxHN:function(je,oe,k){"use strict";var Z=k("q1tI"),X=k.n(Z),P=k("07cG"),V=k.n(P);oe.a=function(U){var M=U.message,G=U.className,W=U.children,n=U.style,D=n===void 0?{}:n;return X.a.createElement("div",{className:"".concat(V.a.idsRingWrapper," ").concat(G)},X.a.createElement("div",{className:V.a.ldsRing},X.a.createElement("div",null),X.a.createElement("div",null),X.a.createElement("div",null),X.a.createElement("div",null)),M?X.a.createElement("p",{style:D},M):null,W)}},J66h:function(je,oe,k){(function(Z){var X,P;(function(V,U){je.exports=U(V)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof Z!="undefined"?Z:this,function(V){"use strict";V=V||{};var U=V.Base64,M="2.6.4",G="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",W=function(v){for(var N={},F=0,A=v.length;F<A;F++)N[v.charAt(F)]=F;return N}(G),n=String.fromCharCode,D=function(v){if(v.length<2){var N=v.charCodeAt(0);return N<128?v:N<2048?n(192|N>>>6)+n(128|N&63):n(224|N>>>12&15)+n(128|N>>>6&63)+n(128|N&63)}else{var N=65536+(v.charCodeAt(0)-55296)*1024+(v.charCodeAt(1)-56320);return n(240|N>>>18&7)+n(128|N>>>12&63)+n(128|N>>>6&63)+n(128|N&63)}},m=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,f=function(v){return v.replace(m,D)},h=function(v){var N=[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),A=[G.charAt(F>>>18),G.charAt(F>>>12&63),N>=2?"=":G.charAt(F>>>6&63),N>=1?"=":G.charAt(F&63)];return A.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)},o=function(v){return c(f(String(v)))},d=function(v){return v.replace(/[+\/]/g,function(N){return N=="+"?"-":"_"}).replace(/=/g,"")},i=function(v,N){return N?d(o(v)):o(v)},a=function(v){return i(v,!0)},r;V.Uint8Array&&(r=function(v,N){for(var F="",A=0,H=v.length;A<H;A+=3){var j=v[A],T=v[A+1],z=v[A+2],Q=j<<16|T<<8|z;F+=G.charAt(Q>>>18)+G.charAt(Q>>>12&63)+(typeof T!="undefined"?G.charAt(Q>>>6&63):"=")+(typeof z!="undefined"?G.charAt(Q&63):"=")}return N?d(F):F});var s=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,S=function(v){switch(v.length){case 4:var N=(7&v.charCodeAt(0))<<18|(63&v.charCodeAt(1))<<12|(63&v.charCodeAt(2))<<6|63&v.charCodeAt(3),F=N-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(s,S)},x=function(v){var N=v.length,F=N%4,A=(N>0?W[v.charAt(0)]<<18:0)|(N>1?W[v.charAt(1)]<<12:0)|(N>2?W[v.charAt(2)]<<6:0)|(N>3?W[v.charAt(3)]:0),H=[n(A>>>16),n(A>>>8&255),n(A&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)},O=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(N){return N=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},g=function(v){return _(b(v))},p;V.Uint8Array&&(p=function(v){return Uint8Array.from(O(b(v)),function(N){return N.charCodeAt(0)})});var C=function(){var v=V.Base64;return V.Base64=U,v};if(V.Base64={VERSION:M,atob:O,btoa:c,fromBase64:g,toBase64:i,utob:f,encode:i,encodeURI:a,btou:w,decode:g,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 g(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),je.exports?je.exports.Base64=V.Base64:!(X=[],P=function(){return V.Base64}.apply(oe,X),P!==void 0&&(je.exports=P)),{Base64:V.Base64}})}).call(this,k("IyRk"))},JB8y:function(je,oe,k){"use strict";k.d(oe,"a",function(){return Z});var Z;(function(X){X[X.NOMATCH=-1]="NOMATCH",X[X.OK=0]="OK",X[X.TIMEOUT=2]="TIMEOUT",X[X.PODFAILURE=3]="PODFAILURE",X[X.COMPILEFAILURE=4]="COMPILEFAILURE",X[X.EXECUTEFAILURE=5]="EXECUTEFAILURE"})(Z||(Z={}))},JPnl:function(je,oe,k){"use strict";k.d(oe,"a",function(){return b}),k.d(oe,"c",function(){return C});var Z=k("+L6B"),X=k("2/Rp"),P=k("tJVT"),V=k("9og8"),U=k("k1fw"),M=k("jrin"),G=k("5NDa"),W=k("5rEg"),n=k("WmNS"),D=k.n(n),m=k("q1tI"),f=k.n(m),h=k("8Skl"),c=k("y3Kf"),o=k("JB8y"),d=k("J66h"),i=k.n(d),a=k("a4uL"),r=k.n(a),s=k("IxHN"),S=k("9Bee"),w=k("1vsH"),x=k("ErOA"),L,O=W.a.TextArea,_={visible:!1,tabIndex:"0"},b=(L={},Object(M.a)(L,o.a.NOMATCH,"\u6D4B\u8BD5\u7528\u4F8B\u7ED3\u679C\u4E0D\u5339\u914D"),Object(M.a)(L,o.a.OK,"\u8C03\u8BD5\u901A\u8FC7"),Object(M.a)(L,2,"\u8C03\u8BD5\u8D85\u65F6"),Object(M.a)(L,3,"\u8C03\u8BD5pod\u5931\u8D25"),Object(M.a)(L,4,"\u7F16\u8BD1\u5931\u8D25"),Object(M.a)(L,5,"\u6267\u884C\u5931\u8D25"),L),g;(function(v){v[v.SET_VISIBLE=0]="SET_VISIBLE",v[v.SET_TABINDEX=1]="SET_TABINDEX"})(g||(g={}));function p(v,N){switch(N.type){case g.SET_VISIBLE:return Object(U.a)(Object(U.a)({},v),{},{visible:N.payload});case g.SET_TABINDEX:return Object(U.a)(Object(U.a)({},v),{},{tabIndex:N.payload});default:throw new Error}}function C(v){var N=v.status,F=v.error_msg,A=v.output,H=v.input,j=v.expected_output,T=v.is_file,z=v.input_file_url,Q=v.output_file_url,ne=v.expected_output_file_url,se=v.setMonacoValue,xe=v.setData,ge=null,ve={minHeight:150,marginBottom:10,paddingLeft:24,background:"#070f19",color:"#fff"};switch(N){case o.a.NOMATCH:ge=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),!T&&f.a.createElement(S.a,{value:H,style:ve}),T&&f.a.createElement("div",{style:ve},f.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(V.a)(D.a.mark(function Oe(){var Re;return D.a.wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:return ue.next=2,fetch(z,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 2:return Re=ue.sent,ue.t0=se,ue.next=6,Re.text();case 6:ue.t1=ue.sent,(0,ue.t0)(ue.t1),setTimeout(function(){xe(z)},200);case 9:case"end":return ue.stop()}},Oe)}))},H)),f.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),!T&&f.a.createElement(S.a,{value:A&&d.Base64.decode(A)||"",style:ve}),T&&f.a.createElement("div",{style:ve},f.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(V.a)(D.a.mark(function Oe(){var Re;return D.a.wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:return ue.next=2,Object(x.a)(Q,{method:"Get",headers:{"Content-Type":"application/xml",Accept:"*/*"}});case 2:Re=ue.sent,se(Re),setTimeout(function(){xe(Q)},200);case 5:case"end":return ue.stop()}},Oe)}))},A)),f.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),!T&&f.a.createElement(S.a,{value:j&&d.Base64.decode(j)||"",style:ve}),T&&f.a.createElement("div",{style:ve},f.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(V.a)(D.a.mark(function Oe(){var Re;return D.a.wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:return ue.next=2,fetch(ne,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 2:return Re=ue.sent,ue.t0=se,ue.next=6,Re.text();case 6:ue.t1=ue.sent,(0,ue.t0)(ue.t1),setTimeout(function(){xe(ne)},200);case 9:case"end":return ue.stop()}},Oe)}))},j)));break;case o.a.EXECUTEFAILURE:ge=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!T&&f.a.createElement(S.a,{value:H,style:ve}),T&&f.a.createElement("div",{style:ve},f.a.createElement("a",{onClick:function(){return Object(w.y)(z,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 o.a.COMPILEFAILURE:ge=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!T&&f.a.createElement(S.a,{value:H,style:ve}),T&&f.a.createElement("div",{style:ve},f.a.createElement("a",{onClick:function(){return Object(w.y)(z,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 o.a.PODFAILURE:ge=f.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case o.a.TIMEOUT:ge=f.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return f.a.createElement(f.a.Fragment,null," ",ge," ")}function E(v){var N=v.status,F=v.error_msg,A=v.execute_time,H=v.output,j=v.input,T=v.expected_output,z=v.is_file,Q=v.input_file_url,ne=v.output_file_url,se=v.expected_output_file_url,xe=null;switch(N){case o.a.OK:xe=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6267\u884C\u7528\u65F6\uFF1A",A,"ms"),f.a.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A"),f.a.createElement("pre",null,d.Base64.decode(H)));break;case o.a.NOMATCH:xe=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u8F93\u5165\uFF1A",f.a.createElement("pre",null,j)),f.a.createElement("p",null,"\u8F93\u51FA\uFF1A",H&&d.Base64.decode(H)),f.a.createElement("p",null,"\u9884\u671F\u8F93\u51FA\uFF1A",T&&d.Base64.decode(T)));break;case o.a.EXECUTEFAILURE:xe=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,j)),f.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),f.a.createElement("pre",{className:"error"},d.Base64.decode(F)));break;case o.a.COMPILEFAILURE:xe=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,j)),f.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),f.a.createElement("pre",{className:"error"},d.Base64.decode(F)));break;case o.a.PODFAILURE:xe=f.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case o.a.TIMEOUT:xe=f.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return f.a.createElement(f.a.Fragment,null," ",xe," ")}oe.b=function(v){var N=v.input,F=v.debuging,A=v.submitting,H=v.executingMessage,j=v.debugResult,T=v.onChangeInput,z=v.onDebugCode,Q=v.onSubmitCode,ne=v.hack,se=v.user,xe=Object(m.useReducer)(p,_),ge=Object(P.a)(xe,2),ve=ge[0],Oe=ge[1],Re=ve.visible,he=ve.tabIndex;function ue(at){var ze=at.target.id;Oe({type:g.SET_TABINDEX,payload:ze})}function Me(){Oe({type:g.SET_VISIBLE,payload:!Re})}var et=Object(m.useMemo)(function(){if(j){var at=j.status;return f.a.createElement(f.a.Fragment,null,E(j))}return null},[j]);function it(){Oe({type:g.SET_VISIBLE,payload:!0}),Oe({type:g.SET_TABINDEX,payload:"1"}),z()}var nt=function(){var at=Object(V.a)(D.a.mark(function ze(Ze){var ot;return D.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.next=2,Object(x.a)("/api/problems/".concat(Ze,"/start.json"),{method:"get",params:{hack_user_id:se==null?void 0:se.user_id}});case 2:ot=Se.sent,ot&&(window.location.href="/myproblems/".concat(ot==null?void 0:ot.identifier,"?type=1"));case 4:case"end":return Se.stop()}},ze)}));return function(Ze){return at.apply(this,arguments)}}();return f.a.createElement("div",{className:"test-case-panel"},f.a.createElement("div",{className:"test-case-panel-body ".concat(Re?"active":"")},f.a.createElement("ul",{className:"s-navs"},f.a.createElement("li",null,f.a.createElement("a",{className:he==="0"?"active":"",id:"0",onClick:ue},"\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B")),f.a.createElement("li",null,f.a.createElement("a",{className:he==="1"?"active":"",id:"1",onClick:ue},"\u4EE3\u7801\u6267\u884C\u7ED3\u679C"))),f.a.createElement("div",{className:"tab-panel-body ".concat(he==="0"?"":"hide")},f.a.createElement(O,{placeholder:"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D",value:N,onChange:T})),f.a.createElement("div",{className:"tab-panel-body ".concat(he==="1"?"":"hide")},F?f.a.createElement(s.a,{message:H}):j?f.a.createElement("section",{style:{height:200}}," ",et," "):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(Re?"up":""),onClick:Me},Re?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"},(ne==null?void 0:ne.is_program)&&(ne==null?void 0:ne.above_question)&&f.a.createElement(X.a,{onClick:function(){return nt(ne==null?void 0:ne.above_question)},id:"oj-prev",className:"btn-blue",type:"ghost"},"\u4E0A\u4E00\u9898"),(ne==null?void 0:ne.is_program)&&(ne==null?void 0:ne.under_question)&&f.a.createElement(X.a,{onClick:function(){return nt(ne==null?void 0:ne.under_question)},id:"oj-next",className:"btn-blue",type:"ghost"},"\u4E0B\u4E00\u9898"),f.a.createElement(X.a,{className:"btn-green",type:"ghost",loading:F,onClick:it},"\u8C03\u8BD5\u4EE3\u7801"),f.a.createElement(X.a,{type:"primary",loading:A,disabled:A,onClick:function(){Oe({type:g.SET_VISIBLE,payload:!1}),Q()}},"\u8BC4\u6D4B\u5E76\u63D0\u4EA4"))))}},JYp7:function(je,oe,k){"use strict";k.d(oe,"a",function(){return Z});var Z;(function(X){function P(s){return s&&typeof s=="object"&&typeof s[Symbol.iterator]=="function"}X.is=P;const V=Object.freeze([]);function U(){return V}X.empty=U;function*M(s){yield s}X.single=M;function G(s){return s||V}X.from=G;function W(s){return!s||s[Symbol.iterator]().next().done===!0}X.isEmpty=W;function n(s){return s[Symbol.iterator]().next().value}X.first=n;function D(s,S){for(const w of s)if(S(w))return!0;return!1}X.some=D;function m(s,S){for(const w of s)if(S(w))return w;return}X.find=m;function*f(s,S){for(const w of s)S(w)&&(yield w)}X.filter=f;function*h(s,S){let w=0;for(const x of s)yield S(x,w++)}X.map=h;function*c(...s){for(const S of s)for(const w of S)yield w}X.concat=c;function*o(s){for(const S of s)for(const w of S)yield w}X.concatNested=o;function d(s,S,w){let x=w;for(const L of s)x=S(x,L);return x}X.reduce=d;function*i(s,S,w=s.length){for(S<0&&(S+=s.length),w<0?w+=s.length:w>s.length&&(w=s.length);S<w;S++)yield s[S]}X.slice=i;function a(s,S=Number.POSITIVE_INFINITY){const w=[];if(S===0)return[w,s];const x=s[Symbol.iterator]();for(let L=0;L<S;L++){const O=x.next();if(O.done)return[w,X.empty()];w.push(O.value)}return[w,{[Symbol.iterator](){return x}}]}X.consume=a;function r(s,S,w=(x,L)=>x===L){const x=s[Symbol.iterator](),L=S[Symbol.iterator]();for(;;){const O=x.next(),_=L.next();if(O.done!==_.done)return!1;if(O.done)return!0;if(!w(O.value,_.value))return!1}}X.equals=r})(Z||(Z={}))},LdHM:function(je,oe,k){"use strict";k.d(oe,"b",function(){return s}),k.d(oe,"a",function(){return w});var Z=k("1OyB"),X=k("vuIU"),P=k("Ji7U"),V=k("LK+K"),U=k("q1tI"),M=k("rePB"),G=k("Ff2n"),W=k("ODXe"),n=k("4IlW"),D=k("bX4T"),m=k("YrtM"),f=k("TSYQ"),h=k.n(f),c=k("+nKL"),o=k("8OUc"),d=function(z,Q){var ne=z.prefixCls,se=z.id,xe=z.flattenOptions,ge=z.childrenAsData,ve=z.values,Oe=z.searchValue,Re=z.multiple,he=z.defaultActiveFirstOption,ue=z.height,Me=z.itemHeight,et=z.notFoundContent,it=z.open,nt=z.menuItemSelectedIcon,at=z.virtual,ze=z.onSelect,Ze=z.onToggleOpen,ot=z.onActiveValue,de=z.onScroll,Se=z.onMouseEnter,Le="".concat(ne,"-item"),De=Object(m.a)(function(){return xe},[it,xe],function(Fe,be){return be[0]&&Fe[1]!==be[1]}),qe=U.useRef(null),lt=function(be){be.preventDefault()},mt=function(be){qe.current&&qe.current.scrollTo({index:be})},gt=function(be){for(var fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,pe=De.length,ie=0;ie<pe;ie+=1){var ae=(be+ie*fe+pe)%pe,ce=De[ae],me=ce.group,Te=ce.data;if(!me&&!Te.disabled)return ae}return-1},Ct=U.useState(function(){return gt(0)}),xt=Object(W.a)(Ct,2),Ae=xt[0],Ce=xt[1],Ve=function(be){Ce(be);var fe=De[be];if(!fe){ot(null,-1);return}ot(fe.data.value,be)};U.useEffect(function(){Ve(he!==!1?gt(0):-1)},[De.length,Oe]),U.useEffect(function(){var Fe=setTimeout(function(){if(!Re&&it&&ve.size===1){var be=Array.from(ve)[0],fe=De.findIndex(function(pe){var ie=pe.data;return ie.value===be});Ve(fe),mt(fe)}});return function(){return clearTimeout(Fe)}},[it]);var Qe=function(be){be!==void 0&&ze(be,{selected:!ve.has(be)}),Re||Ze(!1)};if(U.useImperativeHandle(Q,function(){return{onKeyDown:function(be){var fe=be.which;switch(fe){case n.a.UP:case n.a.DOWN:{var pe=0;if(fe===n.a.UP?pe=-1:fe===n.a.DOWN&&(pe=1),pe!==0){var ie=gt(Ae+pe,pe);mt(ie),Ve(ie)}break}case n.a.ENTER:{var ae=De[Ae];ae&&!ae.data.disabled?Qe(ae.data.value):Qe(void 0),it&&be.preventDefault();break}case n.a.ESC:Ze(!1)}},onKeyUp:function(){},scrollTo:function(be){mt(be)}}}),De.length===0)return U.createElement("div",{role:"listbox",id:"".concat(se,"_list"),className:"".concat(Le,"-empty"),onMouseDown:lt},et);function Pe(Fe){var be=De[Fe];if(!be)return null;var fe=be.data||{},pe=fe.value,ie=fe.label,ae=fe.children,ce=Object(D.a)(fe,!0),me=ge?ae:ie;return be?U.createElement("div",Object.assign({"aria-label":typeof me=="string"?me:null},ce,{key:Fe,role:"option",id:"".concat(se,"_list_").concat(Fe),"aria-selected":ve.has(pe)}),pe):null}return U.createElement(U.Fragment,null,U.createElement("div",{role:"listbox",id:"".concat(se,"_list"),style:{height:0,width:0,overflow:"hidden"}},Pe(Ae-1),Pe(Ae),Pe(Ae+1)),U.createElement(c.a,{itemKey:"key",ref:qe,data:De,height:ue,itemHeight:Me,fullHeight:!1,onMouseDown:lt,onScroll:de,virtual:at,onMouseEnter:Se},function(Fe,be){var fe,pe=Fe.group,ie=Fe.groupOption,ae=Fe.data,ce=ae.label,me=ae.key;if(pe)return U.createElement("div",{className:h()(Le,"".concat(Le,"-group"))},ce!==void 0?ce:me);var Te=ae.disabled,ke=ae.value,$e=ae.title,pt=ae.children,Ot=ae.style,vt=ae.className,st=Object(G.a)(ae,["disabled","value","title","children","style","className"]),Ke=ve.has(ke),Ge="".concat(Le,"-option"),Ue=h()(Le,Ge,vt,(fe={},Object(M.a)(fe,"".concat(Ge,"-grouped"),ie),Object(M.a)(fe,"".concat(Ge,"-active"),Ae===be&&!Te),Object(M.a)(fe,"".concat(Ge,"-disabled"),Te),Object(M.a)(fe,"".concat(Ge,"-selected"),Ke),fe)),le=ge?pt:ce,_e=!nt||typeof nt=="function"||Ke;return U.createElement("div",Object.assign({},st,{"aria-selected":Ke,className:Ue,title:$e,onMouseMove:function(){if(Ae===be||Te)return;Ve(be)},onClick:function(){Te||Qe(ke)},style:Ot}),U.createElement("div",{className:"".concat(Ge,"-content")},le||ke),U.isValidElement(nt)||Ke,_e&&U.createElement(o.a,{className:"".concat(Le,"-option-state"),customizeIcon:nt,customizeIconProps:{isSelected:Ke}},Ke?"\u2713":null))}))},i=U.forwardRef(d);i.displayName="OptionList";var a=i,r=function(){return null};r.isSelectOption=!0;var s=r,S=function(){return null};S.isSelectOptGroup=!0;var w=S,x=k("VTBJ"),L=k("Zm9Q");function O(T){var z=T.key,Q=T.props,ne=Q.children,se=Q.value,xe=Object(G.a)(Q,["children","value"]);return Object(x.a)({key:z,value:se!==void 0?se:z,children:ne},xe)}function _(T){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(L.a)(T).map(function(Q,ne){if(!U.isValidElement(Q)||!Q.type)return null;var se=Q.type.isSelectOptGroup,xe=Q.key,ge=Q.props,ve=ge.children,Oe=Object(G.a)(ge,["children"]);return z||!se?O(Q):Object(x.a)(Object(x.a)({key:"__RC_SELECT_GRP__".concat(xe===null?ne:xe,"__"),label:xe},Oe),{},{options:_(ve)})}).filter(function(Q){return Q})}var b=k("2Qr1"),g=k("qNPg"),p=k("U8pU"),C=k("Kwbf"),E=k("WKfj");function v(T){var z=T.mode,Q=T.options,ne=T.children,se=T.backfill,xe=T.allowClear,ge=T.placeholder,ve=T.getInputElement,Oe=T.showSearch,Re=T.onSearch,he=T.defaultOpen,ue=T.autoFocus,Me=T.labelInValue,et=T.value,it=T.inputValue,nt=T.optionLabelProp,at=z==="multiple"||z==="tags",ze=Oe!==void 0?Oe:at||z==="combobox",Ze=Q||_(ne);if(Object(C.a)(z!=="tags"||Ze.every(function(Le){return!Le.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),z==="tags"||z==="combobox"){var ot=Ze.some(function(Le){return Le.options?Le.options.some(function(De){return typeof("value"in De?De.value:De.key)=="number"}):typeof("value"in Le?Le.value:Le.key)=="number"});Object(C.a)(!ot,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(C.a)(z!=="combobox"||!nt,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(C.a)(z==="combobox"||!se,"`backfill` only works with `combobox` mode."),Object(C.a)(z==="combobox"||!ve,"`getInputElement` only work with `combobox` mode."),Object(C.b)(z!=="combobox"||!ve||!xe||!ge,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Re&&!ze&&z!=="combobox"&&z!=="tags"&&Object(C.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(C.b)(!he||ue,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),et!=null){var de=Object(E.d)(et);Object(C.a)(!Me||de.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)(!at||Array.isArray(et),"`value` should be array when `mode` is `multiple` or `tags`")}if(ne){var Se=null;Object(L.a)(ne).some(function(Le){if(!U.isValidElement(Le)||!Le.type)return!1;var De=Le.type;if(De.isSelectOption)return!1;if(De.isSelectOptGroup){var qe=Object(L.a)(Le.props.children).every(function(lt){return!U.isValidElement(lt)||!Le.type||lt.type.isSelectOption?!0:(Se=lt.type,!1)});return!qe}return Se=De,!0}),Se&&Object(C.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Se.displayName||Se.name||Se,"`.")),Object(C.a)(it===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var N=v,F=Object(g.a)({prefixCls:"rc-select",components:{optionList:a},convertChildrenToData:_,flattenOptions:b.d,getLabeledValue:b.e,filterOptions:b.b,isValueDisabled:b.g,findValueOption:b.c,warningProps:N,fillOptionsWithMissingValue:b.a}),A=function(T){Object(P.a)(Q,T);var z=Object(V.a)(Q);function Q(){var ne;return Object(Z.a)(this,Q),ne=z.apply(this,arguments),ne.selectRef=U.createRef(),ne.focus=function(){ne.selectRef.current.focus()},ne.blur=function(){ne.selectRef.current.blur()},ne}return Object(X.a)(Q,[{key:"render",value:function(){return U.createElement(F,Object.assign({ref:this.selectRef},this.props))}}]),Q}(U.Component);A.Option=s,A.OptGroup=w;var H=A,j=oe.c=H},M8RZ:function(je,oe,k){"use strict";k.d(oe,"a",function(){return n});var Z=k("fWQN"),X=k("mtLc"),P=k("yKVA"),V=k("879j"),U=k("q1tI"),M=k.n(U),G=k("i8i4"),W=k.n(G),n=function(D){Object(P.a)(f,D);var m=Object(V.a)(f);function f(h){var c;Object(Z.a)(this,f),c=m.call(this,h);var o=window.document;return c.node=o.createElement("div"),o.body.appendChild(c.node),c}return Object(X.a)(f,[{key:"render",value:function(){var c=this.props.children;return Object(G.createPortal)(c,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),f}(M.a.Component)},MFOe:function(je,oe,k){(function(Z){var X=M(),P=G(),V=W(),U=typeof window!="undefined"?window:Z;je.exports={assign:X,create:P,trim:V,bind:n,slice:D,each:m,map:f,pluck:h,isList:c,isFunction:o,isObject:d,Global:U};function M(){return Object.assign?Object.assign:function(a,r,s,S){for(var w=1;w<arguments.length;w++)m(Object(arguments[w]),function(x,L){a[L]=x});return a}}function G(){if(Object.create)return function(r,s,S,w){var x=D(arguments,1);return X.apply(this,[Object.create(r)].concat(x))};{function i(){}return function(r,s,S,w){var x=D(arguments,1);return i.prototype=r,X.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 D(i,a){return Array.prototype.slice.call(i,a||0)}function m(i,a){h(i,function(r,s){return a(r,s),!1})}function f(i,a){var r=c(i)?[]:{};return h(i,function(s,S){return r[S]=a(s,S),!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 s in i)if(i.hasOwnProperty(s)&&a(i[s],s))return i[s]}function c(i){return i!=null&&typeof i!="function"&&typeof i.length=="number"}function o(i){return i&&{}.toString.call(i)==="[object Function]"}function d(i){return i&&{}.toString.call(i)==="[object Object]"}}).call(this,k("IyRk"))},MI8n:function(je,oe,k){"use strict";k.d(oe,"c",function(){return U}),k.d(oe,"b",function(){return n}),k.d(oe,"e",function(){return D}),k.d(oe,"a",function(){return m}),k.d(oe,"d",function(){return f}),k.d(oe,"f",function(){return h});var Z=k("/cxE"),X=k("pmY6"),P=k("24hK"),V=k("5Y4S"),U;(function(c){c.None=()=>X.a.None;function o(v){return(N,F=null,A)=>{let H=!1,j;return j=v(T=>H?void 0:(j?j.dispose():H=!0,N.call(F,T)),null,A),H&&j.dispose(),j}}c.once=o;function d(v,N){return w((F,A=null,H)=>v(j=>F.call(A,N(j)),null,H))}c.map=d;function i(v,N){return w((F,A=null,H)=>v(j=>{N(j),F.call(A,j)},null,H))}c.forEach=i;function a(v,N){return w((F,A=null,H)=>v(j=>N(j)&&F.call(A,j),null,H))}c.filter=a;function r(v){return v}c.signal=r;function s(...v){return(N,F=null,A)=>Object(X.e)(...v.map(H=>H(j=>N.call(F,j),null,A)))}c.any=s;function S(v,N,F){let A=F;return d(v,H=>(A=N(A,H),A))}c.reduce=S;function w(v){let N;const F=new n({onFirstListenerAdd(){N=v(F.fire,F)},onLastListenerRemove(){N.dispose()}});return F.event}function x(v,N,F=100,A=!1,H){let j,T,z,Q=0;const ne=new n({leakWarningThreshold:H,onFirstListenerAdd(){j=v(se=>{Q++,T=N(T,se),A&&!z&&(ne.fire(T),T=void 0),clearTimeout(z),z=setTimeout(()=>{const xe=T;T=void 0,z=void 0,(!A||Q>1)&&ne.fire(xe),Q=0},F)})},onLastListenerRemove(){j.dispose()}});return ne.event}c.debounce=x;function L(v,N=(F,A)=>F===A){let F=!0,A;return a(v,H=>{const j=F||!N(H,A);return F=!1,A=H,j})}c.latch=L;function O(v,N){return[c.filter(v,N),c.filter(v,F=>!N(F))]}c.split=O;function _(v,N=!1,F=[]){let A=F.slice(),H=v(z=>{A?A.push(z):T.fire(z)});const j=()=>{A&&A.forEach(z=>T.fire(z)),A=null},T=new n({onFirstListenerAdd(){H||(H=v(z=>T.fire(z)))},onFirstListenerDidAdd(){A&&(N?setTimeout(j):j())},onLastListenerRemove(){H&&H.dispose(),H=null}});return T.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,N){return new b(S(this.event,v,N))}latch(){return new b(L(this.event))}debounce(v,N=100,F=!1,A){return new b(x(this.event,v,N,F,A))}on(v,N,F){return this.event(v,N,F)}once(v,N,F){return o(this.event)(v,N,F)}}function g(v){return new b(v)}c.chain=g;function p(v,N,F=A=>A){const A=(...z)=>T.fire(F(...z)),H=()=>v.on(N,A),j=()=>v.removeListener(N,A),T=new n({onFirstListenerAdd:H,onLastListenerRemove:j});return T.event}c.fromNodeEventEmitter=p;function C(v,N,F=A=>A){const A=(...z)=>T.fire(F(...z)),H=()=>v.addEventListener(N,A),j=()=>v.removeEventListener(N,A),T=new n({onFirstListenerAdd:H,onLastListenerRemove:j});return T.event}c.fromDOMEventEmitter=C;function E(v){return new Promise(N=>o(v)(N))}c.toPromise=E})(U||(U={}));class M{constructor(c){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${c}_${M._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}}}M._idPool=0;let G=-1;class W{constructor(c,o=Math.random().toString(18).slice(2,5)){this.customThreshold=c,this.name=o,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(c){let o=G;if(typeof this.customThreshold=="number"&&(o=this.customThreshold),o<=0||c<o)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=o*.5;let a,r=0;for(const[s,S]of this._stacks)(!a||r<S)&&(a=s,r=S);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 o;this._disposed=!1,this._options=c,this._leakageMon=G>0?new W(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((o=this._options)===null||o===void 0?void 0:o._profName)?new M(this._options._profName):void 0}get event(){return this._event||(this._event=(c,o,d)=>{var i;this._listeners||(this._listeners=new P.a);const a=this._listeners.isEmpty();a&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const r=this._listeners.push(o?[c,o]:c);a&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,c,o);const s=(i=this._leakageMon)===null||i===void 0?void 0:i.check(this._listeners.size),S=Object(X.i)(()=>{if(s&&s(),!this._disposed&&(r(),this._options&&this._options.onLastListenerRemove)){const w=this._listeners&&!this._listeners.isEmpty();w||this._options.onLastListenerRemove(this)}});return d instanceof X.b?d.add(S):Array.isArray(d)&&d.push(S),S}),this._event}fire(c){var o,d;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new P.a);for(let i of this._listeners)this._deliveryQueue.push([i,c]);for((o=this._perfMon)===null||o===void 0||o.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(Z.f)(r)}}(d=this._perfMon)===null||d===void 0||d.stop()}}dispose(){var c,o,d,i,a;this._disposed||(this._disposed=!0,(c=this._listeners)===null||c===void 0||c.clear(),(o=this._deliveryQueue)===null||o===void 0||o.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 D extends n{constructor(c){super(c);this._isPaused=0,this._eventQueue=new P.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 m extends D{constructor(c){var o;super(c);this._delay=(o=c.delay)!==null&&o!==void 0?o: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(o,d,i)=>c(a=>{const r=this.buffers[this.buffers.length-1];r?r.push(()=>o.call(d,a)):o.call(d,a)},void 0,i)}bufferEvents(c){const o=[];this.buffers.push(o);const d=c();return this.buffers.pop(),o.forEach(i=>i()),d}}class h{constructor(){this.listening=!1,this.inputEvent=U.None,this.inputEventListener=X.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(je,oe,k){"use strict";(function(Z,X){k.d(oe,"b",function(){return d}),k.d(oe,"i",function(){return s}),k.d(oe,"f",function(){return S}),k.d(oe,"d",function(){return w}),k.d(oe,"g",function(){return x}),k.d(oe,"h",function(){return L}),k.d(oe,"c",function(){return O}),k.d(oe,"k",function(){return _}),k.d(oe,"j",function(){return b}),k.d(oe,"a",function(){return g}),k.d(oe,"e",function(){return E});var P;const V="en";let U=!1,M=!1,G=!1,W=!1,n=!1,D=!1,m=!1,f,h=V,c,o;const d=typeof self=="object"?self:typeof Z=="object"?Z:{};let i;typeof d.vscode!="undefined"&&typeof d.vscode.process!="undefined"?i=d.vscode.process:typeof X!="undefined"&&(i=X);const a=typeof((P=i==null?void 0:i.versions)===null||P===void 0?void 0:P.electron)=="string"&&i.type==="renderer";if(typeof navigator=="object"&&!a)o=navigator.userAgent,U=o.indexOf("Windows")>=0,M=o.indexOf("Macintosh")>=0,m=(o.indexOf("Macintosh")>=0||o.indexOf("iPad")>=0||o.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,G=o.indexOf("Linux")>=0,D=!0,f=navigator.language,h=f;else if(typeof i=="object"){U=i.platform==="win32",M=i.platform==="darwin",G=i.platform==="linux",W=G&&!!i.env.SNAP&&!!i.env.SNAP_REVISION,f=V,h=V;const v=i.env.VSCODE_NLS_CONFIG;if(v)try{const N=JSON.parse(v),F=N.availableLanguages["*"];f=N.locale,h=F||V,c=N._translationsConfigFile}catch(N){}n=!0}else console.error("Unable to resolve platform.");let r=0;M?r=1:U?r=3:G&&(r=2);const s=U,S=M,w=G,x=n,L=D,O=m,_=o,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 j=0,T=F.length;j<T;j++){const z=F[j];if(z.id===H.data.vscodeSetImmediateId){F.splice(j,1),z.callback();return}}});let A=0;return H=>{const j=++A;F.push({id:j,callback:H}),d.postMessage({vscodeSetImmediateId:j},"*")}}if(typeof(i==null?void 0:i.nextTick)=="function")return i.nextTick.bind(i);const N=Promise.resolve();return F=>N.then(F)}(),g=M||m?2:U?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 N=new Uint16Array(v.buffer);p=N[0]===(2<<8)+1}return p}}).call(this,k("IyRk"),k("Q2Ig"))},N0LK:function(je,oe,k){"use strict";k.d(oe,"C",function(){return Z}),k.d(oe,"v",function(){return P}),k.d(oe,"s",function(){return V}),k.d(oe,"t",function(){return U}),k.d(oe,"U",function(){return M}),k.d(oe,"J",function(){return G}),k.d(oe,"O",function(){return W}),k.d(oe,"p",function(){return n}),k.d(oe,"T",function(){return D}),k.d(oe,"q",function(){return m}),k.d(oe,"N",function(){return f}),k.d(oe,"M",function(){return h}),k.d(oe,"Q",function(){return c}),k.d(oe,"u",function(){return o}),k.d(oe,"x",function(){return d}),k.d(oe,"I",function(){return i}),k.d(oe,"f",function(){return a}),k.d(oe,"h",function(){return r}),k.d(oe,"g",function(){return s}),k.d(oe,"i",function(){return S}),k.d(oe,"G",function(){return w}),k.d(oe,"H",function(){return x}),k.d(oe,"r",function(){return L}),k.d(oe,"R",function(){return O}),k.d(oe,"d",function(){return _}),k.d(oe,"e",function(){return b}),k.d(oe,"E",function(){return g}),k.d(oe,"F",function(){return p}),k.d(oe,"j",function(){return C}),k.d(oe,"z",function(){return E}),k.d(oe,"K",function(){return N}),k.d(oe,"L",function(){return F}),k.d(oe,"m",function(){return H}),k.d(oe,"k",function(){return T}),k.d(oe,"A",function(){return Q}),k.d(oe,"a",function(){return ne}),k.d(oe,"n",function(){return se}),k.d(oe,"l",function(){return xe}),k.d(oe,"D",function(){return ge}),k.d(oe,"B",function(){return ve}),k.d(oe,"b",function(){return Oe}),k.d(oe,"S",function(){return Re}),k.d(oe,"o",function(){return he}),k.d(oe,"P",function(){return ue}),k.d(oe,"w",function(){return Me}),k.d(oe,"c",function(){return et}),k.d(oe,"y",function(){return at});function Z(de){return!de||typeof de!="string"?!0:de.trim().length===0}const X=/{(\d+)}/g;function P(de,...Se){return Se.length===0?de:de.replace(X,function(Le,De){const qe=parseInt(De,10);return isNaN(qe)||qe<0||qe>=Se.length?Le:Se[qe]})}function V(de){return de.replace(/[<>&]/g,function(Se){switch(Se){case"<":return"<";case">":return">";case"&":return"&";default:return Se}})}function U(de){return de.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function M(de,Se=" "){const Le=G(de,Se);return W(Le,Se)}function G(de,Se){if(!de||!Se)return de;const Le=Se.length;if(Le===0||de.length===0)return de;let De=0;for(;de.indexOf(Se,De)===De;)De=De+Le;return de.substring(De)}function W(de,Se){if(!de||!Se)return de;const Le=Se.length,De=de.length;if(Le===0||De===0)return de;let qe=De,lt=-1;for(;!(lt=de.lastIndexOf(Se,qe-1),lt===-1||lt+Le!==qe);){if(lt===0)return"";qe=lt}return de.substring(0,qe)}function n(de){return de.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function D(de){return de.replace(/\*/g,"")}function m(de,Se,Le={}){if(!de)throw new Error("Cannot create regex from empty string");Se||(de=U(de)),Le.wholeWord&&(/\B/.test(de.charAt(0))||(de="\\b"+de),/\B/.test(de.charAt(de.length-1))||(de=de+"\\b"));let De="";return Le.global&&(De+="g"),Le.matchCase||(De+="i"),Le.multiline&&(De+="m"),Le.unicode&&(De+="u"),new RegExp(de,De)}function f(de){if(de.source==="^"||de.source==="^$"||de.source==="$"||de.source==="^\\s*$")return!1;const Se=de.exec("");return!!(Se&&de.lastIndex===0)}function h(de){return(de.global?"g":"")+(de.ignoreCase?"i":"")+(de.multiline?"m":"")+(de.unicode?"u":"")}function c(de){return de.split(/\r\n|\r|\n/)}function o(de){for(let Se=0,Le=de.length;Se<Le;Se++){const De=de.charCodeAt(Se);if(De!==32&&De!==9)return Se}return-1}function d(de,Se=0,Le=de.length){for(let De=Se;De<Le;De++){const qe=de.charCodeAt(De);if(qe!==32&&qe!==9)return de.substring(Se,De)}return de.substring(Se,Le)}function i(de,Se=de.length-1){for(let Le=Se;Le>=0;Le--){const De=de.charCodeAt(Le);if(De!==32&&De!==9)return Le}return-1}function a(de,Se){return de<Se?-1:de>Se?1:0}function r(de,Se,Le=0,De=de.length,qe=0,lt=Se.length){for(;Le<De&&qe<lt;Le++,qe++){let Ct=de.charCodeAt(Le),xt=Se.charCodeAt(qe);if(Ct<xt)return-1;if(Ct>xt)return 1}const mt=De-Le,gt=lt-qe;return mt<gt?-1:mt>gt?1:0}function s(de,Se){return S(de,Se,0,de.length,0,Se.length)}function S(de,Se,Le=0,De=de.length,qe=0,lt=Se.length){for(;Le<De&&qe<lt;Le++,qe++){let Ct=de.charCodeAt(Le),xt=Se.charCodeAt(qe);if(Ct===xt)continue;if(Ct>=128||xt>=128)return r(de.toLowerCase(),Se.toLowerCase(),Le,De,qe,lt);w(Ct)&&(Ct-=32),w(xt)&&(xt-=32);const Ae=Ct-xt;if(Ae===0)continue;return Ae}const mt=De-Le,gt=lt-qe;return mt<gt?-1:mt>gt?1:0}function w(de){return de>=97&&de<=122}function x(de){return de>=65&&de<=90}function L(de,Se){return de.length===Se.length&&S(de,Se)===0}function O(de,Se){const Le=Se.length;return Se.length>de.length?!1:S(de,Se,0,Le)===0}function _(de,Se){let Le,De=Math.min(de.length,Se.length);for(Le=0;Le<De;Le++)if(de.charCodeAt(Le)!==Se.charCodeAt(Le))return Le;return De}function b(de,Se){let Le,De=Math.min(de.length,Se.length);const qe=de.length-1,lt=Se.length-1;for(Le=0;Le<De;Le++)if(de.charCodeAt(qe-Le)!==Se.charCodeAt(lt-Le))return Le;return De}function g(de){return 55296<=de&&de<=56319}function p(de){return 56320<=de&&de<=57343}function C(de,Se){return(de-55296<<10)+(Se-56320)+65536}function E(de,Se,Le){const De=de.charCodeAt(Le);if(g(De)&&Le+1<Se){const qe=de.charCodeAt(Le+1);if(p(qe))return C(De,qe)}return De}function v(de,Se){const Le=de.charCodeAt(Se-1);if(p(Le)&&Se>1){const De=de.charCodeAt(Se-2);if(g(De))return C(De,Le)}return Le}function N(de,Se){const Le=it.getInstance(),De=Se,qe=de.length,lt=E(de,qe,Se);Se+=lt>=65536?2:1;let mt=Le.getGraphemeBreakType(lt);for(;Se<qe;){const gt=E(de,qe,Se),Ct=Le.getGraphemeBreakType(gt);if(et(mt,Ct))break;Se+=gt>=65536?2:1,mt=Ct}return Se-De}function F(de,Se){const Le=it.getInstance(),De=Se,qe=v(de,Se);Se-=qe>=65536?2:1;let lt=Le.getGraphemeBreakType(qe);for(;Se>0;){const mt=v(de,Se),gt=Le.getGraphemeBreakType(mt);if(et(gt,lt))break;Se-=mt>=65536?2:1,lt=gt}return De-Se}const A=/(?:[\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(de){return A.test(de)}const j=/(?:[\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 T(de){return j.test(de)}const z=/^[\t\n\r\x20-\x7E]*$/;function Q(de){return z.test(de)}const ne=/[\u2028\u2029]/;function se(de){return ne.test(de)}function xe(de){for(let Se=0,Le=de.length;Se<Le;Se++)if(ge(de.charCodeAt(Se)))return!0;return!1}function ge(de){return de=+de,de>=11904&&de<=55215||de>=63744&&de<=64255||de>=65281&&de<=65374}function ve(de){return de>=127462&&de<=127487||de===8986||de===8987||de===9200||de===9203||de>=9728&&de<=10175||de===11088||de===11093||de>=127744&&de<=128591||de>=128640&&de<=128764||de>=128992&&de<=129003||de>=129280&&de<=129535||de>=129648&&de<=129750}const Oe=String.fromCharCode(65279);function Re(de){return!!(de&&de.length>0&&de.charCodeAt(0)===65279)}function he(de,Se=!1){return de?(Se&&(de=de.replace(/\\./g,"")),de.toLowerCase()!==de):!1}function ue(de){const Se=90-65+1;return de=de%(2*Se),de<Se?String.fromCharCode(97+de):String.fromCharCode(65+de-Se)}function Me(de){const Se=it.getInstance();return Se.getGraphemeBreakType(de)}function et(de,Se){return de===0?Se!==5&&Se!==7:de===2&&Se===3?!1:de===4||de===2||de===3||(Se===4||Se===2||Se===3)?!0:de===8&&(Se===8||Se===9||Se===11||Se===12)||((de===11||de===9)&&(Se===9||Se===10)||((de===12||de===10)&&Se===10||(Se===5||Se===13||(Se===7||(de===1||de===13&&Se===14)))))?!1:!(de===6&&Se===6)}class it{constructor(){this._data=nt()}static getInstance(){return it._INSTANCE||(it._INSTANCE=new it),it._INSTANCE}getGraphemeBreakType(de){if(de<32)return de===10?3:de===13?2:4;if(de<127)return 0;const Se=this._data,Le=Se.length/3;let De=1;for(;De<=Le;)if(de<Se[3*De])De=2*De;else if(de>Se[3*De+1])De=2*De+1;else return Se[3*De+2];return 0}}it._INSTANCE=null;function nt(){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 at(de,Se){if(de===0)return 0;const Le=ze(de,Se);if(Le!==void 0)return Le;const De=v(Se,de);return de-=Ze(De),de}function ze(de,Se){let Le=v(Se,de);for(de-=Ze(Le);ot(Le)||Le===65039||Le===8419;){if(de===0)return;Le=v(Se,de),de-=Ze(Le)}if(!ve(Le))return;if(de>=0){const De=v(Se,de);De===8205&&(de-=Ze(De))}return de}function Ze(de){return de>=65536?2:1}function ot(de){return 127995<=de&&de<=127999}},NvD2:function(je,oe,k){"use strict";k.d(oe,"a",function(){return M});var Z=k("Kwbf");function X(G,W){var n=new Set;return G.forEach(function(D){W.has(D)||n.add(D)}),n}function P(G){var W=G||{},n=W.disabled,D=W.disableCheckbox,m=W.checkable;return!!(n||D)||m===!1}function V(G,W,n,D){for(var m=new Set(G),f=new Set,h=0;h<=n;h+=1){var c=W.get(h)||new Set;c.forEach(function(a){var r=a.key,s=a.node,S=a.children,w=S===void 0?[]:S;m.has(r)&&!D(s)&&w.filter(function(x){return!D(x.node)}).forEach(function(x){m.add(x.key)})})}for(var o=new Set,d=n;d>=0;d-=1){var i=W.get(d)||new Set;i.forEach(function(a){var r=a.parent,s=a.node;if(D(s)||!a.parent||o.has(a.parent.key))return;if(D(a.parent.node)){o.add(r.key);return}var S=!0,w=!1;(r.children||[]).filter(function(x){return!D(x.node)}).forEach(function(x){var L=x.key,O=m.has(L);S&&!O&&(S=!1),!w&&(O||f.has(L))&&(w=!0)}),S&&m.add(r.key),w&&f.add(r.key),o.add(r.key)})}return{checkedKeys:Array.from(m),halfCheckedKeys:Array.from(X(f,m))}}function U(G,W,n,D,m){for(var f=new Set(G),h=new Set(W),c=0;c<=D;c+=1){var o=n.get(c)||new Set;o.forEach(function(r){var s=r.key,S=r.node,w=r.children,x=w===void 0?[]:w;!f.has(s)&&!h.has(s)&&!m(S)&&x.filter(function(L){return!m(L.node)}).forEach(function(L){f.delete(L.key)})})}h=new Set;for(var d=new Set,i=D;i>=0;i-=1){var a=n.get(i)||new Set;a.forEach(function(r){var s=r.parent,S=r.node;if(m(S)||!r.parent||d.has(r.parent.key))return;if(m(r.parent.node)){d.add(s.key);return}var w=!0,x=!1;(s.children||[]).filter(function(L){return!m(L.node)}).forEach(function(L){var O=L.key,_=f.has(O);w&&!_&&(w=!1),!x&&(_||h.has(O))&&(x=!0)}),w||f.delete(s.key),x&&h.add(s.key),d.add(s.key)})}return{checkedKeys:Array.from(f),halfCheckedKeys:Array.from(X(h,f))}}function M(G,W,n,D){var m=[],f;D?f=D:f=P;var h=new Set(G.filter(function(i){var a=!!n[i];return a||m.push(i),a})),c=new Map,o=0;Object.keys(n).forEach(function(i){var a=n[i],r=a.level,s=c.get(r);s||(s=new Set,c.set(r,s)),s.add(a),o=Math.max(o,r)}),Object(Z.a)(!m.length,"Tree missing follow keys: ".concat(m.slice(0,100).map(function(i){return"'".concat(i,"'")}).join(", ")));var d;return W===!0?d=V(h,c,o,f):d=U(h,W.halfCheckedKeys,c,o,f),d}},OJz4:function(je,oe,k){"use strict";k.d(oe,"d",function(){return X}),k.d(oe,"h",function(){return P}),k.d(oe,"b",function(){return V}),k.d(oe,"f",function(){return U}),k.d(oe,"e",function(){return M}),k.d(oe,"c",function(){return G}),k.d(oe,"a",function(){return W}),k.d(oe,"g",function(){return n}),k.d(oe,"i",function(){return D}),k.d(oe,"k",function(){return m}),k.d(oe,"j",function(){return f});var Z=k("ErOA");function X(h){return Object(Z.c)("myproblems/".concat(h,".json"),{hidePopLogin:!0})}function P(h,c){return Object(Z.f)("myproblems/".concat(h,"/code_submit.json"),c)}function V(h,c){return Object(Z.c)("myproblems/".concat(h,"/code_debug.json"),c)}function U(h,c){return Object(Z.c)("myproblems/".concat(h,"/submit_records.json"),c)}function M(h){return Object(Z.c)("myproblems/record_detail.json",{id:h})}function G(h,c){return Object(Z.c)("myproblems/".concat(h,"/result.json"),{mode:c})}function W(h,c){return Object(Z.f)("myproblems/".concat(h,"/add_notes.json"),c)}function n(h){return Object(Z.f)("myproblems/".concat(h,"/restore_initial_code.json"))}function D(h){return Object(Z.f)("myproblems/".concat(h,"/sync_code.json"))}function m(h,c){return Object(Z.f)("myproblems/".concat(h,"/update_code.json"),c)}function f(h,c){return Object(Z.f)("discusses/".concat(h,"/plus.json"),c)}},OLES:function(je,oe,k){"use strict";var Z=k("U8pU"),X=k("VTBJ"),P=k("Ff2n"),V=k("q1tI"),U=k("uciX"),M=k("7ixt"),G=function(h){var c=h.overlay,o=h.prefixCls,d=h.id,i=h.overlayInnerStyle;return V.createElement("div",{className:"".concat(o,"-inner"),id:d,role:"tooltip",style:i},typeof c=="function"?c():c)},W=G,n=function(h,c){var o=h.overlayClassName,d=h.trigger,i=d===void 0?["hover"]:d,a=h.mouseEnterDelay,r=a===void 0?0:a,s=h.mouseLeaveDelay,S=s===void 0?.1:s,w=h.overlayStyle,x=h.prefixCls,L=x===void 0?"rc-tooltip":x,O=h.children,_=h.onVisibleChange,b=h.afterVisibleChange,g=h.transitionName,p=h.animation,C=h.placement,E=C===void 0?"right":C,v=h.align,N=v===void 0?{}:v,F=h.destroyTooltipOnHide,A=F===void 0?!1:F,H=h.defaultVisible,j=h.getTooltipContainer,T=h.overlayInnerStyle,z=Object(P.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 ne=Object(X.a)({},z);"visible"in h&&(ne.popupVisible=h.visible);var se=function(){var Re=h.arrowContent,he=Re===void 0?null:Re,ue=h.overlay,Me=h.id;return[V.createElement("div",{className:"".concat(L,"-arrow"),key:"arrow"},he),V.createElement(W,{key:"content",prefixCls:L,id:Me,overlay:ue,overlayInnerStyle:T})]},xe=!1,ge=!1;if(typeof A=="boolean")xe=A;else if(A&&Object(Z.a)(A)==="object"){var ve=A.keepParent;xe=ve===!0,ge=ve===!1}return V.createElement(U.a,Object.assign({popupClassName:o,prefixCls:L,popup:se,action:i,builtinPlacements:M.a,popupPlacement:E,ref:Q,popupAlign:N,getPopupContainer:j,onPopupVisibleChange:_,afterPopupVisibleChange:b,popupTransitionName:g,popupAnimation:p,defaultPopupVisible:H,destroyPopupOnHide:xe,autoDestroy:ge,mouseLeaveDelay:S,popupStyle:w,mouseEnterDelay:r},ne),O)},D=Object(V.forwardRef)(n),m=oe.a=D},OZM5:function(je,oe,k){"use strict";k.d(oe,"b",function(){return D}),k.d(oe,"a",function(){return m}),k.d(oe,"k",function(){return f}),k.d(oe,"h",function(){return h}),k.d(oe,"i",function(){return c}),k.d(oe,"g",function(){return o}),k.d(oe,"c",function(){return d}),k.d(oe,"d",function(){return i}),k.d(oe,"j",function(){return s}),k.d(oe,"e",function(){return S}),k.d(oe,"f",function(){return w});var Z=k("KQm4"),X=k("U8pU"),P=k("Ff2n"),V=k("q1tI"),U=k.n(V),M=k("Kwbf"),G=k("WaYH"),W=.25,n=2;function D(x,L){var O=x.slice(),_=O.indexOf(L);return _>=0&&O.splice(_,1),O}function m(x,L){var O=x.slice();return O.indexOf(L)===-1&&O.push(L),O}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 o(x,L){var O=[x],_=L[x];function b(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];g.forEach(function(p){var C=p.key,E=p.children;O.push(C),b(E)})}return b(_.children),O}function d(x,L){var O=x.clientY,_=L.selectHandle.getBoundingClientRect(),b=_.top,g=_.bottom,p=_.height,C=Math.max(p*W,n);return O<=b+C?-1:O>=g-C?1:0}function i(x,L){if(!x)return;var O=L.multiple;return O?x.slice():x.length?[x[0]]:x}var a=function(L){return L};function r(x,L){if(!x)return[];var O=L||{},_=O.processProps,b=_===void 0?a:_,g=Array.isArray(x)?x:[x];return g.map(function(p){var C=p.children,E=Object(P.a)(p,["children"]),v=r(C,L);return U.a.createElement(G.a,Object.assign({},b(E)),v)})}function s(x){if(!x)return null;var L;if(Array.isArray(x))L={checkedKeys:x,halfCheckedKeys:void 0};else if(Object(X.a)(x)==="object")L={checkedKeys:x.checked||void 0,halfCheckedKeys:x.halfChecked||void 0};else return Object(M.a)(!1,"`checkedKeys` is not an array or an object"),null;return L}function S(x,L){var O=new Set;function _(b){if(O.has(b))return;var g=L[b];if(!g)return;O.add(b);var p=g.parent,C=g.node;if(C.disabled)return;p&&_(p.key)}return(x||[]).forEach(function(b){_(b)}),Object(Z.a)(O)}function w(x){var L={};return Object.keys(x).forEach(function(O){(O.startsWith("data-")||O.startsWith("aria-"))&&(L[O]=x[O])}),L}},Ot1p:function(je,oe,k){"use strict";var Z=k("2qtc"),X=k("kLXV"),P=k("rAM+"),V=k("miYZ"),U=k("tsqr"),M=k("9og8"),G=k("tJVT"),W=k("jrin"),n=k("WmNS"),D=k.n(n),m=k("q1tI"),f=k.n(m),h=k("VrN/"),c=k.n(h),o=k("bdgK"),d=k("p77/"),i=k("Bd2K"),a=k("ELLl"),r=k("19Vz"),s=k("lZu9"),S=k("+NIl"),w=k("kSUc"),x=k("9Bee"),L=function(Te){var ke=Te.value,$e=ke===void 0?"":ke,pt=Te.className,Ot=Te.showTextOnly,vt=Te.showLines,st=Te.style,Ke=st===void 0?{}:st,Ge=Object(m.useMemo)(function(){return""},[$e]);return f.a.createElement(f.a.Fragment,null,f.a.createElement("div",{dangerouslySetInnerHTML:{__html:Ge}}))},O=k("0Owb"),_=k("dejd"),b=k("C+DQ"),g=k("1vsH"),p=k("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(Te){var ke=Te.onActionCallback,$e=Te.title,pt=Te.icon,Ot=Te.actionName,vt=Te.className,st=vt===void 0?"":vt,Ke=Te.children;function Ge(){ke(Ot)}return f.a.createElement("a",{title:$e,className:st,onClick:Ge},f.a.createElement("i",{className:"md-iconfont ".concat(pt)}),Ke)}var v=function(Te){var ke=Te.watch,$e=Te.showNullButton,pt=Te.onActionCallback,Ot=Te.fullScreen,vt=Te.insertTemp,st=Te.hidetoolBar,Ke=Te.uuid,Ge=Te.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(g.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(g.F)("_educoder_session"),"&key=").concat(Ke,"&api=").concat(encodeURIComponent(p.a.PROXY_SERVER)));var Ue=[].concat(C,[{title:"".concat(ke?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(ke?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return f.a.createElement("ul",{className:"markdown-toolbar-container"},!st&&Ue.map(function(le,_e){return f.a.createElement("li",{key:_e},le.actionName?f.a.createElement(E,Object(O.a)({},le,{onActionCallback:pt})):f.a.createElement("span",{className:"v-line"}))}),$e?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:pt},f.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,vt&&f.a.createElement("li",null,f.a.createElement(E,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(vt),onActionCallback:pt},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(Ot?"icon-shrink":"icon-enlarge"),title:Ot?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:pt})))},N=k("M8RZ"),F=k("+L6B"),A=k("2/Rp"),H=k("y8nQ"),j=k("Vl3Y"),T=k("5NDa"),z=k("5rEg"),Q={labelCol:{span:4},wrapperCol:{span:20}},ne=function(Te){var ke=Te.callback,$e=Te.onCancel;function pt(Ot){ke(Ot)}return f.a.createElement(j.a,Object(O.a)({},Q,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:pt}),f.a.createElement(j.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},f.a.createElement(z.a,null)),f.a.createElement(j.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},f.a.createElement(z.a,null)),f.a.createElement("div",{className:"flex-container flex-end"},f.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(A.a,{type:"ghost",onClick:$e},"\u53D6\u6D88")))},se=k("7ahc"),xe=k("HmJG"),ge=k("BjJ7"),ve=j.a.useForm,Oe={width:280,marginRight:10},Re={labelCol:{span:5},wrapperCol:{span:19}},he=function(Te){var ke=Te.callback,$e=Te.onCancel,pt=ve(),Ot=Object(G.a)(pt,1),vt=Ot[0];function st(Ue){ke(Ue)}function Ke(Ue,le){if(Ue.status===-1){U.b.error(Ue.message);return}vt.setFieldsValue({src:"/api/attachments/".concat(Ue.id),type:le.type})}function Ge(Ue){var le=Ue.target.files[0];Me(le,Ke)}return f.a.createElement(j.a,Object(O.a)({form:vt},Re,{className:"upload-image-panel",onFinish:st}),f.a.createElement(j.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},f.a.createElement("div",{className:"flex-container"},f.a.createElement(j.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},f.a.createElement(z.a,{style:Oe})),f.a.createElement(ue,{onFileChange:Ge}))),f.a.createElement(j.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},f.a.createElement(z.a,{style:{width:264}})),f.a.createElement(j.a.Item,{style:{textAlign:"right"}},f.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(A.a,{type:"ghost",onClick:$e},"\u53D6\u6D88")))};function ue(Te){var ke=Te.onFileChange;return f.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",f.a.createElement("input",{type:"file",onChange:ke}))}function Me(Te,ke){if(!Te)throw new String("\u6CA1\u6709\u6587\u4EF6");var $e=new FormData;$e.append("editormd-image-file",Te),$e.append("file_param_name","editormd-image-file"),$e.append("byxhr","true");var pt=new window.XMLHttpRequest;pt.withCredentials=!0,pt.addEventListener("load",function(Ot){ke(JSON.parse(Ot.target.responseText),Te)},!1),pt.addEventListener("error",function(Ot){console.error(Ot)},!1),pt.open("POST","".concat(ge.a,"/api/attachments.json")),pt.send($e)}var et=k("giR+"),it=k("fyUT"),nt=k("7Kak"),at=k("9yH6"),ze=at.a.Group,Ze={margin:"0 8px"},ot=function(Te){var ke=Te.callback,$e=Te.onCancel;function pt(Ot){ke(Ot)}return f.a.createElement(j.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:pt},f.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},f.a.createElement("span",{style:Ze},"\u5355\u5143\u683C\u6570\uFF1A"),f.a.createElement("span",{style:Ze},"\u884C\u6570"),f.a.createElement(j.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},f.a.createElement(it.a,null)),f.a.createElement("span",{style:Ze},"\u5217\u6570"),f.a.createElement(j.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},f.a.createElement(it.a,null))),f.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},f.a.createElement("span",{style:Ze},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),f.a.createElement(j.a.Item,{name:"align"},f.a.createElement(ze,null,f.a.createElement(at.a,{value:"default"},f.a.createElement("i",{className:"fa fa-align-justify"})),f.a.createElement(at.a,{value:"left"},f.a.createElement("i",{className:"fa fa-align-left"})),f.a.createElement(at.a,{value:"center"},f.a.createElement("i",{className:"fa fa-align-center"})),f.a.createElement(at.a,{value:"right"},f.a.createElement("i",{className:"fa fa-align-right"}))))),f.a.createElement("div",{className:"flex-container flex-end"},f.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(A.a,{type:"ghost",onClick:$e},"\u53D6\u6D88")))},de=k("ErOA"),Se=k("7Cbv"),Le="link",De="upload-image",qe="code-block",lt="add-table",mt="------------",gt={default:mt,left:":".concat(mt),center:":".concat(mt,":"),right:"".concat(mt,":")},Ct=k("9VGf"),xt,Ae;function Ce(){}var Ve=0,Qe=1e4,Pe="\u2581",Fe=`
|
|
**\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 be(Te){return/^\d+$/.test(Te)?"".concat(Te,"px"):Te}var fe=navigator.platform.toUpperCase().indexOf("MAC")>=0,pe=fe?"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"],ae=(xt={},Object(W.a)(xt,pe+"-B","bold"),Object(W.a)(xt,pe+"-I","italic"),xt),ce=(Ae={},Object(W.a)(Ae,Le,"\u6DFB\u52A0\u94FE\u63A5"),Object(W.a)(Ae,qe,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(W.a)(Ae,De,"\u6DFB\u52A0\u6587\u4EF6"),Object(W.a)(Ae,lt,"\u6DFB\u52A0\u8868\u683C"),Ae),me=oe.a=function(Te){var ke=Te.defaultValue,$e=ke===void 0?"":ke,pt=Te.onChange,Ot=Te.width,vt=Ot===void 0?"100%":Ot,st=Te.height,Ke=st===void 0?400:st,Ge=Te.miniToolbar,Ue=Ge===void 0?!1:Ge,le=Te.isFocus,_e=le===void 0?!1:le,Xe=Te.watch,Be=Te.insertTemp,ct=Te.mode,ft=ct===void 0?"markdown":ct,Ie=Te.id,Je=Ie===void 0?"markdown-editor-id":Ie,tt=Te.showResizeBar,_t=tt===void 0?!1:tt,Tt=Te.noStorage,Zt=Tt===void 0?!1:Tt,nn=Te.showNullButton,Qt=nn===void 0?!1:nn,Lt=Te.hidetoolBar,On=Lt===void 0?!1:Lt,un=Te.fullScreen,fn=un===void 0?!1:un,Xt=Te.onBlur,mn=Te.onCMBeforeChange,Pn=Te.onFullScreen,zn=Te.className,dt=zn===void 0?"":zn,Rt=Te.disablePaste,Vn=Rt===void 0?!1:Rt,pr=Te.placeholder,ur=pr===void 0?"":pr,kr=Te.values,J=kr===void 0?"":kr,I=Object(m.useState)(null),R=Object(G.a)(I,2),K=R[0],ee=R[1],Y=Object(m.useState)($e),Ee=Object(G.a)(Y,2),Ye=Ee[0],ut=Ee[1],yt=Object(m.useState)(Xe),He=Object(G.a)(yt,2),Et=He[0],It=He[1],Pt=Object(m.useState)(fn),qt=Object(G.a)(Pt,2),At=qt[0],tn=qt[1],en=Object(m.useState)(""),kn=Object(G.a)(en,2),Gt=kn[0],An=kn[1],Rn=Object(m.useState)(0),In=Object(G.a)(Rn,2),Sn=In[0],Dn=In[1],Hn=Object(m.useState)(Ke),ar=Object(G.a)(Hn,2),Xn=ar[0],xn=ar[1],Bn=Object(m.useState)(!1),pn=Object(G.a)(Bn,2),yn=pn[0],bn=pn[1],zt=Object(m.useRef)(Object(Se.a)()),wt=Object(m.useRef)(!1),Wt=Object(m.useRef)(),bt=Object(m.useRef)(),Jt=Object(m.useRef)(),Nt=Object(m.useRef)(),Yn=Object(m.useRef)(),cn=function(){var jt=Object(M.a)(D.a.mark(function Yt(){var Kt,rn;return D.a.wrap(function(Cn){for(;;)switch(Cn.prev=Cn.next){case 0:return Cn.next=2,Object(de.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:zt.current}});case 2:rn=Cn.sent,rn!=null&&(Kt=rn.attachments)!==null&&Kt!==void 0&&Kt.length&&(console.log("cm:",K,bt),rn.attachments.map(function(dn){dn.content_type.indexOf("image")>-1?K.replaceSelection(".concat(dn.content_type,")")):dn.content_type.indexOf("video")>-1?K.replaceSelection('<video width="100%" controls src="'.concat(p.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):dn.content_type.indexOf("pdf")>-1?K.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(dn.id,"?type=").concat(dn.content_type,'&disposition=inline" target="_blank">').concat(dn.name,"</a>")):K.replaceSelection("[".concat(dn.name,"](").concat(p.a.API_SERVER,"/api/attachments/").concat(dn.id,"?type=").concat(dn.content_type,")"))}));case 4:case"end":return Cn.stop()}},Yt)}));return function(){return jt.apply(this,arguments)}}();Object(m.useEffect)(function(){ut(J),K==null||K.setValue(J)},[J]),Object(m.useEffect)(function(){Pn==null||Pn(At)},[At]),Object(m.useEffect)(function(){if(bt.current){var jt=c.a.fromTextArea(bt.current,{mode:ft,lineNumbers:!Ue,lineWrapping:!0,value:$e,autoCloseTags:!0,autoCloseBrackets:!0});_e&&jt.focus();function Yt(Kt,rn){if(Vn){rn.preventDefault();return}var on=rn.clipboardData;if(on){var Cn=on.types.toString(),dn=on.items;if(Cn==="Files"||on.types.indexOf("Files")>-1){if(rn.preventDefault(),ft=="stex")return;try{var jn,or=dn[1];((jn=dn[0])===null||jn===void 0?void 0:jn.kind)==="file"&&(or=dn[0]);var an=or.getAsFile(),_r=an.name.split(".").pop();Me(an,function(Tn){if(Tn.id){var qn,er,mr;(an==null||((qn=an.type)===null||qn===void 0)?void 0:qn.indexOf("image"))>-1?jt.replaceSelection(".concat(Tn.content_type,")")):(an==null||((er=an.type)===null||er===void 0)?void 0:er.indexOf("video"))>-1?jt.replaceSelection('<video width="100%" controls src="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Tn.id,'"></video>')):(an==null||((mr=an.type)===null||mr===void 0)?void 0:mr.indexOf("pdf"))>-1?jt.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Tn.id,"?type=").concat(an.type,'&disposition=inline" target="_blank">').concat(an.name,"</a>")):ie.includes(_r)?jt.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Tn.id,'?type=office&disposition=inline" target="_blank">').concat(an.name,"</a>")):jt.replaceSelection("[".concat(an.name,"](").concat(p.a.API_SERVER,"/api/attachments/").concat(Tn.id,"?type=").concat(Tn.content_type,")"))}else(Tn==null?void 0:Tn.status)===401&&(document.location.href="/user/login")})}catch(Tn){U.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return jt.on("paste",Yt),jt.on("dragleave",function(Kt,rn){Jt.current.classList.remove("mouse-hover-md")}),jt.on("dragover",function(Kt,rn){Jt.current.classList.add("mouse-hover-md")}),jt.on("drop",function(Kt,rn){Jt.current.classList.add("mouse-hover-md");var on;if(on=rn.dataTransfer.files,on.length>0){rn.preventDefault(),rn.stopPropagation();for(var Cn=function(or){var an=on[or],_r=an.name.split(".").pop();Me(an,function(Tn){if(Tn.id){var qn,er,mr;(an==null||((qn=an.type)===null||qn===void 0)?void 0:qn.indexOf("image"))>-1?jt.replaceSelection(".concat(Tn.content_type,")")):(an==null||((er=an.type)===null||er===void 0)?void 0:er.indexOf("video"))>-1?jt.replaceSelection('<video width="100%" controls src="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Tn.id,'"></video>')):(an==null||((mr=an.type)===null||mr===void 0)?void 0:mr.indexOf("pdf"))>-1?jt.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Tn.id,"?type=").concat(an.type,'&disposition=inline" target="_blank">').concat(an.name,"</a>")):ie.includes(_r)?jt.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Tn.id,'?type=office&disposition=inline" target="_blank">').concat(an.name,"</a>")):jt.replaceSelection("[".concat(an.name,"](").concat(p.a.API_SERVER,"/api/attachments/").concat(Tn.id,"?type=").concat(Tn.content_type,")"))}else(Tn==null?void 0:Tn.status)===401&&(document.location.href="/user/login")})},dn=0;dn<on.length;dn++)Cn(dn)}}),ee(jt),function(){jt.off("paste",Yt)}}},[]);var Qn=Object(m.useCallback)(function(){if(Jt.current)try{}catch(jt){console.log(jt,"---- to set md editor body height")}},[Xn,Jt,At]);Object(m.useEffect)(function(){function jt(){var Kt=new o.default(function(rn){var on=Object(P.a)(rn),Cn;try{for(on.s();!(Cn=on.n()).done;){var dn=Cn.value;(dn.target.offsetHeight>0||dn.target.offsetWidth>0)&&(Qn(),K.setSize("100%","100%"),K.refresh())}}catch(jn){on.e(jn)}finally{on.f()}});return Kt.observe(bt.current.parentElement),Kt}if(K){var Yt=jt();return function(){Yt.unobserve(bt.current.parentElement)}}},[K,Qn]),Object(m.useEffect)(function(){if(K){for(var jt=[],Yt=function(){var dn=rn[Kt];on=Object(G.a)(dn,2);var jn=on[0],or=on[1],an=Object(W.a)({},jn,function(){Kr(or)});jt.push(an),K.addKeyMap(an)},Kt=0,rn=Object.entries(ae);Kt<rn.length;Kt++){var on;Yt()}return Wt.current=setInterval(function(){wt.current&&cn()},4e3),function(){clearInterval(Wt.current);var Cn=Object(P.a)(jt),dn;try{for(Cn.s();!(dn=Cn.n()).done;){var jn=dn.value;K.removeKeyMap(jn)}}catch(or){Cn.e(or)}finally{Cn.f()}}}},[K]),Object(m.useEffect)(function(){fn!==At&&tn(fn)},[fn]),Object(Ct.a)(function(){if(!Zt&&Sn>0){var jt=new Date().getTime(),Yt=window.sessionStorage.getItem(Je);jt>=Sn+Qe&&(!Yt||Yt!==Ye)&&(window.sessionStorage.setItem(Je,Ye),bn(!0))}},Qe),Object(m.useEffect)(function(){It(Xe)},[K,Xe]),Object(m.useEffect)(function(){K&&(_e&&K.focus())},[K,_e]),Object(m.useEffect)(function(){if(Et&&K){var jt=K.getScrollerElement();function Yt(Kt){var rn=Kt.target;if(Yn.current){var on=rn.scrollTop/rn.scrollHeight;Yn.current.scrollTop=Yn.current.scrollHeight*on}}return jt.addEventListener("scroll",Yt),function(){jt.removeEventListener("scroll",Yt)}}},[K,Et]),Object(m.useEffect)(function(){if(K&&mn){function jt(Yt,Kt){mn(Yt,Kt)}return K.on("beforeChange",jt),function(){K.off("beforeChange",jt)}}},[K,mn]),Object(m.useEffect)(function(){if(K&&Xt){function jt(){Xt(K.getValue())}return K.on("blur",jt),function(){K.off("blur",jt)}}},[K,Xt]),Object(m.useEffect)(function(){if(K){function jt(Yt){var Kt=Yt.getValue();ut(Kt),Dn(new Date().getTime()),Yt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),pt&&pt(Kt)}return K.on("change",jt),function(){K.off("change",jt)}}},[K,pt]),Object(m.useEffect)(function(){K&&($e==null?(K.setValue(""),ut("")):$e!==K.getValue()&&(K.setValue($e),ut($e),K.setCursor(K.lineCount(),0)))},[K,$e]);var Kr=Object(m.useCallback)(function(jt){var Yt=K.getCursor(),Kt=K.getSelection(),rn=Kt.split(`
|
|
`);switch(jt){case"bold":return K.replaceSelection("**"+Kt+"**"),Kt===""&&K.setCursor(Yt.line,Yt.ch+2),K.focus();case"italic":return K.replaceSelection("*"+Kt+"*"),Kt===""&&K.setCursor(Yt.line,Yt.ch+1),K.focus();case"code":return K.replaceSelection("`"+Kt+"`"),Kt===""&&K.setCursor(Yt.line,Yt.ch+1),K.focus();case"inline-latex":return K.replaceSelection("`$$"+Kt+"$$`"),Kt===""&&K.setCursor(Yt.line,Yt.ch+3),K.focus();case"latex":return K.replaceSelection("```latex\n"+Kt+"\n```"),K.setCursor(Yt.line+1,Kt.length+1),K.focus();case"line-break":return K.replaceSelection(`<br/>
|
|
`),K.focus();case"list-ul":return Kt===""?K.replaceSelection("- "+Kt):K.replaceSelection(rn.map(function(on){return on===""?"":"- ".concat(on)}).join(`
|
|
`)),K.focus();case"list-ol":return Kt===""?K.replaceSelection("1. "+Kt):K.replaceSelection(rn.map(function(on,Cn){return on===""?"":"".concat(Cn+1,". ").concat(on)}).join(`
|
|
`)),K.focus();case"add-null-ch":return Kt===""&&K.setCursor(Yt.line,Yt.ch+1),K.replaceSelection(Pe),K.focus();case"inster-template-1":return Kt===""&&K.setCursor(Yt.line,Yt.ch),K.replaceSelection(Fe),K.focus();case"eraser":return K.setValue(""),K.focus();case"trigger-watch":return It(!Et),K.focus();case"trigger-full-screen":return tn(!At),K.focus();case Le:An(Le);return;case qe:An(qe);return;case De:An(De);return;case lt:An(lt);return;default:throw new Error}},[K,Et,At]),wr=Object(m.useCallback)(function(jt){An("");switch(Gt){case Le:var Yt=jt.title,Kt=jt.link;return K.replaceSelection("[".concat(Yt,"](").concat(Kt,")")),K.focus();case qe:var rn=jt.language,on=jt.content;return K.replaceSelection(["```"+rn,on,"```"].join(`
|
|
`)),K.focus();case De:var Cn=jt.src,dn=jt.alt;return dn?K.replaceSelection(".concat(Cn,' "').concat(dn,'" )')):K.replaceSelection("")),K.focus();case lt:for(var jn=jt.row,or=jt.col,an=jt.align,_r=`
|
|
`,Tn=0;Tn<jn;Tn++){for(var qn=[],er=[],mr=0;mr<or;mr++)Tn===1&&er.push(gt[an]),qn.push(" ");Tn===1&&(_r+="| ".concat(er.join(" | "),` |
|
|
`)),_r+="| ".concat(qn.join(or===1?"":" | "),` |
|
|
`)}return K.replaceSelection(_r+`
|
|
`),K.focus();default:throw new Error}},[K,Gt]),Vr=Object(m.useMemo)(function(){switch(Gt){case Le:return f.a.createElement(ne,{callback:wr,onCancel:Nr});case qe:return f.a.createElement(se.b,{callback:wr,onCancel:Nr});case De:return f.a.createElement(he,{callback:wr,onCancel:Nr});case lt:return f.a.createElement(ot,{callback:wr,onCancel:Nr});default:return null}},[Gt]);function Nr(){An("")}Object(m.useEffect)(function(){if(Nt.current){var jt=Nt.current,Yt=!1,Kt=0;function rn(dn){Yt=!0,Kt=dn.pageY}function on(){Yt=!1}function Cn(dn){if(Yt){var jn=dn.pageY-Kt;jn<0&&(jn=0),jn>300&&(jn=300);var or=Ke+jn+"px";xn(or)}}return jt.addEventListener("mousedown",rn),document.addEventListener("mousemove",Cn),document.addEventListener("mouseup",on),function(){jt.removeEventListener("mousedown",rn),document.removeEventListener("mousemove",Cn),document.removeEventListener("mouseup",on)}}},[K,Nt]),Object(m.useEffect)(function(){xn(Ke)},[Ke]);var Rr=be(vt),Gr=be(Xn),Kn={width:Rr,height:Gr},Ht=Object(m.useMemo)(function(){if(Sn){var jt=new Date(Sn),Yt=jt.getHours(),Kt=jt.getMinutes(),rn=jt.getSeconds();return Yt=Yt<10?"0"+Yt:Yt,Kt=Kt<10?"0"+Kt:Kt,rn=rn<10?"0"+rn:rn,"".concat(Yt,":").concat(Kt,":").concat(rn)}return 0},[Sn]);function Xr(){window.sessionStorage.removeItem(Je),bn(!1),Dn(0)}function br(){bn(!1),Dn(0),K.setValue(window.sessionStorage.getItem(Je))}function ni(jt,Yt){var Kt=K.getValue();Kt=Kt.replace(jt,Yt),ut(Kt),K==null||K.setValue(Kt)}return f.a.createElement(m.Fragment,null,f.a.createElement("div",{className:"markdown-editor-wrapper",ref:Jt},f.a.createElement("div",{className:"markdown-editor-container ".concat(dt," ").concat(Et?"on-preview":""," ").concat(Ue?"mini":""," ").concat(At?"full-screen":""),style:Kn},f.a.createElement(v,{insertTemp:Be,watch:Et,fullScreen:At,showNullButton:Qt,onActionCallback:Kr,hidetoolBar:On,uuid:zt.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:bt,placeholder:ur})),Et?f.a.createElement("div",{ref:Yn,className:"preview-container"},ft==="stex"&&f.a.createElement(L,{value:Ye}),ft!=="stex"&&f.a.createElement(x.a,{edit:!0,value:Ye,replaces:ni})):null))),_t?f.a.createElement("a",{ref:Nt,className:"editor-resize"}):null,f.a.createElement(N.a,null,ce[Gt]?f.a.createElement(X.a,{centered:!0,title:ce[Gt],visible:!0,onCancel:Nr,footer:null,className:"markdown-popup-form"},Vr):null))}},PD8m:function(je,oe){je.exports={name:"memoryStorage",read:Z,write:X,each:P,remove:V,clearAll:U};var k={};function Z(M){return k[M]}function X(M,G){k[M]=G}function P(M){for(var G in k)k.hasOwnProperty(G)&&M(k[G],G)}function V(M){delete k[M]}function U(M){k={}}},QUZ3:function(je,oe,k){"use strict";k.r(oe);var Z=k("0Owb"),X=k("PpiC"),P=k("OaEy"),V=k("2fM7"),U=k("T2oS"),M=k("W9HT"),G=k("+L6B"),W=k("2/Rp"),n=k("9og8"),D=k("2qtc"),m=k("kLXV"),f=k("tJVT"),h=k("k1fw"),c=k("aHsQ"),o=k("sGsY"),d=k("WmNS"),i=k.n(d),a=k("q1tI"),r=k.n(a),s=k("Icgb"),S=k("Fvcw"),w=k("GIiI"),x=k("Ty5D"),L=k("55Ip"),O=k("OJz4"),_=k("V0Rq"),b=k("bntm"),g=k("cDPC"),p=k("m3rI"),C=k("RCxd"),E=k("EHPI"),v=k("S+dL"),N=k.n(v),F=k("J66h"),A=k("uMZB"),H=k.n(A),j=k("p/48"),T=k("JPnl"),z=k("y8nQ"),Q=k("Vl3Y"),ne=k("5NDa"),se=k("5rEg"),xe=se.a.TextArea,ge=5e3,ve=function(R){var K=R.callback,ee=R.onCancel,Y=R.notes;function Ee(Ye){K(Ye)}return r.a.createElement(Q.a,{className:"note-form-panel",onFinish:Ee,initialValues:{notes:Y}},r.a.createElement(Q.a.Item,{name:"notes",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9"},{max:ge,message:"\u7B14\u8BB0\u6700\u5927\u5B57\u6570\u4E3A".concat(ge)}]},r.a.createElement(xe,{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:ee,style:{marginRight:10}}," ","\u53D6\u6D88"," "),r.a.createElement(W.a,{type:"primary",htmlType:"submit"}," ","\u63D0\u4EA4"," ")))},Oe=k("bbsP"),Re=k("/wGt"),he=k("DjyN"),ue=k("NUBc"),Me=k("H2Ag"),et=k.n(Me),it=k("miYZ"),nt=k("tsqr"),at=k("g9YV"),ze=k("wCAj"),Ze=k("+k/U"),ot=k.n(Ze),de=k("ye1Q"),Se=k("lfch"),Le=k("JB8y"),De=k("p5ED"),qe=k("ErOA"),lt=k("wd/R"),mt=k.n(lt),gt=ze.a.Column,Ct=function(R){var K,ee=R.submitResult,Y=R.submitting,Ee=R.submitRecords,Ye=R.page,ut=R.onPageChange,yt=R.topicId,He=ee||{},Et=He.status,It=He.id,Pt=He.input,qt=He.output,At=He.expected_output,tn=He.is_file,en=He.input_file_url,kn=He.output_file_url,Gt=He.expected_output_file_url,An=He.error_msg,Rn=Ee||{},In=Rn.records,Sn=Rn.records_count,Dn=Object(a.useState)(""),Hn=Object(f.a)(Dn,2),ar=Hn[0],Xn=Hn[1],xn=Object(a.useState)(""),Bn=Object(f.a)(xn,2),pn=Bn[0],yn=Bn[1],bn=Object(x.h)(),zt=(bn==null||((K=bn.query)===null||K===void 0)?void 0:K.type)==="1";function wt(){tn?navigator.clipboard.writeText(F.Base64.decode(An)).then(function(){nt.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")}):navigator.clipboard.writeText(F.Base64.decode(qt)).then(function(){nt.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")})}return r.a.createElement(M.a,{spinning:Y,tip:"\u8BC4\u6D4B\u4E2D...",indicator:r.a.createElement(de.a,{style:{fontSize:24},spin:!0})},It?r.a.createElement(r.a.Fragment,null,r.a.createElement("ul",{className:ot.a.info},r.a.createElement("li",null,"\u6267\u884C\u7ED3\u679C\uFF1A",r.a.createElement("span",{className:Et===Le.a.OK?"c-green":"c-red"},T.a[Et])),r.a.createElement("li",{className:ot.a.error},r.a.createElement("a",{onClick:wt},"\u590D\u5236\u9519\u8BEF\u4FE1\u606F ",r.a.createElement(Se.a,null)," ")),r.a.createElement("li",null,r.a.createElement(L.a,{to:"/myproblems/".concat(yt,"/record-detail/").concat(It)},"\u663E\u793A\u8BE6\u60C5 >"," "))),Et!==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,!tn&&Pt,tn&&r.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(n.a)(i.a.mark(function Wt(){var bt;return i.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:return Nt.next=2,fetch(en,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 2:return bt=Nt.sent,Nt.t0=yn,Nt.next=6,bt.text();case 6:Nt.t1=Nt.sent,(0,Nt.t0)(Nt.t1),setTimeout(function(){Xn(en)},200);case 9:case"end":return Nt.stop()}},Wt)}))},Pt)),r.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),r.a.createElement("pre",null,(Et===4||Et===5)&&F.Base64.decode(An),Et!=4&&Et!=5&&(tn?r.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(n.a)(i.a.mark(function Wt(){var bt;return i.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:return Nt.next=2,Object(qe.a)(kn,{method:"Get",headers:{"Content-Type":"application/xml",Accept:"*/*"}});case 2:bt=Nt.sent;try{yn(bt)}catch(Yn){yn("")}setTimeout(function(){Xn(kn)},200);case 5:case"end":return Nt.stop()}},Wt)}))},qt):F.Base64.decode(qt))),r.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),r.a.createElement("pre",null,!tn&&F.Base64.decode(At),tn&&r.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(n.a)(i.a.mark(function Wt(){var bt;return i.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:return Nt.next=2,fetch(Gt,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 2:return bt=Nt.sent,Nt.t0=yn,Nt.next=6,bt.text();case 6:Nt.t1=Nt.sent,(0,Nt.t0)(Nt.t1),setTimeout(function(){Xn(Gt)},200);case 9:case"end":return Nt.stop()}},Wt)}))},At))):null):null,(In==null?void 0:In.length)>0?r.a.createElement(ze.a,{dataSource:In,rowKey:"id",pagination:!1},r.a.createElement(gt,{title:"\u63D0\u4EA4\u65F6\u95F4",dataIndex:"created_at",key:"created_at",render:function(bt,Jt){return r.a.createElement("span",null," ",mt()(bt).format("YYYY-MM-DD HH:mm:ss"))}}),r.a.createElement(gt,{title:"\u63D0\u4EA4\u7ED3\u679C",dataIndex:"status",key:"status",render:function(bt,Jt){var Nt;return r.a.createElement(L.a,{className:bt===0?"c-green":"c-red",to:"/myproblems/".concat(yt,"/record-detail/").concat(Jt.id)},(Nt=T.a[bt])===null||Nt===void 0?void 0:Nt.replace("\u8C03\u8BD5","\u8BC4\u6D4B"))}}),r.a.createElement(gt,{title:"\u6267\u884C\u7528\u65F6 (".concat(zt?"MS":"S",")"),dataIndex:"execute_time",key:"execute_time",render:function(bt){return bt?zt?bt:bt/1e3:""}}),r.a.createElement(gt,{title:"\u5185\u5B58\u6D88\u8017\uFF08".concat(zt?"KB":"MB","\uFF09"),dataIndex:"execute_memory",key:"execute_memory",render:function(bt){return bt?zt?bt:parseFloat((bt/1024).toFixed(2)):""}}),r.a.createElement(gt,{title:"\u8BED\u8A00",dataIndex:"language",key:"language"}),r.a.createElement(gt,{title:"\u64CD\u4F5C",dataIndex:"status",key:"status",render:function(bt,Jt){return r.a.createElement(L.a,{className:"c-light-primary",to:"/myproblems/".concat(yt,"/record-detail/").concat(Jt.id)},"\u67E5\u770B")}})):r.a.createElement("div",{style:{height:300,width:"100%"}}),Sn>15?r.a.createElement(ue.a,{className:ot.a.pagination,current:Ye,pageSize:15,total:Sn,onChange:ut}):null,r.a.createElement(De.a,{close:!0,data:ar,type:ar.length?"txt":"",onClose:function(){return Xn("")},monacoEditor:{value:pn,language:"txt",onChange:function(){},options:{fontSize:14,readOnly:!0,minimap:{enabled:!1}}}}))},xt=k("BdwD"),Ae=k("DYRE"),Ce=k("zeV3"),Ve=k("+BJd"),Qe=k("mr32"),Pe=k("pPuO"),Fe=k.n(Pe),be=k("9Bee"),fe={1:{name:"\u7B80\u5355",color:"#52c41a"},2:{name:"\u4E2D\u7B49",color:"#faad14"},3:{name:"\u56F0\u96BE",color:"#f5222d"}},pe=function(R){var K=R.hack,ee=R.onTriggerPraise,Y=R.toDiscuss,Ee=K.language,Ye=K.difficult,ut=K.time_limit,yt=K.username,He=K.user_path,Et=K.user_praise,It=K.comments_count,Pt=K.praises_count,qt=K.description,At=K.pass_count,tn=K.submit_count,en=Object(x.h)(),kn=fe[Ye];return r.a.createElement(r.a.Fragment,null,r.a.createElement("ul",{className:Fe.a.info},r.a.createElement("li",null,"\u7F16\u7A0B\u8BED\uFF1A",r.a.createElement("b",null,Ee)),r.a.createElement("li",null,"\u96BE\u5EA6\uFF1A",r.a.createElement(Qe.a,{color:kn.color},kn.name)),r.a.createElement("li",null,"\u8BC4\u6D4B\u65F6\u957F\u9650\u5236\uFF1A",r.a.createElement("b",null,ut,"\u79D2"))),r.a.createElement(be.a,{value:qt,className:Fe.a.desc}),r.a.createElement("ul",{className:Fe.a["commit-info"]},r.a.createElement("li",null,r.a.createElement(Ce.a,{size:4},r.a.createElement("span",null,"\u901A\u8FC7\u6B21\u6570")," ",r.a.createElement("b",null,At))),r.a.createElement("li",null,r.a.createElement(Ce.a,{size:4},r.a.createElement("span",null,"\u63D0\u4EA4\u6B21\u6570")," ",r.a.createElement("b",null,tn))," "),r.a.createElement("li",{style:{flex:"1 0 0"}}),en.query.type!=="exercises"&&r.a.createElement("li",null,r.a.createElement(Ce.a,{size:4},r.a.createElement("i",{className:"iconfont icon-huifu1",onClick:Y})," ",r.a.createElement("b",null,It))," ")))},ie=k("dhSg"),ae=k("oBTY"),ce=k("M8RZ"),me=k("qJ4+");function Te(R,K){return Object(qe.c)("/problems/".concat(R,"/comments.json?page=").concat(K,"&limit=10"))}function ke(R){return Object(qe.f)("/discusses/".concat(R,"/plus.json"),{container_type:"Discuss",type:1})}function $e(R,K,ee){return Object(qe.f)("/problems/".concat(R,"/comments/reply.json"),{comments:{content:ee,parent_id:K}})}function pt(R,K){return Object(qe.f)("/problems/".concat(R,"/comments.json"),{comments:{content:K}})}function Ot(R,K,ee){return Object(qe.f)("/problems/".concat(R,"/comments/").concat(K,"/hidden.json"),ee)}function vt(R,K){return Object(qe.b)("/problems/".concat(R,"/comments/").concat(K))}var st=k("U7T7"),Ke=k("AMnG");function Ge(R){var K=R.author;return r.a.createElement("a",{href:"/users/".concat(K.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(K.image_url),width:"50"}))}function Ue(R){var K=R.data,ee=R.index,Y=R.parentDiscussIndex,Ee=R.user,Ye=R.onSetActionType,ut=K.author,yt=K.can_delete,He=K.content,Et=K.id,It=K.time;function Pt(){Ye({id:Et,index:ee,type:"delete-discuss",parentDiscussIndex:Y,message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}var qt=Ee.admin||yt||ut.user_id===Ee.user_id;return r.a.createElement("div",{className:"discuss-item-container second-discuss "},r.a.createElement(Ge,{author:ut}),r.a.createElement("section",null,r.a.createElement("div",{className:"discuss-info"},r.a.createElement("a",{href:"/users/".concat(ut.login),target:"_blank"},ut.name),r.a.createElement("span",{className:"grey"},It),r.a.createElement("div",{className:"btn-group",style:{marginBottom:0}},qt?r.a.createElement("a",{onClick:Pt,title:"\u5220\u9664"},r.a.createElement("i",{className:"iconfont icon-shanchu"})):null)),r.a.createElement(be.a,{className:"discuss-content",value:He})))}var le=function(R){var K=R.user,ee=R.data,Y=R.index,Ee=R.onPlusDiscuss,Ye=R.onSetActionType,ut=R.activeDiscussIndex,yt=R.onReplyDiscuss,He=R.onSetActiveDiscussIndex,Et=ee.content,It=ee.children,Pt=ee.hidden,qt=ee.id,At=ee.praise_count,tn=ee.time,en=ee.user_praise,kn=ee.can_delete,Gt=ee.author;function An(){He(qt)}function Rn(){Ee(qt,!en,Y)}function In(){Ye({id:qt,index:Y,type:"delete-discuss",message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}function Sn(){Ye({id:qt,index:Y,params:{hidden:Pt?"0":"1"},type:"hidden-discuss",message:Pt?"\u786E\u5B9A\u8981\u53D6\u6D88\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417":"\u786E\u5B9A\u8981\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417"})}var Dn=K.admin||K.user_id===Gt.user_id;return r.a.createElement("div",{className:"discuss-item-container",key:qt},r.a.createElement(Ge,{author:Gt}),r.a.createElement("section",null,r.a.createElement("div",{className:"discuss-info"},r.a.createElement("a",{href:"/users/".concat(Gt.login),target:"_blank"}," ",Gt.name," "),r.a.createElement("span",{className:"grey"},tn)),r.a.createElement(be.a,{className:"discuss-content",value:Et}),It&&It.length>0?r.a.createElement("div",{className:"reply-discuss-container"},It.map(function(Hn,ar){return r.a.createElement(Ue,{key:Hn.id,data:Hn,index:ar,user:K,onSetActionType:Ye,parentDiscussIndex:Y})})):null,r.a.createElement("div",{className:"btn-group"},Dn?r.a.createElement("a",{onClick:Sn,title:Pt?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF\u8BC4\u8BBA"},r.a.createElement("i",{className:Pt?"iconfont icon-yincangbiyan":"fa fa-eye"})):null,kn&&(!It||It.length==0)?r.a.createElement("a",{onClick:In,title:"\u5220\u9664"},r.a.createElement("i",{className:"iconfont icon-shanchu"})):null,r.a.createElement("a",{onClick:An,title:"\u56DE\u590D"}," ",r.a.createElement("i",{className:"iconfont icon-huifu1"})," "),r.a.createElement("a",{onClick:Rn,className:en?"c-orange":""},r.a.createElement("i",{className:en?"iconfont icon-dianzan mr3":"iconfont icon-dianzan-xian mr3 "}),r.a.createElement("span",null,At||""))),r.a.createElement(Ke.a,{id:qt,activeDiscussIndex:ut,onReplyDiscuss:yt})))},_e=k("kaH+"),Xe=k("uD2n"),Be=k.n(Xe),ct=k("Ot1p"),ft=function(R){var K=R.user_praise,ee=R.praise_count,Y=R.praisePlus,Ee=R.onCreateDiscuss,Ye=R.discuss_count,ut=Object(a.useState)(!1),yt=Object(f.a)(ut,2),He=yt[0],Et=yt[1],It=Object(a.useState)(""),Pt=Object(f.a)(It,2),qt=Pt[0],At=Pt[1];function tn(Rn){At(Rn)}function en(){Et(!0)}function kn(){Et(!1)}function Gt(){return An.apply(this,arguments)}function An(){return An=Object(n.a)(i.a.mark(function Rn(){return i.a.wrap(function(Sn){for(;;)switch(Sn.prev=Sn.next){case 0:Ee(qt),At(""),Et(!1);case 3:case"end":return Sn.stop()}},Rn)})),An.apply(this,arguments)}return r.a.createElement("div",{className:"".concat(Be.a["dis-input-editor-container"]," ").concat(He?Be.a.active:""," "),style:{paddingLeft:"100px"}},r.a.createElement("div",{className:He?"hide ".concat(Be.a["text-area"]):Be.a["text-area"]},r.a.createElement("input",{placeholder:"\u8BF4\u70B9\u4EC0\u4E48",onClick:en}),r.a.createElement("a",null," ",r.a.createElement("i",{className:"iconfont icon-huifu1"})," \xA0 \xA0",Ye," "),r.a.createElement("a",{className:"c-light-black",onClick:Y,title:K?"\u53D6\u6D88\u70B9\u8D5E":"\u70B9\u8D5E"},r.a.createElement("i",{className:"mr3 ".concat(K?"iconfont icon-dianzan c-orange":"iconfont icon-dianzan-xian"," ")}),ee?r.a.createElement("span",null,ee):"")),He?r.a.createElement("div",{className:Be.a["input-mask"],onClick:kn}):null,r.a.createElement("div",{className:He?Be.a["md-container"]:"".concat(Be.a["md-container"]," hide")},r.a.createElement(ct.a,{id:"discuss-input-editor",miniToolbar:!0,watch:!1,noStorage:!0,defaultValue:qt,height:240,onChange:tn}),r.a.createElement("div",{className:Be.a["tip-container"],onClick:kn},r.a.createElement("a",{className:Be.a["btn-send"],onClick:Gt}," ","\u53D1\u9001"," "))))},Ie={loading:!1,page:1,data:[],count:0,actionType:null,activeDiscussIndex:null},Je;(function(R){R[R.GET_DISCUSSES=0]="GET_DISCUSSES",R[R.TOP_OR_DOWN_DISCUSS=1]="TOP_OR_DOWN_DISCUSS",R[R.ACTIVE_DISCUSS_INDEX=2]="ACTIVE_DISCUSS_INDEX",R[R.PLUS_DISCUSS=3]="PLUS_DISCUSS",R[R.SET_ACTION_TYPE=4]="SET_ACTION_TYPE",R[R.SET_PAGE=5]="SET_PAGE",R[R.SHOW_DISCUSSES_LOADING=6]="SHOW_DISCUSSES_LOADING"})(Je||(Je={}));function tt(R,K){switch(K.type){case Je.SHOW_DISCUSSES_LOADING:return Object(h.a)(Object(h.a)({},R),{},{loading:!0});case Je.GET_DISCUSSES:return Object(h.a)(Object(h.a)({},R),K.payload);case Je.TOP_OR_DOWN_DISCUSS:return Object(h.a)(Object(h.a)({},R),K.payload);case Je.SET_ACTION_TYPE:return Object(h.a)(Object(h.a)({},R),K.payload);case Je.PLUS_DISCUSS:return Object(h.a)(Object(h.a)({},R),K.payload);case Je.SET_PAGE:return Object(h.a)(Object(h.a)({},R),{},{page:K.payload});case Je.ACTIVE_DISCUSS_INDEX:return Object(h.a)(Object(h.a)({},R),K.payload);default:throw new Error}}var _t=function(R){var K=R.user,ee=R.identifier,Y=R.hack,Ee=R.onTriggerPraise,Ye=Object(a.useReducer)(tt,Ie),ut=Object(f.a)(Ye,2),yt=ut[0],He=ut[1],Et=yt.loading,It=yt.page,Pt=yt.data,qt=yt.count,At=yt.actionType,tn=yt.activeDiscussIndex,en=Object(a.useCallback)(Object(n.a)(i.a.mark(function pn(){var yn,bn,zt;return i.a.wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:return He({type:Je.SHOW_DISCUSSES_LOADING}),Wt.next=3,Te(ee,It);case 3:yn=Wt.sent,bn=yn.comments,zt=yn.disscuss_count,He({type:Je.GET_DISCUSSES,payload:{data:bn,count:zt,loading:!1}});case 6:case"end":return Wt.stop()}},pn)})),[It,ee]);Object(a.useEffect)(function(){en()},[ee,It]);function kn(pn){He({type:Je.SET_PAGE,page:pn})}function Gt(pn){He({type:Je.SET_ACTION_TYPE,payload:{actionType:pn}})}function An(pn){tn===pn?He({type:Je.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:null}}):He({type:Je.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:pn}})}function Rn(pn,yn,bn){return In.apply(this,arguments)}function In(){return In=Object(n.a)(i.a.mark(function pn(yn,bn,zt){var wt;return i.a.wrap(function(bt){for(;;)switch(bt.prev=bt.next){case 0:return bt.prev=0,bt.next=3,ke(yn);case 3:wt=bt.sent,Pt[zt].user_praise=bn,Pt[zt].praise_count=wt.praise_count,He({type:Je.PLUS_DISCUSS,payload:{data:Object(ae.a)(Pt)}}),bt.next=12;break;case 9:bt.prev=9,bt.t0=bt.catch(0),console.log(bt.t0);case 12:case"end":return bt.stop()}},pn,null,[[0,9]])})),In.apply(this,arguments)}function Sn(){return Dn.apply(this,arguments)}function Dn(){return Dn=Object(n.a)(i.a.mark(function pn(){var yn,bn,zt,wt,Wt,bt,Jt,Nt;return i.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:if(yn=At.id,bn=At.params,zt=At.type,wt=At.index,Wt=At.parentDiscussIndex,!(zt==="hidden-discuss")){cn.next=6;break}return cn.next=4,Ot(ee,yn,bn);case 4:Wt?Pt[Wt].children[wt].hidden=bn.hidden==1:Pt[wt].hidden=bn.hidden==1,He({type:Je.SET_ACTION_TYPE,payload:{actionType:null,data:Object(ae.a)(Pt)}});case 6:if(!(zt==="delete-discuss")){cn.next=31;break}return cn.next=9,vt(ee,yn);case 9:if(!(Wt||Wt===0)){cn.next=22;break}bt=Pt[Wt].children,Jt=bt.length-1;case 12:if(!(Jt>=0)){cn.next=19;break}if(!(bt[Jt].id===yn)){cn.next=16;break}return bt.splice(Jt,1),cn.abrupt("break",19);case 16:Jt--,cn.next=12;break;case 19:Pt[Wt].children=bt,cn.next=30;break;case 22:Nt=Pt.length-1;case 23:if(!(Nt>=0)){cn.next=30;break}if(!(Pt[Nt].id===yn)){cn.next=27;break}return Pt.splice(Nt,1),cn.abrupt("break",30);case 27:Nt--,cn.next=23;break;case 30:He({type:Je.SET_ACTION_TYPE,payload:{actionType:null,data:Object(ae.a)(Pt)}});case 31:case"end":return cn.stop()}},pn)})),Dn.apply(this,arguments)}function Hn(){He({type:Je.SET_ACTION_TYPE,payload:{actionType:null}})}function ar(pn,yn){return Xn.apply(this,arguments)}function Xn(){return Xn=Object(n.a)(i.a.mark(function pn(yn,bn){return i.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.prev=0,wt.next=3,$e(ee,yn,bn);case 3:en(),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()}},pn,null,[[0,6]])})),Xn.apply(this,arguments)}function xn(pn){return Bn.apply(this,arguments)}function Bn(){return Bn=Object(n.a)(i.a.mark(function pn(yn){return i.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:return He({type:Je.SHOW_DISCUSSES_LOADING}),zt.next=3,pt(ee,yn);case 3:en();case 4:case"end":return zt.stop()}},pn)})),Bn.apply(this,arguments)}return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{className:"discuss-panel"},Pt.length===0?r.a.createElement(xt.a,null):Pt.map(function(pn,yn){return r.a.createElement(le,{onReplyDiscuss:ar,onPlusDiscuss:Rn,onSetActiveDiscussIndex:An,onSetActionType:Gt,data:pn,index:yn,user:K,activeDiscussIndex:tn})}),qt>10?r.a.createElement("div",{className:"pagination-container"},r.a.createElement(ue.a,{showQuickJumper:!0,onChange:kn,current:It,total:qt})):null),r.a.createElement(ft,{user_praise:Y.user_praise,praise_count:Y.praises_count,praisePlus:Ee,discuss_count:Y.comments_count,onCreateDiscuss:xn}),r.a.createElement(ce.a,null,r.a.createElement(m.a,{centered:!0,title:"\u63D0\u793A",visible:!!At,onOk:Sn,onCancel:Hn},r.a.createElement("p",null,At?At.message:"")),r.a.createElement(_e.a,null)))},Tt=k("9kvl"),Zt={1:"\u7B80\u5355",2:"\u9002\u4E2D",3:"\u56F0\u96BE"},nn={1:"#2fa34f",2:"#0152d9",3:"#fa6400"},Qt=function(R){var K,ee=R.hack,Y=R.onTriggerPraise,Ee=R.topicId,Ye=R.page,ut=R.onPageChange,yt=R.user,He=R.submitRecords,Et=R.submitting,It=R.submitResult,Pt=Object(a.useState)("0"),qt=Object(f.a)(Pt,2),At=qt[0],tn=qt[1],en=Object(x.h)(),kn=Object(a.useState)(!1),Gt=Object(f.a)(kn,2),An=Gt[0],Rn=Gt[1],In=Object(a.useState)([]),Sn=Object(f.a)(In,2),Dn=Sn[0],Hn=Sn[1],ar=Object(a.useState)(Object(h.a)(Object(h.a)({},Object(x.i)()),{},{page:1,per_page:20,name:""})),Xn=Object(f.a)(ar,2),xn=Xn[0],Bn=Xn[1];function pn(wt){var Wt=wt.target.id;tn(Wt)}Object(a.useEffect)(function(){var wt=ie.a.subscribe("to-commit-info",function(){tn("1")});return wt},[]);function yn(){tn("2")}function bn(){return zt.apply(this,arguments)}function zt(){return zt=Object(n.a)(i.a.mark(function wt(){var Wt;return i.a.wrap(function(Jt){for(;;)switch(Jt.prev=Jt.next){case 0:return Jt.next=2,Object(qe.a)("/api/problems/my_hack_list.json",{method:"get",params:Object(h.a)({identifier:xn==null?void 0:xn.id},xn)});case 2:Wt=Jt.sent,Hn(Wt);case 4:case"end":return Jt.stop()}},wt)})),zt.apply(this,arguments)}return console.log(He,"submitRecords"),r.a.createElement("div",{className:et.a["left-panel"]},r.a.createElement("ul",{className:"".concat(et.a["s-navs"]," ").concat(et.a["bg-white"]," ").concat(et.a.b1)},r.a.createElement("li",null,r.a.createElement("a",{className:At==="0"?et.a.active:"",id:"0",onClick:pn},"\u4EFB\u52A1\u63CF\u8FF0")),r.a.createElement("li",null,r.a.createElement("a",{className:At==="1"?et.a.active:"",id:"1",onClick:pn},"\u63D0\u4EA4\u8BB0\u5F55")),en.query.type!=="exercises"&&r.a.createElement("li",null,r.a.createElement("a",{className:At==="2"?et.a.active:"",id:"2",onClick:pn},"\u8BC4\u8BBA"))),r.a.createElement("div",{className:"".concat(et.a["tab-panel-body"]," ").concat(At==="0"?"":"hide")},r.a.createElement(pe,{hack:ee,onTriggerPraise:Y,toDiscuss:yn})),r.a.createElement("div",{style:{padding:"0 12px"},className:"".concat(et.a["tab-panel-body"]," ").concat(At==="1"?"":"hide")},!!(He!=null&&He.records_count)||Et?r.a.createElement(Ct,{page:Ye,onPageChange:ut,topicId:Ee,submitting:Et,submitRecords:He,submitResult:It}):r.a.createElement(xt.a,null)),r.a.createElement("div",{className:"".concat(et.a["tab-panel-body"]," ").concat(At==="2"?"":"hide"),style:{padding:0}},r.a.createElement(_t,{user:yt,identifier:ee.identifier,hack:ee,onTriggerPraise:Y})),r.a.createElement(Re.a,{className:et.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(se.a.Search,{onSearch:function(Wt){xn.name=Wt,xn.page=1,Bn(Object(h.a)({},xn)),bn()},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(Wt){xn.page=1,xn.difficult=Wt||null,Bn(Object(h.a)({},xn)),bn()}},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(ue.a,{current:xn.page,className:"mt10 mb10",hideOnSinglePage:!0,total:Dn==null?void 0:Dn.count,pageSize:xn.per_page,onChange:function(Wt,bt){xn.page=Wt,xn.per_page=bt,bn()}})),width:530,placement:"left",onClose:function(){return Rn(!1)},visible:An},Dn==null||((K=Dn.data)===null||K===void 0)?void 0:K.map(function(wt,Wt){return r.a.createElement("div",{onClick:Object(n.a)(i.a.mark(function bt(){var Jt;return i.a.wrap(function(Yn){for(;;)switch(Yn.prev=Yn.next){case 0:return Yn.next=2,Object(qe.a)("/api/problems/".concat(wt==null?void 0:wt.identifier,"/start.json"),{method:"get",params:{hack_user_id:yt==null?void 0:yt.user_id}});case 2:Jt=Yn.sent,Jt&&(Tt.d.replace("/myproblems/".concat(Jt==null?void 0:Jt.identifier,"?type=1")),window.location.reload());case 4:case"end":return Yn.stop()}},bt)})),className:"".concat(et.a.list," ").concat(wt!=null&&wt.checked?et.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:nn[wt.difficult]}},Zt[wt.difficult]))})),(ee==null?void 0:ee.is_program)&&r.a.createElement("div",{onClick:function(){bn(),Rn(!0)},className:et.a.btns},r.a.createElement("i",{className:"iconfont icon-timuliebiao"}),r.a.createElement("span",null,"\u9898\u76EE\u5217\u8868")))},Lt=k("oFv4"),On=k.n(Lt),un=k("+aKw"),fn=k("S/kP"),Xt=k.n(fn),mn=k("t/PP"),Pn=k.n(mn),zn=o.a.Countdown,dt={Java:"java",C:"c",Python:"py","C++":"c"},Rt;(function(R){R[R.SET_LOADING=0]="SET_LOADING",R[R.GET_DATA=1]="GET_DATA",R[R.GET_SUBMIT_RECORDS=2]="GET_SUBMIT_RECORDS",R[R.SET_DATA=3]="SET_DATA",R[R.SET_DEBUGING=4]="SET_DEBUGING",R[R.SET_SUBMITING=5]="SET_SUBMITING",R[R.SET_EXECUTE_MESSAGE=6]="SET_EXECUTE_MESSAGE",R[R.SET_EXECUTE_RESULT=7]="SET_EXECUTE_RESULT",R[R.SET_SUBMIT_RESULT=8]="SET_SUBMIT_RESULT",R[R.SET_SHOW_NOTE=9]="SET_SHOW_NOTE",R[R.SET_PAGE=10]="SET_PAGE"})(Rt||(Rt={}));function Vn(){return new Date().getTime()}var pr={loading:!0,data:void 0,showNote:!1,debugResult:void 0,submitResult:void 0,debuging:!1,submitting:!1,submitRecords:void 0,submitRecordPage:1,executingMessage:""};function ur(R,K){switch(K.type){case Rt.GET_DATA:return Object(h.a)(Object(h.a)({},R),K.payload);case Rt.SET_DATA:return Object(h.a)(Object(h.a)({},R),{},{data:K.payload});case Rt.SET_LOADING:return Object(h.a)(Object(h.a)({},R),{},{loading:K.payload});case Rt.SET_SHOW_NOTE:return Object(h.a)(Object(h.a)({},R),{},{showNote:K.payload});case Rt.SET_DEBUGING:return Object(h.a)(Object(h.a)({},R),{},{debuging:K.payload});case Rt.SET_SUBMITING:return Object(h.a)(Object(h.a)({},R),{},{submitting:K.payload});case Rt.GET_SUBMIT_RECORDS:return Object(h.a)(Object(h.a)({},R),{},{submitRecords:K.payload});case Rt.SET_PAGE:return Object(h.a)(Object(h.a)({},R),{},{submitRecordPage:K.payload});case Rt.SET_EXECUTE_MESSAGE:return Object(h.a)(Object(h.a)({},R),{},{executingMessage:K.payload});case Rt.SET_EXECUTE_RESULT:return Object(h.a)(Object(h.a)({},R),K.payload);case Rt.SET_SUBMIT_RESULT:return Object(h.a)(Object(h.a)({},R),K.payload);default:throw new Error}}var kr=oe.default=function(R){var K,ee,Y,Ee,Ye=R.children,ut=Object(a.useReducer)(ur,pr),yt=Object(f.a)(ut,2),He=yt[0],Et=yt[1],It=Object(x.i)(),Pt=It.id,qt=Object(x.g)(),At=Object(x.h)(),tn=He.loading,en=He.data,kn=He.debugResult,Gt=He.submitResult,An=He.submitRecords,Rn=He.submitRecordPage,In=He.showNote,Sn=He.debuging,Dn=He.submitting,Hn=He.executingMessage,ar=Object(a.useState)("#FFF"),Xn=Object(f.a)(ar,2),xn=Xn[0],Bn=Xn[1],pn=Object(a.useState)(null),yn=Object(f.a)(pn,2),bn=yn[0],zt=yn[1],wt=Object(a.useState)({}),Wt=Object(f.a)(wt,2),bt=Wt[0],Jt=Wt[1],Nt=Object(a.useState)(!0),Yn=Object(f.a)(Nt,2),cn=Yn[0],Qn=Yn[1],Kr=Object(a.useState)(!1),wr=Object(f.a)(Kr,2),Vr=wr[0],Nr=wr[1],Rr=Object(a.useRef)(null),Gr=Object(a.useRef)(0),Kn=en==null?void 0:en.user,Ht=en==null?void 0:en.hack,Xr=Object(a.useRef)(),br=Object(a.useRef)();Object(a.useEffect)(function(){var ln;if(clearTimeout(Xr.current),clearTimeout(br.current),bt!=null&&(ln=bt.exercise)!==null&&ln!==void 0&&ln.left_time){var Bt,sn;if((bt==null||((Bt=bt.exercise)===null||Bt===void 0)?void 0:Bt.left_time)>1800){var kt;br.current=setTimeout(function(){m.a.info({content:"\u5F53\u524D\u8DDD\u79BB\u8003\u8BD5\u7ED3\u675F\u8FD8\u670930\u5206\u949F",icon:r.a.createElement(s.a,null),okText:"\u77E5\u9053\u4E86"})},((bt==null||((kt=bt.exercise)===null||kt===void 0)?void 0:kt.left_time)-1800)*1e3)}if((bt==null||((sn=bt.exercise)===null||sn===void 0)?void 0:sn.left_time)>900){var vn;Xr.current=setTimeout(function(){m.a.info({content:"\u5F53\u524D\u8DDD\u79BB\u8003\u8BD5\u7ED3\u675F\u8FD8\u670915\u5206\u949F",icon:r.a.createElement(s.a,null),okText:"\u77E5\u9053\u4E86"})},((bt==null||((vn=bt.exercise)===null||vn===void 0)?void 0:vn.left_time)-900)*1e3)}}},[bt]),Object(a.useEffect)(function(){function ln(){return Bt.apply(this,arguments)}function Bt(){return Bt=Object(n.a)(i.a.mark(function sn(){var kt,vn,Nn,tr,Sr,nr,En,Un,Yr,jr,Jn,vr;return i.a.wrap(function(sr){for(;;)switch(sr.prev=sr.next){case 0:return Qn(!0),sr.next=3,Object(O.d)(Pt);case 3:if(kt=sr.sent,setTimeout(function(){Qn(!1)},800),kt.status===401)document.location.href="/user/login";else{try{kt.hack.code=F.Base64.decode(kt.hack.code)}catch(zr){console.log(zr)}kt.hack=Object(h.a)(Object(h.a)({},kt.hack),{},{is_program:(At==null||((vn=At.query)===null||vn===void 0)?void 0:vn.type)==="1"}),Et({type:Rt.GET_DATA,payload:{loading:!1,data:kt}})}if(!(At.query.type==="exercises")){sr.next=18;break}if(!(At.query.coursesId=="coursesId")){sr.next=13;break}return sr.next=10,Object(_.Z)({categoryId:At.query.exercisesId,login:At.query.login});case 10:nr=sr.sent,sr.next=16;break;case 13:return sr.next=15,Object(_.z)({categoryId:At.query.exercisesId,login:At.query.login});case 15:nr=sr.sent;case 16:Jt(Object(h.a)({},nr)),(Nn=nr)!==null&&Nn!==void 0&&Nn.left_banner_id&&(tr=nr)!==null&&tr!==void 0&&(Sr=tr.exercise)!==null&&Sr!==void 0&&Sr.left_time&&(zt(Date.now()+((En=nr)===null||En===void 0||((Un=En.exercise)===null||Un===void 0)?void 0:Un.left_time)*1e3),setTimeout(function(){Bn("red")},(((Yr=nr)===null||Yr===void 0||((jr=Yr.exercise)===null||jr===void 0)?void 0:jr.left_time)-300>0?((Jn=nr)===null||Jn===void 0||((vr=Jn.exercise)===null||vr===void 0)?void 0:vr.left_time)-300:0)*1e3));case 18:case"end":return sr.stop()}},sn)})),Bt.apply(this,arguments)}Pt&&ln()},[Pt]),Object(a.useEffect)(function(){return At.query.type==="exercises"&&(window.addEventListener(Object(b.c)(),jt),window.focus(),window.onblur=function(){Object(b.a)()&&Object(b.b)()}),function(){document.removeEventListener(Object(b.c)(),jt)}},[Pt]),Object(a.useEffect)(function(){Pt&&Ht!==null&&Ht!==void 0&&Ht.language&&Yt()},[Pt,Rn,Ht==null?void 0:Ht.language]),Object(a.useEffect)(function(){return Ht!=null&&Ht.is_program&&(Gr.current=0,Rr.current=setInterval(function(){ni()},15e3)),function(){clearInterval(Rr.current)}},[Ht==null?void 0:Ht.is_program]);var ni=function(){var ln=Object(n.a)(i.a.mark(function Bt(){var sn;return i.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:return vn.next=2,Object(qe.a)("/api/myproblems/".concat(Pt,"/save_long_time.json"),{method:"get",params:{answer_long_time:Gr.current}});case 2:sn=vn.sent;case 3:case"end":return vn.stop()}},Bt)}));return function(){return ln.apply(this,arguments)}}(),jt=function(){window.parent.postMessage("backExercise","*")};function Yt(){return Kt.apply(this,arguments)}function Kt(){return Kt=Object(n.a)(i.a.mark(function ln(){var Bt;return i.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:return kt.prev=0,kt.next=3,Object(O.f)(Pt,{limit:15,page:Rn,language:Ht==null?void 0:Ht.language});case 3:Bt=kt.sent,Et({type:Rt.GET_SUBMIT_RECORDS,payload:Bt}),kt.next=10;break;case 7:kt.prev=7,kt.t0=kt.catch(0),console.log(kt.t0);case 10:case"end":return kt.stop()}},ln,null,[[0,7]])})),Kt.apply(this,arguments)}function rn(ln){Et({type:Rt.SET_PAGE,payload:ln})}function on(){return Cn.apply(this,arguments)}function Cn(){return Cn=Object(n.a)(i.a.mark(function ln(){var Bt;return i.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:return kt.next=2,Object(O.k)(Pt,{code:F.Base64.encode(Ht.code),language:Ht==null?void 0:Ht.language});case 2:return Bt=kt.sent,kt.abrupt("return",Bt);case 4:case"end":return kt.stop()}},ln)})),Cn.apply(this,arguments)}function dn(){return jn.apply(this,arguments)}function jn(){return jn=Object(n.a)(i.a.mark(function ln(){var Bt,sn,kt,vn,Nn,tr,Sr,nr;return i.a.wrap(function(Un){for(;;)switch(Un.prev=Un.next){case 0:if(!Dn){Un.next=2;break}return Un.abrupt("return");case 2:return Et({type:Rt.SET_SUBMITING,payload:!0}),Un.prev=3,ie.a.publish("to-commit-info"),Un.next=7,on();case 7:if(Bt=Un.sent,console.log(Bt,1),!(Bt.status===0)){Un.next=23;break}return nr=function(){return nr=Object(n.a)(i.a.mark(function jr(){var Jn,vr,Cr,sr,zr,wi,Br;return i.a.wrap(function(Er){for(;;)switch(Er.prev=Er.next){case 0:return Er.next=2,Object(O.c)(Pt,"submit");case 2:if(Jn=Er.sent,vr=Jn.status,Cr=Jn.data,sr=Vn(),zr=sr-tr>(Nn+3)*1e3,vr!==0&&!zr&&setTimeout(Sr,1e3),!zr){Er.next=12;break}return m.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),Et({type:Rt.SET_SUBMITING,payload:!1}),Er.abrupt("return");case 12:if(!(vr===0)){Er.next=19;break}return Cr.status===2&&m.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),(Cr==null?void 0:Cr.status)===0&&(At==null||((wi=At.query)===null||wi===void 0)?void 0:wi.type)==="1"&&Nr(!0),Er.next=17,Object(O.f)(Pt,{limit:15,page:Rn,language:Ht==null?void 0:Ht.language});case 17:Br=Er.sent,Et({type:Rt.SET_SUBMIT_RESULT,payload:Object(h.a)(Object(h.a)({},He),{},{submitResult:Cr,submitting:!1,submitRecords:Br})});case 19:case"end":return Er.stop()}},jr)})),nr.apply(this,arguments)},Sr=function(){return nr.apply(this,arguments)},kt={},At.query.type==="exercises"&&(kt.extras={exercise_id:At.query.exercisesId,question_id:At.query.questionId}),Un.next=16,Object(O.h)(Pt,kt);case 16:if(vn=Un.sent,!(vn.status===-1&&At!==null&&At!==void 0&&(sn=At.query)!==null&&sn!==void 0&&sn.coursesId)){Un.next=20;break}return window.parent.location.href="/classrooms/".concat(At.query.coursesId,"/exercise/").concat(At.query.exercisesId,"/detail"),Un.abrupt("return");case 20:Nn=Ht.time_limit,tr=Vn(),Sr();case 23:Un.next=29;break;case 25:Un.prev=25,Un.t0=Un.catch(3),console.log(Un.t0),Et({type:Rt.SET_SUBMITING,payload:!1});case 29:case"end":return Un.stop()}},ln,null,[[3,25]])})),jn.apply(this,arguments)}function or(){return an.apply(this,arguments)}function an(){return an=Object(n.a)(i.a.mark(function ln(){var Bt,sn,kt,vn,Nn,tr,Sr;return i.a.wrap(function(En){for(;;)switch(En.prev=En.next){case 0:return He.debuging=!0,Et({type:Rt.SET_DEBUGING,payload:!0}),En.prev=2,En.next=5,on();case 5:if(Bt=En.sent,!(Bt.status===0)){En.next=22;break}return Sr=function(){return Sr=Object(n.a)(i.a.mark(function Yr(){var jr,Jn,vr,Cr,sr,zr;return i.a.wrap(function(Br){for(;;)switch(Br.prev=Br.next){case 0:return Br.next=2,Object(O.c)(Pt,"debug");case 2:if(jr=Br.sent,Jn=jr.status,vr=jr.message,Cr=jr.data,sr=Vn(),zr=sr-Nn>(sn+3)*1e3,Jn!==0&&!zr&&(Et({type:Rt.SET_EXECUTE_MESSAGE,payload:vr}),setTimeout(tr,1e3)),!zr){Br.next=13;break}return m.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),Et({type:Rt.SET_DEBUGING,payload:!1}),Br.abrupt("return");case 13:Jn===0&&(Et({type:Rt.SET_DEBUGING,payload:!1}),Cr.status===2&&m.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),Cr.status===2&&m.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),Et({type:Rt.SET_EXECUTE_RESULT,payload:Object(h.a)(Object(h.a)({},He),{},{debugResult:Cr,debuging:!1})}));case 14:case"end":return Br.stop()}},Yr)})),Sr.apply(this,arguments)},tr=function(){return Sr.apply(this,arguments)},sn=Ht.time_limit,kt={input:encodeURIComponent(en.test_case.input)},At.query.type==="exercises"&&(kt.exercise_id=At.query.exercisesId),En.next=14,Object(O.b)(Pt,kt);case 14:if(vn=En.sent,!(vn.status===-1&&At.query.coursesId)){En.next=18;break}return window.parent.location.href="/classrooms/".concat(At.query.coursesId,"/exercise/").concat(At.query.exercisesId,"/detail"),En.abrupt("return");case 18:Nn=Vn(),tr(),En.next=23;break;case 22:Et({type:Rt.SET_DEBUGING,payload:!1});case 23:En.next=28;break;case 25:En.prev=25,En.t0=En.catch(2),console.log(En.t0);case 28:return En.prev=28,En.finish(28);case 30:case"end":return En.stop()}},ln,null,[[2,25,28,30]])})),an.apply(this,arguments)}function _r(ln){Et({type:Rt.SET_DATA,payload:Object(h.a)(Object(h.a)({},en),{},{hack:Object(h.a)(Object(h.a)({},Ht),{},{code:ln})})})}var Tn=function(){var ln=Object(n.a)(i.a.mark(function Bt(sn){var kt,vn;return i.a.wrap(function(tr){for(;;)switch(tr.prev=tr.next){case 0:return tr.next=2,Object(qe.a)("/api/problems/".concat(Ht==null?void 0:Ht.identifier,"/start.json"),{method:"get",params:{language:sn==="C++"||sn==="c++"?encodeURIComponent(sn):sn,hack_user_id:Kn==null?void 0:Kn.user_id}});case 2:kt=tr.sent,kt.status!==-1&&qt.replace("/myproblems/".concat(kt==null?void 0:kt.identifier,"?type=").concat(At==null||((vn=At.query)===null||vn===void 0)?void 0:vn.type));case 4:case"end":return tr.stop()}},Bt)}));return function(sn){return ln.apply(this,arguments)}}();function qn(ln){var Bt=ln.target.value;Et({type:Rt.SET_DATA,payload:Object(h.a)(Object(h.a)({},en),{},{test_case:{input:Bt}})})}function er(){return mr.apply(this,arguments)}function mr(){return mr=Object(n.a)(i.a.mark(function ln(){var Bt;return i.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:return kt.prev=0,kt.next=3,Object(O.g)(Pt);case 3:Bt=kt.sent,Bt.status===401?qt.replace("/login",{from:At.pathname}):_r(F.Base64.decode(Bt.code)),kt.next=10;break;case 7:kt.prev=7,kt.t0=kt.catch(0),console.log(kt.t0);case 10:case"end":return kt.stop()}},ln,null,[[0,7]])})),mr.apply(this,arguments)}function Wi(){m.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 Bt(){var sn;return i.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:return vn.next=2,Object(O.i)(Pt);case 2:sn=vn.sent,sn.status===401?qt.replace("/login",{from:At.pathname}):_r(F.Base64.decode(sn.code));case 4:case"end":return vn.stop()}},Bt)}))()}})}function wn(){Et({type:Rt.SET_SHOW_NOTE,payload:!0})}function gn(){Et({type:Rt.SET_SHOW_NOTE,payload:!1})}function _n(ln){return gr.apply(this,arguments)}function gr(){return gr=Object(n.a)(i.a.mark(function ln(Bt){return i.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:return kt.next=2,Object(O.a)(Pt,Bt);case 2:Et({type:Rt.GET_DATA,payload:{showNote:!1,data:Object(h.a)(Object(h.a)({},en),{},{hack:Object(h.a)(Object(h.a)({},Ht),{},{notes:Bt.notes})})}});case 3:case"end":return kt.stop()}},ln)})),gr.apply(this,arguments)}var Qr={hack:Ht,isLoading:cn,input:en==null||((K=en.test_case)===null||K===void 0)?void 0:K.input,language:Ht==null?void 0:Ht.language,code:Ht==null?void 0:Ht.code,title:"main."+dt[Ht==null?void 0:Ht.language],modify_code:Ht==null?void 0:Ht.modify_code,notes:Ht==null?void 0:Ht.notes,debugResult:kn,debuging:Sn,submitting:Dn,executingMessage:Hn,onCancelNote:gn,onAddNote:_n,showNote:In,user:Kn,onShowNote:wn,onSubmitCode:dn,onChangeCode:_r,onChangeInput:qn,onDebugCode:or,onResetCode:er,onSyncCode:Wi,onUpdateCode:on,onChangeLanguage:Tn};function qr(){return ri.apply(this,arguments)}function ri(){return ri=Object(n.a)(i.a.mark(function ln(){var Bt,sn,kt;return i.a.wrap(function(Nn){for(;;)switch(Nn.prev=Nn.next){case 0:return Nn.next=2,Object(O.j)(Ht.id,{container_type:"Hack",type:1});case 2:Bt=Nn.sent,sn=Bt.praise_count,kt=Object(h.a)(Object(h.a)({},en),{},{hack:Object(h.a)(Object(h.a)({},Ht),{},{praises_count:sn,user_praise:!Ht.user_praise})}),Et({type:Rt.SET_DATA,payload:kt});case 6:case"end":return Nn.stop()}},ln)})),ri.apply(this,arguments)}var Ti={topicId:Pt,submitResult:Gt,submitRecords:An,submitting:Dn,page:Rn,onPageChange:rn,hack:Ht,user:en==null?void 0:en.user,onTriggerPraise:qr};return r.a.createElement(r.a.Fragment,null,r.a.createElement(M.a,{spinning:tn,delay:500},en?r.a.createElement(r.a.Fragment,null,r.a.createElement("header",{className:H.a.header},At.query.type!=="exercises"&&r.a.createElement("div",null,r.a.createElement("img",{src:"".concat(p.a.IMG_SERVER,"/images/").concat(Kn.image_url),alt:"user",width:30}),r.a.createElement("span",null,Kn.name)),r.a.createElement("h2",{className:"flex-wrp flex_box_column flex_box_center"},r.a.createElement("div",null,Ht.name),(Ht==null?void 0:Ht.is_program)&&r.a.createElement(un.a,{defaultValue:Ht==null?void 0:Ht.answer_long_time,onChange:function(Bt){console.log(Bt),Gr.current=Bt},className:"font12 c-grey-999"})),Kn.hack_manager?r.a.createElement(L.a,{className:H.a.btn_back,to:(At==null||((ee=At.query)===null||ee===void 0)?void 0:ee.type)==="1"?"/problems/".concat(Ht.identifier,"/edit?type=1"):"/problems/".concat(Ht.identifier,"/edit"),style:{marginRight:10}}," ",r.a.createElement(S.a,null)," \u7F16\u8F91"):null,(bt==null||((Y=bt.exercise)===null||Y===void 0)?void 0:Y.left_time)&&r.a.createElement(r.a.Fragment,null,r.a.createElement("span",{style:{color:xn},className:"iconfont icon-kaoshishichang mr5"}),r.a.createElement("span",{className:"c-white mr20"},r.a.createElement(zn,{valueStyle:{color:xn,fontSize:16,fontWeight:"normal"},title:r.a.createElement("span",{style:{color:xn,fontSize:16}},"\u5269\u4F59\u65F6\u95F4\uFF1A"),value:bn,onFinish:Object(n.a)(i.a.mark(function ln(){var Bt,sn;return i.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:return vn.next=2,Object(_.ab)({categoryId:At.query.exercisesId,commit_method:2});case 2:Bt=vn.sent,(Bt==null?void 0:Bt.status)===0&&(on(),m.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 Nn=Object(n.a)(i.a.mark(function Sr(){return i.a.wrap(function(En){for(;;)switch(En.prev=En.next){case 0:window.parent.location.href="/classrooms/".concat(At.query.coursesId,"/exercise/").concat(At.query.exercisesId,"/detail");case 1:case"end":return En.stop()}},Sr)}));function tr(){return Nn.apply(this,arguments)}return tr}()})),(Bt==null?void 0:Bt.status)===-3&&(sn=parseInt(Bt==null?void 0:Bt.message),zt(Date.now()+sn*1e3));case 5:case"end":return vn.stop()}},ln)}))}))),(At==null||((Ee=At.query)===null||Ee===void 0)?void 0:Ee.type)==="exercises"?r.a.createElement(W.a,{type:"primary",onClick:function(){on(),m.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(){jt()}})}},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 Bt;if((At==null||((Bt=At.query)===null||Bt===void 0)?void 0:Bt.type)==="1"){var sn,kt=(sn=localStorage.getItem("program_homework"))===null||sn===void 0?void 0:sn.split(",");qt.push("/classrooms/".concat(kt==null?void 0:kt[0],"/program_homework/").concat(kt==null?void 0:kt[1],"/detail"))}else qt.push("/problemset")}}," ",r.a.createElement(w.a,null),"\u9000\u51FA")),r.a.createElement(M.a,{size:"large",spinning:cn},r.a.createElement(g.a,{className:"my-problems",leftChild:r.a.createElement(Qt,Ti),rightChild:r.a.createElement(I,Qr)}))):null,r.a.createElement(m.a,{centered:!0,closable:!1,width:680,footer:null,visible:Vr,className:"oj-modal"},r.a.createElement("section",{className:"oj-modal-content"},r.a.createElement("div",{className:"oj-modal-head"},r.a.createElement("img",{src:On.a,alt:""}),r.a.createElement("i",{onClick:function(){return Nr(!1)},className:"iconfont icon-guanbi1"})),r.a.createElement("aside",null,r.a.createElement("img",{className:"mr30",src:Pn.a}),"\u8FD0\u884C\u65F6\u95F4:\xA0",r.a.createElement("span",{style:{color:"#75d6ba",marginRight:100}},Gt==null?void 0:Gt.execute_time,"ms"),"\u4F18\u4E8E",r.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(Gt==null?void 0:Gt.time_better_than)||100,"%"),"\u7684\u7528\u6237"),r.a.createElement("aside",{className:"mb50"},r.a.createElement("img",{src:Xt.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"},Gt==null?void 0:Gt.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"}},(Gt==null?void 0:Gt.memory_better_than)||100,"%"),"\u7684\u7528\u6237"),r.a.createElement("div",{id:"oj-modal-next",onClick:Object(n.a)(i.a.mark(function ln(){var Bt,sn,kt;return i.a.wrap(function(Nn){for(;;)switch(Nn.prev=Nn.next){case 0:if(!(Gt!=null&&Gt.next_identifier)){Nn.next=7;break}return Nn.next=3,Object(qe.a)("/api/problems/".concat(Gt==null?void 0:Gt.next_identifier,"/start.json"),{method:"get",params:{hack_user_id:Kn==null?void 0:Kn.user_id}});case 3:Bt=Nn.sent,Bt&&(qt.replace("/myproblems/".concat(Bt==null?void 0:Bt.identifier,"?type=1")),window.location.reload()),Nn.next=9;break;case 7:kt=(sn=localStorage.getItem("program_homework"))===null||sn===void 0?void 0:sn.split(","),qt.push("/classrooms/".concat(kt==null?void 0:kt[0],"/program_homework/").concat(kt==null?void 0:kt[1],"/detail"));case 9:case"end":return Nn.stop()}},ln)})),className:"oj-modal-btn"},Gt!=null&&Gt.next_identifier?"\u8FDB\u5165\u4E0B\u4E00\u9898":"\u56DE\u5230\u4F5C\u4E1A\u8BE6\u60C5\u9875")))))};function J(R){var K,ee=R.title,Y=R.modify_code,Ee=R.onSyncCode,Ye=R.onShowCodeSetting,ut=R.onResetCode,yt=R.hack,He=R.onChangeLanguage,Et=function(){m.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:ut})};return console.log(yt,"hack"),r.a.createElement("div",{className:"action-bar",style:{paddingLeft:0}},(yt==null?void 0:yt.is_program)&&r.a.createElement(V.a,{className:"oj-select",value:yt==null?void 0:yt.language,style:{width:100},placeholder:"\u9009\u62E9\u8BED\u8A00",onChange:He},yt==null||((K=yt.all_language)===null||K===void 0)?void 0:K.map(function(It){return r.a.createElement(V.a.Option,{key:It,value:It},It)})),r.a.createElement("span",null),Y?r.a.createElement("a",{title:"\u66F4\u65B0\u901A\u77E5",onClick:Ee},r.a.createElement("img",{src:N.a,alt:"notice"})):null,r.a.createElement("a",{title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",onClick:Et},r.a.createElement("i",{className:"iconfont icon-zhongzhi font-20 "})),r.a.createElement("a",{onClick:Ye},r.a.createElement("i",{className:"iconfont icon-shezhi"})))}function I(R){var K=R.input,ee=R.showNote,Y=R.onShowNote,Ee=R.notes,Ye=R.onCancelNote,ut=R.onAddNote,yt=R.debugResult,He=R.language,Et=R.debuging,It=R.submitting,Pt=R.executingMessage,qt=R.code,At=R.onSubmitCode,tn=R.onDebugCode,en=R.onChangeCode,kn=R.onChangeInput,Gt=R.onUpdateCode,An=R.user,Rn=R.isLoading,In=Object(X.a)(R,["input","showNote","onShowNote","notes","onCancelNote","onAddNote","debugResult","language","debuging","submitting","executingMessage","code","onSubmitCode","onDebugCode","onChangeCode","onChangeInput","onUpdateCode","user","isLoading"]);function Sn(Hn){return r.a.createElement(J,Object(Z.a)({},In,{onShowCodeSetting:Hn}))}var Dn=Object(h.a)({input:K,debugResult:yt,debuging:Et,submitting:It,executingMessage:Pt,onDebugCode:tn,onChangeCode:en,onSubmitCode:At,onChangeInput:kn,user:An},In);return r.a.createElement("div",{className:"right-panel"},r.a.createElement(E.a,{isLoading:Rn,language:He,value:qt,onChange:en,ActionBarRender:Sn}),r.a.createElement("div",{className:"note-form-area ".concat(ee?"active":"")},r.a.createElement(ve,{onCancel:Ye,notes:Ee,callback:ut})),r.a.createElement(T.b,Dn))}},RELg:function(je,oe,k){var Z=k("MFOe"),X=Z.Global;je.exports={name:"oldIE-userDataStorage",write:G,read:W,each:n,remove:D,clearAll:m};var P="storejs",V=X.document,U=c(),M=(X.navigator?X.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function G(o,d){if(M)return;var i=h(o);U(function(a){a.setAttribute(i,d),a.save(P)})}function W(o){if(M)return;var d=h(o),i=null;return U(function(a){i=a.getAttribute(d)}),i}function n(o){U(function(d){for(var i=d.XMLDocument.documentElement.attributes,a=i.length-1;a>=0;a--){var r=i[a];o(d.getAttribute(r.name),r.name)}})}function D(o){var d=h(o);U(function(i){i.removeAttribute(d),i.save(P)})}function m(){U(function(o){var d=o.XMLDocument.documentElement.attributes;o.load(P);for(var i=d.length-1;i>=0;i--)o.removeAttribute(d[i].name);o.save(P)})}var f=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function h(o){return o.replace(/^\d/,"___$&").replace(f,"___")}function c(){if(!V||!V.documentElement||!V.documentElement.addBehavior)return null;var o="script",d,i,a;try{i=new ActiveXObject("htmlfile"),i.open(),i.write("<"+o+">document.w=window</"+o+'><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 s=[].slice.call(arguments,0);s.unshift(a),d.appendChild(a),a.addBehavior("#default#userData"),a.load(P),r.apply(this,s),d.removeChild(a);return}}},"S+dL":function(je,oe){je.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(je,oe,k){je.exports=k.p+"static/time.69bc8c81.svg"},"SA+Z":function(je,oe,k){var Z=k("wTVA"),X=k("EbDI"),P=k("ZhPi"),V=k("wkBT");function U(M){return Z(M)||X(M)||P(M)||V()}je.exports=U,je.exports.__esModule=!0,je.exports.default=je.exports},SJMd:function(je,oe){/**
|
|
* @license
|
|
* Copyright (C) 2006 Google Inc.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/var k,Z,X,P=!1,V,U;window.PR_SHOULD_USE_CONTINUATION=!0;var M,G;(function(){var W=window,n=["break,continue,do,else,for,if,return,while"],D=[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"],m=[D,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],f=[m,"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=[m,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],c=[m,"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"],o="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=[m,"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"],s=[n,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],S=[f,c,h,d,i,a,r,s],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",O="com",_="typ",b="lit",g="pun",p="pln",C="tag",E="dec",v="src",N="atn",F="atv",A="nocode",H="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function j(ze){for(var Ze=0,ot=!1,de=!1,Se=0,Le=ze.length;Se<Le;++Se){var De=ze[Se];if(De.ignoreCase)de=!0;else if(/[a-z]/i.test(De.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){ot=!0,de=!1;break}}var qe={b:8,t:9,n:10,v:11,f:12,r:13};function lt(Ae){var Ce=Ae.charCodeAt(0);if(Ce!==92)return Ce;var Ve=Ae.charAt(1);return Ce=qe[Ve],Ce||("0"<=Ve&&Ve<="7"?parseInt(Ae.substring(1),8):Ve==="u"||Ve==="x"?parseInt(Ae.substring(2),16):Ae.charCodeAt(1))}function mt(Ae){if(Ae<32)return(Ae<16?"\\x0":"\\x")+Ae.toString(16);var Ce=String.fromCharCode(Ae);return Ce==="\\"||Ce==="-"||Ce==="]"||Ce==="^"?"\\"+Ce:Ce}function gt(Ae){var Ce=Ae.substring(1,Ae.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")),Ve=[],Qe=Ce[0]==="^",Pe=["["];Qe&&Pe.push("^");for(var Fe=Qe?1:0,be=Ce.length;Fe<be;++Fe){var fe=Ce[Fe];if(/\\[bdsw]/i.test(fe))Pe.push(fe);else{var pe=lt(fe),ie;Fe+2<be&&Ce[Fe+1]==="-"?(ie=lt(Ce[Fe+2]),Fe+=2):ie=pe,Ve.push([pe,ie]),ie<65||pe>122||(ie<65||pe>90||Ve.push([Math.max(65,pe)|32,Math.min(ie,90)|32]),ie<97||pe>122||Ve.push([Math.max(97,pe)&~32,Math.min(ie,122)&~32]))}}Ve.sort(function(Te,ke){return Te[0]-ke[0]||ke[1]-Te[1]});for(var ae=[],ce=[],Fe=0;Fe<Ve.length;++Fe){var me=Ve[Fe];me[0]<=ce[1]+1?ce[1]=Math.max(ce[1],me[1]):ae.push(ce=me)}for(var Fe=0;Fe<ae.length;++Fe){var me=ae[Fe];Pe.push(mt(me[0])),me[1]>me[0]&&(me[1]+1>me[0]&&Pe.push("-"),Pe.push(mt(me[1])))}return Pe.push("]"),Pe.join("")}function Ct(Ae){for(var Ce=Ae.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),Ve=Ce.length,Qe=[],Pe=0,Fe=0;Pe<Ve;++Pe){var be=Ce[Pe];if(be==="(")++Fe;else if(be.charAt(0)==="\\"){var fe=+be.substring(1);fe&&(fe<=Fe?Qe[fe]=-1:Ce[Pe]=mt(fe))}}for(var Pe=1;Pe<Qe.length;++Pe)Qe[Pe]===-1&&(Qe[Pe]=++Ze);for(var Pe=0,Fe=0;Pe<Ve;++Pe){var be=Ce[Pe];if(be==="(")++Fe,Qe[Fe]||(Ce[Pe]="(?:");else if(be.charAt(0)==="\\"){var fe=+be.substring(1);fe&&fe<=Fe&&(Ce[Pe]="\\"+Qe[fe])}}for(var Pe=0;Pe<Ve;++Pe)Ce[Pe]==="^"&&Ce[Pe+1]!=="^"&&(Ce[Pe]="");if(Ae.ignoreCase&&ot)for(var Pe=0;Pe<Ve;++Pe){var be=Ce[Pe],pe=be.charAt(0);be.length>=2&&pe==="["?Ce[Pe]=gt(be):pe!=="\\"&&(Ce[Pe]=be.replace(/[a-zA-Z]/g,function(ce){var me=ce.charCodeAt(0);return"["+String.fromCharCode(me&~32,me|32)+"]"}))}return Ce.join("")}for(var xt=[],Se=0,Le=ze.length;Se<Le;++Se){var De=ze[Se];if(De.global||De.multiline)throw new Error(""+De);xt.push("(?:"+Ct(De)+")")}return new RegExp(xt.join("|"),de?"gi":"g")}function T(ze,Ze){var ot=/(?:^|\s)nocode(?:\s|$)/,de=[],Se=0,Le=[],De=0;function qe(lt){var mt=lt.nodeType;if(mt==1){if(ot.test(lt.className))return;for(var gt=lt.firstChild;gt;gt=gt.nextSibling)qe(gt);var Ct=lt.nodeName.toLowerCase();(Ct==="br"||Ct==="li")&&(de[De]=`
|
|
`,Le[De<<1]=Se++,Le[De++<<1|1]=lt)}else if(mt==3||mt==4){var xt=lt.nodeValue;xt.length&&(Ze?xt=xt.replace(/\r\n?/g,`
|
|
`):xt=xt.replace(/[ \t\r\n]+/g," "),de[De]=xt,Le[De<<1]=Se,Se+=xt.length,Le[De++<<1|1]=lt)}}return qe(ze),{sourceCode:de.join("").replace(/\n$/,""),spans:Le}}function z(ze,Ze,ot,de,Se){if(!ot)return;var Le={sourceNode:ze,pre:1,langExtension:null,numberLines:null,sourceCode:ot,spans:null,basePos:Ze,decorations:null};de(Le),Se.push.apply(Se,Le.decorations)}var Q=/\S/;function ne(ze){for(var Ze=void 0,ot=ze.firstChild;ot;ot=ot.nextSibling){var de=ot.nodeType;Ze=de===1?Ze?ze:ot:de===3&&Q.test(ot.nodeValue)?ze:Ze}return Ze===ze?void 0:Ze}function se(ze,Ze){var ot={},de;(function(){for(var De=ze.concat(Ze),qe=[],lt={},mt=0,gt=De.length;mt<gt;++mt){var Ct=De[mt],xt=Ct[3];if(xt)for(var Ae=xt.length;--Ae>=0;)ot[xt.charAt(Ae)]=Ct;var Ce=Ct[1],Ve=""+Ce;lt.hasOwnProperty(Ve)||(qe.push(Ce),lt[Ve]=null)}qe.push(/[\0-\uffff]/),de=j(qe)})();var Se=Ze.length,Le=function(De){for(var qe=De.sourceCode,lt=De.basePos,mt=De.sourceNode,gt=[lt,p],Ct=0,xt=qe.match(de)||[],Ae={},Ce=0,Ve=xt.length;Ce<Ve;++Ce){var Qe=xt[Ce],Pe=Ae[Qe],Fe=void 0,be;if(typeof Pe=="string")be=!1;else{var fe=ot[Qe.charAt(0)];if(fe)Fe=Qe.match(fe[1]),Pe=fe[0];else{for(var pe=0;pe<Se;++pe)if(fe=Ze[pe],Fe=Qe.match(fe[1]),Fe){Pe=fe[0];break}Fe||(Pe=p)}be=Pe.length>=5&&Pe.substring(0,5)==="lang-",be&&!(Fe&&typeof Fe[1]=="string")&&(be=!1,Pe=v),be||(Ae[Qe]=Pe)}var ie=Ct;if(Ct+=Qe.length,!be)gt.push(lt+ie,Pe);else{var ae=Fe[1],ce=Qe.indexOf(ae),me=ce+ae.length;Fe[2]&&(me=Qe.length-Fe[2].length,ce=me-ae.length);var Te=Pe.substring(5);z(mt,lt+ie,Qe.substring(0,ce),Le,gt),z(mt,lt+ie+ce,ae,ue(Te,ae),gt),z(mt,lt+ie+me,Qe.substring(me),Le,gt)}}De.decorations=gt};return Le}function xe(ze){var Ze=[],ot=[];ze.tripleQuotedStrings?Ze.push([x,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ze.multiLineStrings?Ze.push([x,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ze.push([x,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ze.verbatimStrings&&ot.push([x,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var de=ze.hashComments;de&&(ze.cStyleComments?(de>1?Ze.push([O,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ze.push([O,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),ot.push([x,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ze.push([O,/^#[^\r\n]*/,null,"#"])),ze.cStyleComments&&(ot.push([O,/^\/\/[^\r\n]*/,null]),ot.push([O,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Se=ze.regexLiterals;if(Se){var Le=Se>1?"":`
|
|
\r`,De=Le?".":"[\\S\\s]",qe="/(?=[^/*"+Le+"])(?:[^/\\x5B\\x5C"+Le+"]|\\x5C"+De+"|\\x5B(?:[^\\x5C\\x5D"+Le+"]|\\x5C"+De+")*(?:\\x5D|$))+/";ot.push(["lang-regex",RegExp("^"+H+"("+qe+")")])}var lt=ze.types;lt&&ot.push([_,lt]);var mt=(""+ze.keywords).replace(/^ | $/g,"");mt.length&&ot.push([L,new RegExp("^(?:"+mt.replace(/[\s,]+/g,"|")+")\\b"),null]),Ze.push([p,/^\s+/,null,` \r
|
|
\xA0`]);var gt="^.[^\\s\\w.$@'\"`/\\\\]*";return ze.regexLiterals&&(gt+="(?!s*/)"),ot.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],[g,new RegExp(gt),null]),se(Ze,ot)}var ge=xe({keywords:S,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ve(ze,Ze,ot){for(var de=/(?:^|\s)nocode(?:\s|$)/,Se=/\r\n?|\n/,Le=ze.ownerDocument,De=Le.createElement("li");ze.firstChild;)De.appendChild(ze.firstChild);var qe=[De];function lt(Ce){var Ve=Ce.nodeType;if(Ve==1&&!de.test(Ce.className))if(Ce.nodeName==="br")mt(Ce),Ce.parentNode&&Ce.parentNode.removeChild(Ce);else for(var Qe=Ce.firstChild;Qe;Qe=Qe.nextSibling)lt(Qe);else if((Ve==3||Ve==4)&&ot){var Pe=Ce.nodeValue,Fe=Pe.match(Se);if(Fe){var be=Pe.substring(0,Fe.index);Ce.nodeValue=be;var fe=Pe.substring(Fe.index+Fe[0].length);if(fe){var pe=Ce.parentNode;pe.insertBefore(Le.createTextNode(fe),Ce.nextSibling)}mt(Ce),be||Ce.parentNode.removeChild(Ce)}}}function mt(Ce){for(;!Ce.nextSibling;)if(Ce=Ce.parentNode,!Ce)return;function Ve(Fe,be){var fe=be?Fe.cloneNode(!1):Fe,pe=Fe.parentNode;if(pe){var ie=Ve(pe,1),ae=Fe.nextSibling;ie.appendChild(fe);for(var ce=ae;ce;ce=ae)ae=ce.nextSibling,ie.appendChild(ce)}return fe}for(var Qe=Ve(Ce.nextSibling,0),Pe;(Pe=Qe.parentNode)&&Pe.nodeType===1;)Qe=Pe;qe.push(Qe)}for(var gt=0;gt<qe.length;++gt)lt(qe[gt]);Ze===(Ze|0)&&qe[0].setAttribute("value",Ze);var Ct=Le.createElement("ol");Ct.className="linenums";for(var xt=Math.max(0,Ze-1|0)||0,gt=0,Ae=qe.length;gt<Ae;++gt)De=qe[gt],De.className="L"+(gt+xt)%10,De.firstChild||De.appendChild(Le.createTextNode("\xA0")),Ct.appendChild(De);ze.appendChild(Ct)}function Oe(ze){var Ze=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Ze=Ze&&+Ze[1]<=8;var ot=/\n/g,de=ze.sourceCode,Se=de.length,Le=0,De=ze.spans,qe=De.length,lt=0,mt=ze.decorations,gt=mt.length,Ct=0;mt[gt]=Se;var xt,Ae;for(Ae=xt=0;Ae<gt;)mt[Ae]!==mt[Ae+2]?(mt[xt++]=mt[Ae++],mt[xt++]=mt[Ae++]):Ae+=2;for(gt=xt,Ae=xt=0;Ae<gt;){for(var Ce=mt[Ae],Ve=mt[Ae+1],Qe=Ae+2;Qe+2<=gt&&mt[Qe+1]===Ve;)Qe+=2;mt[xt++]=Ce,mt[xt++]=Ve,Ae=Qe}gt=mt.length=xt;var Pe=ze.sourceNode,Fe="";Pe&&(Fe=Pe.style.display,Pe.style.display="none");try{for(var be=null;lt<qe;){var fe=De[lt],pe=De[lt+2]||Se,ie=mt[Ct+2]||Se,Qe=Math.min(pe,ie),ae=De[lt+1],ce;if(ae.nodeType!==1&&(ce=de.substring(Le,Qe))){Ze&&(ce=ce.replace(ot,"\r")),ae.nodeValue=ce;var me=ae.ownerDocument,Te=me.createElement("span");Te.className=mt[Ct+1];var ke=ae.parentNode;ke.replaceChild(Te,ae),Te.appendChild(ae),Le<pe&&(De[lt+1]=ae=me.createTextNode(de.substring(Qe,pe)),ke.insertBefore(ae,Te.nextSibling))}Le=Qe,Le>=pe&&(lt+=2),Le>=ie&&(Ct+=2)}}finally{Pe&&(Pe.style.display=Fe)}}var Re={};function he(ze,Ze){for(var ot=Ze.length;--ot>=0;){var de=Ze[ot];Re.hasOwnProperty(de)?W.console&&console.warn("cannot override language handler %s",de):Re[de]=ze}}function ue(ze,Ze){return ze&&Re.hasOwnProperty(ze)||(ze=/^\s*</.test(Ze)?"default-markup":"default-code"),Re[ze]}he(ge,["default-code"]),he(se([],[[p,/^[^<?]+/],[E,/^<!\w[^>]*(?:>|$)/],[O,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[g,/^(?:<[%?]|[%?]>)/],["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"]),he(se([[p,/^[\s]+/,null,` \r
|
|
`],[F,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[C,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[N,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[g,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),he(se([],[[F,/^[\s\S]+/]]),["uq.val"]),he(xe({keywords:f,hashComments:!0,cStyleComments:!0,types:w}),["c","cc","cpp","cxx","cyc","m"]),he(xe({keywords:"null,true,false"}),["json"]),he(xe({keywords:c,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:w}),["cs"]),he(xe({keywords:h,cStyleComments:!0}),["java"]),he(xe({keywords:s,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),he(xe({keywords:a,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),he(xe({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),he(xe({keywords:r,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),he(xe({keywords:d,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),he(xe({keywords:o,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),he(se([],[[x,/^[\s\S]+/]]),["regex"]);function Me(ze){var Ze=ze.langExtension;try{var ot=T(ze.sourceNode,ze.pre),de=ot.sourceCode;ze.sourceCode=de,ze.spans=ot.spans,ze.basePos=0,ue(Ze,de)(ze),Oe(ze)}catch(Se){W.console&&console.log(Se&&Se.stack||Se)}}function et(ze,Ze,ot){var de=ot||!1,Se=Ze||null,Le=document.createElement("div");Le.innerHTML="<pre>"+ze+"</pre>",Le=Le.firstChild,de&&ve(Le,de,!0);var De={langExtension:Se,numberLines:de,sourceNode:Le,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Me(De),Le.innerHTML}function it(ze,Ze){var ot=Ze||document.body,de=ot.ownerDocument||document;function Se(fe){return ot.getElementsByTagName(fe)}for(var Le=[Se("pre"),Se("code"),Se("xmp")],De=[],qe=0;qe<Le.length;++qe)for(var lt=0,mt=Le[qe].length;lt<mt;++lt)De.push(Le[qe][lt]);Le=null;var gt=Date;gt.now||(gt={now:function(){return+new Date}});var Ct=0,xt=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ae=/\bprettyprint\b/,Ce=/\bprettyprinted\b/,Ve=/pre|xmp/i,Qe=/^code$/i,Pe=/^(?:pre|code|xmp)$/i,Fe={};function be(){for(var fe=W.PR_SHOULD_USE_CONTINUATION?gt.now()+250:Infinity;Ct<De.length&>.now()<fe;Ct++){for(var pe=De[Ct],ie=Fe,ae=pe;ae=ae.previousSibling;){var ce=ae.nodeType,me=(ce===7||ce===8)&&ae.nodeValue;if(me?!/^\??prettify\b/.test(me):ce!==3||/\S/.test(ae.nodeValue))break;if(me){ie={},me.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Xe,Be,ct){ie[Be]=ct});break}}var Te=pe.className;if((ie!==Fe||Ae.test(Te))&&!Ce.test(Te)){for(var ke=!1,$e=pe.parentNode;$e;$e=$e.parentNode){var pt=$e.tagName;if(Pe.test(pt)&&$e.className&&Ae.test($e.className)){ke=!0;break}}if(!ke){pe.className+=" prettyprinted";var Ot=ie.lang;if(!Ot){Ot=Te.match(xt);var vt;!Ot&&(vt=ne(pe))&&Qe.test(vt.tagName)&&(Ot=vt.className.match(xt)),Ot&&(Ot=Ot[1])}var st;if(Ve.test(pe.tagName))st=1;else{var Ke=pe.currentStyle,Ge=de.defaultView,Ue=Ke?Ke.whiteSpace:Ge&&Ge.getComputedStyle?Ge.getComputedStyle(pe,null).getPropertyValue("white-space"):0;st=Ue&&Ue.substring(0,3)==="pre"}var le=ie.linenums;(le=le==="true"||+le)||(le=Te.match(/\blinenums\b(?::(\d+))?/),le=le?le[1]&&le[1].length?+le[1]:!0:!1),le&&ve(pe,le,st);var _e={langExtension:Ot,sourceNode:pe,numberLines:le,pre:st,sourceCode:null,basePos:null,spans:null,decorations:null};Me(_e)}}}Ct<De.length?W.setTimeout(be,250):typeof ze=="function"&&ze()}be()}var nt=W.PR={createSimpleLexer:se,registerLangHandler:he,sourceDecorator:xe,PR_ATTRIB_NAME:N,PR_ATTRIB_VALUE:F,PR_COMMENT:O,PR_DECLARATION:E,PR_KEYWORD:L,PR_LITERAL:b,PR_NOCODE:A,PR_PLAIN:p,PR_PUNCTUATION:g,PR_SOURCE:v,PR_STRING:x,PR_TAG:C,PR_TYPE:_,prettyPrintOne:P?W.prettyPrintOne=et:M=et,prettyPrint:G=P?W.prettyPrint=it:G=it},at=W.define;typeof at=="function"&&at.amd&&at("google-code-prettify",[],function(){return nt})})()},T8No:function(je,oe,k){"use strict";k.d(oe,"a",function(){return G}),k.d(oe,"e",function(){return W}),k.d(oe,"c",function(){return g}),k.d(oe,"b",function(){return p}),k.d(oe,"d",function(){return C}),k.d(oe,"f",function(){return N});var Z=k("MNsG"),X=k("N0LK"),P=k("Cg/j");let V=Z.k||"";const U=new Map;U.set("false",!1),U.set("true",!0),U.set("isMac",Z.f),U.set("isLinux",Z.d),U.set("isWindows",Z.i),U.set("isWeb",Z.h),U.set("isMacNative",Z.f&&!Z.h),U.set("isEdge",V.indexOf("Edg/")>=0),U.set("isFirefox",V.indexOf("Firefox")>=0),U.set("isChrome",V.indexOf("Chrome")>=0),U.set("isSafari",V.indexOf("Safari")>=0);const M=Object.prototype.hasOwnProperty;class G{static has(A){return f.create(A)}static equals(A,H){return h.create(A,H)}static regex(A,H){return x.create(A,H)}static not(A){return i.create(A)}static and(...A){return _.create(A,null)}static or(...A){return b.create(A,null,!0)}static deserialize(A,H=!1){return A?this._deserializeOrExpression(A,H):void 0}static _deserializeOrExpression(A,H){let j=A.split("||");return b.create(j.map(T=>this._deserializeAndExpression(T,H)),null,!0)}static _deserializeAndExpression(A,H){let j=A.split("&&");return _.create(j.map(T=>this._deserializeOne(T,H)),null)}static _deserializeOne(A,H){if(A=A.trim(),A.indexOf("!=")>=0){let j=A.split("!=");return d.create(j[0].trim(),this._deserializeValue(j[1],H))}if(A.indexOf("==")>=0){let j=A.split("==");return h.create(j[0].trim(),this._deserializeValue(j[1],H))}if(A.indexOf("=~")>=0){let j=A.split("=~");return x.create(j[0].trim(),this._deserializeRegexValue(j[1],H))}if(A.indexOf(" in ")>=0){let j=A.split(" in ");return c.create(j[0].trim(),j[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(A)){const j=A.split(">=");return s.create(j[0].trim(),j[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(A)){const j=A.split(">");return r.create(j[0].trim(),j[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(A)){const j=A.split("<=");return w.create(j[0].trim(),j[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(A)){const j=A.split("<");return S.create(j[0].trim(),j[1].trim())}return/^\!\s*/.test(A)?i.create(A.substr(1).trim()):f.create(A)}static _deserializeValue(A,H){if(A=A.trim(),A==="true")return!0;if(A==="false")return!1;let j=/^'([^']*)'$/.exec(A);return j?j[1].trim():A}static _deserializeRegexValue(A,H){if(Object(X.C)(A)){if(H)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let j=A.indexOf("/"),T=A.lastIndexOf("/");if(j===T||j<0){if(H)throw new Error(`bad regexp-value '${A}', missing /-enclosure`);return console.warn(`bad regexp-value '${A}', missing /-enclosure`),null}let z=A.slice(j+1,T),Q=A[T+1]==="i"?"i":"";try{return new RegExp(z,Q)}catch(ne){if(H)throw new Error(`bad regexp-value '${A}', parse error: ${ne}`);return console.warn(`bad regexp-value '${A}', parse error: ${ne}`),null}}}function W(A,H){const j=A?A.substituteConstants():void 0,T=H?H.substituteConstants():void 0;return!j&&!T?!0:!j||!T?!1:j.equals(T)}function n(A,H){return A.cmp(H)}class D{constructor(){this.type=0}cmp(A){return this.type-A.type}equals(A){return A.type===this.type}substituteConstants(){return this}evaluate(A){return!1}serialize(){return"false"}keys(){return[]}negate(){return m.INSTANCE}}D.INSTANCE=new D;class m{constructor(){this.type=1}cmp(A){return this.type-A.type}equals(A){return A.type===this.type}substituteConstants(){return this}evaluate(A){return!0}serialize(){return"true"}keys(){return[]}negate(){return D.INSTANCE}}m.INSTANCE=new m;class f{constructor(A,H){this.key=A,this.negated=H,this.type=2}static create(A,H=null){const j=U.get(A);return typeof j=="boolean"?j?m.INSTANCE:D.INSTANCE:new f(A,H)}cmp(A){return A.type!==this.type?this.type-A.type:E(this.key,A.key)}equals(A){return A.type===this.type?this.key===A.key:!1}substituteConstants(){const A=U.get(this.key);return typeof A=="boolean"?A?m.INSTANCE:D.INSTANCE:this}evaluate(A){return!!A.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(A,H,j){this.key=A,this.value=H,this.negated=j,this.type=4}static create(A,H,j=null){if(typeof H=="boolean")return H?f.create(A,j):i.create(A,j);const T=U.get(A);if(typeof T=="boolean"){const z=T?"true":"false";return H===z?m.INSTANCE:D.INSTANCE}return new h(A,H,j)}cmp(A){return A.type!==this.type?this.type-A.type:v(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){const A=U.get(this.key);if(typeof A=="boolean"){const H=A?"true":"false";return this.value===H?m.INSTANCE:D.INSTANCE}return this}evaluate(A){return A.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(A,H){this.key=A,this.valueKey=H,this.type=10,this.negated=null}static create(A,H){return new c(A,H)}cmp(A){return A.type!==this.type?this.type-A.type:v(this.key,this.valueKey,A.key,A.valueKey)}equals(A){return A.type===this.type?this.key===A.key&&this.valueKey===A.valueKey:!1}substituteConstants(){return this}evaluate(A){const H=A.getValue(this.valueKey),j=A.getValue(this.key);return Array.isArray(H)?H.indexOf(j)>=0:typeof j=="string"&&typeof H=="object"&&H!==null?M.call(H,j):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=o.create(this)),this.negated}}class o{constructor(A){this._actual=A,this.type=11}static create(A){return new o(A)}cmp(A){return A.type!==this.type?this.type-A.type:this._actual.cmp(A._actual)}equals(A){return A.type===this.type?this._actual.equals(A._actual):!1}substituteConstants(){return this}evaluate(A){return!this._actual.evaluate(A)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class d{constructor(A,H,j){this.key=A,this.value=H,this.negated=j,this.type=5}static create(A,H,j=null){if(typeof H=="boolean")return H?i.create(A,j):f.create(A,j);const T=U.get(A);if(typeof T=="boolean"){const z=T?"true":"false";return H===z?D.INSTANCE:m.INSTANCE}return new d(A,H,j)}cmp(A){return A.type!==this.type?this.type-A.type:v(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){const A=U.get(this.key);if(typeof A=="boolean"){const H=A?"true":"false";return this.value===H?D.INSTANCE:m.INSTANCE}return this}evaluate(A){return A.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(A,H){this.key=A,this.negated=H,this.type=3}static create(A,H=null){const j=U.get(A);return typeof j=="boolean"?j?D.INSTANCE:m.INSTANCE:new i(A,H)}cmp(A){return A.type!==this.type?this.type-A.type:E(this.key,A.key)}equals(A){return A.type===this.type?this.key===A.key:!1}substituteConstants(){const A=U.get(this.key);return typeof A=="boolean"?A?D.INSTANCE:m.INSTANCE:this}evaluate(A){return!A.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(A,H){if(typeof A=="string"){const j=parseFloat(A);isNaN(j)||(A=j)}return typeof A=="string"||typeof A=="number"?H(A):D.INSTANCE}class r{constructor(A,H,j){this.key=A,this.value=H,this.negated=j,this.type=12}static create(A,H,j=null){return a(H,T=>new r(A,T,j))}cmp(A){return A.type!==this.type?this.type-A.type:v(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.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 s{constructor(A,H,j){this.key=A,this.value=H,this.negated=j,this.type=13}static create(A,H,j=null){return a(H,T=>new s(A,T,j))}cmp(A){return A.type!==this.type?this.type-A.type:v(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=S.create(this.key,this.value,this)),this.negated}}class S{constructor(A,H,j){this.key=A,this.value=H,this.negated=j,this.type=14}static create(A,H,j=null){return a(H,T=>new S(A,T,j))}cmp(A){return A.type!==this.type?this.type-A.type:v(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=s.create(this.key,this.value,this)),this.negated}}class w{constructor(A,H,j){this.key=A,this.value=H,this.negated=j,this.type=15}static create(A,H,j=null){return a(H,T=>new w(A,T,j))}cmp(A){return A.type!==this.type?this.type-A.type:v(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.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(A,H){this.key=A,this.regexp=H,this.type=7,this.negated=null}static create(A,H){return new x(A,H)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.key<A.key)return-1;if(this.key>A.key)return 1;const H=this.regexp?this.regexp.source:"",j=A.regexp?A.regexp.source:"";return H<j?-1:H>j?1:0}equals(A){if(A.type===this.type){const H=this.regexp?this.regexp.source:"",j=A.regexp?A.regexp.source:"";return this.key===A.key&&H===j}return!1}substituteConstants(){return this}evaluate(A){let H=A.getValue(this.key);return this.regexp?this.regexp.test(H):!1}serialize(){const A=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${A}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=L.create(this)),this.negated}}class L{constructor(A){this._actual=A,this.type=8}static create(A){return new L(A)}cmp(A){return A.type!==this.type?this.type-A.type:this._actual.cmp(A._actual)}equals(A){return A.type===this.type?this._actual.equals(A._actual):!1}substituteConstants(){return this}evaluate(A){return!this._actual.evaluate(A)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function O(A){let H=null;for(let j=0,T=A.length;j<T;j++){const z=A[j].substituteConstants();if(A[j]!==z&&H===null){H=[];for(let Q=0;Q<j;Q++)H[Q]=A[Q]}H!==null&&(H[j]=z)}return H===null?A:H}class _{constructor(A,H){this.expr=A,this.negated=H,this.type=6}static create(A,H){return _._normalizeArr(A,H)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.expr.length<A.expr.length)return-1;if(this.expr.length>A.expr.length)return 1;for(let H=0,j=this.expr.length;H<j;H++){const T=n(this.expr[H],A.expr[H]);if(T!==0)return T}return 0}equals(A){if(A.type===this.type){if(this.expr.length!==A.expr.length)return!1;for(let H=0,j=this.expr.length;H<j;H++)if(!this.expr[H].equals(A.expr[H]))return!1;return!0}return!1}substituteConstants(){const A=O(this.expr);return A===this.expr?this:_.create(A,this.negated)}evaluate(A){for(let H=0,j=this.expr.length;H<j;H++)if(!this.expr[H].evaluate(A))return!1;return!0}static _normalizeArr(A,H){const j=[];let T=!1;for(const z of A){if(!z)continue;if(z.type===1){T=!0;continue}if(z.type===0)return D.INSTANCE;if(z.type===6){j.push(...z.expr);continue}j.push(z)}if(j.length===0&&T)return m.INSTANCE;if(j.length===0)return;if(j.length===1)return j[0];j.sort(n);for(let z=1;z<j.length;z++)j[z-1].equals(j[z])&&(j.splice(z,1),z--);if(j.length===1)return j[0];for(;j.length>1;){const z=j[j.length-1];if(z.type!==9)break;j.pop();const Q=j.pop(),ne=j.length===0,se=b.create(z.expr.map(xe=>_.create([xe,Q],null)),null,ne);se&&(j.push(se),j.sort(n))}return j.length===1?j[0]:new _(j,H)}serialize(){return this.expr.map(A=>A.serialize()).join(" && ")}keys(){const A=[];for(let H of this.expr)A.push(...H.keys());return A}negate(){if(!this.negated){const A=[];for(let H of this.expr)A.push(H.negate());this.negated=b.create(A,this,!0)}return this.negated}}class b{constructor(A,H){this.expr=A,this.negated=H,this.type=9}static create(A,H,j){return b._normalizeArr(A,H,j)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.expr.length<A.expr.length)return-1;if(this.expr.length>A.expr.length)return 1;for(let H=0,j=this.expr.length;H<j;H++){const T=n(this.expr[H],A.expr[H]);if(T!==0)return T}return 0}equals(A){if(A.type===this.type){if(this.expr.length!==A.expr.length)return!1;for(let H=0,j=this.expr.length;H<j;H++)if(!this.expr[H].equals(A.expr[H]))return!1;return!0}return!1}substituteConstants(){const A=O(this.expr);return A===this.expr?this:b.create(A,this.negated,!1)}evaluate(A){for(let H=0,j=this.expr.length;H<j;H++)if(this.expr[H].evaluate(A))return!0;return!1}static _normalizeArr(A,H,j){let T=[],z=!1;if(A){for(let Q=0,ne=A.length;Q<ne;Q++){const se=A[Q];if(!se)continue;if(se.type===0){z=!0;continue}if(se.type===1)return m.INSTANCE;if(se.type===9){T=T.concat(se.expr);continue}T.push(se)}if(T.length===0&&z)return D.INSTANCE;T.sort(n)}if(T.length===0)return;if(T.length===1)return T[0];for(let Q=1;Q<T.length;Q++)T[Q-1].equals(T[Q])&&(T.splice(Q,1),Q--);if(T.length===1)return T[0];if(j){for(let Q=0;Q<T.length;Q++)for(let ne=Q+1;ne<T.length;ne++)N(T[Q],T[ne])&&(T.splice(ne,1),ne--);if(T.length===1)return T[0]}return new b(T,H)}serialize(){return this.expr.map(A=>A.serialize()).join(" || ")}keys(){const A=[];for(let H of this.expr)A.push(...H.keys());return A}negate(){if(!this.negated){let A=[];for(let H of this.expr)A.push(H.negate());for(;A.length>1;){const H=A.shift(),j=A.shift(),T=[];for(const Q of F(H))for(const ne of F(j))T.push(_.create([Q,ne],null));const z=A.length===0;A.unshift(b.create(T,null,z))}this.negated=A[0]}return this.negated}}class g extends f{constructor(A,H,j){super(A,null);this._defaultValue=H,typeof j=="object"?g._info.push(Object.assign(Object.assign({},j),{key:A})):j!==!0&&g._info.push({key:A,description:j,type:H!=null?typeof H:void 0})}static all(){return g._info.values()}bindTo(A){return A.createKey(this.key,this._defaultValue)}getValue(A){return A.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(A){return h.create(this.key,A)}}g._info=[];const p=Object(P.c)("contextKeyService"),C="setContext";function E(A,H){return A<H?-1:A>H?1:0}function v(A,H,j,T){return A<j?-1:A>j?1:H<T?-1:H>T?1:0}function N(A,H){if(H.type===6&&A.type!==9&&A.type!==6){for(const z of H.expr)if(A.equals(z))return!0}const j=A.negate(),T=F(j).concat(F(H));T.sort(n);for(let z=0;z<T.length;z++){const Q=T[z],ne=Q.negate();for(let se=z+1;se<T.length;se++){const xe=T[se];if(ne.equals(xe))return!0}}return!1}function F(A){return A.type===9?A.expr:[A]}},TXwP:function(je,oe,k){var Z,X;(function(){var P;(function(){"use strict";var U=[,,function(n){function D(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=[]}D.prototype.clone_empty=function(){var h=new D(this.__parent);return h.set_indent(this.__indent_count,this.__alignment_count),h},D.prototype.item=function(h){return h<0?this.__items[this.__items.length+h]:this.__items[h]},D.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},D.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))},D.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)},D.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},D.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},D.prototype.is_empty=function(){return this.__items.length===0},D.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},D.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},D.prototype.pop=function(){var h=null;return this.is_empty()||(h=this.__items.pop(),this.__character_count-=h.length),h},D.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},D.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},D.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},D.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 m(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}m.prototype.get_indent_size=function(h,c){var o=this.__base_string_length;return c=c||0,h<0&&(o=0),o+=h*this.__indent_size,o+=c,o},m.prototype.get_indent_string=function(h,c){var o=this.__base_string;return c=c||0,h<0&&(h=0,o=""),c+=h*this.__indent_size,this.__ensure_cache(c),o+=this.__cache[c],o},m.prototype.__ensure_cache=function(h){for(;h>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var h=this.__cache.length,c=0,o="";this.__indent_size&&h>=this.__indent_size&&(c=Math.floor(h/this.__indent_size),h-=c*this.__indent_size,o=new Array(c+1).join(this.__indent_string)),h&&(o+=new Array(h+1).join(" ")),this.__cache.push(o)};function f(h,c){this.__indent_cache=new m(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 D(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 o=this.__lines.join(`
|
|
`);return h!==`
|
|
`&&(o=o.replace(/[\n]/g,h)),o},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 o=this.__lines.length-2;o>=0;){var d=this.__lines[o];if(d.is_empty())break;if(d.item(0).indexOf(h)!==0&&d.item(-1)!==c){this.__lines.splice(o+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},n.exports.Output=f},,,,function(n){function D(h,c){this.raw_options=m(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"])}D.prototype._get_array=function(h,c){var o=this.raw_options[h],d=c||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(d=o.concat()):typeof o=="string"&&(d=o.split(/[^a-zA-Z0-9_\/\-]+/)),d},D.prototype._get_boolean=function(h,c){var o=this.raw_options[h],d=o===void 0?!!c:!!o;return d},D.prototype._get_characters=function(h,c){var o=this.raw_options[h],d=c||"";return typeof o=="string"&&(d=o.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),d},D.prototype._get_number=function(h,c){var o=this.raw_options[h];c=parseInt(c,10),isNaN(c)&&(c=0);var d=parseInt(o,10);return isNaN(d)&&(d=c),d},D.prototype._get_selection=function(h,c,o){var d=this._get_selection_list(h,c,o);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]},D.prototype._get_selection_list=function(h,c,o){if(!c||c.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[c[0]],!this._is_valid_selection(o,c))throw new Error("Invalid Default Value!");var d=this._get_array(h,o);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},D.prototype._is_valid_selection=function(h,c){return h.length&&c.length&&!h.some(function(o){return c.indexOf(o)===-1})};function m(h,c){var o={};h=f(h);var d;for(d in h)d!==c&&(o[d]=h[d]);if(c&&h[c])for(d in h[c])o[d]=h[c][d];return o}function f(h){var c={},o;for(o in h){var d=o.replace(/-/g,"_");c[d]=h[o]}return c}n.exports.Options=D,n.exports.normalizeOpts=f,n.exports.mergeOpts=m},,function(n){var D=RegExp.prototype.hasOwnProperty("sticky");function m(f){this.__input=f||"",this.__input_length=this.__input.length,this.__position=0}m.prototype.restart=function(){this.__position=0},m.prototype.back=function(){this.__position>0&&(this.__position-=1)},m.prototype.hasNext=function(){return this.__position<this.__input_length},m.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__input.charAt(this.__position),this.__position+=1),f},m.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},m.prototype.__match=function(f,h){f.lastIndex=h;var c=f.exec(this.__input);return c&&!(D&&f.sticky)&&(c.index!==h&&(c=null)),c},m.prototype.test=function(f,h){return h=h||0,h+=this.__position,h>=0&&h<this.__input_length?!!this.__match(f,h):!1},m.prototype.testChar=function(f,h){var c=this.peek(h);return f.lastIndex=0,c!==null&&f.test(c)},m.prototype.match=function(f){var h=this.__match(f,this.__position);return h?this.__position+=h[0].length:h=null,h},m.prototype.read=function(f,h,c){var o="",d;return f&&(d=this.match(f),d&&(o+=d[0])),h&&(d||!f)&&(o+=this.readUntil(h,c)),o},m.prototype.readUntil=function(f,h){var c="",o=this.__position;f.lastIndex=this.__position;var d=f.exec(this.__input);return d?(o=d.index,h&&(o+=d[0].length)):o=this.__input_length,c=this.__input.substring(this.__position,o),this.__position=o,c},m.prototype.readUntilAfter=function(f){return this.readUntil(f,!0)},m.prototype.get_regexp=function(f,h){var c=null,o="g";return h&&D&&(o="y"),typeof f=="string"&&f!==""?c=new RegExp(f,o):f&&(c=new RegExp(f.source,o)),c},m.prototype.get_literal_regexp=function(f){return RegExp(f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},m.prototype.peekUntilAfter=function(f){var h=this.__position,c=this.readUntilAfter(f);return this.__position=h,c},m.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=m},,,,,function(n){function D(m,f){m=typeof m=="string"?m:m.source,f=typeof f=="string"?f:f.source,this.__directives_block_pattern=new RegExp(m+/ beautify( \w+[:]\w+)+ /.source+f,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(m+/\sbeautify\signore:end\s/.source+f,"g")}D.prototype.get_directives=function(m){if(!m.match(this.__directives_block_pattern))return null;var f={};this.__directive_pattern.lastIndex=0;for(var h=this.__directive_pattern.exec(m);h;)f[h[1]]=h[2],h=this.__directive_pattern.exec(m);return f},D.prototype.readIgnored=function(m){return m.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=D},,function(n,D,m){var f=m(16).Beautifier,h=m(17).Options;function c(o,d){var i=new f(o,d);return i.beautify()}n.exports=c,n.exports.defaultOptions=function(){return new h}},function(n,D,m){var f=m(17).Options,h=m(2).Output,c=m(8).InputScanner,o=m(13).Directives,d=new o(/\/\*/,/\*\//),i=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,r=/\s/,s=/(?:\s|\n)+/g,S=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,w=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function x(L,O){this._source_text=L||"",this._options=new f(O),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 O="";for(this._ch=this._input.next();this._ch;){if(O+=this._ch,this._ch==="\\")O+=this._input.next();else if(L.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return O},x.prototype.eatWhitespace=function(L){for(var O=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 O},x.prototype.foundNestedPseudoClass=function(){for(var L=0,O=1,_=this._input.peek(O);_;){if(_==="{")return!0;if(_==="(")L+=1;else if(_===")"){if(L===0)return!1;L-=1}else if(_===";"||_==="}")return!1;O++,_=this._input.peek(O)}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,O=this._options.eol;O==="auto"&&(O=`
|
|
`,L&&i.test(L||"")&&(O=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,g=!1,p=!1,C=!1,E=!1,v=!1,N=!1,F=this._ch,A=!1,H,j,T;H=this._input.read(s),j=H!=="",T=F,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),F=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var z=this._input.read(S),Q=d.get_directives(z);Q&&Q.ignore==="start"&&(z+=d.readIgnored(this._input)),this.print_string(z),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(w)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(j),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ne=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ne.match(/[ :]$/)&&(ne=this.eatString(": ").replace(/\s$/,""),this.print_string(ne),this._output.space_before_token=!0),ne=ne.replace(/\s$/,""),ne==="extend"?E=!0:ne==="import"&&(v=!0),ne in this.NESTED_AT_RULE?(this._nestedLevel+=1,ne in this.CONDITIONAL_GROUP_RULE&&(C=!0)):!g&&b===0&&ne.indexOf(":")!==-1&&(p=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(j),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")p&&(p=!1,this.outdent()),C?(C=!1,g=this._indentLevel>=this._nestedLevel):g=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&g&&(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)):(T==="("?this._output.space_before_token=!1:T!==","&&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(),T==="{"&&this._output.trim(!0),v=!1,E=!1,p&&(this.outdent(),p=!1),this.print_string(this._ch),g=!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 se=0;se<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;se++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[se])){A=!0;break}(g||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 xe=T==='"'||T==="'";this.preserveSingleSpace(xe||j),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")A=!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 ge=!1;this._input.lookBack("with")&&(ge=!0),this.preserveSingleSpace(j||ge),this.print_string(this._ch),p&&T==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),N=!0):(this.eatWhitespace(),b++,this.indent())}else if(this._ch===")")b&&(b--,this.outdent()),N&&this._input.peek()===";"&&this._options.selector_separator_newline&&(N=!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||N)&&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(j),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 ve=T==='"'||T==="'";this.preserveSingleSpace(ve||j),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&A&&this._output.add_new_line()}var Oe=this._output.get_code(O);return Oe},n.exports.Beautifier=x},function(n,D,m){var f=m(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 o=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||o;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}],M={};function G(n){var D=M[n];if(D!==void 0)return D.exports;var m=M[n]={exports:{}};return U[n](m,m.exports,G),m.exports}var W=G(15);P=W})();var V=P;!(Z=[],X=function(){return{css_beautify:V}}.apply(oe,Z),X!==void 0&&(je.exports=X))})()},U7T7:function(je,oe,k){},UZu5:function(je,oe,k){},Vhoy:function(je,oe,k){"use strict";k.d(oe,"d",function(){return V}),k.d(oe,"e",function(){return U}),k.d(oe,"c",function(){return M}),k.d(oe,"b",function(){return G}),k.d(oe,"a",function(){return W});var Z=k("MI8n");class X{constructor(){this._icons=new Map,this._onDidRegister=new Z.b}add(n){const D=this._icons.get(n.id);D?n.description?D.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 P=new X,V=P;function U(n,D){return new G(n,D)}function M(n){return n?n.replace(/\$\((.*?)\)/g,(D,m)=>` ${m} `).trim():""}class G{constructor(n,D,m){this.id=n,this.definition=D,this.description=m,P.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 D=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function m(c){if(c instanceof G)return["codicon","codicon-"+c.id];const o=D.exec(c.id);if(!o)return m(G.error);let[,d,i]=o;const a=["codicon","codicon-"+d];return i&&a.push("codicon-modifier-"+i.substr(1)),a}n.asClassNameArray=m;function f(c){return m(c).join(" ")}n.asClassName=f;function h(c){return"."+m(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"})}(G||(G={}))},"VrN/":function(je,oe,k){(function(Z,X){je.exports=X()})(this,function(){"use strict";var Z=navigator.userAgent,X=navigator.platform,P=/gecko\/\d/i.test(Z),V=/MSIE \d/.test(Z),U=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Z),M=/Edge\/(\d+)/.exec(Z),G=V||U||M,W=G&&(V?document.documentMode||6:+(M||U)[1]),n=!M&&/WebKit\//.test(Z),D=n&&/Qt\/\d+\.\d+/.test(Z),m=!M&&/Chrome\//.test(Z),f=/Opera\//.test(Z),h=/Apple Computer/.test(navigator.vendor),c=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Z),o=/PhantomJS/.test(Z),d=!M&&/AppleWebKit/.test(Z)&&/Mobile\/\w+/.test(Z),i=/Android/.test(Z),a=d||i||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Z),r=d||/Mac/.test(X),s=/\bCrOS\b/.test(Z),S=/win/i.test(X),w=f&&Z.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(f=!1,n=!0);var x=r&&(D||f&&(w==null||w<12.11)),L=P||G&&W>=9;function O(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var _=function(e,t){var u=e.className,l=O(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 g(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 B=0;B<t.length;++B)y.appendChild(t[B]);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 N(){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;O(t).test(u)||(e.className+=(u?" ":"")+t)}function A(e,t){for(var u=e.split(" "),l=0;l<u.length;l++)u[l]&&!O(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}:G&&(H=function(e){try{e.select()}catch(t){}});function j(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function T(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 z(e,t,u,l,y){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var B=l||0,$=y||0;;){var q=e.indexOf(" ",B);if(q<0||q>=t)return $+(t-B);$+=q-B,$+=u-$%u,B=q+1}}var Q=function(){this.id=null,this.f=null,this.time=0,this.handler=j(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 ne(e,t){for(var u=0;u<e.length;++u)if(e[u]==t)return u;return-1}var se=50,xe={toString:function(){return"CodeMirror.Pass"}},ge={scroll:!1},ve={origin:"*mouse"},Oe={origin:"+move"};function Re(e,t,u){for(var l=0,y=0;;){var B=e.indexOf(" ",l);B==-1&&(B=e.length);var $=B-l;if(B==e.length||y+$>=t)return l+Math.min($,t-y);if(y+=B-l,y+=u-y%u,l=B+1,y>=t)return l}}var he=[""];function ue(e){for(;he.length<=e;)he.push(Me(he)+" ");return he[e]}function Me(e){return e[e.length-1]}function et(e,t){for(var u=[],l=0;l<e.length;l++)u[l]=t(e[l],l);return u}function it(e,t,u){for(var l=0,y=u(t);l<e.length&&u(e[l])<=y;)l++;e.splice(l,0,t)}function nt(){}function at(e,t){var u;return Object.create?u=Object.create(e):(nt.prototype=e,u=new nt),t&&T(t,u),u}var ze=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Ze(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ze.test(e))}function ot(e,t){return t?t.source.indexOf("\\w")>-1&&Ze(e)?!0:t.test(e):Ze(e)}function de(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Se=/[\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&&Se.test(e)}function De(e,t,u){for(;(u<0?t>0:t<e.length)&&Le(e.charAt(t));)t+=u;return t}function qe(e,t,u){for(var l=t>u?-1:1;;){if(t==u)return t;var y=(t+u)/2,B=l<0?Math.ceil(y):Math.floor(y);if(B==t)return e(B)?t:u;e(B)?u=B:t=B+l}}function lt(e,t,u,l){if(!e)return l(t,u,"ltr",0);for(var y=!1,B=0;B<e.length;++B){var $=e[B];($.from<u&&$.to>t||t==u&&$.to==t)&&(l(Math.max($.from,t),Math.min($.to,u),$.level==1?"rtl":"ltr",B),y=!0)}y||l(t,u,"ltr")}var mt=null;function gt(e,t,u){var l;mt=null;for(var y=0;y<e.length;++y){var B=e[y];if(B.from<t&&B.to>t)return y;B.to==t&&(B.from!=B.to&&u=="before"?l=y:mt=y),B.from==t&&(B.from!=B.to&&u!="before"?l=y:mt=y)}return l!=null?l:mt}var Ct=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function u(re){return re<=247?e.charAt(re):1424<=re&&re<=1524?"R":1536<=re&&re<=1785?t.charAt(re-1536):1774<=re&&re<=2220?"r":8192<=re&&re<=8203?"w":re==8204?"b":"L"}var l=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,y=/[stwN]/,B=/[LRr]/,$=/[Lb1n]/,q=/[1n]/;function te(re,ye,we){this.level=re,this.from=ye,this.to=we}return function(re,ye){var we=ye=="ltr"?"L":"R";if(re.length==0||ye=="ltr"&&!l.test(re))return!1;for(var We=re.length,Ne=[],rt=0;rt<We;++rt)Ne.push(u(re.charCodeAt(rt)));for(var ht=0,St=we;ht<We;++ht){var Dt=Ne[ht];Dt=="m"?Ne[ht]=St:St=Dt}for(var Ut=0,Mt=we;Ut<We;++Ut){var Ft=Ne[Ut];Ft=="1"&&Mt=="r"?Ne[Ut]="n":B.test(Ft)&&(Mt=Ft,Ft=="r"&&(Ne[Ut]="R"))}for(var $t=1,Vt=Ne[0];$t<We-1;++$t){var hn=Ne[$t];hn=="+"&&Vt=="1"&&Ne[$t+1]=="1"?Ne[$t]="1":hn==","&&Vt==Ne[$t+1]&&(Vt=="1"||Vt=="n")&&(Ne[$t]=Vt),Vt=hn}for(var Fn=0;Fn<We;++Fn){var hr=Ne[Fn];if(hr==",")Ne[Fn]="N";else if(hr=="%"){var Gn=void 0;for(Gn=Fn+1;Gn<We&&Ne[Gn]=="%";++Gn);for(var Fr=Fn&&Ne[Fn-1]=="!"||Gn<We&&Ne[Gn]=="1"?"1":"N",Dr=Fn;Dr<Gn;++Dr)Ne[Dr]=Fr;Fn=Gn-1}}for(var rr=0,Mr=we;rr<We;++rr){var yr=Ne[rr];Mr=="L"&&yr=="1"?Ne[rr]="L":B.test(yr)&&(Mr=yr)}for(var lr=0;lr<We;++lr)if(y.test(Ne[lr])){var ir=void 0;for(ir=lr+1;ir<We&&y.test(Ne[ir]);++ir);for(var $n=(lr?Ne[lr-1]:we)=="L",Pr=(ir<We?Ne[ir]:we)=="L",ji=$n==Pr?$n?"L":"R":we,fi=lr;fi<ir;++fi)Ne[fi]=ji;lr=ir-1}for(var Tr=[],ti,fr=0;fr<We;)if($.test(Ne[fr])){var co=fr;for(++fr;fr<We&&$.test(Ne[fr]);++fr);Tr.push(new te(0,co,fr))}else{var ai=fr,Ei=Tr.length,xi=ye=="rtl"?1:0;for(++fr;fr<We&&Ne[fr]!="L";++fr);for(var Ar=ai;Ar<fr;)if(q.test(Ne[Ar])){ai<Ar&&(Tr.splice(Ei,0,new te(1,ai,Ar)),Ei+=xi);var Bi=Ar;for(++Ar;Ar<fr&&q.test(Ne[Ar]);++Ar);Tr.splice(Ei,0,new te(2,Bi,Ar)),Ei+=xi,ai=Ar}else++Ar;ai<fr&&Tr.splice(Ei,0,new te(1,ai,fr))}return ye=="ltr"&&(Tr[0].level==1&&(ti=re.match(/^\s+/))&&(Tr[0].from=ti[0].length,Tr.unshift(new te(0,0,ti[0].length))),Me(Tr).level==1&&(ti=re.match(/\s+$/))&&(Me(Tr).to-=ti[0].length,Tr.push(new te(0,We-ti[0].length,We)))),ye=="rtl"?Tr.reverse():Tr}}();function xt(e,t){var u=e.order;return u==null&&(u=e.order=Ct(e.text,t)),u}var Ae=[],Ce=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]||Ae).concat(u)}};function Ve(e,t){return e._handlers&&e._handlers[t]||Ae}function Qe(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 B=ne(y,u);B>-1&&(l[t]=y.slice(0,B).concat(y.slice(B+1)))}}}function Pe(e,t){var u=Ve(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 Fe(e,t,u){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Pe(e,u||t.type,e,t),ce(t)||t.codemirrorIgnore}function be(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)ne(u,t[l])==-1&&u.push(t[l])}function fe(e,t){return Ve(e,t).length>0}function pe(e){e.prototype.on=function(t,u){Ce(this,t,u)},e.prototype.off=function(t,u){Qe(this,t,u)}}function ie(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ae(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ce(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function me(e){ie(e),ae(e)}function Te(e){return e.target||e.srcElement}function ke(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),r&&e.ctrlKey&&t==1&&(t=3),t}var $e=function(){if(G&&W<9)return!1;var e=p("div");return"draggable"in e||"dragDrop"in e}(),pt;function Ot(e){if(pt==null){var t=p("span","\u200B");g(e,p("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(pt=t.offsetWidth<=1&&t.offsetHeight>2&&!(G&&W<8))}var u=pt?p("span","\u200B"):p("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return u.setAttribute("cm-text",""),u}var vt;function st(e){if(vt!=null)return vt;var t=g(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:vt=l.right-u.right<3}var Ke=`
|
|
|
|
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 B=e.slice(t,e.charAt(y-1)=="\r"?y-1:y),$=B.indexOf("\r");$!=-1?(u.push(B.slice(0,$)),t+=$+1):(u.push(B),t=y+1)}return u}:function(e){return e.split(/\r\n?|\n/)},Ge=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},Ue=function(){var e=p("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),le=null;function _e(e){if(le!=null)return le;var t=g(e,p("span","x")),u=t.getBoundingClientRect(),l=E(t,0,1).getBoundingClientRect();return le=Math.abs(u.left-l.left)>1}var Xe={},Be={};function ct(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Xe[e]=t}function ft(e,t){Be[e]=t}function Ie(e){if(typeof e=="string"&&Be.hasOwnProperty(e))e=Be[e];else if(e&&typeof e.name=="string"&&Be.hasOwnProperty(e.name)){var t=Be[e.name];typeof t=="string"&&(t={name:t}),e=at(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ie("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ie("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Je(e,t){t=Ie(t);var u=Xe[t.name];if(!u)return Je(e,"text/plain");var l=u(e,t);if(tt.hasOwnProperty(t.name)){var y=tt[t.name];for(var B in y){if(!y.hasOwnProperty(B))continue;l.hasOwnProperty(B)&&(l["_"+B]=l[B]),l[B]=y[B]}}if(l.name=t.name,t.helperType&&(l.helperType=t.helperType),t.modeProps)for(var $ in t.modeProps)l[$]=t.modeProps[$];return l}var tt={};function _t(e,t){var u=tt.hasOwnProperty(e)?tt[e]:tt[e]={};T(t,u)}function Tt(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 Zt(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 nn(e,t,u){return e.startState?e.startState(t,u):!0}var Qt=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};Qt.prototype.eol=function(){return this.pos>=this.string.length},Qt.prototype.sol=function(){return this.pos==this.lineStart},Qt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Qt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Qt.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},Qt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Qt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Qt.prototype.skipToEnd=function(){this.pos=this.string.length},Qt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Qt.prototype.backUp=function(e){this.pos-=e},Qt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=z(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)},Qt.prototype.indentation=function(){return z(this.string,null,this.tabSize)-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)},Qt.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 B=this.string.slice(this.pos).match(e);return B&&B.index>0?null:(B&&t!==!1&&(this.pos+=B[0].length),B)}},Qt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Qt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Qt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Qt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Lt(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],B=y.chunkSize();if(t<B){u=y;break}t-=B}return u.lines[t]}function On(e,t,u){var l=[],y=t.line;return e.iter(t.line,u.line+1,function(B){var $=B.text;y==u.line&&($=$.slice(0,u.ch)),y==t.line&&($=$.slice(t.ch)),l.push($),++y}),l}function un(e,t,u){var l=[];return e.iter(t,u,function(y){l.push(y.text)}),l}function fn(e,t){var u=t-e.height;if(u)for(var l=e;l;l=l.parent)l.height+=u}function Xt(e){if(e.parent==null)return null;for(var t=e.parent,u=ne(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 mn(e,t){var u=e.first;e:do{for(var l=0;l<e.children.length;++l){var y=e.children[l],B=y.height;if(t<B){e=y;continue e}t-=B,u+=y.chunkSize()}return u}while(!e.lines);for(var $=0;$<e.lines.length;++$){var q=e.lines[$],te=q.height;if(t<te)break;t-=te}return u+$}function Pn(e,t){return t>=e.first&&t<e.first+e.size}function zn(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function dt(e,t,u){if(u===void 0&&(u=null),!(this instanceof dt))return new dt(e,t,u);this.line=e,this.ch=t,this.sticky=u}function Rt(e,t){return e.line-t.line||e.ch-t.ch}function Vn(e,t){return e.sticky==t.sticky&&Rt(e,t)==0}function pr(e){return dt(e.line,e.ch)}function ur(e,t){return Rt(e,t)<0?t:e}function kr(e,t){return Rt(e,t)<0?e:t}function J(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function I(e,t){if(t.line<e.first)return dt(e.first,0);var u=e.first+e.size-1;return t.line>u?dt(u,Lt(e,u).text.length):R(t,Lt(e,t.line).text.length)}function R(e,t){var u=e.ch;return u==null||u>t?dt(e.line,t):u<0?dt(e.line,0):e}function K(e,t){for(var u=[],l=0;l<t.length;l++)u[l]=I(e,t[l]);return u}var ee=function(e,t){this.state=e,this.lookAhead=t},Y=function(e,t,u,l){this.state=t,this.doc=e,this.line=u,this.maxLookAhead=l||0,this.baseTokens=null,this.baseTokenPos=1};Y.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Y.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}},Y.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Y.fromSaved=function(e,t,u){return t instanceof ee?new Y(e,Tt(e.mode,t.state),u,t.lookAhead):new Y(e,Tt(e.mode,t),u)},Y.prototype.save=function(e){var t=e!==!1?Tt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ee(t,this.maxLookAhead):t};function Ee(e,t,u,l){var y=[e.state.modeGen],B={};At(e,t.text,e.doc.mode,u,function(re,ye){return y.push(re,ye)},B,l);for(var $=u.state,q=function(re){u.baseTokens=y;var ye=e.state.overlays[re],we=1,We=0;u.state=!0,At(e,t.text,ye.mode,u,function(Ne,rt){for(var ht=we;We<Ne;){var St=y[we];St>Ne&&y.splice(we,1,Ne,y[we+1],St),we+=2,We=Math.min(Ne,St)}if(!rt)return;if(ye.opaque)y.splice(ht,we-ht,Ne,"overlay "+rt),we=ht+2;else for(;ht<we;ht+=2){var Dt=y[ht+1];y[ht+1]=(Dt?Dt+" ":"")+"overlay "+rt}},B),u.state=$,u.baseTokens=null,u.baseTokenPos=1},te=0;te<e.state.overlays.length;++te)q(te);return{styles:y,classes:B.bgClass||B.textClass?B:null}}function Ye(e,t,u){if(!t.styles||t.styles[0]!=e.state.modeGen){var l=ut(e,Xt(t)),y=t.text.length>e.options.maxHighlightLength&&Tt(e.doc.mode,l.state),B=Ee(e,t,l);y&&(l.state=y),t.stateAfter=l.save(!y),t.styles=B.styles,B.classes?t.styleClasses=B.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 ut(e,t,u){var l=e.doc,y=e.display;if(!l.mode.startState)return new Y(l,!0,t);var B=tn(e,t,u),$=B>l.first&&Lt(l,B-1).stateAfter,q=$?Y.fromSaved(l,$,B):new Y(l,nn(l.mode),B);return l.iter(B,t,function(te){yt(e,te.text,q);var re=q.line;te.stateAfter=re==t-1||re%5==0||re>=y.viewFrom&&re<y.viewTo?q.save():null,q.nextLine()}),u&&(l.modeFrontier=q.line),q}function yt(e,t,u,l){var y=e.doc.mode,B=new Qt(t,e.options.tabSize,u);for(B.start=B.pos=l||0,t==""&&He(y,u.state);!B.eol();)Et(y,B,u.state),B.start=B.pos}function He(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var u=Zt(e,t);if(u.mode.blankLine)return u.mode.blankLine(u.state)}function Et(e,t,u,l){for(var y=0;y<10;y++){l&&(l[0]=Zt(e,u).mode);var B=e.token(t,u);if(t.pos>t.start)return B}throw new Error("Mode "+e.name+" failed to advance stream.")}var It=function(e,t,u){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=u};function Pt(e,t,u,l){var y=e.doc,B=y.mode,$;t=I(y,t);var q=Lt(y,t.line),te=ut(e,t.line,u),re=new Qt(q.text,e.options.tabSize,te),ye;for(l&&(ye=[]);(l||re.pos<t.ch)&&!re.eol();)re.start=re.pos,$=Et(B,re,te.state),l&&ye.push(new It(re,$,Tt(y.mode,te.state)));return l?ye:new It(re,$,te.state)}function qt(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 At(e,t,u,l,y,B,$){var q=u.flattenSpans;q==null&&(q=e.options.flattenSpans);var te=0,re=null,ye=new Qt(t,e.options.tabSize,l),we,We=e.options.addModeClass&&[null];for(t==""&&qt(He(u,l.state),B);!ye.eol();){if(ye.pos>e.options.maxHighlightLength?(q=!1,$&&yt(e,t,l,ye.pos),ye.pos=t.length,we=null):we=qt(Et(u,ye,l.state,We),B),We){var Ne=We[0].name;Ne&&(we="m-"+(we?Ne+" "+we:Ne))}if(!q||re!=we){for(;te<ye.start;)te=Math.min(ye.start,te+5e3),y(te,re);re=we}ye.start=ye.pos}for(;te<ye.pos;){var rt=Math.min(ye.pos,te+5e3);y(rt,re),te=rt}}function tn(e,t,u){for(var l,y,B=e.doc,$=u?-1:t-(e.doc.mode.innerMode?1e3:100),q=t;q>$;--q){if(q<=B.first)return B.first;var te=Lt(B,q-1),re=te.stateAfter;if(re&&(!u||q+(re instanceof ee?re.lookAhead:0)<=B.modeFrontier))return q;var ye=z(te.text,null,e.options.tabSize);(y==null||l>ye)&&(y=q-1,l=ye)}return y}function en(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=Lt(e,l).stateAfter;if(y&&(!(y instanceof ee)||l+y.lookAhead<t)){u=l+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,u)}var kn=!1,Gt=!1;function An(){kn=!0}function Rn(){Gt=!0}function In(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 Dn(e,t){for(var u,l=0;l<e.length;++l)e[l]!=t&&(u||(u=[])).push(e[l]);return u}function Hn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function ar(e,t,u){var l;if(e)for(var y=0;y<e.length;++y){var B=e[y],$=B.marker,q=B.from==null||($.inclusiveLeft?B.from<=t:B.from<t);if(q||B.from==t&&$.type=="bookmark"&&(!u||!B.marker.insertLeft)){var te=B.to==null||($.inclusiveRight?B.to>=t:B.to>t);(l||(l=[])).push(new In($,B.from,te?null:B.to))}}return l}function Xn(e,t,u){var l;if(e)for(var y=0;y<e.length;++y){var B=e[y],$=B.marker,q=B.to==null||($.inclusiveRight?B.to>=t:B.to>t);if(q||B.from==t&&$.type=="bookmark"&&(!u||B.marker.insertLeft)){var te=B.from==null||($.inclusiveLeft?B.from<=t:B.from<t);(l||(l=[])).push(new In($,te?null:B.from-t,B.to==null?null:B.to-t))}}return l}function xn(e,t){if(t.full)return null;var u=Pn(e,t.from.line)&&Lt(e,t.from.line).markedSpans,l=Pn(e,t.to.line)&&Lt(e,t.to.line).markedSpans;if(!u&&!l)return null;var y=t.from.ch,B=t.to.ch,$=Rt(t.from,t.to)==0,q=ar(u,y,$),te=Xn(l,B,$),re=t.text.length==1,ye=Me(t.text).length+(re?y:0);if(q)for(var we=0;we<q.length;++we){var We=q[we];if(We.to==null){var Ne=Sn(te,We.marker);Ne?re&&(We.to=Ne.to==null?null:Ne.to+ye):We.to=y}}if(te)for(var rt=0;rt<te.length;++rt){var ht=te[rt];if(ht.to!=null&&(ht.to+=ye),ht.from==null){var St=Sn(q,ht.marker);St||(ht.from=ye,re&&(q||(q=[])).push(ht))}else ht.from+=ye,re&&(q||(q=[])).push(ht)}q&&(q=Bn(q)),te&&te!=q&&(te=Bn(te));var Dt=[q];if(!re){var Ut=t.text.length-2,Mt;if(Ut>0&&q)for(var Ft=0;Ft<q.length;++Ft)q[Ft].to==null&&(Mt||(Mt=[])).push(new In(q[Ft].marker,null,null));for(var $t=0;$t<Ut;++$t)Dt.push(Mt);Dt.push(te)}return Dt}function Bn(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 pn(e,t,u){var l=null;if(e.iter(t.line,u.line+1,function(Ne){if(Ne.markedSpans)for(var rt=0;rt<Ne.markedSpans.length;++rt){var ht=Ne.markedSpans[rt].marker;ht.readOnly&&(!l||ne(l,ht)==-1)&&(l||(l=[])).push(ht)}}),!l)return null;for(var y=[{from:t,to:u}],B=0;B<l.length;++B)for(var $=l[B],q=$.find(0),te=0;te<y.length;++te){var re=y[te];if(Rt(re.to,q.from)<0||Rt(re.from,q.to)>0)continue;var ye=[te,1],we=Rt(re.from,q.from),We=Rt(re.to,q.to);(we<0||!$.inclusiveLeft&&!we)&&ye.push({from:re.from,to:q.from}),(We>0||!$.inclusiveRight&&!We)&&ye.push({from:q.to,to:re.to}),y.splice.apply(y,ye),te+=ye.length-3}return y}function yn(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 bn(e,t){if(!t)return;for(var u=0;u<t.length;++u)t[u].marker.attachLine(e);e.markedSpans=t}function zt(e){return e.inclusiveLeft?-1:0}function wt(e){return e.inclusiveRight?1:0}function Wt(e,t){var u=e.lines.length-t.lines.length;if(u!=0)return u;var l=e.find(),y=t.find(),B=Rt(l.from,y.from)||zt(e)-zt(t);if(B)return-B;var $=Rt(l.to,y.to)||wt(e)-wt(t);return $||t.id-e.id}function bt(e,t){var u=Gt&&e.markedSpans,l;if(u)for(var y=void 0,B=0;B<u.length;++B)y=u[B],y.marker.collapsed&&(t?y.from:y.to)==null&&(!l||Wt(l,y.marker)<0)&&(l=y.marker);return l}function Jt(e){return bt(e,!0)}function Nt(e){return bt(e,!1)}function Yn(e,t){var u=Gt&&e.markedSpans,l;if(u)for(var y=0;y<u.length;++y){var B=u[y];B.marker.collapsed&&(B.from==null||B.from<t)&&(B.to==null||B.to>t)&&(!l||Wt(l,B.marker)<0)&&(l=B.marker)}return l}function cn(e,t,u,l,y){var B=Lt(e,t),$=Gt&&B.markedSpans;if($)for(var q=0;q<$.length;++q){var te=$[q];if(!te.marker.collapsed)continue;var re=te.marker.find(0),ye=Rt(re.from,u)||zt(te.marker)-zt(y),we=Rt(re.to,l)||wt(te.marker)-wt(y);if(ye>=0&&we<=0||ye<=0&&we>=0)continue;if(ye<=0&&(te.marker.inclusiveRight&&y.inclusiveLeft?Rt(re.to,u)>=0:Rt(re.to,u)>0)||ye>=0&&(te.marker.inclusiveRight&&y.inclusiveLeft?Rt(re.from,l)<=0:Rt(re.from,l)<0))return!0}}function Qn(e){for(var t;t=Jt(e);)e=t.find(-1,!0).line;return e}function Kr(e){for(var t;t=Nt(e);)e=t.find(1,!0).line;return e}function wr(e){for(var t,u;t=Nt(e);)e=t.find(1,!0).line,(u||(u=[])).push(e);return u}function Vr(e,t){var u=Lt(e,t),l=Qn(u);return u==l?t:Xt(l)}function Nr(e,t){if(t>e.lastLine())return t;var u=Lt(e,t),l;if(!Rr(e,u))return t;for(;l=Nt(u);)u=l.find(1,!0).line;return Xt(u)+1}function Rr(e,t){var u=Gt&&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&&Gr(e,t,l))return!0}}function Gr(e,t,u){if(u.to==null){var l=u.marker.find(1,!0);return Gr(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,B=0;B<t.markedSpans.length;++B)if(y=t.markedSpans[B],y.marker.collapsed&&!y.marker.widgetNode&&y.from==u.to&&(y.to==null||y.to!=u.from)&&(y.marker.inclusiveLeft||u.marker.inclusiveRight)&&Gr(e,t,y))return!0}function Kn(e){e=Qn(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 B=u.parent;B;u=B,B=u.parent)for(var $=0;$<B.children.length;++$){var q=B.children[$];if(q==u)break;t+=q.height}return t}function Ht(e){if(e.height==0)return 0;for(var t=e.text.length,u,l=e;u=Jt(l);){var y=u.find(0,!0);l=y.from.line,t+=y.from.ch-y.to.ch}for(l=e;u=Nt(l);){var B=u.find(0,!0);t-=l.text.length-B.from.ch,l=B.to.line,t+=l.text.length-B.to.ch}return t}function Xr(e){var t=e.display,u=e.doc;t.maxLine=Lt(u,u.first),t.maxLineLength=Ht(t.maxLine),t.maxLineChanged=!0,u.iter(function(l){var y=Ht(l);y>t.maxLineLength&&(t.maxLineLength=y,t.maxLine=l)})}var br=function(e,t,u){this.text=e,bn(this,t),this.height=u?u(this):1};br.prototype.lineNo=function(){return Xt(this)},pe(br);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),yn(e),bn(e,u);var y=l?l(e):1;y!=e.height&&fn(e,y)}function jt(e){e.parent=null,yn(e)}var Yt={},Kt={};function rn(e,t){if(!e||/^\s*$/.test(e))return null;var u=t.addModeClass?Kt:Yt;return u[e]||(u[e]=e.replace(/\S+/g,"cm-$&"))}function on(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 B=y?t.rest[y-1]:t.line,$=void 0;l.pos=0,l.addToken=dn,st(e.display.measure)&&($=xt(B,e.doc.direction))&&(l.addToken=or(l.addToken,$)),l.map=[];var q=t!=e.display.externalMeasured&&Xt(B);_r(B,l,Ye(e,B,q)),B.styleClasses&&(B.styleClasses.bgClass&&(l.bgClass=A(B.styleClasses.bgClass,l.bgClass||"")),B.styleClasses.textClass&&(l.textClass=A(B.styleClasses.textClass,l.textClass||""))),l.map.length==0&&l.map.push(0,0,l.content.appendChild(Ot(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 te=l.content.lastChild;(/\bcm-tab\b/.test(te.className)||te.querySelector&&te.querySelector(".cm-tab"))&&(l.content.className="cm-tab-wrap-hack")}return Pe(e,"renderLine",e,t.line,l.pre),l.pre.className&&(l.textClass=A(l.pre.className,l.textClass||"")),l}function Cn(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 dn(e,t,u,l,y,B,$){if(!t)return;var q=e.splitSpaces?jn(t,e.trailingSpace):t,te=e.cm.state.specialChars,re=!1,ye;if(!te.test(t))e.col+=t.length,ye=document.createTextNode(q),e.map.push(e.pos,e.pos+t.length,ye),G&&W<9&&(re=!0),e.pos+=t.length;else{ye=document.createDocumentFragment();for(var we=0;;){te.lastIndex=we;var We=te.exec(t),Ne=We?We.index-we:t.length-we;if(Ne){var rt=document.createTextNode(q.slice(we,we+Ne));G&&W<9?ye.appendChild(p("span",[rt])):ye.appendChild(rt),e.map.push(e.pos,e.pos+Ne,rt),e.col+=Ne,e.pos+=Ne}if(!We)break;we+=Ne+1;var ht=void 0;if(We[0]==" "){var St=e.cm.options.tabSize,Dt=St-e.col%St;ht=ye.appendChild(p("span",ue(Dt),"cm-tab")),ht.setAttribute("role","presentation"),ht.setAttribute("cm-text"," "),e.col+=Dt}else We[0]=="\r"||We[0]==`
|
|
`?(ht=ye.appendChild(p("span",We[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),ht.setAttribute("cm-text",We[0]),e.col+=1):(ht=e.cm.options.specialCharPlaceholder(We[0]),ht.setAttribute("cm-text",We[0]),G&&W<9?ye.appendChild(p("span",[ht])):ye.appendChild(ht),e.col+=1);e.map.push(e.pos,e.pos+1,ht),e.pos++}}if(e.trailingSpace=q.charCodeAt(t.length-1)==32,u||l||y||re||B||$){var Ut=u||"";l&&(Ut+=l),y&&(Ut+=y);var Mt=p("span",[ye],Ut,B);if($)for(var Ft in $)$.hasOwnProperty(Ft)&&Ft!="style"&&Ft!="class"&&Mt.setAttribute(Ft,$[Ft]);return e.content.appendChild(Mt)}e.content.appendChild(ye)}function jn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var u=t,l="",y=0;y<e.length;y++){var B=e.charAt(y);B==" "&&u&&(y==e.length-1||e.charCodeAt(y+1)==32)&&(B="\xA0"),l+=B,u=B==" "}return l}function or(e,t){return function(u,l,y,B,$,q,te){y=y?y+" cm-force-border":"cm-force-border";for(var re=u.pos,ye=re+l.length;;){for(var we=void 0,We=0;We<t.length&&!(we=t[We],we.to>re&&we.from<=re);We++);if(we.to>=ye)return e(u,l,y,B,$,q,te);e(u,l.slice(0,we.to-re),y,B,null,q,te),B=null,l=l.slice(we.to-re),re=we.to}}}function an(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 _r(e,t,u){var l=e.markedSpans,y=e.text,B=0;if(!l){for(var $=1;$<u.length;$+=2)t.addToken(t,y.slice(B,B=u[$]),rn(u[$+1],t.cm.options));return}for(var q=y.length,te=0,re=1,ye="",we,We,Ne=0,rt,ht,St,Dt,Ut;;){if(Ne==te){rt=ht=St=We="",Ut=null,Dt=null,Ne=Infinity;for(var Mt=[],Ft=void 0,$t=0;$t<l.length;++$t){var Vt=l[$t],hn=Vt.marker;if(hn.type=="bookmark"&&Vt.from==te&&hn.widgetNode)Mt.push(hn);else if(Vt.from<=te&&(Vt.to==null||Vt.to>te||hn.collapsed&&Vt.to==te&&Vt.from==te)){if(Vt.to!=null&&Vt.to!=te&&Ne>Vt.to&&(Ne=Vt.to,ht=""),hn.className&&(rt+=" "+hn.className),hn.css&&(We=(We?We+";":"")+hn.css),hn.startStyle&&Vt.from==te&&(St+=" "+hn.startStyle),hn.endStyle&&Vt.to==Ne&&(Ft||(Ft=[])).push(hn.endStyle,Vt.to),hn.title&&((Ut||(Ut={})).title=hn.title),hn.attributes)for(var Fn in hn.attributes)(Ut||(Ut={}))[Fn]=hn.attributes[Fn];hn.collapsed&&(!Dt||Wt(Dt.marker,hn)<0)&&(Dt=Vt)}else Vt.from>te&&Ne>Vt.from&&(Ne=Vt.from)}if(Ft)for(var hr=0;hr<Ft.length;hr+=2)Ft[hr+1]==Ne&&(ht+=" "+Ft[hr]);if(!Dt||Dt.from==te)for(var Gn=0;Gn<Mt.length;++Gn)an(t,0,Mt[Gn]);if(Dt&&(Dt.from||0)==te){if(an(t,(Dt.to==null?q+1:Dt.to)-te,Dt.marker,Dt.from==null),Dt.to==null)return;Dt.to==te&&(Dt=!1)}}if(te>=q)break;for(var Fr=Math.min(q,Ne);;){if(ye){var Dr=te+ye.length;if(!Dt){var rr=Dr>Fr?ye.slice(0,Fr-te):ye;t.addToken(t,rr,we?we+rt:rt,St,te+rr.length==Ne?ht:"",We,Ut)}if(Dr>=Fr){ye=ye.slice(Fr-te),te=Fr;break}te=Dr,St=""}ye=y.slice(B,B=u[re++]),we=rn(u[re++],t.cm.options)}}}function Tn(e,t,u){this.line=t,this.rest=wr(t),this.size=this.rest?Xt(Me(this.rest))-u+1:1,this.node=this.text=null,this.hidden=Rr(e,t)}function qn(e,t,u){for(var l=[],y,B=t;B<u;B=y){var $=new Tn(e.doc,Lt(e.doc,B),B);y=B+$.size,l.push($)}return l}var er=null;function mr(e){er?er.ops.push(e):e.ownsGroup=er={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 wn(e,t){var u=e.ownsGroup;if(!u)return;try{Wi(u)}finally{er=null,t(u)}}var gn=null;function _n(e,t){var u=Ve(e,t);if(!u.length)return;var l=Array.prototype.slice.call(arguments,2),y;er?y=er.delayedCallbacks:gn?y=gn:(y=gn=[],setTimeout(gr,0));for(var B=function(q){y.push(function(){return u[q].apply(null,l)})},$=0;$<u.length;++$)B($)}function gr(){var e=gn;gn=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 B=t.changes[y];B=="text"?ln(e,t):B=="gutter"?sn(e,t,u,l):B=="class"?Bt(e,t):B=="widget"&&kt(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),G&&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):on(e,t)}function ln(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,Bt(e,t)):u&&(t.text.className=u)}function Bt(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 sn(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 B=t.line.gutterMarkers;if(e.options.lineNumbers||B){var $=qr(t),q=t.gutter=p("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px");if(e.display.input.setUneditable(q),$.insertBefore(q,t.text),t.line.gutterClass&&(q.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!B||!B["CodeMirror-linenumbers"])&&(t.lineNumber=q.appendChild(p("div",zn(e.options,u),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+l.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),B)for(var te=0;te<e.display.gutterSpecs.length;++te){var re=e.display.gutterSpecs[te].className,ye=B.hasOwnProperty(re)&&B[re];ye&&q.appendChild(p("div",[ye],"CodeMirror-gutter-elt","left: "+l.gutterLeft[re]+"px; width: "+l.gutterWidth[re]+"px"))}}}function kt(e,t,u){t.alignable&&(t.alignable=null);for(var l=O("CodeMirror-linewidget"),y=t.node.firstChild,B=void 0;y;y=B)B=y.nextSibling,l.test(y.className)&&t.node.removeChild(y);Nn(e,t,u)}function vn(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),Bt(e,t),sn(e,t,u,l),Nn(e,t,l),t.node}function Nn(e,t,u){if(tr(e,t.line,t,u,!0),t.rest)for(var l=0;l<t.rest.length;l++)tr(e,t.rest[l],t,u,!1)}function tr(e,t,u,l,y){if(!t.widgets)return;for(var B=qr(u),$=0,q=t.widgets;$<q.length;++$){var te=q[$],re=p("div",[te.node],"CodeMirror-linewidget"+(te.className?" "+te.className:""));te.handleMouseEvents||re.setAttribute("cm-ignore-events","true"),Sr(te,re,u,l),e.display.input.setUneditable(re),y&&te.above?B.insertBefore(re,u.gutter||u.text):B.appendChild(re),_n(te,"redraw")}}function Sr(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 nr(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;"),g(t.display.measure,p("div",[e.node],null,u))}return e.height=e.node.parentNode.offsetHeight}function En(e,t){for(var u=Te(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 Un(e){return e.lineSpace.offsetTop}function Yr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function jr(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=g(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 Jn(e){return se-e.display.nativeBarWidth}function vr(e){return e.display.scroller.clientWidth-Jn(e)-e.display.barWidth}function Cr(e){return e.display.scroller.clientHeight-Jn(e)-e.display.barHeight}function sr(e,t,u){var l=e.options.lineWrapping,y=l&&vr(e);if(!t.measure.heights||l&&t.measure.width!=y){var B=t.measure.heights=[];if(l){t.measure.width=y;for(var $=t.text.firstChild.getClientRects(),q=0;q<$.length-1;q++){var te=$[q],re=$[q+1];Math.abs(te.bottom-re.bottom)>2&&B.push((te.bottom+re.top)/2-u.top)}}B.push(u.bottom-u.top)}}function zr(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(Xt(e.rest[y])>u)return{map:e.measure.maps[y],cache:e.measure.caches[y],before:!0}}function wi(e,t){t=Qn(t);var u=Xt(t),l=e.display.externalMeasured=new Tn(e.doc,t,u);l.lineN=u;var y=l.built=on(e,l);return l.text=y.pre,g(e.display.lineMeasure,y.pre),l}function Br(e,t,u,l){return ei(e,Er(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 Er(e,t){var u=Xt(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=zr(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 B=u+(l||""),$;return t.cache.hasOwnProperty(B)?$=t.cache[B]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(sr(e,t.view,t.rect),t.hasHeights=!0),$=Ws(e,t,u,l),$.bogus||(t.cache[B]=$)),{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,B,$,q,te,re=0;re<e.length;re+=3)if(q=e[re],te=e[re+1],t<q?(y=0,B=1,$="left"):t<te?(y=t-q,B=y+1):(re==e.length-3||t==te&&e[re+3]>t)&&(B=te-q,y=B-1,t>=te&&($="right")),y!=null){if(l=e[re+2],q==te&&u==(l.insertLeft?"left":"right")&&($=u),u=="left"&&y==0)for(;re&&e[re-2]==e[re-3]&&e[re-1].insertLeft;)l=e[(re-=3)+2],$="left";if(u=="right"&&y==te-q)for(;re<e.length-3&&e[re+3]==e[re+4]&&!e[re+5].insertLeft;)l=e[(re+=3)+2],$="right";break}return{node:l,start:y,end:B,collapse:$,coverStart:q,coverEnd:te}}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),B=y.node,$=y.start,q=y.end,te=y.collapse,re;if(B.nodeType==3){for(var ye=0;ye<4;ye++){for(;$&&Le(t.line.text.charAt(y.coverStart+$));)--$;for(;y.coverStart+q<y.coverEnd&&Le(t.line.text.charAt(y.coverStart+q));)++q;if(G&&W<9&&$==0&&q==y.coverEnd-y.coverStart?re=B.parentNode.getBoundingClientRect():re=Bs(E(B,$,q).getClientRects(),l),re.left||re.right||$==0)break;q=$,$=$-1,te="right"}G&&W<11&&(re=Hs(e.display.measure,re))}else{$>0&&(te=l="right");var we;e.options.lineWrapping&&(we=B.getClientRects()).length>1?re=we[l=="right"?we.length-1:0]:re=B.getBoundingClientRect()}if(G&&W<9&&!$&&(!re||!re.left&&!re.right)){var We=B.parentNode.getClientRects()[0];We?re={left:We.left,right:We.left+Ci(e.display),top:We.top,bottom:We.bottom}:re=fo}for(var Ne=re.top-t.rect.top,rt=re.bottom-t.rect.top,ht=(Ne+rt)/2,St=t.view.measure.heights,Dt=0;Dt<St.length-1&&!(ht<St[Dt]);Dt++);var Ut=Dt?St[Dt-1]:0,Mt=St[Dt],Ft={left:(te=="right"?re.right:re.left)-t.rect.left,right:(te=="left"?re.left:re.right)-t.rect.left,top:Ut,bottom:Mt};return!re.left&&!re.right&&(Ft.bogus=!0),e.options.singleCursorHeightPerLine||(Ft.rtop=Ne,Ft.rbottom=rt),Ft}function Hs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!_e(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 m&&i?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function yo(){return m&&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+=nr(e.widgets[u]));return t}function da(e,t,u,l,y){if(!y){var B=Da(t);u.top+=B,u.bottom+=B}if(l=="line")return u;l||(l="local");var $=Kn(t);if(l=="local"?$+=Un(e.display):$-=e.display.viewOffset,l=="page"||l=="window"){var q=e.display.lineSpace.getBoundingClientRect();$+=q.top+(l=="window"?0:yo());var te=q.left+(l=="window"?0:vo());u.left+=te,u.right+=te}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 B=e.display.sizer.getBoundingClientRect();l+=B.left,y+=B.top}var $=e.display.lineSpace.getBoundingClientRect();return{left:l-$.left,top:y-$.top}}function Ma(e,t,u,l,y){return l||(l=Lt(e.doc,t.line)),da(e,l,Br(e,l,t.ch,y),u)}function $r(e,t,u,l,y,B){l=l||Lt(e.doc,t.line),y||(y=Er(e,l));function $(rt,ht){var St=ei(e,y,rt,ht?"right":"left",B);return ht?St.left=St.right:St.right=St.left,da(e,l,St,u)}var q=xt(l,e.doc.direction),te=t.ch,re=t.sticky;if(te>=l.text.length?(te=l.text.length,re="before"):te<=0&&(te=0,re="after"),!q)return $(re=="before"?te-1:te,re=="before");function ye(rt,ht,St){var Dt=q[ht],Ut=Dt.level==1;return $(St?rt-1:rt,Ut!=St)}var we=gt(q,te,re),We=mt,Ne=ye(te,we,re=="before");return We!=null&&(Ne.other=ye(te,We,re!="before")),Ne}function _o(e,t){var u=0;t=I(e.doc,t),e.options.lineWrapping||(u=Ci(e.display)*t.ch);var l=Lt(e.doc,t.line),y=Kn(l)+Un(e.display);return{left:u,right:u,top:y,bottom:y+l.height}}function Pa(e,t,u,l,y){var B=dt(e,t,u);return B.xRel=y,l&&(B.outside=l),B}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=mn(l,u),B=l.first+l.size-1;if(y>B)return Pa(l.first+l.size-1,Lt(l,B).text.length,null,1,1);t<0&&(t=0);for(var $=Lt(l,y);;){var q=Ks(e,$,y,t,u),te=Yn($,q.ch+(q.xRel>0||q.outside>0?1:0));if(!te)return q;var re=te.find(1);if(re.line==y)return re;$=Lt(l,y=re.line)}}function Eo(e,t,u,l){l-=Da(t);var y=t.text.length,B=qe(function($){return ei(e,u,$-1).bottom<=l},y,0);return y=qe(function($){return ei(e,u,$).top>l},B,y),{begin:B,end:y}}function xo(e,t,u,l){u||(u=Er(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-=Kn(t);var B=Er(e,t),$=Da(t),q=0,te=t.text.length,re=!0,ye=xt(t,e.doc.direction);if(ye){var we=(e.options.lineWrapping?zs:Gs)(e,t,u,B,ye,l,y);re=we.level!=1,q=re?we.from:we.to-1,te=re?we.to:we.from-1}var We=null,Ne=null,rt=qe(function($t){var Vt=ei(e,B,$t);return Vt.top+=$,Vt.bottom+=$,Na(Vt,l,y,!1)?(Vt.top<=y&&Vt.left<=l&&(We=$t,Ne=Vt),!0):!1},q,te),ht,St,Dt=!1;if(Ne){var Ut=l-Ne.left<Ne.right-l,Mt=Ut==re;rt=We+(Mt?0:1),St=Mt?"after":"before",ht=Ut?Ne.left:Ne.right}else{!re&&(rt==te||rt==q)&&rt++,St=rt==0?"after":rt==t.text.length?"before":ei(e,B,rt-(re?1:0)).bottom+$<=y==re?"after":"before";var Ft=$r(e,dt(u,rt,St),"line",t,B);ht=Ft.left,Dt=y<Ft.top?-1:y>=Ft.bottom?1:0}return rt=De(t.text,rt,1),Pa(u,rt,St,Dt,l-ht)}function Gs(e,t,u,l,y,B,$){var q=qe(function(we){var We=y[we],Ne=We.level!=1;return Na($r(e,dt(u,Ne?We.to:We.from,Ne?"before":"after"),"line",t,l),B,$,!0)},0,y.length-1),te=y[q];if(q>0){var re=te.level!=1,ye=$r(e,dt(u,re?te.from:te.to,re?"after":"before"),"line",t,l);Na(ye,B,$,!0)&&ye.top>$&&(te=y[q-1])}return te}function zs(e,t,u,l,y,B,$){var q=Eo(e,t,l,$),te=q.begin,re=q.end;/\s/.test(t.text.charAt(re-1))&&re--;for(var ye=null,we=null,We=0;We<y.length;We++){var Ne=y[We];if(Ne.from>=re||Ne.to<=te)continue;var rt=Ne.level!=1,ht=ei(e,l,rt?Math.min(re,Ne.to)-1:Math.max(te,Ne.from)).right,St=ht<B?B-ht+1e9:ht-B;(!ye||we>St)&&(ye=Ne,we=St)}return ye||(ye=y[y.length-1]),ye.from<te&&(ye={from:te,to:ye.to,level:ye.level}),ye.to>re&&(ye={from:ye.from,to:re,level:ye.level}),ye}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"))}g(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");g(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,B=t.gutters.firstChild,$=0;B;B=B.nextSibling,++$){var q=e.display.gutterSpecs[$].className;u[q]=B.offsetLeft+B.clientLeft+y,l[q]=B.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(Rr(e.doc,y))return 0;var B=0;if(y.widgets)for(var $=0;$<y.widgets.length;$++)y.widgets[$].height&&(B+=y.widgets[$].height);return u?B+(Math.ceil(y.text.length/l)||1)*t:B+t}}function ja(e){var t=e.doc,u=To(e);t.iter(function(l){var y=u(l);y!=l.height&&fn(l,y)})}function mi(e,t,u,l){var y=e.display;if(!u&&Te(t).getAttribute("cm-not-content")=="true")return null;var B,$,q=y.lineSpace.getBoundingClientRect();try{B=t.clientX-q.left,$=t.clientY-q.top}catch(we){return null}var te=ka(e,B,$),re;if(l&&te.xRel>0&&(re=Lt(e.doc,te.line).text).length==te.ch){var ye=z(re,re.length,e.options.tabSize)-re.length;te=dt(te.line,Math.max(0,Math.round((B-jr(e.display).left)/Ci(e.display))-ye))}return te}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 Lr(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)Gt&&Vr(e.doc,t)<y.viewTo&&si(e);else if(u<=y.viewFrom)Gt&&Nr(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 B=ha(e,u,u+l,1);B?(y.view=y.view.slice(B.index),y.viewFrom=B.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 q=ha(e,t,t,-1),te=ha(e,u,u+l,1);q&&te?(y.view=y.view.slice(0,q.index).concat(qn(e,q.lineN,te.lineN)).concat(y.view.slice(te.index)),y.viewTo+=l):si(e)}var re=y.externalMeasured;re&&(u<re.lineN?re.lineN+=l:t<re.lineN+re.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 B=l.view[gi(e,t)];if(B.node==null)return;var $=B.changes||(B.changes=[]);ne($,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),B,$=e.display.view;if(!Gt||u==e.doc.first+e.doc.size)return{index:y,lineN:u};for(var q=e.display.viewFrom,te=0;te<y;te++)q+=$[te].size;if(q!=t){if(l>0){if(y==$.length-1)return null;B=q+$[y].size-t,y++}else B=q-t;t+=B,u+=B}for(;Vr(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=qn(e,t,u),l.viewFrom=t):(l.viewFrom>t?l.view=qn(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(qn(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(),B=l.selection=document.createDocumentFragment(),$=0;$<u.sel.ranges.length;$++){if(!t&&$==u.sel.primIndex)continue;var q=u.sel.ranges[$];if(q.from().line>=e.display.viewTo||q.to().line<e.display.viewFrom)continue;var te=q.empty();(te||e.options.showCursorWhenSelecting)&&Co(e,q.head,y),te||Xs(e,q,B)}return l}function Co(e,t,u){var l=$r(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 B=u.appendChild(p("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));B.style.display="",B.style.left=l.other.left+"px",B.style.top=l.other.top+"px",B.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,B=document.createDocumentFragment(),$=jr(e.display),q=$.left,te=Math.max(l.sizerWidth,vr(e)-l.sizer.offsetLeft)-$.right,re=y.direction=="ltr";function ye(Mt,Ft,$t,Vt){Ft<0&&(Ft=0),Ft=Math.round(Ft),Vt=Math.round(Vt),B.appendChild(p("div",null,"CodeMirror-selected","position: absolute; left: "+Mt+`px;
|
|
top: `+Ft+"px; width: "+($t==null?te-Mt:$t)+`px;
|
|
height: `+(Vt-Ft)+"px"))}function we(Mt,Ft,$t){var Vt=Lt(y,Mt),hn=Vt.text.length,Fn,hr;function Gn(rr,Mr){return Ma(e,dt(Mt,rr),"div",Vt,Mr)}function Fr(rr,Mr,yr){var lr=xo(e,Vt,null,rr),ir=Mr=="ltr"==(yr=="after")?"left":"right",$n=yr=="after"?lr.begin:lr.end-(/\s/.test(Vt.text.charAt(lr.end-1))?2:1);return Gn($n,ir)[ir]}var Dr=xt(Vt,y.direction);return lt(Dr,Ft||0,$t==null?hn:$t,function(rr,Mr,yr,lr){var ir=yr=="ltr",$n=Gn(rr,ir?"left":"right"),Pr=Gn(Mr-1,ir?"right":"left"),ji=Ft==null&&rr==0,fi=$t==null&&Mr==hn,Tr=lr==0,ti=!Dr||lr==Dr.length-1;if(Pr.top-$n.top<=3){var fr=(re?ji:fi)&&Tr,co=(re?fi:ji)&&ti,ai=fr?q:(ir?$n:Pr).left,Ei=co?te:(ir?Pr:$n).right;ye(ai,$n.top,Ei-ai,$n.bottom)}else{var xi,Ar,Bi,ho;ir?(xi=re&&ji&&Tr?q:$n.left,Ar=re?te:Fr(rr,yr,"before"),Bi=re?q:Fr(Mr,yr,"after"),ho=re&&fi&&ti?te:Pr.right):(xi=re?Fr(rr,yr,"before"):q,Ar=!re&&ji&&Tr?te:$n.right,Bi=!re&&fi&&ti?q:Pr.left,ho=re?Fr(Mr,yr,"after"):te),ye(xi,$n.top,Ar-xi,$n.bottom),$n.bottom<Pr.top&&ye(q,$n.bottom,null,Pr.top),ye(Bi,Pr.top,ho-Bi,Pr.bottom)}(!Fn||fa($n,Fn)<0)&&(Fn=$n),fa(Pr,Fn)<0&&(Fn=Pr),(!hr||fa($n,hr)<0)&&(hr=$n),fa(Pr,hr)<0&&(hr=Pr)}),{start:Fn,end:hr}}var We=t.from(),Ne=t.to();if(We.line==Ne.line)we(We.line,We.ch,Ne.ch);else{var rt=Lt(y,We.line),ht=Lt(y,Ne.line),St=Qn(rt)==Qn(ht),Dt=we(We.line,We.ch,St?rt.text.length+1:null).end,Ut=we(Ne.line,St?0:null,Ne.ch).start;St&&(Dt.top<Ut.top-2?(ye(Dt.right,Dt.top,null,Dt.bottom),ye(q,Ut.top,Ut.left,Ut.bottom)):ye(Dt.right,Dt.top,Ut.left-Dt.right,Dt.bottom)),Dt.bottom<Ut.top&&ye(q,Dt.bottom,null,Ut.top)}u.appendChild(B)}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||(Pe(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&&(Pe(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],B=e.options.lineWrapping,$=void 0,q=0;if(y.hidden)continue;if(G&&W<8){var te=y.node.offsetTop+y.node.offsetHeight;$=te-u,u=te}else{var re=y.node.getBoundingClientRect();$=re.bottom-re.top,!B&&y.text.firstChild&&(q=y.text.firstChild.getBoundingClientRect().right-re.left-1)}var ye=y.line.height-$;if((ye>.005||ye<-.005)&&(fn(y.line,$),Ro(y.line),y.rest))for(var we=0;we<y.rest.length;we++)Ro(y.rest[we]);if(q>e.display.sizerWidth){var We=Math.ceil(q/Ci(e.display));We>e.display.maxLineLength&&(e.display.maxLineLength=We,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-Un(e));var y=u&&u.bottom!=null?u.bottom:l+e.wrapper.clientHeight,B=mn(t,l),$=mn(t,y);if(u&&u.ensure){var q=u.ensure.from.line,te=u.ensure.to.line;q<B?(B=q,$=mn(t,Kn(Lt(t,q))+e.wrapper.clientHeight)):Math.min(te,t.lastLine())>=$&&(B=mn(t,Kn(Lt(t,te))-e.wrapper.clientHeight),$=te)}return{from:B,to:Math.max($,B+1)}}function Ys(e,t){if(Fe(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&&!o){var B=p("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-u.viewOffset-Un(e.display))+`px;
|
|
height: `+(t.bottom-t.top+Jn(e)+u.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(B),B.scrollIntoView(y),e.display.lineSpace.removeChild(B)}}function $s(e,t,u,l){l==null&&(l=0);var y;!e.options.lineWrapping&&t==u&&(t=t.ch?dt(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,u=t.sticky=="before"?dt(t.line,t.ch+1,"before"):t);for(var B=0;B<5;B++){var $=!1,q=$r(e,t),te=!u||u==t?q:$r(e,u);y={left:Math.min(q.left,te.left),top:Math.min(q.top,te.top)-l,right:Math.max(q.left,te.left),bottom:Math.max(q.bottom,te.bottom)+l};var re=Ha(e,y),ye=e.doc.scrollTop,we=e.doc.scrollLeft;if(re.scrollTop!=null&&(zi(e,re.scrollTop),Math.abs(e.doc.scrollTop-ye)>1&&($=!0)),re.scrollLeft!=null&&(vi(e,re.scrollLeft),Math.abs(e.doc.scrollLeft-we)>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,B=Cr(e),$={};t.bottom-t.top>B&&(t.bottom=t.top+B);var q=e.doc.height+Yr(u),te=t.top<l,re=t.bottom>q-l;if(t.top<y)$.scrollTop=te?0:t.top;else if(t.bottom>y+B){var ye=Math.min(t.top,(re?q:t.bottom)-B);ye!=y&&($.scrollTop=ye)}var we=e.options.fixedGutter?0:u.gutters.offsetWidth,We=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:u.scroller.scrollLeft-we,Ne=vr(e)-u.gutters.offsetWidth,rt=t.right-t.left>Ne;return rt&&(t.right=t.left+Ne),t.left<10?$.scrollLeft=0:t.left<We?$.scrollLeft=Math.max(0,t.left+we-(rt?0:10)):t.right>Ne+We-3&&($.scrollLeft=t.right+(rt?0:10)-Ne),$}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;P||za(e,{top:t}),Io(e,t,!0),P&&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+Yr(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+Jn(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),Ce(l,"scroll",function(){l.clientHeight&&t(l.scrollTop,"vertical")}),Ce(y,"scroll",function(){y.clientWidth&&t(y.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,G&&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 B=e.viewWidth-e.barLeft-(u?l:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+B)+"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(),B=u=="vert"?document.elementFromPoint(y.right-1,(y.top+y.bottom)/2):document.elementFromPoint((y.right+y.left)/2,y.bottom-1);B!=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),Ce(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},mr(e.curOp)}function _i(e){var t=e.curOp;t&&wn(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 B=0;B<t.length;B++)rl(t[B]);for(var $=0;$<t.length;$++)il(t[$])}function el(e){var t=e.cm,u=t.display;ol(t),e.updateMaxLine&&Xr(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+Jn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,u.sizer.offsetLeft+e.adjustWidthTo-vr(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==N();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,I(l,e.scrollToPos.from),I(l,e.scrollToPos.to),e.scrollToPos.margin);Ys(t,y)}var B=e.maybeHiddenMarkers,$=e.maybeUnhiddenMarkers;if(B)for(var q=0;q<B.length;++q)B[q].lines.length||Pe(B[q],"hide");if($)for(var te=0;te<$.length;++te)$[te].lines.length&&Pe($[te],"unhide");u.wrapper.offsetHeight&&(l.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Pe(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Ur(e,t){if(e.curOp)return t();bi(e);try{return t()}finally{_i(e)}}function cr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);bi(e);try{return t.apply(e,arguments)}finally{_i(e)}}}function Or(e){return function(){if(this.curOp)return e.apply(this,arguments);bi(this);try{return e.apply(this,arguments)}finally{_i(this)}}}function dr(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,j(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var u=+new Date+e.options.workTime,l=ut(e,t.highlightFrontier),y=[];t.iter(l.line,Math.min(t.first+t.size,e.display.viewTo+500),function(B){if(l.line>=e.display.viewFrom){var $=B.styles,q=B.text.length>e.options.maxHighlightLength?Tt(t.mode,l.state):null,te=Ee(e,B,l,!0);q&&(l.state=q),B.styles=te.styles;var re=B.styleClasses,ye=te.classes;ye?B.styleClasses=ye:re&&(B.styleClasses=null);for(var we=!$||$.length!=B.styles.length||re!=ye&&(!re||!ye||re.bgClass!=ye.bgClass||re.textClass!=ye.textClass),We=0;!we&&We<$.length;++We)we=$[We]!=B.styles[We];we&&y.push(l.line),B.stateAfter=l.save(),l.nextLine()}else B.text.length<=e.options.maxHighlightLength&&yt(e,B.text,l),B.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&&Ur(e,function(){for(var B=0;B<y.length;B++)oi(e,y[B],"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=vr(e),this.force=u,this.dims=Ua(e),this.events=[]};va.prototype.signal=function(e,t){fe(e,t)&&this.events.push(arguments)},va.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Pe.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=Jn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Jn(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=N();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==N())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,B=Math.max(t.visible.from-e.options.viewportMargin,l.first),$=Math.min(y,t.visible.to+e.options.viewportMargin);u.viewFrom<B&&B-u.viewFrom<20&&(B=Math.max(l.first,u.viewFrom)),u.viewTo>$&&u.viewTo-$<20&&($=Math.min(y,u.viewTo)),Gt&&(B=Vr(e.doc,B),$=Nr(e.doc,$));var q=B!=u.viewFrom||$!=u.viewTo||u.lastWrapHeight!=t.wrapperHeight||u.lastWrapWidth!=t.wrapperWidth;Vs(e,B,$),u.viewOffset=Kn(Lt(e.doc,u.viewFrom)),e.display.mover.style.top=u.viewOffset+"px";var te=wo(e);if(!q&&te==0&&!t.force&&u.renderedView==u.view&&(u.updateLineNumbers==null||u.updateLineNumbers>=u.viewTo))return!1;var re=sl(e);return te>4&&(u.lineDiv.style.display="none"),ul(e,u.updateLineNumbers,t.dims),te>4&&(u.lineDiv.style.display=""),u.renderedView=u.view,ll(re),b(u.cursorDiv),b(u.selectionDiv),u.gutters.style.height=u.sizer.style.minHeight=0,q&&(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==vr(e)){if(u&&u.top!=null&&(u={top:Math.min(e.doc.height+Yr(e.display)-Cr(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,B=l.lineDiv,$=B.firstChild;function q(rt){var ht=rt.nextSibling;return n&&r&&e.display.currentWheelTarget==rt?rt.style.display="none":rt.parentNode.removeChild(rt),ht}for(var te=l.view,re=l.viewFrom,ye=0;ye<te.length;ye++){var we=te[ye];if(!we.hidden)if(!we.node||we.node.parentNode!=B){var We=vn(e,we,re,u);B.insertBefore(We,$)}else{for(;$!=we.node;)$=q($);var Ne=y&&t!=null&&t<=re&&we.lineNumber;we.changes&&(ne(we.changes,"gutter")>-1&&(Ne=!1),Qr(e,we,re,u)),Ne&&(b(we.lineNumber),we.lineNumber.appendChild(document.createTextNode(zn(e.options,re)))),$=we.node.nextSibling}re+=we.size}for(;$;)$=q($)}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+Jn(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,B=l+"px",$=0;$<u.length;$++)if(!u[$].hidden){e.options.fixedGutter&&(u[$].gutter&&(u[$].gutter.style.left=B),u[$].gutterBackground&&(u[$].gutterBackground.style.left=B));var q=u[$].alignable;if(q)for(var te=0;te<q.length;te++)q[te].style.left=B}e.options.fixedGutter&&(t.gutters.style.left=l+y+"px")}function Uo(e){if(!e.options.lineNumbers)return!1;var t=e.doc,u=zn(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")),B=y.firstChild.offsetWidth,$=y.offsetWidth-B;return l.lineGutter.style.width="",l.lineNumInnerWidth=Math.max(B,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 B=e[y],$=null;if(typeof B!="string"&&($=B.style,B=B.className),B=="CodeMirror-linenumbers")if(t)l=!0;else continue;u.push({className:B,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],B=y.className,$=y.style,q=t.appendChild(p("div",null,"CodeMirror-gutter "+B));$&&(q.style.cssText=$),B=="CodeMirror-linenumbers"&&(e.lineGutter=q,q.style.width=(e.lineNumWidth||1)+"px")}t.style.display=u.length?"":"none",Va(e)}function $i(e){Fo(e.display),Lr(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 B=C("div",[y.lineSpace],"CodeMirror-lines");y.mover=p("div",[B],null,"position: relative"),y.sizer=p("div",[y.mover],"CodeMirror-sizer"),y.sizerWidth=null,y.heightForcer=p("div",null,null,"position: absolute; height: "+se+"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"),G&&W<8&&(y.gutters.style.zIndex=-1,y.scroller.style.paddingRight=0),!n&&!(P&&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;G?Wr=-.53:P?Wr=15:m?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,B=e.display,$=B.scroller,q=$.scrollWidth>$.clientWidth,te=$.scrollHeight>$.clientHeight;if(!(l&&q||y&&te))return;if(y&&r&&n){e:for(var re=t.target,ye=B.view;re!=$;re=re.parentNode)for(var we=0;we<ye.length;we++)if(ye[we].node==re){e.display.currentWheelTarget=re;break e}}if(l&&!P&&!f&&Wr!=null){y&&te&&zi(e,Math.max(0,$.scrollTop+y*Wr)),vi(e,Math.max(0,$.scrollLeft+l*Wr)),(!y||y&&te)&&ie(t),B.wheelStartX=null;return}if(y&&Wr!=null){var We=y*Wr,Ne=e.doc.scrollTop,rt=Ne+B.wrapper.clientHeight;We<0?Ne=Math.max(0,Ne+We-50):rt=Math.min(e.doc.height,rt+We+50),za(e,{top:Ne,bottom:rt})}ya<20&&(B.wheelStartX==null?(B.wheelStartX=$.scrollLeft,B.wheelStartY=$.scrollTop,B.wheelDX=l,B.wheelDY=y,setTimeout(function(){if(B.wheelStartX==null)return;var ht=$.scrollLeft-B.wheelStartX,St=$.scrollTop-B.wheelStartY,Dt=St&&B.wheelDY&&St/B.wheelDY||ht&&B.wheelDX&&ht/B.wheelDX;if(B.wheelStartX=B.wheelStartY=null,!Dt)return;Wr=(Wr*ya+Dt)/(ya+1),++ya},200)):(B.wheelDX+=l,B.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(!Vn(u.anchor,l.anchor)||!Vn(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 Ln(pr(this.ranges[t].anchor),pr(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(Rt(t,l.from())>=0&&Rt(e,l.to())<=0)return u}return-1};var Ln=function(e,t){this.anchor=e,this.head=t};Ln.prototype.from=function(){return kr(this.anchor,this.head)},Ln.prototype.to=function(){return ur(this.anchor,this.head)},Ln.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Jr(e,t,u){var l=e&&e.options.selectionsMayTouch,y=t[u];t.sort(function(We,Ne){return Rt(We.from(),Ne.from())}),u=ne(t,y);for(var B=1;B<t.length;B++){var $=t[B],q=t[B-1],te=Rt(q.to(),$.from());if(l&&!$.empty()?te>0:te>=0){var re=kr(q.from(),$.from()),ye=ur(q.to(),$.to()),we=q.empty()?$.from()==$.head:q.from()==q.head;B<=u&&--u,t.splice(--B,2,new Ln(we?ye:re,we?re:ye))}}return new Hr(t,u)}function li(e,t){return new Hr([new Ln(e,t||e)],0)}function ui(e){return e.text?dt(e.from.line+e.text.length-1,Me(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Wo(e,t){if(Rt(e,t.from)<0)return e;if(Rt(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),dt(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 Ln(Wo(y.anchor,t),Wo(y.head,t)))}return Jr(e.cm,u,e.sel.primIndex)}function Ho(e,t,u){return e.line==t.line?dt(u.line,e.ch-t.ch+u.ch):dt(u.line+(e.line-t.line),e.ch)}function hl(e,t,u){for(var l=[],y=dt(e.first,0),B=y,$=0;$<t.length;$++){var q=t[$],te=Ho(q.from,y,B),re=Ho(ui(q),y,B);if(y=q.to,B=re,u=="around"){var ye=e.sel.ranges[$],we=Rt(ye.head,ye.anchor)<0;l[$]=new Ln(we?re:te,we?te:re)}else l[$]=new Ln(te,te)}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&&Lr(e)}function Ko(e,t){return t.from.ch==0&&t.to.ch==0&&Me(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Za(e,t,u,l){function y(Ut){return u?u[Ut]:null}function B(Ut,Mt,Ft){ni(Ut,Mt,Ft,l),_n(Ut,"change",Ut,t)}function $(Ut,Mt){for(var Ft=[],$t=Ut;$t<Mt;++$t)Ft.push(new br(re[$t],y($t),l));return Ft}var q=t.from,te=t.to,re=t.text,ye=Lt(e,q.line),we=Lt(e,te.line),We=Me(re),Ne=y(re.length-1),rt=te.line-q.line;if(t.full)e.insert(0,$(0,re.length)),e.remove(re.length,e.size-re.length);else if(Ko(e,t)){var ht=$(0,re.length-1);B(we,we.text,Ne),rt&&e.remove(q.line,rt),ht.length&&e.insert(q.line,ht)}else if(ye==we)if(re.length==1)B(ye,ye.text.slice(0,q.ch)+We+ye.text.slice(te.ch),Ne);else{var St=$(1,re.length-1);St.push(new br(We+ye.text.slice(te.ch),Ne,l)),B(ye,ye.text.slice(0,q.ch)+re[0],y(0)),e.insert(q.line+1,St)}else if(re.length==1)B(ye,ye.text.slice(0,q.ch)+re[0]+we.text.slice(te.ch),y(0)),e.remove(q.line+1,rt);else{B(ye,ye.text.slice(0,q.ch)+re[0],y(0)),B(we,We+we.text.slice(te.ch),Ne);var Dt=$(1,re.length-1);rt>1&&e.remove(q.line+1,rt-1),e.insert(q.line+1,Dt)}_n(e,"change",e,t)}function ci(e,t,u){function l(y,B,$){if(y.linked)for(var q=0;q<y.linked.length;++q){var te=y.linked[q];if(te.doc==B)continue;var re=$&&te.sharedHist;if(u&&!re)continue;t(te.doc,re),l(te.doc,y,re)}}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||Xr(e),e.options.mode=t.modeOption,Lr(e)}function zo(e){(e.doc.direction=="rtl"?F:_)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Ur(e,function(){zo(e),Lr(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:pr(t.from),to:ui(t),text:On(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=Me(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Vo(e.done),Me(e.done);if(e.done.length&&!Me(e.done).ranges)return Me(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Me(e.done)}function Xo(e,t,u,l){var y=e.history;y.undone.length=0;var B=+new Date,$,q;if((y.lastOp==l||y.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&y.lastModTime>B-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&($=pl(y,y.lastOp==l)))q=Me($.changes),Rt(t.from,t.to)==0&&Rt(t.from,q.to)==0?q.to=ui(t):$.changes.push(Qa(e,t));else{var te=Me(y.done);for((!te||!te.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=B,y.lastOp=y.lastSelOp=l,y.lastOrigin=y.lastSelOrigin=t.origin,q||Pe(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,B=l&&l.origin;u==y.lastSelOp||B&&y.lastSelOrigin==B&&(y.lastModTime==y.lastSelTime&&y.lastOrigin==B||ml(e,B,Me(y.done),t))?y.done[y.done.length-1]=t:_a(t,y.done),y.lastSelTime=+new Date,y.lastSelOrigin=B,y.lastSelOp=u,l&&l.clearRedo!==!1&&Vo(y.undone)}function _a(e,t){var u=Me(t);u&&u.ranges&&u.equals(e)||t.push(e)}function Yo(e,t,u,l){var y=t["spans_"+e.id],B=0;e.iter(Math.max(e.first,u),Math.min(e.first+e.size,l),function($){$.markedSpans&&((y||(y=t["spans_"+e.id]={}))[B]=$.markedSpans),++B})}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=xn(e,t);if(!u)return l;if(!l)return u;for(var y=0;y<u.length;++y){var B=u[y],$=l[y];if(B&&$){e:for(var q=0;q<$.length;++q){for(var te=$[q],re=0;re<B.length;++re)if(B[re].marker==te.marker)continue e;B.push(te)}}else $&&(u[y]=$)}return u}function Li(e,t,u){for(var l=[],y=0;y<e.length;++y){var B=e[y];if(B.ranges){l.push(u?Hr.prototype.deepCopy.call(B):B);continue}var $=B.changes,q=[];l.push({changes:q});for(var te=0;te<$.length;++te){var re=$[te],ye=void 0;if(q.push({from:re.from,to:re.to,text:re.text}),t)for(var we in re)(ye=we.match(/^spans_(\d+)$/))&&(ne(t,Number(ye[1]))>-1&&(Me(q)[we]=re[we],delete re[we]))}}return l}function qa(e,t,u,l){if(l){var y=e.anchor;if(u){var B=Rt(t,y)<0;B!=Rt(u,y)<0?(y=t,t=u):B!=Rt(t,u)<0&&(t=u)}return new Ln(y,t)}else return new Ln(u||t,t)}function Ea(e,t,u,l,y){y==null&&(y=e.cm&&(e.cm.display.shift||e.extend)),xr(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),B=0;B<e.sel.ranges.length;B++)l[B]=qa(e.sel.ranges[B],t[B],null,y);var $=Jr(e.cm,l,e.sel.primIndex);xr(e,$,u)}function eo(e,t,u,l){var y=e.sel.ranges.slice(0);y[t]=u,xr(e,Jr(e.cm,y,e.sel.primIndex),l)}function Zo(e,t,u,l){xr(e,li(t,u),l)}function bl(e,t,u){var l={ranges:t.ranges,update:function(y){this.ranges=[];for(var B=0;B<y.length;B++)this.ranges[B]=new Ln(I(e,y[B].anchor),I(e,y[B].head))},origin:u&&u.origin};return Pe(e,"beforeSelectionChange",e,l),e.cm&&Pe(e.cm,"beforeSelectionChange",e.cm,l),l.ranges!=t.ranges?Jr(e.cm,l.ranges,l.ranges.length-1):t}function Qo(e,t,u){var l=e.history.done,y=Me(l);y&&y.ranges?(l[l.length-1]=t,xa(e,t,u)):xr(e,t,u)}function xr(e,t,u){xa(e,t,u),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,u)}function xa(e,t,u){(fe(e,"beforeSelectionChange")||e.cm&&fe(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,u));var l=u&&u.bias||(Rt(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,be(e.cm)),_n(e,"cursorActivity",e)}function es(e){qo(e,ts(e,e.sel,null,!1))}function ts(e,t,u,l){for(var y,B=0;B<t.ranges.length;B++){var $=t.ranges[B],q=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[B],te=Ta(e,$.anchor,q&&q.anchor,u,l),re=Ta(e,$.head,q&&q.head,u,l);(y||te!=$.anchor||re!=$.head)&&(y||(y=t.ranges.slice(0,B)),y[B]=new Ln(te,re))}return y?Jr(e.cm,y,t.primIndex):t}function Ii(e,t,u,l,y){var B=Lt(e,t.line);if(B.markedSpans)for(var $=0;$<B.markedSpans.length;++$){var q=B.markedSpans[$],te=q.marker,re="selectLeft"in te?!te.selectLeft:te.inclusiveLeft,ye="selectRight"in te?!te.selectRight:te.inclusiveRight;if((q.from==null||(re?q.from<=t.ch:q.from<t.ch))&&(q.to==null||(ye?q.to>=t.ch:q.to>t.ch))){if(y&&(Pe(te,"beforeCursorEnter"),te.explicitlyCleared))if(B.markedSpans){--$;continue}else break;if(!te.atomic)continue;if(u){var we=te.find(l<0?1:-1),We=void 0;if((l<0?ye:re)&&(we=ns(e,we,-l,we&&we.line==t.line?B:null)),we&&we.line==t.line&&(We=Rt(we,u))&&(l<0?We<0:We>0))return Ii(e,we,t,l,y)}var Ne=te.find(l<0?-1:1);return(l<0?re:ye)&&(Ne=ns(e,Ne,l,Ne.line==t.line?B:null)),Ne?Ii(e,Ne,t,l,y):null}}return t}function Ta(e,t,u,l,y){var B=l||1,$=Ii(e,t,u,B,y)||!y&&Ii(e,t,u,B,!0)||Ii(e,t,u,-B,y)||!y&&Ii(e,t,u,-B,!0);return $||(e.cantEdit=!0,dt(e.first,0))}function ns(e,t,u,l){return u<0&&t.ch==0?t.line>e.first?I(e,dt(t.line-1)):null:u>0&&t.ch==(l||Lt(e,t.line)).text.length?t.line<e.first+e.size-1?dt(t.line+1,0):null:new dt(t.line,t.ch+u)}function rs(e){e.setSelection(dt(e.firstLine(),0),dt(e.lastLine()),ge)}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,B,$,q){y&&(l.from=I(e,y)),B&&(l.to=I(e,B)),$&&(l.text=$),q!==void 0&&(l.origin=q)}),Pe(e,"beforeChange",e,l),e.cm&&Pe(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 cr(e.cm,Di)(e,t,u);if(e.cm.state.suppressEdits)return}if((fe(e,"beforeChange")||e.cm&&fe(e.cm,"beforeChange"))&&(t=is(e,t,!0),!t))return;var l=kn&&!u&&pn(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]==""&&Rt(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,xn(e,t));var l=[];ci(e,function(y,B){!B&&ne(l,y.history)==-1&&(us(y.history,t),l.push(y.history)),Zi(y,t,null,xn(y,t))})}function wa(e,t,u){var l=e.cm&&e.cm.state.suppressEdits;if(l&&!u)return;for(var y=e.history,B,$=e.sel,q=t=="undo"?y.done:y.undone,te=t=="undo"?y.undone:y.done,re=0;re<q.length&&!(B=q[re],u?B.ranges&&!B.equals(e.sel):!B.ranges);re++);if(re==q.length)return;for(y.lastOrigin=y.lastSelOrigin=null;;)if(B=q.pop(),B.ranges){if(_a(B,te),u&&!B.equals(e.sel)){xr(e,B,{clearRedo:!1});return}$=B}else if(l){q.push(B);return}else break;var ye=[];_a($,te),te.push({changes:ye,generation:y.generation}),y.generation=B.generation||++y.maxGeneration;for(var we=fe(e,"beforeChange")||e.cm&&fe(e.cm,"beforeChange"),We=function(ht){var St=B.changes[ht];if(St.origin=t,we&&!is(e,St,!1))return q.length=0,{};ye.push(Qa(e,St));var Dt=ht?$a(e,St):Me(q);Zi(e,St,Dt,$o(e,St)),!ht&&e.cm&&e.cm.scrollIntoView({from:St.from,to:ui(St)});var Ut=[];ci(e,function(Mt,Ft){!Ft&&ne(Ut,Mt.history)==-1&&(us(Mt.history,St),Ut.push(Mt.history)),Zi(Mt,St,null,$o(Mt,St))})},Ne=B.changes.length-1;Ne>=0;--Ne){var rt=We(Ne);if(rt)return rt.v}}function os(e,t){if(t==0)return;if(e.first+=t,e.sel=new Hr(et(e.sel.ranges,function(y){return new Ln(dt(y.anchor.line+t,y.anchor.ch),dt(y.head.line+t,y.head.ch))}),e.sel.primIndex),e.cm){Lr(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 cr(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:dt(e.first,0),to:dt(t.to.line+y,t.to.ch),text:[Me(t.text)],origin:t.origin}}var B=e.lastLine();t.to.line>B&&(t={from:t.from,to:dt(B,Lt(e,B).text.length),text:[t.text[0]],origin:t.origin}),t.removed=On(e,t.from,t.to),u||(u=$a(e,t)),e.cm?_l(e.cm,t,l):Za(e,t,l),xa(e,u,ge),e.cantEdit&&Ta(e,dt(e.firstLine(),0))&&(e.cantEdit=!1)}function _l(e,t,u){var l=e.doc,y=e.display,B=t.from,$=t.to,q=!1,te=B.line;e.options.lineWrapping||(te=Xt(Qn(Lt(l,B.line))),l.iter(te,$.line+1,function(Ne){if(Ne==y.maxLine)return q=!0,!0})),l.sel.contains(t.from,t.to)>-1&&be(e),Za(l,t,u,To(e)),e.options.lineWrapping||(l.iter(te,B.line+t.text.length,function(Ne){var rt=Ht(Ne);rt>y.maxLineLength&&(y.maxLine=Ne,y.maxLineLength=rt,y.maxLineChanged=!0,q=!1)}),q&&(e.curOp.updateMaxLine=!0)),en(l,B.line),Yi(e,400);var re=t.text.length-($.line-B.line)-1;t.full?Lr(e):B.line==$.line&&t.text.length==1&&!Ko(e.doc,t)?oi(e,B.line,"text"):Lr(e,B.line,$.line+1,re);var ye=fe(e,"changes"),we=fe(e,"change");if(we||ye){var We={from:B,to:$,text:t.text,removed:t.removed,origin:t.origin};we&&_n(e,"change",e,We),ye&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(We)}e.display.selForContextMenu=null}function Mi(e,t,u,l,y){var B;l||(l=u),Rt(l,u)<0&&(B=[l,u],u=B[0],l=B[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 B=e[y],$=!0;if(B.ranges){B.copied||(B=e[y]=B.deepCopy(),B.copied=!0);for(var q=0;q<B.ranges.length;q++)ss(B.ranges[q].anchor,t,u,l),ss(B.ranges[q].head,t,u,l);continue}for(var te=0;te<B.changes.length;++te){var re=B.changes[te];if(u<re.from.line)re.from=dt(re.from.line+l,re.from.ch),re.to=dt(re.to.line+l,re.to.ch);else if(t<=re.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,B=t;return typeof t=="number"?B=Lt(e,J(e,t)):y=Xt(t),y==null?null:(l(B,y)&&e.cm&&oi(e.cm,y,u),B)}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,jt(y),_n(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 B=Math.min(t,y-e),$=l.height;if(l.removeInner(e,B),this.height-=$-l.height,y==B&&(this.children.splice(u--,1),l.parent=null),(t-=B)==0)break;e=0}else e-=y}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof qi))){var q=[];this.collapse(q),this.children=[new qi(q)],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],B=y.chunkSize();if(e<=B){if(y.insertInner(e,t,u),y.lines&&y.lines.length>50){for(var $=y.lines.length%25+25,q=$;q<y.lines.length;){var te=new qi(y.lines.slice(q,q+=25));y.height-=te.height,this.children.splice(++l,0,te),te.parent=this}y.lines=y.lines.slice(0,$),this.maybeSpill()}break}e-=B}},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=ne(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],B=y.chunkSize();if(e<B){var $=Math.min(t,B-e);if(y.iterN(e,$,u))return!0;if((t-=$)==0)break;e=0}else e-=B}}};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=Xt(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 B=nr(this);fn(u,Math.max(0,u.height-B)),e&&(Ur(e,function(){cs(e,u,-B),oi(e,l,"widget")}),_n(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=nr(this)-t;if(!y)return;Rr(this.doc,l)||fn(l,l.height+y),u&&Ur(u,function(){u.curOp.forceUpdate=!0,cs(u,l,y),_n(u,"lineWidgetChanged",u,e,Xt(l))})},pe(ta);function cs(e,t,u){Kn(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),B=e.cm;return B&&y.noHScroll&&(B.display.alignWidgets=!0),Qi(e,t,"widget",function($){var q=$.widgets||($.widgets=[]);if(y.insertAt==null?q.push(y):q.splice(Math.min(q.length-1,Math.max(0,y.insertAt)),0,y),y.line=$,B&&!Rr(e,$)){var te=Kn($)<e.scrollTop;fn($,$.height+nr(y)),te&&Ka(B,y.height),B.curOp.forceUpdate=!0}return!0}),B&&_n(B,"lineWidgetAdded",B,y,typeof t=="number"?t:Xt(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),fe(this,"clear")){var u=this.find();u&&_n(this,"clear",u.from,u.to)}for(var l=null,y=null,B=0;B<this.lines.length;++B){var $=this.lines[B],q=Sn($.markedSpans,this);e&&!this.collapsed?oi(e,Xt($),"text"):e&&(q.to!=null&&(y=Xt($)),q.from!=null&&(l=Xt($))),$.markedSpans=Dn($.markedSpans,q),q.from==null&&this.collapsed&&!Rr(this.doc,$)&&e&&fn($,Si(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var te=0;te<this.lines.length;++te){var re=Qn(this.lines[te]),ye=Ht(re);ye>e.display.maxLineLength&&(e.display.maxLine=re,e.display.maxLineLength=ye,e.display.maxLineChanged=!0)}l!=null&&e&&this.collapsed&&Lr(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&&_n(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 B=this.lines[y],$=Sn(B.markedSpans,this);if($.from!=null&&(u=dt(t?B:Xt(B),$.from),e==-1))return u;if($.to!=null&&(l=dt(t?B:Xt(B),$.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;Ur(l,function(){var y=t.line,B=Xt(t.line),$=ca(l,B);if($&&(mo($),l.curOp.selectionChanged=l.curOp.forceUpdate=!0),l.curOp.updateMaxLine=!0,!Rr(u.doc,y)&&u.height!=null){var q=u.height;u.height=null;var te=nr(u)-q;te&&fn(y,y.height+te)}_n(l,"markerChanged",l,e)})},di.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ne(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},di.prototype.detachLine=function(e){if(this.lines.splice(ne(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},pe(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 cr(e.cm,Pi)(e,t,u,l,y);var B=new di(e,y),$=Rt(t,u);if(l&&T(l,B,!1),$>0||$==0&&B.clearWhenEmpty!==!1)return B;if(B.replacedWith&&(B.collapsed=!0,B.widgetNode=C("span",[B.replacedWith],"CodeMirror-widget"),l.handleMouseEvents||B.widgetNode.setAttribute("cm-ignore-events","true"),l.insertLeft&&(B.widgetNode.insertLeft=!0)),B.collapsed){if(cn(e,t.line,t,u,B)||t.line!=u.line&&cn(e,u.line,t,u,B))throw new Error("Inserting collapsed marker partially overlapping an existing one");Rn()}B.addToHistory&&Xo(e,{from:t,to:u,origin:"markText"},e.sel,NaN);var q=t.line,te=e.cm,re;if(e.iter(q,u.line+1,function(we){te&&B.collapsed&&!te.options.lineWrapping&&Qn(we)==te.display.maxLine&&(re=!0),B.collapsed&&q!=t.line&&fn(we,0),Hn(we,new In(B,q==t.line?t.ch:null,q==u.line?u.ch:null)),++q}),B.collapsed&&e.iter(t.line,u.line+1,function(we){Rr(e,we)&&fn(we,0)}),B.clearOnEnter&&Ce(B,"beforeCursorEnter",function(){return B.clear()}),B.readOnly&&(An(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),B.collapsed&&(B.id=++ds,B.atomic=!0),te){if(re&&(te.curOp.updateMaxLine=!0),B.collapsed)Lr(te,t.line,u.line+1);else if(B.className||B.startStyle||B.endStyle||B.css||B.attributes||B.title)for(var ye=t.line;ye<=u.line;ye++)oi(te,ye,"text");B.atomic&&es(te.doc),_n(te,"markerAdded",te,B)}return B}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();_n(this,"clear")},na.prototype.find=function(e,t){return this.primary.find(e,t)},pe(na);function xl(e,t,u,l,y){l=T(l),l.shared=!1;var B=[Pi(e,t,u,l,y)],$=B[0],q=l.widgetNode;return ci(e,function(te){q&&(l.widgetNode=q.cloneNode(!0)),B.push(Pi(te,I(te,t),I(te,u),l,y));for(var re=0;re<te.linked.length;++re)if(te.linked[re].isParent)return;$=Me(B)}),new na(B,$)}function hs(e){return e.findMarks(dt(e.first,0),e.clipPos(dt(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(),B=e.clipPos(y.from),$=e.clipPos(y.to);if(Rt(B,$)){var q=Pi(e,B,$,l.primary,l.primary.type);l.markers.push(q),q.parent=l}}}function wl(e){for(var t=function(l){var y=e[l],B=[y.primary.doc];ci(y.primary.doc,function(te){return B.push(te)});for(var $=0;$<y.markers.length;$++){var q=y.markers[$];ne(B,q.doc)==-1&&(q.parent=null,y.markers.splice($--,1))}},u=0;u<e.length;u++)t(u)}var Sl=0,Ir=function(e,t,u,l,y){if(!(this instanceof Ir))return new Ir(e,t,u,l,y);u==null&&(u=0),ea.call(this,[new qi([new br("",null)])]),this.first=u,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=u;var B=dt(u,0);this.sel=li(B),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:B,to:B,text:e}),xr(this,li(B),ge)};Ir.prototype=at(ea.prototype,{constructor:Ir,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=un(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:dr(function(e){var t=dt(this.first,0),u=this.first+this.size-1;Di(this,{from:t,to:dt(u,Lt(this,u).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Gi(this.cm,0,0),xr(this,li(t),ge)}),replaceRange:function(e,t,u,l){t=I(this,t),u=u?I(this,u):t,Mi(this,e,t,u,l)},getRange:function(e,t,u){var l=On(this,I(this,e),I(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(Pn(this,e))return Lt(this,e)},getLineNumber:function(e){return Xt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Lt(this,e)),Qn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return I(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:dr(function(e,t,u){Zo(this,I(this,typeof e=="number"?dt(e,t||0):e),null,u)}),setSelection:dr(function(e,t,u){Zo(this,I(this,e),I(this,t||e),u)}),extendSelection:dr(function(e,t,u){Ea(this,I(this,e),t&&I(this,t),u)}),extendSelections:dr(function(e,t){Jo(this,K(this,e),t)}),extendSelectionsBy:dr(function(e,t){var u=et(this.sel.ranges,e);Jo(this,K(this,u),t)}),setSelections:dr(function(e,t,u){if(!e.length)return;for(var l=[],y=0;y<e.length;y++)l[y]=new Ln(I(this,e[y].anchor),I(this,e[y].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),xr(this,Jr(this.cm,l,t),u)}),addSelection:dr(function(e,t,u){var l=this.sel.ranges.slice(0);l.push(new Ln(I(this,e),I(this,t||e))),xr(this,Jr(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=On(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=On(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:dr(function(e,t,u){for(var l=[],y=this.sel,B=0;B<y.ranges.length;B++){var $=y.ranges[B];l[B]={from:$.from(),to:$.to(),text:this.splitLines(e[B]),origin:u}}for(var q=t&&t!="end"&&hl(this,l,t),te=l.length-1;te>=0;te--)Di(this,l[te]);q?Qo(this,q):this.cm&&Ai(this.cm)}),undo:dr(function(){wa(this,"undo")}),redo:dr(function(){wa(this,"redo")}),undoSelection:dr(function(){wa(this,"undo",!0)}),redoSelection:dr(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:dr(function(e,t,u){return Qi(this,e,"gutter",function(l){var y=l.gutterMarkers||(l.gutterMarkers={});return y[t]=u,!u&&de(y)&&(l.gutterMarkers=null),!0})}),clearGutter:dr(function(e){var t=this;this.iter(function(u){u.gutterMarkers&&u.gutterMarkers[e]&&Qi(t,u,"gutter",function(){return u.gutterMarkers[e]=null,de(u.gutterMarkers)&&(u.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Pn(this,e))return null;if(t=e,e=Lt(this,e),!e)return null}else if(t=Xt(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:dr(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(O(u).test(l[y]))return!1;l[y]+=" "+u}return!0})}),removeLineClass:dr(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",B=l[y];if(B)if(u==null)l[y]=null;else{var $=B.match(O(u));if(!$)return!1;var q=$.index+$[0].length;l[y]=B.slice(0,$.index)+(!$.index||q==B.length?"":" ")+B.slice(q)||null}else return!1;return!0})}),addLineWidget:dr(function(e,t,u){return El(this,e,t,u)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,u){return Pi(this,I(this,e),I(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=I(this,e),Pi(this,e,e,u,"bookmark")},findMarksAt:function(e){e=I(this,e);var t=[],u=Lt(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=I(this,e),t=I(this,t);var l=[],y=e.line;return this.iter(e.line,t.line+1,function(B){var $=B.markedSpans;if($)for(var q=0;q<$.length;q++){var te=$[q];!(te.to!=null&&y==e.line&&e.ch>=te.to||te.from==null&&y!=e.line||te.from!=null&&y==t.line&&te.from>=t.ch)&&(!u||u(te.marker))&&l.push(te.marker.parent||te.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 B=y.text.length+l;if(B>e)return t=e,!0;e-=B,++u}),I(this,dt(u,t))},indexFromPos:function(e){e=I(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 Ir(un(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 Ir(un(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 Wn&&(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):Ke(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:dr(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)})}),Ir.prototype.eachLine=Ir.prototype.iter;var fs=0;function Cl(e){var t=this;if(ps(t),Fe(t,e)||En(t.display,e))return;ie(e),G&&(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,B=Array(y),$=0,q=function(){++$==y&&cr(t,function(){u=I(t.doc,u);var Ne={from:u,to:u,text:t.doc.splitLines(B.filter(function(rt){return rt!=null}).join(t.doc.lineSeparator())),origin:"paste"};Di(t.doc,Ne),Qo(t.doc,li(I(t.doc,u),I(t.doc,ui(Ne))))})()},te=function(Ne,rt){if(t.options.allowDropFileTypes&&ne(t.options.allowDropFileTypes,Ne.type)==-1){q();return}var ht=new FileReader;ht.onerror=function(){return q()},ht.onload=function(){var St=ht.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(St)){q();return}B[rt]=St,q()},ht.readAsText(Ne)},re=0;re<l.length;re++)te(l[re],re);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 ye=e.dataTransfer.getData("Text");if(ye){var we;if(t.state.draggingText&&!t.state.draggingText.copy&&(we=t.listSelections()),xa(t.doc,li(u,u)),we)for(var We=0;We<we.length;++We)Mi(t.doc,"",we[We].anchor,we[We].head,"drag");t.replaceSelection(ye,"around","paste"),t.display.input.focus()}}catch(Ne){}}}function Ol(e,t){if(G&&(!e.state.draggingText||+new Date-fs<100)){me(t);return}if(Fe(e,t)||En(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)),g(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 B=0;B<u.length;B++)e(u[B])})}var gs=!1;function Rl(){if(gs)return;Ll(),gs=!0}function Ll(){var e;Ce(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ms(Il)},100))}),Ce(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,B,$=0;$<t.length-1;$++){var q=t[$];if(/^(cmd|meta|m)$/i.test(q))B=!0;else if(/^a(lt)?$/i.test(q))u=!0;else if(/^(c|ctrl|control)$/i.test(q))l=!0;else if(/^s(hift)?$/i.test(q))y=!0;else throw new Error("Unrecognized modifier name: "+q)}return u&&(e="Alt-"+e),l&&(e="Ctrl-"+e),B&&(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=et(u.split(" "),Dl),B=0;B<y.length;B++){var $=void 0,q=void 0;B==y.length-1?(q=y.join(" "),$=l):(q=y.slice(0,B+1).join(" "),$="...");var te=t[q];if(!te)t[q]=$;else if(te!=$)throw new Error("Inconsistent bindings for "+q)}delete e[u]}for(var re in t)e[re]=t[re];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 B=0;B<t.fallthrough.length;B++){var $=ki(e,t.fallthrough[B],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 B=t(u[y]);l.length&&Rt(B.from,Me(l).to)<=0;){var $=l.pop();if(Rt($.from,B.from)<0){B.from=$.from;break}}l.push(B)}Ur(e,function(){for(var q=l.length-1;q>=0;q--)Mi(e.doc,"",l[q].from,l[q].to,"+delete");Ai(e)})}function to(e,t,u){var l=De(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 dt(t.line,l,u<0?"after":"before")}function ro(e,t,u,l,y){if(e){t.doc.direction=="rtl"&&(y=-y);var B=xt(u,t.doc.direction);if(B){var $=y<0?Me(B):B[0],q=y<0==($.level==1),te=q?"after":"before",re;if($.level>0||t.doc.direction=="rtl"){var ye=Er(t,u);re=y<0?u.text.length-1:0;var we=ei(t,ye,re).top;re=qe(function(We){return ei(t,ye,We).top==we},y<0==($.level==1)?$.from:$.to-1,re),te=="before"&&(re=to(u,re,1))}else re=y<0?$.to:$.from;return new dt(l,re,te)}}return new dt(l,y<0?u.text.length:0,y<0?"before":"after")}function Pl(e,t,u,l){var y=xt(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 B=gt(y,u.ch,u.sticky),$=y[B];if(e.doc.direction=="ltr"&&$.level%2==0&&(l>0?$.to>u.ch:$.from<u.ch))return no(t,u,l);var q=function(Dt,Ut){return to(t,Dt instanceof dt?Dt.ch:Dt,Ut)},te,re=function(Dt){return e.options.lineWrapping?(te=te||Er(e,t),xo(e,t,te,Dt)):{begin:0,end:t.text.length}},ye=re(u.sticky=="before"?q(u,-1):u.ch);if(e.doc.direction=="rtl"||$.level==1){var we=$.level==1==l<0,We=q(u,we?1:-1);if(We!=null&&(we?We<=$.to&&We<=ye.end:We>=$.from&&We>=ye.begin)){var Ne=we?"before":"after";return new dt(u.line,We,Ne)}}var rt=function(Dt,Ut,Mt){for(var Ft=function(Fn,hr){return hr?new dt(u.line,q(Fn,1),"before"):new dt(u.line,Fn,"after")};Dt>=0&&Dt<y.length;Dt+=Ut){var $t=y[Dt],Vt=Ut>0==($t.level!=1),hn=Vt?Mt.begin:q(Mt.end,-1);if($t.from<=hn&&hn<$t.to)return Ft(hn,Vt);if(hn=Vt?$t.from:q($t.to,-1),Mt.begin<=hn&&hn<Mt.end)return Ft(hn,Vt)}},ht=rt(B+l,l,ye);if(ht)return ht;var St=l>0?ye.end:q(ye.begin,-1);return St!=null&&!(l>0&&St==t.text.length)&&(ht=rt(l>0?0:y.length-1,l,re(St)),ht)?ht:null}var aa={selectAll:rs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),ge)},killLine:function(e){return Ni(e,function(t){if(t.empty()){var u=Lt(e.doc,t.head.line).text.length;return t.head.ch==u&&t.head.line<e.lastLine()?{from:t.head,to:dt(t.head.line+1,0)}:{from:t.head,to:dt(t.head.line,u)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Ni(e,function(t){return{from:dt(t.from().line,0),to:I(e.doc,dt(t.to().line+1,0))}})},delLineLeft:function(e){return Ni(e,function(t){return{from:dt(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(dt(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(dt(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")},Oe)},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")},Oe)},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},Oe)},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 B=u[y].from(),$=z(e.getLine(B.line),B.ch,l);t.push(ue(l-$%l))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Ur(e,function(){for(var t=e.listSelections(),u=[],l=0;l<t.length;l++){if(!t[l].empty())continue;var y=t[l].head,B=Lt(e.doc,y.line).text;if(B){if(y.ch==B.length&&(y=new dt(y.line,y.ch-1)),y.ch>0)y=new dt(y.line,y.ch+1),e.replaceRange(B.charAt(y.ch-1)+B.charAt(y.ch-2),dt(y.line,y.ch-2),y,"+transpose");else if(y.line>e.doc.first){var $=Lt(e.doc,y.line-1).text;$&&(y=new dt(y.line,1),e.replaceRange(B.charAt(0)+e.doc.lineSeparator()+$.charAt($.length-1),dt(y.line-1,$.length-1),y,"+transpose"))}}u.push(new Ln(y,y))}e.setSelections(u)})},newlineAndIndent:function(e){return Ur(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=Lt(e.doc,t),l=Qn(u);return l!=u&&(t=Xt(l)),ro(!0,e,l,t,1)}function kl(e,t){var u=Lt(e.doc,t),l=Kr(u);return l!=u&&(t=Xt(l)),ro(!0,e,u,t,-1)}function Es(e,t){var u=_s(e,t.line),l=Lt(e.doc,u.line),y=xt(l,e.doc.direction);if(!y||y[0].level==0){var B=Math.max(u.ch,l.text.search(/\S/)),$=t.line==u.line&&t.ch<=B&&t.ch;return dt(u.line,$?0:B,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)!=xe}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"&&_n(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=N(),Fe(t,e))return;G&&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&&!Ue&&(r?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),P&&!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"),Qe(document,"keyup",u),Qe(document,"mouseover",u))}Ce(document,"keyup",u),Ce(document,"mouseover",u)}function Ss(e){e.keyCode==16&&(this.doc.sel.shift=!1),Fe(this,e)}function Cs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(En(t.display,e)||Fe(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&&Rt(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(Fe(t,e)||u.activeTouch&&u.input.supportsTouch())return;if(u.input.ensurePolled(),u.shift=e.shiftKey,En(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=ke(e),B=l?Wl(l,y):"single";if(window.focus(),y==1&&t.state.selectingText&&t.state.selectingText(e),l&&Hl(t,y,l,B,e))return;y==1?l?Gl(t,l,B,e):Te(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 B="Click";return l=="double"?B="Double"+B:l=="triple"&&(B="Triple"+B),B=(t==1?"Left":t==2?"Middle":"Right")+B,oa(e,ys(B,y),y,function($){if(typeof $=="string"&&($=aa[$]),!$)return!1;var q=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),q=$(e,u)!=xe}finally{e.state.suppressEdits=!1}return q})}function Kl(e,t,u){var l=e.getOption("configureMouse"),y=l?l(e,t,u):{};if(y.unit==null){var B=s?u.shiftKey&&u.metaKey:u.altKey;y.unit=B?"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){G?setTimeout(j(Oo,e),0):e.curOp.focus=N();var y=Kl(e,u,l),B=e.doc.sel,$;e.options.dragDrop&&$e&&!e.isReadOnly()&&u=="single"&&($=B.contains(t))>-1&&(Rt(($=B.ranges[$]).from(),t)<0||t.xRel>0)&&(Rt($.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,B=!1,$=cr(e,function(re){n&&(y.scroller.draggable=!1),e.state.draggingText=!1,Qe(y.wrapper.ownerDocument,"mouseup",$),Qe(y.wrapper.ownerDocument,"mousemove",q),Qe(y.scroller,"dragstart",te),Qe(y.scroller,"drop",$),B||(ie(re),l.addNew||Ea(e.doc,u,null,null,l.extend),n&&!h||G&&W==9?setTimeout(function(){y.wrapper.ownerDocument.body.focus({preventScroll:!0}),y.input.focus()},20):y.input.focus())}),q=function(re){B=B||Math.abs(t.clientX-re.clientX)+Math.abs(t.clientY-re.clientY)>=10},te=function(){return B=!0};n&&(y.scroller.draggable=!0),e.state.draggingText=$,$.copy=!l.moveOnDrag,y.scroller.dragDrop&&y.scroller.dragDrop(),Ce(y.wrapper.ownerDocument,"mouseup",$),Ce(y.wrapper.ownerDocument,"mousemove",q),Ce(y.scroller,"dragstart",te),Ce(y.scroller,"drop",$),Ao(e),setTimeout(function(){return y.input.focus()},20)}function As(e,t,u){if(u=="char")return new Ln(t,t);if(u=="word")return e.findWordAt(t);if(u=="line")return new Ln(dt(t.line,0),I(e.doc,dt(t.line+1,0)));var l=u(e,t);return new Ln(l.from,l.to)}function Vl(e,t,u,l){var y=e.display,B=e.doc;ie(t);var $,q,te=B.sel,re=te.ranges;if(l.addNew&&!l.extend?(q=B.sel.contains(u),q>-1?$=re[q]:$=new Ln(u,u)):($=B.sel.primary(),q=B.sel.primIndex),l.unit=="rectangle")l.addNew||($=new Ln(u,u)),u=mi(e,t,!0,!0),q=-1;else{var ye=As(e,u,l.unit);l.extend?$=qa($,ye.anchor,ye.head,l.extend):$=ye}l.addNew?q==-1?(q=re.length,xr(B,Jr(e,re.concat([$]),q),{scroll:!1,origin:"*mouse"})):re.length>1&&re[q].empty()&&l.unit=="char"&&!l.extend?(xr(B,Jr(e,re.slice(0,q).concat(re.slice(q+1)),0),{scroll:!1,origin:"*mouse"}),te=B.sel):eo(B,q,$,ve):(q=0,xr(B,new Hr([$],0),ve),te=B.sel);var we=u;function We(Mt){if(Rt(we,Mt)==0)return;if(we=Mt,l.unit=="rectangle"){for(var Ft=[],$t=e.options.tabSize,Vt=z(Lt(B,u.line).text,u.ch,$t),hn=z(Lt(B,Mt.line).text,Mt.ch,$t),Fn=Math.min(Vt,hn),hr=Math.max(Vt,hn),Gn=Math.min(u.line,Mt.line),Fr=Math.min(e.lastLine(),Math.max(u.line,Mt.line));Gn<=Fr;Gn++){var Dr=Lt(B,Gn).text,rr=Re(Dr,Fn,$t);Fn==hr?Ft.push(new Ln(dt(Gn,rr),dt(Gn,rr))):Dr.length>rr&&Ft.push(new Ln(dt(Gn,rr),dt(Gn,Re(Dr,hr,$t))))}Ft.length||Ft.push(new Ln(u,u)),xr(B,Jr(e,te.ranges.slice(0,q).concat(Ft),q),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Mt)}else{var Mr=$,yr=As(e,Mt,l.unit),lr=Mr.anchor,ir;Rt(yr.anchor,lr)>0?(ir=yr.head,lr=kr(Mr.from(),yr.anchor)):(ir=yr.anchor,lr=ur(Mr.to(),yr.head));var $n=te.ranges.slice(0);$n[q]=Xl(e,new Ln(I(B,lr),ir)),xr(B,Jr(e,$n,q),ve)}}var Ne=y.wrapper.getBoundingClientRect(),rt=0;function ht(Mt){var Ft=++rt,$t=mi(e,Mt,!0,l.unit=="rectangle");if(!$t)return;if(Rt($t,we)!=0){e.curOp.focus=N(),We($t);var Vt=ma(y,B);($t.line>=Vt.to||$t.line<Vt.from)&&setTimeout(cr(e,function(){rt==Ft&&ht(Mt)}),150)}else{var hn=Mt.clientY<Ne.top?-20:Mt.clientY>Ne.bottom?20:0;hn&&setTimeout(cr(e,function(){if(rt!=Ft)return;y.scroller.scrollTop+=hn,ht(Mt)}),50)}}function St(Mt){e.state.selectingText=!1,rt=Infinity,Mt&&(ie(Mt),y.input.focus()),Qe(y.wrapper.ownerDocument,"mousemove",Dt),Qe(y.wrapper.ownerDocument,"mouseup",Ut),B.history.lastSelOrigin=null}var Dt=cr(e,function(Mt){Mt.buttons===0||!ke(Mt)?St(Mt):ht(Mt)}),Ut=cr(e,St);e.state.selectingText=Ut,Ce(y.wrapper.ownerDocument,"mousemove",Dt),Ce(y.wrapper.ownerDocument,"mouseup",Ut)}function Xl(e,t){var u=t.anchor,l=t.head,y=Lt(e.doc,u.line);if(Rt(u,l)==0&&u.sticky==l.sticky)return t;var B=xt(y);if(!B)return t;var $=gt(B,u.ch,u.sticky),q=B[$];if(q.from!=u.ch&&q.to!=u.ch)return t;var te=$+(q.from==u.ch==(q.level!=1)?0:1);if(te==0||te==B.length)return t;var re;if(l.line!=u.line)re=(l.line-u.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var ye=gt(B,l.ch,l.sticky),we=ye-$||(l.ch-u.ch)*(q.level==1?-1:1);ye==te-1||ye==te?re=we<0:re=we>0}var We=B[te+(re?-1:0)],Ne=re==(We.level==1),rt=Ne?We.from:We.to,ht=Ne?"after":"before";return u.ch==rt&&u.sticky==ht?t:new Ln(new dt(u.line,rt,ht),l)}function Rs(e,t,u,l){var y,B;if(t.touches)y=t.touches[0].clientX,B=t.touches[0].clientY;else try{y=t.clientX,B=t.clientY}catch(We){return!1}if(y>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;l&&ie(t);var $=e.display,q=$.lineDiv.getBoundingClientRect();if(B>q.bottom||!fe(e,u))return ce(t);B-=q.top-$.viewOffset;for(var te=0;te<e.display.gutterSpecs.length;++te){var re=$.gutters.childNodes[te];if(re&&re.getBoundingClientRect().right>=y){var ye=mn(e.doc,B),we=e.display.gutterSpecs[te];return Pe(e,u,e,ye,we.className,t),ce(t)}}}function oo(e,t){return Rs(e,t,"gutterClick",!0)}function Ls(e,t){if(En(e.display,t)||Yl(e,t))return;if(Fe(e,t,"contextmenu"))return;L||e.display.input.onContextMenu(t)}function Yl(e,t){return fe(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,B,$){e.defaults[l]=y,B&&(t[l]=$?function(q,te,re){re!=Ui&&B(q,te,re)}:B)}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),Lr(l)},!0),u("lineSeparator",null,function(l,y){if(l.doc.lineSep=y,!y)return;var B=[],$=l.doc.first;l.doc.iter(function(te){for(var re=0;;){var ye=te.text.indexOf(y,re);if(ye==-1)break;re=ye+y.length,B.push(dt($,ye))}$++});for(var q=B.length-1;q>=0;q--)Mi(l.doc,y,B[q],dt(B[q].line,B[q].ch+y.length))}),u("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(l,y,B){l.state.specialChars=new RegExp(y.source+(y.test(" ")?"":"| "),"g"),B!=Ui&&l.refresh()}),u("specialCharPlaceholder",Cn,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",!S),u("wholeLineUpdateBefore",!0),u("theme","default",function(l){Is(l),$i(l)},!0),u("keyMap","default",function(l,y,B){var $=Ca(y),q=B!=Ui&&Ca(B);q&&q.detach&&q.detach(l,$),$.attach&&$.attach(l,q||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,B=t?Ce:Qe;B(e.display.scroller,"dragstart",y.start),B(e.display.scroller,"dragenter",y.enter),B(e.display.scroller,"dragover",y.over),B(e.display.scroller,"dragleave",y.leave),B(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"),Xr(e)),ja(e),Lr(e),Hi(e),setTimeout(function(){return Ri(e)},100)}function Wn(e,t){var u=this;if(!(this instanceof Wn))return new Wn(e,t);this.options=t=t?T(t):{},T(Ds,t,!1);var l=t.value;typeof l=="string"?l=new Ir(l,t.mode,null,t.lineSeparator,t.direction):t.mode&&(l.modeOption=t.mode),this.doc=l;var y=new Wn.inputStyles[t.inputStyle](this),B=this.display=new cl(e,l,y,t);B.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&&B.input.focus(),G&&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 q=0;q<so.length;++q)so[q](this);_i(this),n&&t.lineWrapping&&getComputedStyle(B.lineDiv).textRendering=="optimizelegibility"&&(B.lineDiv.style.textRendering="auto")}Wn.defaults=Ds,Wn.optionHandlers=Aa;function Ql(e){var t=e.display;Ce(t.scroller,"mousedown",cr(e,Os)),G&&W<11?Ce(t.scroller,"dblclick",cr(e,function(te){if(Fe(e,te))return;var re=mi(e,te);if(!re||oo(e,te)||En(e.display,te))return;ie(te);var ye=e.findWordAt(re);Ea(e.doc,ye.anchor,ye.head)})):Ce(t.scroller,"dblclick",function(te){return Fe(e,te)||ie(te)}),Ce(t.scroller,"contextmenu",function(te){return Ls(e,te)}),Ce(t.input.getField(),"contextmenu",function(te){t.scroller.contains(te.target)||Ls(e,te)});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 B(te){if(te.touches.length!=1)return!1;var re=te.touches[0];return re.radiusX<=1&&re.radiusY<=1}function $(te,re){if(re.left==null)return!0;var ye=re.left-te.left,we=re.top-te.top;return ye*ye+we*we>20*20}Ce(t.scroller,"touchstart",function(te){if(!Fe(e,te)&&!B(te)&&!oo(e,te)){t.input.ensurePolled(),clearTimeout(u);var re=+new Date;t.activeTouch={start:re,moved:!1,prev:re-l.end<=300?l:null},te.touches.length==1&&(t.activeTouch.left=te.touches[0].pageX,t.activeTouch.top=te.touches[0].pageY)}}),Ce(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ce(t.scroller,"touchend",function(te){var re=t.activeTouch;if(re&&!En(t,te)&&re.left!=null&&!re.moved&&new Date-re.start<300){var ye=e.coordsChar(t.activeTouch,"page"),we;!re.prev||$(re,re.prev)?we=new Ln(ye,ye):!re.prev.prev||$(re,re.prev.prev)?we=e.findWordAt(ye):we=new Ln(dt(ye.line,0),I(e.doc,dt(ye.line+1,0))),e.setSelection(we.anchor,we.head),e.focus(),ie(te)}y()}),Ce(t.scroller,"touchcancel",y),Ce(t.scroller,"scroll",function(){t.scroller.clientHeight&&(zi(e,t.scroller.scrollTop),vi(e,t.scroller.scrollLeft,!0),Pe(e,"scroll",e))}),Ce(t.scroller,"mousewheel",function(te){return Bo(e,te)}),Ce(t.scroller,"DOMMouseScroll",function(te){return Bo(e,te)}),Ce(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(te){Fe(e,te)||me(te)},over:function(te){Fe(e,te)||(Al(e,te),me(te))},start:function(te){return Ol(e,te)},drop:cr(e,Cl),leave:function(te){Fe(e,te)||ps(e)}};var q=t.input.getField();Ce(q,"keyup",function(te){return Ss.call(e,te)}),Ce(q,"keydown",cr(e,ws)),Ce(q,"keypress",cr(e,Cs)),Ce(q,"focus",function(te){return Wa(e,te)}),Ce(q,"blur",function(te){return Oi(e,te)})}var so=[];Wn.defineInitHook=function(e){return so.push(e)};function ua(e,t,u,l){var y=e.doc,B;u==null&&(u="add"),u=="smart"&&(y.mode.indent?B=ut(e,t).state:u="prev");var $=e.options.tabSize,q=Lt(y,t),te=z(q.text,null,$);q.stateAfter&&(q.stateAfter=null);var re=q.text.match(/^\s*/)[0],ye;if(!l&&!/\S/.test(q.text))ye=0,u="not";else if(u=="smart"&&(ye=y.mode.indent(B,q.text.slice(re.length),q.text),ye==xe||ye>150)){if(!l)return;u="prev"}u=="prev"?t>y.first?ye=z(Lt(y,t-1).text,null,$):ye=0:u=="add"?ye=te+e.options.indentUnit:u=="subtract"?ye=te-e.options.indentUnit:typeof u=="number"&&(ye=te+u),ye=Math.max(0,ye);var we="",We=0;if(e.options.indentWithTabs)for(var Ne=Math.floor(ye/$);Ne;--Ne)We+=$,we+=" ";if(We<ye&&(we+=ue(ye-We)),we!=re)return Mi(y,we,dt(t,0),dt(t,re.length),"+input"),q.stateAfter=null,!0;for(var rt=0;rt<y.sel.ranges.length;rt++){var ht=y.sel.ranges[rt];if(ht.head.line==t&&ht.head.ch<re.length){var St=dt(t,re.length);eo(y,rt,new Ln(St,St));break}}}var Zr=null;function Ra(e){Zr=e}function lo(e,t,u,l,y){var B=e.doc;e.display.shift=!1,l||(l=B.sel);var $=+new Date-200,q=y=="paste"||e.state.pasteIncoming>$,te=Ke(t),re=null;if(q&&l.ranges.length>1)if(Zr&&Zr.text.join(`
|
|
`)==t){if(l.ranges.length%Zr.text.length==0){re=[];for(var ye=0;ye<Zr.text.length;ye++)re.push(B.splitLines(Zr.text[ye]))}}else te.length==l.ranges.length&&e.options.pasteLinesPerSelection&&(re=et(te,function(Dt){return[Dt]}));for(var we=e.curOp.updateInput,We=l.ranges.length-1;We>=0;We--){var Ne=l.ranges[We],rt=Ne.from(),ht=Ne.to();Ne.empty()&&(u&&u>0?rt=dt(rt.line,rt.ch-u):e.state.overwrite&&!q?ht=dt(ht.line,Math.min(Lt(B,ht.line).text.length,ht.ch+Me(te).length)):q&&Zr&&Zr.lineWise&&Zr.text.join(`
|
|
`)==te.join(`
|
|
`)&&(rt=ht=dt(rt.line,0)));var St={from:rt,to:ht,text:re?re[We%re.length]:te,origin:y||(q?"paste":e.state.cutIncoming>$?"cut":"+input")};Di(e.doc,St),_n(e,"inputRead",e,St)}t&&!q&&Ps(e,t),Ai(e),e.curOp.updateInput<2&&(e.curOp.updateInput=we),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&&Ur(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 B=e.getModeAt(y.head),$=!1;if(B.electricChars){for(var q=0;q<B.electricChars.length;q++)if(t.indexOf(B.electricChars.charAt(q))>-1){$=ua(e,y.head.line,"smart");break}}else B.electricInput&&(B.electricInput.test(Lt(e.doc,y.head.line).text.slice(0,y.head.ch))&&($=ua(e,y.head.line,"smart")));$&&_n(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,B={anchor:dt(y,0),head:dt(y+1,0)};u.push(B),t.push(e.getRange(B.anchor,B.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 B=this.options,$=B[l];if(B[l]==y&&l!="mode")return;B[l]=y,t.hasOwnProperty(l)&&cr(this,t[l])(this,y,$),Pe(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,B=0;B<y.length;++B)if(y[B]==l||y[B].name==l)return y.splice(B,1),!0},addOverlay:Or(function(l,y){var B=l.token?l:e.getMode(this.options,l);if(B.startState)throw new Error("Overlays may not be stateful.");it(this.state.overlays,{mode:B,modeSpec:l,opaque:y&&y.opaque,priority:y&&y.priority||0},function($){return $.priority}),this.state.modeGen++,Lr(this)}),removeOverlay:Or(function(l){for(var y=this.state.overlays,B=0;B<y.length;++B){var $=y[B].modeSpec;if($==l||typeof l=="string"&&$.name==l){y.splice(B,1),this.state.modeGen++,Lr(this);return}}}),indentLine:Or(function(l,y,B){typeof y!="string"&&typeof y!="number"&&(y==null?y=this.options.smartIndent?"smart":"prev":y=y?"add":"subtract"),Pn(this.doc,l)&&ua(this,l,y,B)}),indentSelection:Or(function(l){for(var y=this.doc.sel.ranges,B=-1,$=0;$<y.length;$++){var q=y[$];if(q.empty())q.head.line>B&&(ua(this,q.head.line,l,!0),B=q.head.line,$==this.doc.sel.primIndex&&Ai(this));else{var te=q.from(),re=q.to(),ye=Math.max(B,te.line);B=Math.min(this.lastLine(),re.line-(re.ch?0:1))+1;for(var we=ye;we<B;++we)ua(this,we,l);var We=this.doc.sel.ranges;te.ch==0&&y.length==We.length&&We[$].from().ch>0&&eo(this.doc,$,new Ln(te,We[$].to()),ge)}}}),getTokenAt:function(l,y){return Pt(this,l,y)},getLineTokens:function(l,y){return Pt(this,dt(l),y,!0)},getTokenTypeAt:function(l){l=I(this.doc,l);var y=Ye(this,Lt(this.doc,l.line)),B=0,$=(y.length-1)/2,q=l.ch,te;if(q==0)te=y[2];else for(;;){var re=B+$>>1;if((re?y[re*2-1]:0)>=q)$=re;else if(y[re*2+1]<q)B=re+1;else{te=y[re*2+2];break}}var ye=te?te.indexOf("overlay "):-1;return ye<0?te:ye==0?null:te.slice(0,ye-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 B=[];if(!u.hasOwnProperty(y))return B;var $=u[y],q=this.getModeAt(l);if(typeof q[y]=="string")$[q[y]]&&B.push($[q[y]]);else if(q[y])for(var te=0;te<q[y].length;te++){var re=$[q[y][te]];re&&B.push(re)}else q.helperType&&$[q.helperType]?B.push($[q.helperType]):$[q.name]&&B.push($[q.name]);for(var ye=0;ye<$._global.length;ye++){var we=$._global[ye];we.pred(q,this)&&ne(B,we.val)==-1&&B.push(we.val)}return B},getStateAfter:function(l,y){var B=this.doc;return l=J(B,l==null?B.first+B.size-1:l),ut(this,l+1,y).state},cursorCoords:function(l,y){var B,$=this.doc.sel.primary();return l==null?B=$.head:typeof l=="object"?B=I(this.doc,l):B=l?$.from():$.to(),$r(this,B,y||"page")},charCoords:function(l,y){return Ma(this,I(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,mn(this.doc,l+this.display.viewOffset)},heightAtLine:function(l,y,B){var $=!1,q;if(typeof l=="number"){var te=this.doc.first+this.doc.size-1;l<this.doc.first?l=this.doc.first:l>te&&(l=te,$=!0),q=Lt(this.doc,l)}else q=l;return da(this,q,{top:0,left:0},y||"page",B||$).top+($?this.doc.height-Kn(q):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,B,$,q){var te=this.display;l=$r(this,I(this.doc,l));var re=l.bottom,ye=l.left;if(y.style.position="absolute",y.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(y),te.sizer.appendChild(y),$=="over")re=l.top;else if($=="above"||$=="near"){var we=Math.max(te.wrapper.clientHeight,this.doc.height),We=Math.max(te.sizer.clientWidth,te.lineSpace.clientWidth);($=="above"||l.bottom+y.offsetHeight>we)&&l.top>y.offsetHeight?re=l.top-y.offsetHeight:l.bottom+y.offsetHeight<=we&&(re=l.bottom),ye+y.offsetWidth>We&&(ye=We-y.offsetWidth)}y.style.top=re+"px",y.style.left=y.style.right="",q=="right"?(ye=te.sizer.clientWidth-y.offsetWidth,y.style.right="0px"):(q=="left"?ye=0:q=="middle"&&(ye=(te.sizer.clientWidth-y.offsetWidth)/2),y.style.left=ye+"px"),B&&Js(this,{left:ye,top:re,right:ye+y.offsetWidth,bottom:re+y.offsetHeight})},triggerOnKeyDown:Or(ws),triggerOnKeyPress:Or(Cs),triggerOnKeyUp:Ss,triggerOnMouseDown:Or(Os),execCommand:function(l){if(aa.hasOwnProperty(l))return aa[l].call(null,this)},triggerElectric:Or(function(l){Ps(this,l)}),findPosH:function(l,y,B,$){var q=1;y<0&&(q=-1,y=-y);for(var te=I(this.doc,l),re=0;re<y&&!(te=uo(this.doc,te,q,B,$),te.hitSide);++re);return te},moveH:Or(function(l,y){var B=this;this.extendSelectionsBy(function($){return B.display.shift||B.doc.extend||$.empty()?uo(B.doc,$.head,l,y,B.options.rtlMoveVisually):l<0?$.from():$.to()},Oe)}),deleteH:Or(function(l,y){var B=this.doc.sel,$=this.doc;B.somethingSelected()?$.replaceSelection("",null,"+delete"):Ni(this,function(q){var te=uo($,q.head,l,y,!1);return l<0?{from:te,to:q.head}:{from:q.head,to:te}})}),findPosV:function(l,y,B,$){var q=1,te=$;y<0&&(q=-1,y=-y);for(var re=I(this.doc,l),ye=0;ye<y;++ye){var we=$r(this,re,"div");if(te==null?te=we.left:we.left=te,re=Fs(this,we,q,B),re.hitSide)break}return re},moveV:Or(function(l,y){var B=this,$=this.doc,q=[],te=!this.display.shift&&!$.extend&&$.sel.somethingSelected();if($.extendSelectionsBy(function(ye){if(te)return l<0?ye.from():ye.to();var we=$r(B,ye.head,"div");ye.goalColumn!=null&&(we.left=ye.goalColumn),q.push(we.left);var We=Fs(B,we,l,y);return y=="page"&&ye==$.sel.primary()&&Ka(B,Ma(B,We,"div").top-we.top),We},Oe),q.length)for(var re=0;re<$.sel.ranges.length;re++)$.sel.ranges[re].goalColumn=q[re]}),findWordAt:function(l){var y=this.doc,B=Lt(y,l.line).text,$=l.ch,q=l.ch;if(B){var te=this.getHelper(l,"wordChars");(l.sticky=="before"||q==B.length)&&$?--$:++q;for(var re=B.charAt($),ye=ot(re,te)?function(we){return ot(we,te)}:/\s/.test(re)?function(we){return/\s/.test(we)}:function(we){return!/\s/.test(we)&&!ot(we)};$>0&&ye(B.charAt($-1));)--$;for(;q<B.length&&ye(B.charAt(q));)++q}return new Ln(dt(l.line,$),dt(l.line,q))},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"),Pe(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==N()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Or(function(l,y){Gi(this,l,y)}),getScrollInfo:function(){var l=this.display.scroller;return{left:l.scrollLeft,top:l.scrollTop,height:l.scrollHeight-Jn(this)-this.display.barHeight,width:l.scrollWidth-Jn(this)-this.display.barWidth,clientHeight:Cr(this),clientWidth:vr(this)}},scrollIntoView:Or(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:dt(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:Or(function(l,y){var B=this,$=function(te){return typeof te=="number"||/^\d+$/.test(String(te))?te+"px":te};l!=null&&(this.display.wrapper.style.width=$(l)),y!=null&&(this.display.wrapper.style.height=$(y)),this.options.lineWrapping&&go(this);var q=this.display.viewFrom;this.doc.iter(q,this.display.viewTo,function(te){if(te.widgets){for(var re=0;re<te.widgets.length;re++)if(te.widgets[re].noHScroll){oi(B,q,"widget");break}}++q}),this.curOp.forceUpdate=!0,Pe(this,"refresh",this)}),operation:function(l){return Ur(this,l)},startOperation:function(){return bi(this)},endOperation:function(){return _i(this)},refresh:Or(function(){var l=this.display.cachedTextHeight;Lr(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),Pe(this,"refresh",this)}),swapDoc:Or(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,_n(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}},pe(e),e.registerHelper=function(l,y,B){u.hasOwnProperty(l)||(u[l]=e[l]={_global:[]}),u[l][y]=B},e.registerGlobalHelper=function(l,y,B,$){e.registerHelper(l,y,$),u[l]._global.push({pred:B,val:$})}}function uo(e,t,u,l,y){var B=t,$=u,q=Lt(e,t.line),te=y&&e.direction=="rtl"?-u:u;function re(){var Ut=t.line+te;return Ut<e.first||Ut>=e.first+e.size?!1:(t=new dt(Ut,t.ch,t.sticky),q=Lt(e,Ut))}function ye(Ut){var Mt;if(l=="codepoint"){var Ft=q.text.charCodeAt(t.ch+(l>0?0:-1));isNaN(Ft)?Mt=null:Mt=new dt(t.line,Math.max(0,Math.min(q.text.length,t.ch+u*(Ft>=55296&&Ft<56320?2:1))),-u)}else y?Mt=Pl(e.cm,q,t,u):Mt=no(q,t,u);if(Mt==null)if(!Ut&&re())t=ro(y,e.cm,q,t.line,te);else return!1;else t=Mt;return!0}if(l=="char"||l=="codepoint")ye();else if(l=="column")ye(!0);else if(l=="word"||l=="group")for(var we=null,We=l=="group",Ne=e.cm&&e.cm.getHelper(t,"wordChars"),rt=!0;!(u<0&&!ye(!rt));rt=!1){var ht=q.text.charAt(t.ch)||`
|
|
`,St=ot(ht,Ne)?"w":We&&ht==`
|
|
`?"n":!We||/\s/.test(ht)?null:"p";if(We&&!rt&&!St&&(St="s"),we&&we!=St){u<0&&(u=1,ye(),t.sticky="after");break}if(St&&(we=St),u>0&&!ye(!rt))break}var Dt=Ta(e,t,B,$,!0);return Vn(B,Dt)&&(Dt.hitSide=!0),Dt}function Fs(e,t,u,l){var y=e.doc,B=t.left,$;if(l=="page"){var q=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),te=Math.max(q-.5*Si(e.display),3);$=(u>0?t.bottom:t.top)+u*te}else l=="line"&&($=u>0?t.bottom+3:t.top-3);for(var re;!(re=ka(e,B,$),!re.outside);){if(u<0?$<=0:$>=y.height){re.hitSide=!0;break}$+=u*5}return re}var Mn=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};Mn.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 B(q){for(var te=q.target;te;te=te.parentNode){if(te==y)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(te.className))break}return!1}Ce(y,"paste",function(q){if(!B(q)||Fe(l,q)||Ms(q,l))return;W<=11&&setTimeout(cr(l,function(){return t.updateFromDOM()}),20)}),Ce(y,"compositionstart",function(q){t.composing={data:q.data,done:!1}}),Ce(y,"compositionupdate",function(q){t.composing||(t.composing={data:q.data,done:!1})}),Ce(y,"compositionend",function(q){t.composing&&(q.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ce(y,"touchstart",function(){return u.forceCompositionEnd()}),Ce(y,"input",function(){t.composing||t.readFromDOMSoon()});function $(q){if(!B(q)||Fe(l,q))return;if(l.somethingSelected())Ra({lineWise:!1,text:l.getSelections()}),q.type=="cut"&&l.replaceSelection("",null,"cut");else if(l.options.lineWiseCopyCut){var te=ks(l);Ra({lineWise:!0,text:te.text}),q.type=="cut"&&l.operation(function(){l.setSelections(te.ranges,0,ge),l.replaceSelection("",null,"cut")})}else return;if(q.clipboardData){q.clipboardData.clearData();var re=Zr.text.join(`
|
|
`);if(q.clipboardData.setData("Text",re),q.clipboardData.getData("Text")==re){q.preventDefault();return}}var ye=Us(),we=ye.firstChild;l.display.lineSpace.insertBefore(ye,l.display.lineSpace.firstChild),we.value=Zr.text.join(`
|
|
`);var We=document.activeElement;H(we),setTimeout(function(){l.display.lineSpace.removeChild(ye),We.focus(),We==y&&u.showPrimarySelection()},50)}Ce(y,"copy",$),Ce(y,"cut",$)},Mn.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Mn.prototype.prepareSelection=function(){var e=So(this.cm,!1);return e.focus=document.activeElement==this.div,e},Mn.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Mn.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Mn.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 B=La(t,e.anchorNode,e.anchorOffset),$=La(t,e.focusNode,e.focusOffset);if(B&&!B.bad&&$&&!$.bad&&Rt(kr(B,$),l)==0&&Rt(ur(B,$),y)==0)return;var q=t.display.view,te=l.line>=t.display.viewFrom&&js(t,l)||{node:q[0].measure.map[2],offset:0},re=y.line<t.display.viewTo&&js(t,y);if(!re){var ye=q[q.length-1].measure,we=ye.maps?ye.maps[ye.maps.length-1]:ye.map;re={node:we[we.length-1],offset:we[we.length-2]-we[we.length-3]}}if(!te||!re){e.removeAllRanges();return}var We=e.rangeCount&&e.getRangeAt(0),Ne;try{Ne=E(te.node,te.offset,re.offset,re.node)}catch(rt){}Ne&&(!P&&t.state.focused?(e.collapse(te.node,te.offset),Ne.collapsed||(e.removeAllRanges(),e.addRange(Ne))):(e.removeAllRanges(),e.addRange(Ne)),We&&e.anchorNode==null?e.addRange(We):P&&this.startGracePeriod()),this.rememberSelection()},Mn.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)},Mn.prototype.showMultipleSelections=function(e){g(this.cm.display.cursorDiv,e.cursors),g(this.cm.display.selectionDiv,e.selection)},Mn.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Mn.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return v(this.div,t)},Mn.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Mn.prototype.blur=function(){this.div.blur()},Mn.prototype.getField=function(){return this.div},Mn.prototype.supportsTouch=function(){return!0},Mn.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Ur(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)},Mn.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Mn.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(i&&m&&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&&Ur(t,function(){xr(t.doc,li(u,l),ge),(u.bad||l.bad)&&(t.curOp.selectionChanged=!0)})},Mn.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=dt(l.line-1,Lt(e.doc,l.line-1).length)),y.ch==Lt(e.doc,y.line).text.length&&y.line<e.lastLine()&&(y=dt(y.line+1,0)),l.line<t.viewFrom||y.line>t.viewTo-1)return!1;var B,$,q;l.line==t.viewFrom||(B=gi(e,l.line))==0?($=Xt(t.view[0].line),q=t.view[0].node):($=Xt(t.view[B].line),q=t.view[B-1].node.nextSibling);var te=gi(e,y.line),re,ye;if(te==t.view.length-1?(re=t.viewTo-1,ye=t.lineDiv.lastChild):(re=Xt(t.view[te+1].line)-1,ye=t.view[te+1].node.previousSibling),!q)return!1;for(var we=e.doc.splitLines(tu(e,q,ye,$,re)),We=On(e.doc,dt($,0),dt(re,Lt(e.doc,re).text.length));we.length>1&&We.length>1;)if(Me(we)==Me(We))we.pop(),We.pop(),re--;else if(we[0]==We[0])we.shift(),We.shift(),$++;else break;for(var Ne=0,rt=0,ht=we[0],St=We[0],Dt=Math.min(ht.length,St.length);Ne<Dt&&ht.charCodeAt(Ne)==St.charCodeAt(Ne);)++Ne;for(var Ut=Me(we),Mt=Me(We),Ft=Math.min(Ut.length-(we.length==1?Ne:0),Mt.length-(We.length==1?Ne:0));rt<Ft&&Ut.charCodeAt(Ut.length-rt-1)==Mt.charCodeAt(Mt.length-rt-1);)++rt;if(we.length==1&&We.length==1&&$==l.line)for(;Ne&&Ne>l.ch&&Ut.charCodeAt(Ut.length-rt-1)==Mt.charCodeAt(Mt.length-rt-1);)Ne--,rt++;we[we.length-1]=Ut.slice(0,Ut.length-rt).replace(/^\u200b+/,""),we[0]=we[0].slice(Ne).replace(/\u200b+$/,"");var $t=dt($,Ne),Vt=dt(re,We.length?Me(We).length-rt:0);if(we.length>1||we[0]||Rt($t,Vt))return Mi(e.doc,we,$t,Vt,"+input"),!0},Mn.prototype.ensurePolled=function(){this.forceCompositionEnd()},Mn.prototype.reset=function(){this.forceCompositionEnd()},Mn.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Mn.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)},Mn.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Ur(this.cm,function(){return Lr(e.cm)})},Mn.prototype.setUneditable=function(e){e.contentEditable="false"},Mn.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||cr(this.cm,lo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Mn.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Mn.prototype.onContextMenu=function(){},Mn.prototype.resetPosition=function(){},Mn.prototype.needsContentAttribute=!0;function js(e,t){var u=ca(e,t.line);if(!u||u.hidden)return null;var l=Lt(e.doc,t.line),y=zr(u,l,t.line),B=xt(l,e.doc.direction),$="left";if(B){var q=gt(B,t.ch);$=q%2?"right":"left"}var te=po(y.map,t.ch,$);return te.offset=te.collapse=="right"?te.end:te.start,te}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Fi(e,t){return t&&(e.bad=!0),e}function tu(e,t,u,l,y){var B="",$=!1,q=e.doc.lineSeparator(),te=!1;function re(Ne){return function(rt){return rt.id==Ne}}function ye(){$&&(B+=q,te&&(B+=q),$=te=!1)}function we(Ne){Ne&&(ye(),B+=Ne)}function We(Ne){if(Ne.nodeType==1){var rt=Ne.getAttribute("cm-text");if(rt){we(rt);return}var ht=Ne.getAttribute("cm-marker"),St;if(ht){var Dt=e.findMarks(dt(l,0),dt(y+1,0),re(+ht));Dt.length&&(St=Dt[0].find(0))&&we(On(e.doc,St.from,St.to).join(q));return}if(Ne.getAttribute("contenteditable")=="false")return;var Ut=/^(pre|div|p|li|table|br)$/i.test(Ne.nodeName);if(!/^br$/i.test(Ne.nodeName)&&Ne.textContent.length==0)return;Ut&&ye();for(var Mt=0;Mt<Ne.childNodes.length;Mt++)We(Ne.childNodes[Mt]);/^(pre|p)$/i.test(Ne.nodeName)&&(te=!0),Ut&&($=!0)}else Ne.nodeType==3&&we(Ne.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(We(t),t==u);)t=t.nextSibling,te=!1;return B}function La(e,t,u){var l;if(t==e.display.lineDiv){if(l=e.display.lineDiv.childNodes[u],!l)return Fi(e.clipPos(dt(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 B=e.display.view[y];if(B.node==l)return nu(B,t,u)}}function nu(e,t,u){var l=e.text.firstChild,y=!1;if(!t||!v(l,t))return Fi(dt(Xt(e.line),0),!0);if(t==l&&(y=!0,t=l.childNodes[u],u=0,!t)){var B=e.rest?Me(e.rest):e.line;return Fi(dt(Xt(B),B.text.length),y)}var $=t.nodeType==3?t:null,q=t;for(!$&&t.childNodes.length==1&&t.firstChild.nodeType==3&&($=t.firstChild,u&&(u=$.nodeValue.length));q.parentNode!=l;)q=q.parentNode;var te=e.measure,re=te.maps;function ye(St,Dt,Ut){for(var Mt=-1;Mt<(re?re.length:0);Mt++)for(var Ft=Mt<0?te.map:re[Mt],$t=0;$t<Ft.length;$t+=3){var Vt=Ft[$t+2];if(Vt==St||Vt==Dt){var hn=Xt(Mt<0?e.line:e.rest[Mt]),Fn=Ft[$t]+Ut;return(Ut<0||Vt!=St)&&(Fn=Ft[$t+(Ut?1:0)]),dt(hn,Fn)}}}var we=ye($,q,u);if(we)return Fi(we,y);for(var We=q.nextSibling,Ne=$?$.nodeValue.length-u:0;We;We=We.nextSibling){if(we=ye(We,We.firstChild,0),we)return Fi(dt(we.line,we.ch-Ne),y);Ne+=We.textContent.length}for(var rt=q.previousSibling,ht=u;rt;rt=rt.previousSibling){if(we=ye(rt,rt.firstChild,-1),we)return Fi(dt(we.line,we.ch+ht),y);ht+=rt.textContent.length}}var Zn=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Q,this.hasSelection=!1,this.composing=null};Zn.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"),Ce(y,"input",function(){G&&W>=9&&t.hasSelection&&(t.hasSelection=null),u.poll()}),Ce(y,"paste",function($){if(Fe(l,$)||Ms($,l))return;l.state.pasteIncoming=+new Date,u.fastPoll()});function B($){if(Fe(l,$))return;if(l.somethingSelected())Ra({lineWise:!1,text:l.getSelections()});else if(l.options.lineWiseCopyCut){var q=ks(l);Ra({lineWise:!0,text:q.text}),$.type=="cut"?l.setSelections(q.ranges,null,ge):(u.prevInput="",y.value=q.text.join(`
|
|
`),H(y))}else return;$.type=="cut"&&(l.state.cutIncoming=+new Date)}Ce(y,"cut",B),Ce(y,"copy",B),Ce(e.scroller,"paste",function($){if(En(e,$)||Fe(l,$))return;if(!y.dispatchEvent){l.state.pasteIncoming=+new Date,u.focus();return}var q=new Event("paste");q.clipboardData=$.clipboardData,y.dispatchEvent(q)}),Ce(e.lineSpace,"selectstart",function($){En(e,$)||ie($)}),Ce(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"})}}),Ce(y,"compositionend",function(){u.composing&&(u.poll(),u.composing.range.clear(),u.composing=null)})},Zn.prototype.createField=function(e){this.wrapper=Us(),this.textarea=this.wrapper.firstChild},Zn.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Zn.prototype.prepareSelection=function(){var e=this.cm,t=e.display,u=e.doc,l=So(e);if(e.options.moveInputWithCursor){var y=$r(e,u.sel.primary().head,"div"),B=t.wrapper.getBoundingClientRect(),$=t.lineDiv.getBoundingClientRect();l.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,y.top+$.top-B.top)),l.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,y.left+$.left-B.left))}return l},Zn.prototype.showSelection=function(e){var t=this.cm,u=t.display;g(u.cursorDiv,e.cursors),g(u.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Zn.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),G&&W>=9&&(this.hasSelection=u)}else e||(this.prevInput=this.textarea.value="",G&&W>=9&&(this.hasSelection=null))},Zn.prototype.getField=function(){return this.textarea},Zn.prototype.supportsTouch=function(){return!1},Zn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!a||N()!=this.textarea))try{this.textarea.focus()}catch(e){}},Zn.prototype.blur=function(){this.textarea.blur()},Zn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Zn.prototype.receivedFocus=function(){this.slowPoll()},Zn.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()})},Zn.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)},Zn.prototype.poll=function(){var e=this,t=this.cm,u=this.textarea,l=this.prevInput;if(this.contextMenuPending||!t.state.focused||Ge(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(G&&W>=9&&this.hasSelection===y||r&&/[\uf700-\uf7ff]/.test(y))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var B=y.charCodeAt(0);if(B==8203&&!l&&(l="\u200B"),B==8666)return this.reset(),this.cm.execCommand("undo")}for(var $=0,q=Math.min(l.length,y.length);$<q&&l.charCodeAt($)==y.charCodeAt($);)++$;return Ur(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},Zn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Zn.prototype.onKeyPress=function(){G&&W>=9&&(this.hasSelection=null),this.fastPoll()},Zn.prototype.onContextMenu=function(e){var t=this,u=t.cm,l=u.display,y=t.textarea;t.contextMenuPending&&t.contextMenuPending();var B=mi(u,e),$=l.scroller.scrollTop;if(!B||f)return;var q=u.options.resetSelectionOnContextMenu;q&&u.doc.sel.contains(B)==-1&&cr(u,xr)(u.doc,li(B),ge);var te=y.style.cssText,re=t.wrapper.style.cssText,ye=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",y.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-ye.top-5)+"px; left: "+(e.clientX-ye.left-5)+`px;
|
|
z-index: 1000; background: `+(G?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var we;n&&(we=window.scrollY),l.input.focus(),n&&window.scrollTo(null,we),l.input.reset(),u.somethingSelected()||(y.value=t.prevInput=" "),t.contextMenuPending=Ne,l.selForContextMenu=u.doc.sel,clearTimeout(l.detectingSelectAll);function We(){if(y.selectionStart!=null){var ht=u.somethingSelected(),St="\u200B"+(ht?y.value:"");y.value="\u21DA",y.value=St,t.prevInput=ht?"":"\u200B",y.selectionStart=1,y.selectionEnd=St.length,l.selForContextMenu=u.doc.sel}}function Ne(){if(t.contextMenuPending!=Ne)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=re,y.style.cssText=te,G&&W<9&&l.scrollbars.setScrollTop(l.scroller.scrollTop=$),y.selectionStart!=null){(!G||G&&W<9)&&We();var ht=0,St=function(){l.selForContextMenu==u.doc.sel&&y.selectionStart==0&&y.selectionEnd>0&&t.prevInput=="\u200B"?cr(u,rs)(u):ht++<10?l.detectingSelectAll=setTimeout(St,500):(l.selForContextMenu=null,l.input.reset())};l.detectingSelectAll=setTimeout(St,200)}}if(G&&W>=9&&We(),L){me(e);var rt=function(){Qe(window,"mouseup",rt),setTimeout(Ne,20)};Ce(window,"mouseup",rt)}else setTimeout(Ne,50)},Zn.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Zn.prototype.setUneditable=function(){},Zn.prototype.needsContentAttribute=!1;function ru(e,t){if(t=t?T(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=N();t.autofocus=u==e||e.getAttribute("autofocus")!=null&&u==document.body}function l(){e.value=q.getValue()}var y;if(e.form&&(Ce(e.form,"submit",l),!t.leaveSubmitMethodAlone)){var B=e.form;y=B.submit;try{var $=B.submit=function(){l(),B.submit=y,B.submit(),B.submit=$}}catch(te){}}t.finishInit=function(te){te.save=l,te.getTextArea=function(){return e},te.toTextArea=function(){te.toTextArea=isNaN,l(),e.parentNode.removeChild(te.getWrapperElement()),e.style.display="",e.form&&(Qe(e.form,"submit",l),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=y))}},e.style.display="none";var q=Wn(function(te){return e.parentNode.insertBefore(te,e.nextSibling)},t);return q}function iu(e){e.off=Qe,e.on=Ce,e.wheelEventPixels=dl,e.Doc=Ir,e.splitLines=Ke,e.countColumn=z,e.findColumn=Re,e.isWordChar=Ze,e.Pass=xe,e.signal=Pe,e.Line=br,e.changeEnd=ui,e.scrollbarModel=Mo,e.Pos=dt,e.cmpPos=Rt,e.modes=Xe,e.mimeModes=Be,e.resolveMode=Ie,e.getMode=Je,e.modeExtensions=tt,e.extendMode=_t,e.copyState=Tt,e.startState=nn,e.innerMode=Zt,e.commands=aa,e.keyMap=ii,e.keyName=bs,e.isModifierKey=vs,e.lookupKey=ki,e.normalizeKeyMap=Ml,e.StringStream=Qt,e.SharedTextMarker=na,e.TextMarker=di,e.LineWidget=ta,e.e_preventDefault=ie,e.e_stopPropagation=ae,e.e_stop=me,e.addClass=F,e.contains=v,e.rmClass=_,e.keyNames=hi}$l(Wn),ql(Wn);var au="iter insert remove copy getEditor constructor".split(" ");for(var Ia in Ir.prototype)Ir.prototype.hasOwnProperty(Ia)&&ne(au,Ia)<0&&(Wn.prototype[Ia]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ir.prototype[Ia]));return pe(Ir),Wn.inputStyles={textarea:Zn,contenteditable:Mn},Wn.defineMode=function(e){!Wn.defaults.mode&&e!="null"&&(Wn.defaults.mode=e),ct.apply(this,arguments)},Wn.defineMIME=ft,Wn.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Wn.defineMIME("text/plain","null"),Wn.defineExtension=function(e,t){Wn.prototype[e]=t},Wn.defineDocExtension=function(e,t){Ir.prototype[e]=t},Wn.fromTextArea=ru,iu(Wn),Wn.version="5.58.2",Wn})},WaYH:function(je,oe,k){"use strict";var Z=k("rePB"),X=k("Ff2n"),P=k("VTBJ"),V=k("1OyB"),U=k("vuIU"),M=k("JX7q"),G=k("Ji7U"),W=k("LK+K"),n=k("q1tI"),D=k("TSYQ"),m=k.n(D),f=k("sboe"),h=k("OZM5"),c=function(L){var O=L.prefixCls,_=L.level,b=L.isStart,g=L.isEnd;if(!_)return null;for(var p="".concat(O,"-indent-unit"),C=[],E=0;E<_;E+=1){var v;C.push(n.createElement("span",{key:E,className:m()(p,(v={},Object(Z.a)(v,"".concat(p,"-start"),b[E+1]),Object(Z.a)(v,"".concat(p,"-end"),g[E+1]),Object(Z.a)(v,"".concat(p,"-end-first-level"),!E&&g[0]),v))}))}return n.createElement("span",{"aria-hidden":"true",className:"".concat(O,"-indent")},C)},o=c,d=k("815F"),i="open",a="close",r="---",s=function(x){Object(G.a)(O,x);var L=Object(W.a)(O);function O(){var _;return Object(V.a)(this,O),_=L.apply(this,arguments),_.state={dragNodeHighlight:!1},_.onSelectorClick=function(b){var g=_.props.context.onNodeClick;g(b,Object(d.b)(_.props)),_.isSelectable()?_.onSelect(b):_.onCheck(b)},_.onSelectorDoubleClick=function(b){var g=_.props.context.onNodeDoubleClick;g(b,Object(d.b)(_.props))},_.onSelect=function(b){if(_.isDisabled())return;var g=_.props.context.onNodeSelect;b.preventDefault(),g(b,Object(d.b)(_.props))},_.onCheck=function(b){if(_.isDisabled())return;var g=_.props,p=g.disableCheckbox,C=g.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 g=_.props.context.onNodeMouseEnter;g(b,Object(d.b)(_.props))},_.onMouseLeave=function(b){var g=_.props.context.onNodeMouseLeave;g(b,Object(d.b)(_.props))},_.onContextMenu=function(b){var g=_.props.context.onNodeContextMenu;g(b,Object(d.b)(_.props))},_.onDragStart=function(b){var g=_.props.context.onNodeDragStart;b.stopPropagation(),_.setState({dragNodeHighlight:!0}),g(b,Object(M.a)(_));try{b.dataTransfer.setData("text/plain","")}catch(p){}},_.onDragEnter=function(b){var g=_.props.context.onNodeDragEnter;b.preventDefault(),b.stopPropagation(),g(b,Object(M.a)(_))},_.onDragOver=function(b){var g=_.props.context.onNodeDragOver;b.preventDefault(),b.stopPropagation(),g(b,Object(M.a)(_))},_.onDragLeave=function(b){var g=_.props.context.onNodeDragLeave;b.stopPropagation(),g(b,Object(M.a)(_))},_.onDragEnd=function(b){var g=_.props.context.onNodeDragEnd;b.stopPropagation(),_.setState({dragNodeHighlight:!1}),g(b,Object(M.a)(_))},_.onDrop=function(b){var g=_.props.context.onNodeDrop;b.preventDefault(),b.stopPropagation(),_.setState({dragNodeHighlight:!1}),g(b,Object(M.a)(_))},_.onExpand=function(b){var g=_.props.context.onNodeExpand;g(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,g=_.props.context.keyEntities,p=g[b]||{},C=p.children;return!!(C||[]).length},_.isLeaf=function(){var b=_.props,g=b.isLeaf,p=b.loaded,C=_.props.context.loadData,E=_.hasChildren();return g===!1?!1:g||!C&&!E||C&&p&&!E},_.isDisabled=function(){var b=_.props.disabled,g=_.props.context.disabled;return!!(g||b)},_.isCheckable=function(){var b=_.props.checkable,g=_.props.context.checkable;return!g||b===!1?!1:g},_.syncLoadData=function(b){var g=b.expanded,p=b.loading,C=b.loaded,E=_.props.context,v=E.loadData,N=E.onNodeLoad;if(p)return;v&&g&&!_.isLeaf()&&(!_.hasChildren()&&!C&&N(Object(d.b)(_.props)))},_.renderSwitcher=function(){var b=_.props,g=b.expanded,p=b.switcherIcon,C=_.props.context,E=C.prefixCls,v=C.switcherIcon,N=p||v;if(_.isLeaf())return n.createElement("span",{className:m()("".concat(E,"-switcher"),"".concat(E,"-switcher-noop"))},typeof N=="function"?N(Object(P.a)(Object(P.a)({},_.props),{},{isLeaf:!0})):N);var F=m()("".concat(E,"-switcher"),"".concat(E,"-switcher_").concat(g?i:a));return n.createElement("span",{onClick:_.onExpand,className:F},typeof N=="function"?N(Object(P.a)(Object(P.a)({},_.props),{},{isLeaf:!1})):N)},_.renderCheckbox=function(){var b=_.props,g=b.checked,p=b.halfChecked,C=b.disableCheckbox,E=_.props.context.prefixCls,v=_.isDisabled(),N=_.isCheckable();if(!N)return null;var F=typeof N!="boolean"?N:null;return n.createElement("span",{className:m()("".concat(E,"-checkbox"),g&&"".concat(E,"-checkbox-checked"),!g&&p&&"".concat(E,"-checkbox-indeterminate"),(v||C)&&"".concat(E,"-checkbox-disabled")),onClick:_.onCheck},F)},_.renderIcon=function(){var b=_.props.loading,g=_.props.context.prefixCls;return n.createElement("span",{className:m()("".concat(g,"-iconEle"),"".concat(g,"-icon__").concat(_.getNodeState()||"docu"),b&&"".concat(g,"-icon_loading"))})},_.renderSelector=function(){var b=_.state.dragNodeHighlight,g=_.props,p=g.title,C=g.selected,E=g.icon,v=g.loading,N=g.data,F=_.props.context,A=F.prefixCls,H=F.showIcon,j=F.icon,T=F.draggable,z=F.loadData,Q=F.titleRender,ne=_.isDisabled(),se="".concat(A,"-node-content-wrapper"),xe;if(H){var ge=E||j;xe=ge?n.createElement("span",{className:m()("".concat(A,"-iconEle"),"".concat(A,"-icon__customize"))},typeof ge=="function"?ge(_.props):ge):_.renderIcon()}else z&&v&&(xe=_.renderIcon());var ve;typeof p=="function"?ve=p(N):Q?ve=Q(N):ve=p;var Oe=n.createElement("span",{className:"".concat(A,"-title")},ve);return n.createElement("span",{ref:_.setSelectHandle,title:typeof p=="string"?p:"",className:m()("".concat(se),"".concat(se,"-").concat(_.getNodeState()||"normal"),!ne&&(C||b)&&"".concat(A,"-node-selected"),!ne&&T&&"draggable"),draggable:!ne&&T||void 0,"aria-grabbed":!ne&&T||void 0,onMouseEnter:_.onMouseEnter,onMouseLeave:_.onMouseLeave,onContextMenu:_.onContextMenu,onClick:_.onSelectorClick,onDoubleClick:_.onSelectorDoubleClick,onDragStart:T?_.onDragStart:void 0},xe,Oe)},_}return Object(U.a)(O,[{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,g=this.props.context.selectable;return typeof b=="boolean"?b:g}},{key:"render",value:function(){var b,g=this.props,p=g.eventKey,C=g.className,E=g.style,v=g.dragOver,N=g.dragOverGapTop,F=g.dragOverGapBottom,A=g.isLeaf,H=g.isStart,j=g.isEnd,T=g.expanded,z=g.selected,Q=g.checked,ne=g.halfChecked,se=g.loading,xe=g.domRef,ge=g.active,ve=g.onMouseMove,Oe=Object(X.a)(g,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Re=this.props.context,he=Re.prefixCls,ue=Re.filterTreeNode,Me=Re.draggable,et=Re.keyEntities,it=this.isDisabled(),nt=Object(h.f)(Oe),at=et[p]||{},ze=at.level,Ze=j[j.length-1];return n.createElement("div",Object.assign({ref:xe,className:m()(C,"".concat(he,"-treenode"),(b={},Object(Z.a)(b,"".concat(he,"-treenode-disabled"),it),Object(Z.a)(b,"".concat(he,"-treenode-switcher-").concat(T?"open":"close"),!A),Object(Z.a)(b,"".concat(he,"-treenode-checkbox-checked"),Q),Object(Z.a)(b,"".concat(he,"-treenode-checkbox-indeterminate"),ne),Object(Z.a)(b,"".concat(he,"-treenode-selected"),z),Object(Z.a)(b,"".concat(he,"-treenode-loading"),se),Object(Z.a)(b,"".concat(he,"-treenode-active"),ge),Object(Z.a)(b,"".concat(he,"-treenode-leaf-last"),Ze),Object(Z.a)(b,"drag-over",!it&&v),Object(Z.a)(b,"drag-over-gap-top",!it&&N),Object(Z.a)(b,"drag-over-gap-bottom",!it&&F),Object(Z.a)(b,"filter-node",ue&&ue(Object(d.b)(this.props))),b)),style:E,onDragEnter:Me?this.onDragEnter:void 0,onDragOver:Me?this.onDragOver:void 0,onDragLeave:Me?this.onDragLeave:void 0,onDrop:Me?this.onDrop:void 0,onDragEnd:Me?this.onDragEnd:void 0,onMouseMove:ve},nt),n.createElement(o,{prefixCls:he,level:ze,isStart:H,isEnd:j}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),O}(n.Component),S=function(L){return n.createElement(f.a.Consumer,null,function(O){return n.createElement(s,Object.assign({},L,{context:O}))})};S.displayName="TreeNode",S.defaultProps={title:r},S.isTreeNode=1;var w=oe.a=S},XIdC:function(je,oe,k){"use strict";var Z=k("rePB"),X=k("ODXe"),P=k("Ff2n"),V=k("q1tI"),U=k.n(V),M=k("TSYQ"),G=k.n(M),W=k("6cGi"),n=k("4IlW"),D=V.forwardRef(function(m,f){var h,c=m.prefixCls,o=c===void 0?"rc-switch":c,d=m.className,i=m.checked,a=m.defaultChecked,r=m.disabled,s=m.loadingIcon,S=m.checkedChildren,w=m.unCheckedChildren,x=m.onClick,L=m.onChange,O=m.onKeyDown,_=Object(P.a)(m,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),b=Object(W.a)(!1,{value:i,defaultValue:a}),g=Object(X.a)(b,2),p=g[0],C=g[1];function E(A,H){var j=p;return r||(j=A,C(j),L==null||L(j,H)),j}function v(A){A.which===n.a.LEFT?E(!1,A):A.which===n.a.RIGHT&&E(!0,A),O==null||O(A)}function N(A){var H=E(!p,A);x==null||x(H,A)}var F=G()(o,d,(h={},Object(Z.a)(h,"".concat(o,"-checked"),p),Object(Z.a)(h,"".concat(o,"-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:N}),s,V.createElement("span",{className:"".concat(o,"-inner")},p?S:w))});D.displayName="Switch",oe.a=D},Y1PL:function(je,oe,k){"use strict";k.r(oe),k.d(oe,"ResizableTextArea",function(){return ne});var Z=k("wx14"),X=k("1OyB"),P=k("vuIU"),V=k("Ji7U"),U=k("LK+K"),M=k("q1tI"),G=k("VTBJ"),W=k("rePB"),n=k("Zm9Q"),D=k("Kwbf"),m=k("c+Xe"),f=k("m+aA"),h=k("bdgK"),c=new Map;function o(ge){ge.forEach(function(ve){var Oe,Re=ve.target;(Oe=c.get(Re))===null||Oe===void 0||Oe.forEach(function(he){return he(Re)})})}var d=new h.default(o),i=null,a=null;function r(ge,ve){c.has(ge)||(c.set(ge,new Set),d.observe(ge)),c.get(ge).add(ve)}function s(ge,ve){c.has(ge)&&(c.get(ge).delete(ve),c.get(ge).size||(d.unobserve(ge),c.delete(ge)))}var S=function(ge){Object(V.a)(Oe,ge);var ve=Object(U.a)(Oe);function Oe(){return Object(X.a)(this,Oe),ve.apply(this,arguments)}return Object(P.a)(Oe,[{key:"render",value:function(){return this.props.children}}]),Oe}(M.Component),w=M.createContext(null);function x(ge){var ve=ge.children,Oe=ge.onBatchResize,Re=M.useRef(0),he=M.useRef([]),ue=M.useContext(w),Me=M.useCallback(function(et,it,nt){Re.current+=1;var at=Re.current;he.current.push({size:et,element:it,data:nt}),Promise.resolve().then(function(){at===Re.current&&(Oe==null||Oe(he.current),he.current=[])}),ue==null||ue(et,it,nt)},[Oe,ue]);return M.createElement(w.Provider,{value:Me},ve)}function L(ge){var ve=ge.children,Oe=ge.disabled,Re=M.useRef(null),he=M.useRef(null),ue=M.useContext(w),Me=M.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),et=M.isValidElement(ve)&&Object(m.c)(ve),it=et?ve.ref:null,nt=M.useMemo(function(){return Object(m.a)(it,Re)},[it,Re]),at=M.useRef(ge);at.current=ge;var ze=M.useCallback(function(Ze){var ot=at.current,de=ot.onResize,Se=ot.data,Le=Ze.getBoundingClientRect(),De=Le.width,qe=Le.height,lt=Ze.offsetWidth,mt=Ze.offsetHeight,gt=Math.floor(De),Ct=Math.floor(qe);if(Me.current.width!==gt||Me.current.height!==Ct||Me.current.offsetWidth!==lt||Me.current.offsetHeight!==mt){var xt={width:gt,height:Ct,offsetWidth:lt,offsetHeight:mt};Me.current=xt;var Ae=lt===Math.round(De)?De:lt,Ce=mt===Math.round(qe)?qe:mt,Ve=Object(G.a)(Object(G.a)({},xt),{},{offsetWidth:Ae,offsetHeight:Ce});ue==null||ue(Ve,Ze,Se),de&&Promise.resolve().then(function(){de(Ve,Ze)})}},[]);return M.useEffect(function(){var Ze=Object(f.a)(Re.current)||Object(f.a)(he.current);return Ze&&!Oe&&r(Ze,ze),function(){return s(Ze,ze)}},[Re.current,Oe]),M.createElement(S,{ref:he},et?M.cloneElement(ve,{ref:nt}):ve)}var O="rc-observer-key";function _(ge){var ve=ge.children,Oe=Object(n.a)(ve);return Oe.map(function(Re,he){var ue=(Re==null?void 0:Re.key)||"".concat(O,"-").concat(he);return M.createElement(L,Object(Z.a)({},ge,{key:ue}),Re)})}_.Collection=x;var b=_,g=k("bT9E"),p=k("TSYQ"),C=k.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"],N={},F;function A(ge){var ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Oe=ge.getAttribute("id")||ge.getAttribute("data-reactid")||ge.getAttribute("name");if(ve&&N[Oe])return N[Oe];var Re=window.getComputedStyle(ge),he=Re.getPropertyValue("box-sizing")||Re.getPropertyValue("-moz-box-sizing")||Re.getPropertyValue("-webkit-box-sizing"),ue=parseFloat(Re.getPropertyValue("padding-bottom"))+parseFloat(Re.getPropertyValue("padding-top")),Me=parseFloat(Re.getPropertyValue("border-bottom-width"))+parseFloat(Re.getPropertyValue("border-top-width")),et=v.map(function(nt){return"".concat(nt,":").concat(Re.getPropertyValue(nt))}).join(";"),it={sizingStyle:et,paddingSize:ue,borderSize:Me,boxSizing:he};return ve&&Oe&&(N[Oe]=it),it}function H(ge){var ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Oe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Re=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)),ge.getAttribute("wrap")?F.setAttribute("wrap",ge.getAttribute("wrap")):F.removeAttribute("wrap");var he=A(ge,ve),ue=he.paddingSize,Me=he.borderSize,et=he.boxSizing,it=he.sizingStyle;F.setAttribute("style","".concat(it,";").concat(E)),F.value=ge.value||ge.placeholder||"";var nt=Number.MIN_SAFE_INTEGER,at=Number.MAX_SAFE_INTEGER,ze=F.scrollHeight,Ze;if(et==="border-box"?ze+=Me:et==="content-box"&&(ze-=ue),Oe!==null||Re!==null){F.value=" ";var ot=F.scrollHeight-ue;Oe!==null&&(nt=ot*Oe,et==="border-box"&&(nt=nt+ue+Me),ze=Math.max(nt,ze)),Re!==null&&(at=ot*Re,et==="border-box"&&(at=at+ue+Me),Ze=ze>at?"":"hidden",ze=Math.min(at,ze))}return{height:ze,minHeight:nt,maxHeight:at,overflowY:Ze,resize:"none"}}var j=k("Gytx"),T=k.n(j),z;(function(ge){ge[ge.NONE=0]="NONE",ge[ge.RESIZING=1]="RESIZING",ge[ge.RESIZED=2]="RESIZED"})(z||(z={}));var Q=function(ge){Object(V.a)(Oe,ge);var ve=Object(U.a)(Oe);function Oe(Re){var he;return Object(X.a)(this,Oe),he=ve.call(this,Re),he.nextFrameActionId=void 0,he.resizeFrameId=void 0,he.textArea=void 0,he.saveTextArea=function(ue){he.textArea=ue},he.handleResize=function(ue){var Me=he.state.resizeStatus,et=he.props,it=et.autoSize,nt=et.onResize;if(Me!==z.NONE)return;typeof nt=="function"&&nt(ue),it&&he.resizeOnNextFrame()},he.resizeOnNextFrame=function(){cancelAnimationFrame(he.nextFrameActionId),he.nextFrameActionId=requestAnimationFrame(he.resizeTextarea)},he.resizeTextarea=function(){var ue=he.props.autoSize;if(!ue||!he.textArea)return;var Me=ue.minRows,et=ue.maxRows,it=H(he.textArea,!1,Me,et);he.setState({textareaStyles:it,resizeStatus:z.RESIZING},function(){cancelAnimationFrame(he.resizeFrameId),he.resizeFrameId=requestAnimationFrame(function(){he.setState({resizeStatus:z.RESIZED},function(){he.resizeFrameId=requestAnimationFrame(function(){he.setState({resizeStatus:z.NONE}),he.fixFirefoxAutoScroll()})})})})},he.renderTextArea=function(){var ue=he.props,Me=ue.prefixCls,et=Me===void 0?"rc-textarea":Me,it=ue.autoSize,nt=ue.onResize,at=ue.className,ze=ue.disabled,Ze=he.state,ot=Ze.textareaStyles,de=Ze.resizeStatus,Se=Object(g.a)(he.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Le=C()(et,at,Object(W.a)({},"".concat(et,"-disabled"),ze));"value"in Se&&(Se.value=Se.value||"");var De=Object(G.a)(Object(G.a)(Object(G.a)({},he.props.style),ot),de===z.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return M.createElement(b,{onResize:he.handleResize,disabled:!(it||nt)},M.createElement("textarea",Object(Z.a)({},Se,{className:Le,style:De,ref:he.saveTextArea})))},he.state={textareaStyles:{},resizeStatus:z.NONE},he}return Object(P.a)(Oe,[{key:"componentDidUpdate",value:function(he){(he.value!==this.props.value||!T()(he.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var he=this.textArea.selectionStart,ue=this.textArea.selectionEnd;this.textArea.setSelectionRange(he,ue)}}catch(Me){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Oe}(M.Component),ne=Q,se=function(ge){Object(V.a)(Oe,ge);var ve=Object(U.a)(Oe);function Oe(Re){var he;Object(X.a)(this,Oe),he=ve.call(this,Re),he.resizableTextArea=void 0,he.focus=function(){he.resizableTextArea.textArea.focus()},he.saveTextArea=function(Me){he.resizableTextArea=Me},he.handleChange=function(Me){var et=he.props.onChange;he.setValue(Me.target.value,function(){he.resizableTextArea.resizeTextarea()}),et&&et(Me)},he.handleKeyDown=function(Me){var et=he.props,it=et.onPressEnter,nt=et.onKeyDown;Me.keyCode===13&&it&&it(Me),nt&&nt(Me)};var ue=typeof Re.value=="undefined"||Re.value===null?Re.defaultValue:Re.value;return he.state={value:ue},he}return Object(P.a)(Oe,[{key:"setValue",value:function(he,ue){"value"in this.props||this.setState({value:he},ue)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return M.createElement(ne,Object(Z.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(he){return"value"in he?{value:he.value}:null}}]),Oe}(M.Component),xe=oe.default=se},ZD9Y:function(je,oe,k){"use strict";var Z=k("BoS7"),X=k("Sdc0"),P=k("OaEy"),V=k("2fM7"),U=k("q1tI"),M=k.n(U),G=k("lOMy"),W=k.n(G),n=V.a.Option;oe.a=function(D){var m=D.onFontSizeChange,f=D.cmFontSize,h=D.cmCodeMode,c=D.onCodeModeChange,o=D.onTabToSpace,d=D.className,i=d===void 0?"":d,a=D.tabToSpace,r=D.children;return M.a.createElement("div",{className:"tpi-code-setting ".concat(i)},M.a.createElement("h3",null,"\u4EE3\u7801\u683C\u5F0F"),M.a.createElement("section",null,M.a.createElement("div",{className:"file-item"},M.a.createElement("b",null,"\u663E\u793A\u6A21\u5F0F"),M.a.createElement(V.a,{bordered:!1,size:"small",value:h,onChange:c},M.a.createElement(n,{value:"vs"},"\u767D\u8272\u80CC\u666F"),M.a.createElement(n,{value:"vs-dark"},"\u9ED1\u8272\u80CC\u666F"))),M.a.createElement("div",{className:"file-item"},M.a.createElement("b",null,"\u5B57\u4F53\u5927\u5C0F"),M.a.createElement(V.a,{bordered:!1,size:"small",value:f,onChange:m},M.a.createElement(n,{value:12},"12px"),M.a.createElement(n,{value:14},"14px"),M.a.createElement(n,{value:16},"16px"),M.a.createElement(n,{value:18},"18px"),M.a.createElement(n,{value:20},"20px"),M.a.createElement(n,{value:22},"22px"))),M.a.createElement("div",{className:"file-item"},M.a.createElement("b",null,"Tab\u8F6C\u6362"),M.a.createElement(X.a,{checked:a,onChange:o}))),M.a.createElement("h3",null,"\u5FEB\u6377\u952E"),M.a.createElement("section",null,M.a.createElement("div",{className:"file-item"},M.a.createElement("b",null,"\u4FDD\u5B58\u4EE3\u7801"),M.a.createElement("span",null,"Ctrl + S")),M.a.createElement("div",{className:"file-item"},M.a.createElement("b",null,"\u5524\u51FA\u5FEB\u6377\u952E\u5217\u8868"),M.a.createElement("span",null,"F1 / Alt + F1")),M.a.createElement("div",{className:"file-item"},M.a.createElement("b",null,"\u5DE6\u53F3\u7F29\u8FDB"),M.a.createElement("span",null,"Ctrl + ]/[")),M.a.createElement("div",{className:"file-item"},M.a.createElement("b",null,"\u8DF3\u5230\u5339\u914D\u7684\u62EC\u53F7"),M.a.createElement("span",null,"Ctrl + Shift + \\")),M.a.createElement("div",{className:"file-item"},M.a.createElement("b",null,"\u8F6C\u5230\u884C\u9996"),M.a.createElement("span",null,"Home")),M.a.createElement("div",{className:"file-item"},M.a.createElement("b",null,"\u8F6C\u5230\u884C\u5C3E"),M.a.createElement("span",null,"End"))),r)}},ZW9T:function(je,oe,k){"use strict";k.d(oe,"a",function(){return j});var Z=k("k1fw"),X=k("oBTY"),P=k("miYZ"),V=k("tsqr"),U=k("rAM+"),M=k("tJVT"),G=k("PpiC"),W=k("q1tI"),n=k.n(W),D=k("bdgK"),m=k("9og8"),f=k("WmNS"),h=k.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"]},o={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=k("5VLF"),r=k.n(a),s={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"]}},S=function(z,Q){return Q.map(function(ne){return{label:ne,kind:z.languages.CompletionItemKind.Keyword,insertText:ne}})},w=function(z){return Object.keys(s.tables).map(function(Q){return{label:Q,kind:z.languages.CompletionItemKind.Variable,insertText:Q}})},x=function(z,Q){var ne=s.tables[z];return ne?ne.map(function(se){return{label:se,kind:Q.languages.CompletionItemKind.Field,insertText:se}}):[]};function L(T,z,Q,ne,se){var xe=z.getWordUntilPosition(Q),ge={startLineNumber:Q.lineNumber,endLineNumber:Q.lineNumber,startColumn:xe.startColumn,endColumn:xe.endColumn},ve=ne.map(function(Oe){return{label:Oe,kind:T.languages.CompletionItemKind.Keyword,insertText:Oe,insertTextRules:T.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ge}});return se.map(function(Oe){ve.push(Object(Z.a)(Object(Z.a)({},Oe),{},{range:ge}))}),ve}var O=function(T){s.languages.map(function(se){return T.languages.registerDocumentFormattingEditProvider(se,{provideDocumentFormattingEdits:function(ge,ve,Oe){return Object(m.a)(h.a.mark(function Re(){var he;return h.a.wrap(function(Me){for(;;)switch(Me.prev=Me.next){case 0:return he=r()(ge.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}),Me.abrupt("return",[{range:ge.getFullModelRange(),text:he}]);case 2:case"end":return Me.stop()}},Re)}))()}}),se});var z=d.quickKey.map(function(se){return{label:se.label,kind:T.languages.CompletionItemKind.Method,insertText:se.content,insertTextRules:T.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),Q=i.quickKey.map(function(se){return{label:se.label,kind:T.languages.CompletionItemKind.Method,insertText:se.content,insertTextRules:T.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ne=o.quickKey.map(function(se){return{label:se.label,kind:T.languages.CompletionItemKind.Method,insertText:se.content,insertTextRules:T.languages.CompletionItemInsertTextRule.InsertAsSnippet}});T.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(xe,ge){var ve=xe.getWordUntilPosition(ge),Oe={startLineNumber:ge.lineNumber,endLineNumber:ge.lineNumber,startColumn:ve.startColumn,endColumn:ve.endColumn},Re=xe.getLineContent(ge.lineNumber).substring(ve.startColumn-2,ve.endColumn);return{suggestions:[].concat(Object(X.a)(d.keywords.map(function(he){return{label:he,kind:T.languages.CompletionItemKind.Function,documentation:he,insertText:he,insertTextRules:T.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Oe}})),Object(X.a)(d.quickKey.map(function(he){return{label:he.label,kind:T.languages.CompletionItemKind.Function,documentation:he.content,insertText:Re.startsWith("#")?he.content.replace(/#/,""):he.content,insertTextRules:T.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Oe}})))}}}),T.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(xe,ge){var ve=xe.getWordUntilPosition(ge),Oe={startLineNumber:ge.lineNumber,endLineNumber:ge.lineNumber,startColumn:ve.startColumn,endColumn:ve.endColumn};return{suggestions:Object(X.a)(c.keywords.map(function(Re){return{label:Re,kind:T.languages.CompletionItemKind.Function,documentation:Re,insertText:Re,insertTextRules:T.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Oe}}))}}}),T.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(xe,ge){var ve=xe.getWordUntilPosition(ge),Oe={startLineNumber:ge.lineNumber,endLineNumber:ge.lineNumber,startColumn:ve.startColumn,endColumn:ve.endColumn},Re=xe.getLineContent(ge.lineNumber).substring(ve.startColumn-2,ve.endColumn);return{suggestions:[].concat(Object(X.a)(o.keywords.map(function(he){return{label:he,kind:T.languages.CompletionItemKind.Function,documentation:he,insertText:he,insertTextRules:T.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Oe}})),Object(X.a)(o.quickKey.map(function(he){return{label:he.label,kind:T.languages.CompletionItemKind.Function,documentation:he.content,insertText:Re.startsWith("#")?he.content.replace(/#/,""):he.content,insertTextRules:T.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Oe}})))}}}),T.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(xe,ge){var ve=xe.getWordUntilPosition(ge),Oe={startLineNumber:ge.lineNumber,endLineNumber:ge.lineNumber,startColumn:ve.startColumn,endColumn:ve.endColumn},Re=xe.getLineContent(ge.lineNumber).substring(ve.startColumn-2,ve.endColumn);return{suggestions:[].concat(Object(X.a)(i.keywords.map(function(he){return{label:he,kind:T.languages.CompletionItemKind.Function,documentation:he,insertText:he,insertTextRules:T.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Oe}})),Object(X.a)(i.quickKey.map(function(he){return{label:he.label,kind:T.languages.CompletionItemKind.Function,documentation:he.content,insertText:Re.startsWith("#")?he.content.replace(/#/,""):he.content,insertTextRules:T.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Oe}})))}}})},_="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",b=k("fjLI"),g=k("LvDl"),p=k("+ua5");function C(T){return/^\d+$/.test(T)?"".concat(T,"px"):T}function E(){}var v=!1,N={"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 T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],z=T;if(Array.isArray(T)){for(var Q=0;Q<T.length;Q++){var ne=N[T[Q]];if(ne)return ne}return z[0]}return N[z]||z}var A=null,H=oe.b=function(T){var z=T.width,Q=z===void 0?"100%":z,ne=T.height,se=ne===void 0?"100%":ne,xe=T.value,ge=T.language,ve=ge===void 0?"javascript":ge,Oe=T.style,Re=Oe===void 0?{}:Oe,he=T.options,ue=he===void 0?{}:he,Me=T.overrideServices,et=Me===void 0?{}:Me,it=T.theme,nt=it===void 0?"vs-dark":it,at=T.onEditBlur,ze=T.onSave,Ze=T.autoHeight,ot=Ze===void 0?!1:Ze,de=T.forbidCopy,Se=de===void 0?!1:de,Le=T.onChange,De=Le===void 0?E:Le,qe=T.editorDidMount,lt=qe===void 0?E:qe,mt=T.onFocus,gt=mt===void 0?E:mt,Ct=T.filename,xt=Ct===void 0?"educoder.txt":Ct,Ae=T.errorLine,Ce=T.errorContent,Ve=Ce===void 0?"":Ce,Qe=Object(G.a)(T,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),Pe=Object(W.useRef)(),Fe=Object(W.useRef)({}),be=Object(W.useRef)(),fe=Object(W.useRef)(),pe=Object(W.useRef)(!1),ie=Object(W.useRef)(),ae=Object(W.useState)(!1),ce=Object(M.a)(ae,2),me=ce[0],Te=ce[1];function ke(){var tt;return Pe.current&&(tt=new D.default(function(_t){var Tt=Object(U.a)(_t),Zt;try{for(Tt.s();!(Zt=Tt.n()).done;){var nn=Zt.value;(nn.target.offsetHeight>0||nn.target.offsetWidth>0)&&Fe.current.instance.layout()}}catch(Qt){Tt.e(Qt)}finally{Tt.f()}}),tt.observe(Pe.current)),tt}function $e(){V.b.warn(decodeURIComponent(_))}var pt=function(){var _t=Fe.current.instance;if(xe!=null&&_t&&me){var Tt=_t.getModel();Tt&&xe!==Tt.getValue()&&(v=!0,Tt.setValue(xe),_t.layout(),v=!1)}};Object(W.useEffect)(function(){fe.current&&clearTimeout(fe.current),fe.current=setTimeout(function(){pt()},500)},[xe,me,Fe.current]),Object(W.useEffect)(function(){if(Ae&&Fe.current&&Fe.current.instance){var tt=Fe.current.instance;tt.changeViewZones(function(Tt){var Zt=document.createElement("div");Zt.style.padding="10px 20px",Zt.style.width="calc(100% - 20px)",Zt.className="my-error-line-wrp",Zt.innerHTML=Ve,Tt.addZone({afterLineNumber:Ae||11,heightInLines:3,domNode:Zt})});var _t={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}};tt.addOverlayWidget(_t),tt.revealPositionInCenter({lineNumber:20,column:1})}},[Ae,Fe.current,me]);function Ot(){var tt=Fe.current.instance;if(tt){var _t=tt.getSelection(),Tt=Fe.current.pastePos||{},Zt=new A.Range(Tt.startLineNumber||_t.endLineNumber,Tt.startColumn||_t.endColumn,Tt.endLineNumber||_t.endLineNumber,Tt.endColumn||_t.endColumn);setTimeout(function(){tt.executeEdits("",[{range:Zt,text:""}])},300)}}function vt(tt){(window.navigator.platform.match("Mac")?tt.metaKey:tt.ctrlKey)&&tt.keyCode==83&&(tt.preventDefault(),ze())}var st=function(){if(ot&&Fe.current.instance){var _t=Fe.current.instance.getContentHeight();Ie(_t<se?se:_t)}else Ie(se)};function Ke(tt){var _t=document.createEvent("MouseEvents");_t.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),tt.dispatchEvent(_t)}function Ge(tt,_t){var Tt=window.URL||window.webkitURL||window,Zt=new Blob([_t]),nn=document.createElementNS("http://www.w3.org/1999/xhtml","a");nn.href=Tt.createObjectURL(Zt),nn.download=tt,Ke(nn)}Object(W.useEffect)(function(){st()},[st]),Object(W.useEffect)(function(){Pe.current&&!me&&Promise.all([k.e(16),k.e(28)]).then(k.t.bind(null,"M/lh",7)).then(function(tt){try{A=tt,Fe.current.instance=A.editor.create(Pe.current,{value:xe,language:F(ve),theme:nt,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},et);var _t=Fe.current.instance,Tt=b.d._menuItems,Zt=Object(X.a)(Tt).find(function(un){return un[0]._debugName=="EditorContext"}),nn=Zt[1],Qt=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Lt=function(fn,Xt){var mn=fn._first;do{var Pn,zn,dt=Xt.includes((Pn=mn.element)===null||Pn===void 0||((zn=Pn.command)===null||zn===void 0)?void 0:zn.id);dt&&fn._remove(mn)}while(mn=mn.next)};if(lt(_t,A),setTimeout(function(){st(),Fe.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Ge(xt||"educoder.txt",_t.getValue())}}),_t.getDomNode().addEventListener("input",function(){be.current.autoFormat&&_t.getAction("editor.action.formatDocument").run()})},500),Fe.current.subscription=_t.onDidChangeModelContent(function(un){pe.current?clearTimeout(ie.current):(st(),De(_t.getValue(),un)),ie.current=setTimeout(function(){pe.current=!1},500)}),window.Monaco||O(A,F(ve)),Se&&(Lt(nn,Qt),Pe.current.classList.add("noCopyPaste"),_t.onKeyDown(function(un){var fn=un.keyCode,Xt=un.ctrlKey,mn=un.metaKey;(fn===33||fn===52)&&(mn||Xt)&&($e(),un.preventDefault())})),window.Monaco=A,at&&_t.onDidBlurEditorWidget(function(){at(_t.getValue())}),gt&&_t.onDidFocusEditorText(function(){gt(_t.getValue())}),Se){_t.addCommand(A.KeyMod.CtrlCmd|A.KeyCode.KEY_V,function(){return $e(),null}),_t.onDidPaste(function(un){Fe.current.pastePos=un});try{window.addEventListener("paste",Ot)}catch(un){}}var On=ke();return Te(!0),function(){var un=Fe.current.instance;un.dispose();var fn=un.getModel();fn&&fn.dispose(),Fe.current.subscription&&Fe.current.subscription.dispose(),Se&&window.removeEventListener("paste",Ot),On.unobserve(Pe.current)}}catch(un){}})},[]),Object(W.useEffect)(function(){var tt=Fe.current.instance;if(tt&&me)return document.addEventListener("keydown",vt,!1),function(){document.removeEventListener("keydown",vt)}},[ze,me]),Object(W.useEffect)(function(){var tt=Fe.current.instance;if(tt&&me){var _t=F(ve);A.editor.setModelLanguage(tt.getModel(),_t),console.log("language:",ve,tt.getModel(),_t)}},[ve,me]),Object(W.useEffect)(function(){var tt=Fe.current.instance;tt&&me&&A.editor.setTheme(nt)},[nt,me]),Object(W.useEffect)(function(){var tt=Fe.current.instance;be.current=ue,tt&&me&&(tt.updateOptions(Object(Z.a)({},ue)),setTimeout(function(){tt.getModel().updateOptions(Object(Z.a)({},ue))},200))},[JSON.stringify(ue),me]),Object(W.useEffect)(function(){var tt=Fe.current.instance;tt&&me&&tt.layout()},[Q,se,me]);var Ue=Object(W.useState)(C(Q)),le=Object(M.a)(Ue,2),_e=le[0],Xe=le[1],Be=Object(W.useState)(C(se)),ct=Object(M.a)(Be,2),ft=ct[0],Ie=ct[1],Je=Object(Z.a)(Object(Z.a)({},Re),{},{width:_e,height:ft});return n.a.createElement("div",{className:"my-monaco-editor",ref:Pe,style:Je})};function j(T){var z=T.width,Q=z===void 0?"100%":z,ne=T.height,se=ne===void 0?"100%":ne,xe=T.original,ge=T.modified,ve=T.language,Oe=T.options,Re=Oe===void 0?{}:Oe,he=Object(W.useRef)(),ue=Object(W.useState)(null),Me=Object(M.a)(ue,2),et=Me[0],it=Me[1];function nt(ot){var de;return he.current&&(de=new D.default(function(Se){var Le=Object(U.a)(Se),De;try{for(Le.s();!(De=Le.n()).done;){var qe=De.value;(qe.target.offsetHeight>0||qe.target.offsetWidth>0)&&ot.layout()}}catch(lt){Le.e(lt)}finally{Le.f()}}),de.observe(he.current)),de}Object(W.useEffect)(function(){he.current&&Promise.all([k.e(16),k.e(28)]).then(k.t.bind(null,"M/lh",7)).then(function(ot){A=ot;var de=A.editor.createDiffEditor(he.current,Object(Z.a)(Object(Z.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},Re),{},{wordWrap:!0}));it(de);var Se=nt(de);return function(){de.dispose();var Le=de.getModel();Le&&Le.dispose(),Se.unobserve(he.current)}})},[]),Object(W.useEffect)(function(){et&&et.setModel({original:A.editor.createModel(xe,ve),modified:A.editor.createModel(ge,ve)})},[xe,ge,ve,et]);var at=C(Q),ze=C(se),Ze={width:at,height:ze};return n.a.createElement("div",{className:"my-diff-editor",ref:he,style:Ze})}},ZpRC:function(je,oe,k){"use strict";function Z(m){return typeof m=="object"&&m!=null&&m.nodeType===1}function X(m,f){return(!f||m!=="hidden")&&m!=="visible"&&m!=="clip"}function P(m,f){if(m.clientHeight<m.scrollHeight||m.clientWidth<m.scrollWidth){var h=getComputedStyle(m,null);return X(h.overflowY,f)||X(h.overflowX,f)||function(c){var o=function(d){if(!d.ownerDocument||!d.ownerDocument.defaultView)return null;try{return d.ownerDocument.defaultView.frameElement}catch(i){return null}}(c);return!!o&&(o.clientHeight<c.scrollHeight||o.clientWidth<c.scrollWidth)}(m)}return!1}function V(m,f,h,c,o,d,i,a){return d<m&&i>f||d>m&&i<f?0:d<=m&&a<=h||i>=f&&a>=h?d-m-c:i>f&&a<h||d<m&&a>h?i-f+o:0}var U=function(m,f){var h=window,c=f.scrollMode,o=f.block,d=f.inline,i=f.boundary,a=f.skipOverflowHiddenElements,r=typeof i=="function"?i:function(ot){return ot!==i};if(!Z(m))throw new TypeError("Invalid target");for(var s=document.scrollingElement||document.documentElement,S=[],w=m;Z(w)&&r(w);){if((w=w.parentElement)===s){S.push(w);break}w!=null&&w===document.body&&P(w)&&!P(document.documentElement)||w!=null&&P(w,a)&&S.push(w)}for(var x=h.visualViewport?h.visualViewport.width:innerWidth,L=h.visualViewport?h.visualViewport.height:innerHeight,O=window.scrollX||pageXOffset,_=window.scrollY||pageYOffset,b=m.getBoundingClientRect(),g=b.height,p=b.width,C=b.top,E=b.right,v=b.bottom,N=b.left,F=o==="start"||o==="nearest"?C:o==="end"?v:C+g/2,A=d==="center"?N+p/2:d==="end"?E:N,H=[],j=0;j<S.length;j++){var T=S[j],z=T.getBoundingClientRect(),Q=z.height,ne=z.width,se=z.top,xe=z.right,ge=z.bottom,ve=z.left;if(c==="if-needed"&&C>=0&&N>=0&&v<=L&&E<=x&&C>=se&&v<=ge&&N>=ve&&E<=xe)return H;var Oe=getComputedStyle(T),Re=parseInt(Oe.borderLeftWidth,10),he=parseInt(Oe.borderTopWidth,10),ue=parseInt(Oe.borderRightWidth,10),Me=parseInt(Oe.borderBottomWidth,10),et=0,it=0,nt="offsetWidth"in T?T.offsetWidth-T.clientWidth-Re-ue:0,at="offsetHeight"in T?T.offsetHeight-T.clientHeight-he-Me:0;if(s===T)et=o==="start"?F:o==="end"?F-L:o==="nearest"?V(_,_+L,L,he,Me,_+F,_+F+g,g):F-L/2,it=d==="start"?A:d==="center"?A-x/2:d==="end"?A-x:V(O,O+x,x,Re,ue,O+A,O+A+p,p),et=Math.max(0,et+_),it=Math.max(0,it+O);else{et=o==="start"?F-se-he:o==="end"?F-ge+Me+at:o==="nearest"?V(se,ge,Q,he,Me+at,F,F+g,g):F-(se+Q/2)+at/2,it=d==="start"?A-ve-Re:d==="center"?A-(ve+ne/2)+nt/2:d==="end"?A-xe+ue+nt:V(ve,xe,ne,Re,ue+nt,A,A+p,p);var ze=T.scrollLeft,Ze=T.scrollTop;F+=Ze-(et=Math.max(0,Math.min(Ze+et,T.scrollHeight-Q+at))),A+=ze-(it=Math.max(0,Math.min(ze+it,T.scrollWidth-ne+nt)))}H.push({el:T,top:et,left:it})}return H};function M(m){return m===Object(m)&&Object.keys(m).length!==0}function G(m,f){f===void 0&&(f="auto");var h="scrollBehavior"in document.body.style;m.forEach(function(c){var o=c.el,d=c.top,i=c.left;o.scroll&&h?o.scroll({top:d,left:i,behavior:f}):(o.scrollTop=d,o.scrollLeft=i)})}function W(m){return m===!1?{block:"end",inline:"nearest"}:M(m)?m:{block:"start",inline:"nearest"}}function n(m,f){var h=!m.ownerDocument.documentElement.contains(m);if(M(f)&&typeof f.behavior=="function")return f.behavior(h?[]:U(m,f));if(h)return;var c=W(f);return G(U(m,c),c.behavior)}var D=oe.a=n},a4uL:function(je,oe,k){},bCnd:function(je,oe,k){"use strict";k.d(oe,"b",function(){return V}),k.d(oe,"a",function(){return U});var Z=k("je13"),X=k.n(Z),P=!1;function V(M,G){var W=X.a.get("__ec");W||(W={}),W[M]=G,X.a.set("__ec",W)}function U(M,G){var W=X.a.get("__ec");return W?W[M]===void 0?G:W[M]:G}},bT9E:function(je,oe,k){"use strict";k.d(oe,"a",function(){return X});var Z=k("VTBJ");function X(P,V){var U=Object(Z.a)({},P);return Array.isArray(V)&&V.forEach(function(M){delete U[M]}),U}},biw7:function(je,oe,k){"use strict";var Z=k("q1tI"),X=k.n(Z),P=Z.createContext(null);oe.a=P},c5Ni:function(je,oe,k){},cDPC:function(je,oe,k){"use strict";var Z=k("tJVT"),X=k("q1tI"),P=k.n(X),V=k("i3hx"),U=k.n(V);oe.a=function(M){var G=M.defaultX,W=G===void 0?"40%":G,n=M.leftChild,D=M.rightChild,m=M.className,f=M.hideResize,h=f===void 0?!1:f,c=Object(X.useState)(W),o=Object(Z.a)(c,2),d=o[0],i=o[1],a=Object(X.useRef)();function r(){a.current=!0}Object(X.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 s=typeof d=="number"&&d!==.01?"".concat(d,"px"):W,S="calc(100% - ".concat(h?"0px":"4px"," - ").concat(s,")");return P.a.createElement("div",{className:"split-panel-container ".concat(m)},P.a.createElement("section",{style:{width:s,display:d===.01?"none":""}},n),P.a.createElement("section",{className:"resize-x-bar",onMouseDown:r},P.a.createElement("a",{className:"btn-resize"},P.a.createElement("svg",{width:"16",height:"13",viewBox:"0 0 16 13"},P.a.createElement("path",{d:"M12.245 7.53H5.647v1.882h6.598v2.823L16 8.471l-3.755-3.765V7.53zM10.353 4.706H3.755v2.823L0 3.765 3.755 0v2.824h6.598v1.882z"})))),P.a.createElement("section",{style:{width:S}},D))}},dejd:function(je,oe,k){},dmUQ:function(je,oe,k){"use strict";var Z=k("Ff2n"),X=k("rePB"),P=k("1OyB"),V=k("vuIU"),U=k("Ji7U"),M=k("md7G"),G=k("foSv"),W=k("q1tI"),n=k.n(W),D=k("TSYQ"),m=k.n(D),f=k("4IlW");function h(g,p){var C=Object.keys(g);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(g);p&&(E=E.filter(function(v){return Object.getOwnPropertyDescriptor(g,v).enumerable})),C.push.apply(C,E)}return C}function c(g){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(X.a)(g,E,C[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(C)):h(Object(C)).forEach(function(E){Object.defineProperty(g,E,Object.getOwnPropertyDescriptor(C,E))})}return g}function o(g){var p=d();return function(){var E=Object(G.a)(g),v;if(p){var N=Object(G.a)(this).constructor;v=Reflect.construct(E,arguments,N)}else v=E.apply(this,arguments);return Object(M.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(g){return!1}}function i(){}function a(g){g.preventDefault()}var r=function(p){return p.replace(/[^\w.-]+/g,"")},s=200,S=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)},O=function(g){Object(U.a)(C,g);var p=o(C);function C(E){var v;Object(P.a)(this,C),v=p.call(this,E),v.onKeyDown=function(A){var H=v.props,j=H.onKeyDown,T=H.onPressEnter;if(A.keyCode===f.a.UP){var z=v.getRatio(A);v.up(A,z,null),v.stop()}else if(A.keyCode===f.a.DOWN){var Q=v.getRatio(A);v.down(A,Q,null),v.stop()}else A.keyCode===f.a.ENTER&&T&&T(A);if(v.recordCursorPosition(),v.lastKeyCode=A.keyCode,j){for(var ne=arguments.length,se=new Array(ne>1?ne-1:0),xe=1;xe<ne;xe++)se[xe-1]=arguments[xe];j.apply(void 0,[A].concat(se))}},v.onKeyUp=function(A){var H=v.props.onKeyUp;if(v.stop(),v.recordCursorPosition(),H){for(var j=arguments.length,T=new Array(j>1?j-1:0),z=1;z<j;z++)T[z-1]=arguments[z];H.apply(void 0,[A].concat(T))}},v.onChange=function(A){var H=v.props.onChange;v.state.focused&&(v.inputting=!0),v.rawInput=v.props.parser(v.getValueFromEvent(A)),v.setState({inputValue:v.rawInput}),H(v.toNumber(v.rawInput))},v.onMouseUp=function(){var A=v.props.onMouseUp;v.recordCursorPosition(),A&&A.apply(void 0,arguments)},v.onFocus=function(){var A;v.setState({focused:!0}),(A=v.props).onFocus.apply(A,arguments)},v.onBlur=function(){var A=v.props.onBlur;v.inputting=!1,v.setState({focused:!1});var H=v.getCurrentValidValue(v.state.inputValue),j=v.setValue(H,i);if(A){var T=v.input.value,z=v.getInputDisplayValue({focus:!1,value:j});v.input.value=z&&Number(z),A.apply(void 0,arguments),v.input.value=T}},v.getRatio=function(A){var H=1;return A.metaKey||A.ctrlKey?H=.1:A.shiftKey&&(H=10),H},v.getFullNum=function(A){return isNaN(A)?A:/e/i.test(String(A))?Number(A).toFixed(18).replace(/\.?0+$/,""):A},v.getPrecision=function(A){if(x(v.props.precision))return v.props.precision;var H=String(A);if(H.indexOf("e-")>=0)return parseInt(H.slice(H.indexOf("e-")+2),10);var j=0;return H.indexOf(".")>=0&&(j=H.length-H.indexOf(".")-1),j},v.getInputDisplayValue=function(A){var H=A||v.state,j=H.focused,T=H.inputValue,z=H.value,Q;j?Q=T:Q=v.toPrecisionAsStep(z),Q==null&&(Q="");var ne=v.formatWrapper(Q);return x(v.props.decimalSeparator)&&(ne=ne.toString().replace(".",v.props.decimalSeparator)),ne},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(A){}},v.restoreByAfter=function(A){if(A===void 0)return!1;var H=v.input.value,j=H.lastIndexOf(A);if(j===-1)return!1;var T=v.cursorBefore.length;return v.lastKeyCode===f.a.DELETE&&v.cursorBefore.charAt(T-1)===A[0]?(v.fixCaret(T,T),!0):j+A.length===H.length?(v.fixCaret(j,j),!0):!1},v.partRestoreByAfter=function(A){return A===void 0?!1:Array.prototype.some.call(A,function(H,j){var T=A.substring(j);return v.restoreByAfter(T)})},v.isNotCompleteNumber=function(A){return isNaN(A)||A===""||A===null||A&&A.toString().indexOf(".")===A.toString().length-1},v.stop=function(){v.autoStepTimer&&clearTimeout(v.autoStepTimer)},v.down=function(A,H,j){v.pressingUpOrDown=!0,v.step("down",A,H,j)},v.up=function(A,H,j){v.pressingUpOrDown=!0,v.step("up",A,H,j)},v.saveInput=function(A){v.input=A};var N=E.value;N===void 0&&(N=E.defaultValue),v.state={focused:E.autoFocus};var F=v.getValidValue(v.toNumber(N));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 N=this.props,F=N.value,A=N.onChange,H=N.max,j=N.min,T=this.state.focused;if(v){if(!L(v.value,F)||!L(v.max,H)||!L(v.min,j)){var z=T?F:this.getValidValue(F),Q;this.pressingUpOrDown?Q=z:this.inputting?Q=this.rawInput:Q=this.toPrecisionAsStep(z),this.setState({value:z,inputValue:Q})}var ne="value"in this.props?F:this.state.value;"max"in this.props&&v.max!==H&&typeof ne=="number"&&ne>H&&A&&A(H),"min"in this.props&&v.min!==j&&typeof ne=="number"&&ne<j&&A&&A(j)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var se=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===f.a.BACKSPACE?se=this.cursorStart-1:this.lastKeyCode===f.a.DELETE&&(se=this.cursorStart):se=this.input.value.length,this.fixCaret(se,se)}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(xe){}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 N=v;return N===""?N="":this.isNotCompleteNumber(parseFloat(N))?N=this.state.value:N=this.getValidValue(N),this.toNumber(N)}},{key:"getValueFromEvent",value:function(v){var N=v.target.value.trim().replace(/。/g,".");return x(this.props.decimalSeparator)&&(N=N.replace(this.props.decimalSeparator,".")),N}},{key:"getValidValue",value:function(v){var N=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,A=parseFloat(v);return isNaN(A)?v:(A<N&&(A=N),A>F&&(A=F),A)}},{key:"setValue",value:function(v,N){var F=this.props.precision,A=this.isNotCompleteNumber(parseFloat(v))?null:parseFloat(v),H=this.state.value,j=H===void 0?null:H,T=this.state.inputValue,z=T===void 0?null:T,Q=typeof A=="number"?A.toFixed(F):"".concat(A),ne=A!==j||Q!=="".concat(z);return"value"in this.props?(z=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:z},N)):this.setState({value:A,inputValue:this.toPrecisionAsStep(v)},N),ne&&this.props.onChange(A),A}},{key:"getMaxPrecision",value:function(v){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.props,A=F.precision,H=F.step;if(x(A))return A;var j=this.getPrecision(N),T=this.getPrecision(H),z=this.getPrecision(v);return v?Math.max(z,j+T):j+T}},{key:"getPrecisionFactor",value:function(v){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.getMaxPrecision(v,N);return Math.pow(10,F)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(v){return this.props.formatter?this.props.formatter(v):v}},{key:"toPrecisionAsStep",value:function(v){if(this.isNotCompleteNumber(v)||v==="")return v;var N=Math.abs(this.getMaxPrecision(v));return isNaN(N)?v.toString():Number(v).toFixed(N)}},{key:"toNumber",value:function(v){var N=this.props.precision,F=this.state.focused,A=v&&v.length>16&&F;return this.isNotCompleteNumber(v)||A?v:x(N)?Math.round(v*Math.pow(10,N))/Math.pow(10,N):Number(v)}},{key:"upStep",value:function(v,N){var F=this.props.step,A=this.getPrecisionFactor(v,N),H=Math.abs(this.getMaxPrecision(v,N)),j=((A*v+A*F*N)/A).toFixed(H);return this.toNumber(j)}},{key:"downStep",value:function(v,N){var F=this.props.step,A=this.getPrecisionFactor(v,N),H=Math.abs(this.getMaxPrecision(v,N)),j=((A*v-A*F*N)/A).toFixed(H);return this.toNumber(j)}},{key:"step",value:function(v,N){var F=this,A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,H=arguments.length>3?arguments[3]:void 0;this.stop(),N&&(N.persist(),N.preventDefault());var j=this.props;if(j.disabled)return;var T=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(T))return;var z=this["".concat(v,"Step")](T,A),Q=z>j.max||z<j.min;if(z>j.max?z=j.max:z<j.min&&(z=j.min),this.setValue(z,null),this.setState({focused:!0},function(){F.pressingUpOrDown=!1}),Q)return;this.autoStepTimer=setTimeout(function(){F[v](N,A,!0)},H?s:S)}},{key:"fixCaret",value:function(v,N){if(v===void 0||N===void 0||!this.input||!this.input.value)return;try{var F=this.input.selectionStart,A=this.input.selectionEnd;(v!==F||N!==A)&&this.input.setSelectionRange(v,N)}catch(H){}}},{key:"render",value:function(){var v,N=this.props,F=N.prefixCls,A=N.disabled,H=N.readOnly,j=N.useTouch,T=N.autoComplete,z=N.upHandler,Q=N.downHandler,ne=N.className,se=N.max,xe=N.min,ge=N.style,ve=N.title,Oe=N.onMouseEnter,Re=N.onMouseLeave,he=N.onMouseOver,ue=N.onMouseOut,Me=N.required,et=N.onClick,it=N.tabIndex,nt=N.type,at=N.placeholder,ze=N.id,Ze=N.inputMode,ot=N.pattern,de=N.step,Se=N.maxLength,Le=N.autoFocus,De=N.name,qe=N.onPaste,lt=N.onInput,mt=Object(Z.a)(N,["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"]),gt=this.state,Ct=gt.value,xt=gt.focused,Ae=m()(F,(v={},Object(X.a)(v,ne,!!ne),Object(X.a)(v,"".concat(F,"-disabled"),A),Object(X.a)(v,"".concat(F,"-focused"),xt),v)),Ce={};Object.keys(mt).forEach(function(me){(me.substr(0,5)==="data-"||me.substr(0,5)==="aria-"||me==="role")&&(Ce[me]=mt[me])});var Ve=!H&&!A,Qe=this.getInputDisplayValue(null),Pe=(Ct||Ct===0)&&(isNaN(Ct)||Number(Ct)>=se),Fe=(Ct||Ct===0)&&(isNaN(Ct)||Number(Ct)<=xe),be=Pe||A||H,fe=Fe||A||H,pe=m()("".concat(F,"-handler"),"".concat(F,"-handler-up"),Object(X.a)({},"".concat(F,"-handler-up-disabled"),be)),ie=m()("".concat(F,"-handler"),"".concat(F,"-handler-down"),Object(X.a)({},"".concat(F,"-handler-down-disabled"),fe)),ae=j?{onTouchStart:be?i:this.up,onTouchEnd:this.stop}:{onMouseDown:be?i:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},ce=j?{onTouchStart:fe?i:this.down,onTouchEnd:this.stop}:{onMouseDown:fe?i:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return n.a.createElement("div",{className:Ae,style:ge,title:ve,onMouseEnter:Oe,onMouseLeave:Re,onMouseOver:he,onMouseOut:ue,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"},ae,{role:"button","aria-label":"Increase Value","aria-disabled":be,className:pe}),z||n.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-up-inner"),onClick:a})),n.a.createElement("span",Object.assign({unselectable:"on"},ce,{role:"button","aria-label":"Decrease Value","aria-disabled":fe,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":xe,"aria-valuemax":se,"aria-valuenow":Ct,required:Me,type:nt,placeholder:at,onPaste:qe,onClick:et,onMouseUp:this.onMouseUp,className:"".concat(F,"-input"),tabIndex:it,autoComplete:T,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Ve?this.onKeyDown:i,onKeyUp:Ve?this.onKeyUp:i,autoFocus:Le,maxLength:Se,readOnly:H,disabled:A,max:se,min:xe,step:de,name:De,title:ve,id:ze,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(Qe),pattern:ot,inputMode:Ze,onInput:lt},Ce))))}}]),C}(n.a.Component);O.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 _=O,b=oe.a=_},fcSX:function(je,oe,k){"use strict";var Z=k("Ff2n"),X=k("1OyB"),P=k("vuIU"),V=k("Ji7U"),U=k("md7G"),M=k("foSv"),G=k("1W/9"),W=k("q1tI"),n=k("rePB"),D=k("JX7q"),m=k("TSYQ"),f=k.n(m),h=k("qx4F"),c=k("4IlW");function o(A){return Array.isArray(A)?A:[A]}var d={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},i=Object.keys(d).filter(function(A){if(typeof document=="undefined")return!1;var H=document.getElementsByTagName("html")[0];return A in(H?H.style:{})})[0],a=d[i];function r(A,H,j,T){A.addEventListener?A.addEventListener(H,j,T):A.attachEvent&&A.attachEvent("on".concat(H),j)}function s(A,H,j,T){A.removeEventListener?A.removeEventListener(H,j,T):A.attachEvent&&A.detachEvent("on".concat(H),j)}function S(A,H){var j=typeof A=="function"?A(H):A;return Array.isArray(j)?j.length===2?j:[j[0],j[1]]:[j]}var w=function(H){return!isNaN(parseFloat(H))&&isFinite(H)},x=!(typeof window!="undefined"&&window.document&&window.document.createElement),L=function A(H,j,T,z){if(!j||j===document||j instanceof Document)return!1;if(j===H.parentNode)return!0;var Q=Math.max(Math.abs(T),Math.abs(z))===Math.abs(z),ne=Math.max(Math.abs(T),Math.abs(z))===Math.abs(T),se=j.scrollHeight-j.clientHeight,xe=j.scrollWidth-j.clientWidth,ge=document.defaultView.getComputedStyle(j),ve=ge.overflowY==="auto"||ge.overflowY==="scroll",Oe=ge.overflowX==="auto"||ge.overflowX==="scroll",Re=se&&ve,he=xe&&Oe;return Q&&(!Re||Re&&(j.scrollTop>=se&&z<0||j.scrollTop<=0&&z>0))||ne&&(!he||he&&(j.scrollLeft>=xe&&T<0||j.scrollLeft<=0&&T>0))?A(H,j.parentNode,T,z):!1};function O(A){var H=_();return function(){var T=Object(M.a)(A),z;if(H){var Q=Object(M.a)(this).constructor;z=Reflect.construct(T,arguments,Q)}else z=T.apply(this,arguments);return Object(U.a)(this,z)}}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(A){return!1}}var b={},g=function(A){Object(V.a)(j,A);var H=O(j);function j(T){var z;return Object(X.a)(this,j),z=H.call(this,T),z.domFocus=function(){z.dom&&z.dom.focus()},z.removeStartHandler=function(Q){if(Q.touches.length>1)return;z.startPos={x:Q.touches[0].clientX,y:Q.touches[0].clientY}},z.removeMoveHandler=function(Q){if(Q.changedTouches.length>1)return;var ne=Q.currentTarget,se=Q.changedTouches[0].clientX-z.startPos.x,xe=Q.changedTouches[0].clientY-z.startPos.y;(ne===z.maskDom||ne===z.handlerDom||ne===z.contentDom&&L(ne,Q.target,se,xe))&&Q.cancelable&&Q.preventDefault()},z.transitionEnd=function(Q){var ne=Q.target;s(ne,a,z.transitionEnd),ne.style.transition=""},z.onKeyDown=function(Q){if(Q.keyCode===c.a.ESC){var ne=z.props.onClose;Q.stopPropagation(),ne&&ne(Q)}},z.onWrapperTransitionEnd=function(Q){var ne=z.props,se=ne.open,xe=ne.afterVisibleChange;Q.target===z.contentWrapper&&Q.propertyName.match(/transform$/)&&(z.dom.style.transition="",!se&&z.getCurrentDrawerSome()&&(document.body.style.overflowX="",z.maskDom&&(z.maskDom.style.left="",z.maskDom.style.width="")),xe&&xe(!!se))},z.openLevelTransition=function(){var Q=z.props,ne=Q.open,se=Q.width,xe=Q.height,ge=z.getHorizontalBoolAndPlacementName(),ve=ge.isHorizontal,Oe=ge.placementName,Re=z.contentDom?z.contentDom.getBoundingClientRect()[ve?"width":"height"]:0,he=(ve?se:xe)||Re;z.setLevelAndScrolling(ne,Oe,he)},z.setLevelTransform=function(Q,ne,se,xe){var ge=z.props,ve=ge.placement,Oe=ge.levelMove,Re=ge.duration,he=ge.ease,ue=ge.showMask;z.levelDom.forEach(function(Me){Me.style.transition="transform ".concat(Re," ").concat(he),r(Me,a,z.transitionEnd);var et=Q?se:0;if(Oe){var it=S(Oe,{target:Me,open:Q});et=Q?it[0]:it[1]||0}var nt=typeof et=="number"?"".concat(et,"px"):et,at=ve==="left"||ve==="top"?nt:"-".concat(nt);at=ue&&ve==="right"&&xe?"calc(".concat(at," + ").concat(xe,"px)"):at,Me.style.transform=et?"".concat(ne,"(").concat(at,")"):""})},z.setLevelAndScrolling=function(Q,ne,se){var xe=z.props.onChange;if(!x){var ge=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(h.a)(!0):0;z.setLevelTransform(Q,ne,se,ge),z.toggleScrollingToDrawerAndBody(ge)}xe&&xe(Q)},z.toggleScrollingToDrawerAndBody=function(Q){var ne=z.props,se=ne.getOpenCount,xe=ne.getContainer,ge=ne.showMask,ve=ne.open,Oe=xe&&xe(),Re=se&&se();if(Oe&&Oe.parentNode===document.body&&ge){var he=["touchstart"],ue=[document.body,z.maskDom,z.handlerDom,z.contentDom];ve&&document.body.style.overflow!=="hidden"?(Q&&z.addScrollingEffect(Q),Re===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",ue.forEach(function(Me,et){if(!Me)return;r(Me,he[et]||"touchmove",et?z.removeMoveHandler:z.removeStartHandler,z.passive)})):z.getCurrentDrawerSome()&&(Re||(document.body.style.overflow=""),document.body.style.touchAction="",Q&&z.remScrollingEffect(Q),ue.forEach(function(Me,et){if(!Me)return;s(Me,he[et]||"touchmove",et?z.removeMoveHandler:z.removeStartHandler,z.passive)}))}},z.addScrollingEffect=function(Q){var ne=z.props,se=ne.placement,xe=ne.duration,ge=ne.ease,ve=ne.getOpenCount,Oe=ne.switchScrollingEffect,Re=ve&&ve();Re===1&&Oe();var he="width ".concat(xe," ").concat(ge),ue="transform ".concat(xe," ").concat(ge);z.dom.style.transition="none";switch(se){case"right":z.dom.style.transform="translateX(-".concat(Q,"px)");break;case"top":case"bottom":z.dom.style.width="calc(100% - ".concat(Q,"px)"),z.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(z.timeout),z.timeout=setTimeout(function(){z.dom&&(z.dom.style.transition="".concat(ue,",").concat(he),z.dom.style.width="",z.dom.style.transform="")})},z.remScrollingEffect=function(Q){var ne=z.props,se=ne.placement,xe=ne.duration,ge=ne.ease,ve=ne.getOpenCount,Oe=ne.switchScrollingEffect,Re=ve&&ve();Re||Oe(!0),i&&(document.body.style.overflowX="hidden"),z.dom.style.transition="none";var he,ue="width ".concat(xe," ").concat(ge),Me="transform ".concat(xe," ").concat(ge);switch(se){case"left":{z.dom.style.width="100%",ue="width 0s ".concat(ge," ").concat(xe);break}case"right":{z.dom.style.transform="translateX(".concat(Q,"px)"),z.dom.style.width="100%",ue="width 0s ".concat(ge," ").concat(xe),z.maskDom&&(z.maskDom.style.left="-".concat(Q,"px"),z.maskDom.style.width="calc(100% + ".concat(Q,"px)"));break}case"top":case"bottom":{z.dom.style.width="calc(100% + ".concat(Q,"px)"),z.dom.style.height="100%",z.dom.style.transform="translateZ(0)",he="height 0s ".concat(ge," ").concat(xe);break}default:break}clearTimeout(z.timeout),z.timeout=setTimeout(function(){z.dom&&(z.dom.style.transition="".concat(Me,",").concat(he?"".concat(he,","):"").concat(ue),z.dom.style.transform="",z.dom.style.width="",z.dom.style.height="")})},z.getCurrentDrawerSome=function(){return!Object.keys(b).some(function(Q){return b[Q]})},z.getLevelDom=function(Q){var ne=Q.level,se=Q.getContainer;if(x)return;var xe=se&&se(),ge=xe?xe.parentNode:null;if(z.levelDom=[],ne==="all"){var ve=ge?Array.prototype.slice.call(ge.children):[];ve.forEach(function(Oe){Oe.nodeName!=="SCRIPT"&&Oe.nodeName!=="STYLE"&&Oe.nodeName!=="LINK"&&Oe!==xe&&z.levelDom.push(Oe)})}else ne&&o(ne).forEach(function(Oe){document.querySelectorAll(Oe).forEach(function(Re){z.levelDom.push(Re)})})},z.getHorizontalBoolAndPlacementName=function(){var Q=z.props.placement,ne=Q==="left"||Q==="right",se="translate".concat(ne?"X":"Y");return{isHorizontal:ne,placementName:se}},z.state={_self:Object(D.a)(z)},z}return Object(P.a)(j,[{key:"componentDidMount",value:function(){var z=this;if(!x){var Q=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return Q=!0,null}}))}catch(ve){}this.passive=Q?{passive:!1}:!1}var ne=this.props,se=ne.open,xe=ne.getContainer,ge=xe&&xe();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),se&&(ge&&ge.parentNode===document.body&&(b[this.drawerId]=se),this.openLevelTransition(),this.forceUpdate(function(){z.domFocus()}))}},{key:"componentDidUpdate",value:function(z){var Q=this.props,ne=Q.open,se=Q.getContainer,xe=se&&se();ne!==z.open&&(ne&&this.domFocus(),xe&&xe.parentNode===document.body&&(b[this.drawerId]=!!ne),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var z=this.props,Q=z.getOpenCount,ne=z.open,se=z.switchScrollingEffect,xe=typeof Q=="function"&&Q();delete b[this.drawerId],ne&&(this.setLevelTransform(!1),document.body.style.touchAction=""),xe||(document.body.style.overflow="",se(!0))}},{key:"render",value:function(){var z,Q=this,ne=this.props,se=ne.className,xe=ne.children,ge=ne.style,ve=ne.width,Oe=ne.height,Re=ne.defaultOpen,he=ne.open,ue=ne.prefixCls,Me=ne.placement,et=ne.level,it=ne.levelMove,nt=ne.ease,at=ne.duration,ze=ne.getContainer,Ze=ne.handler,ot=ne.onChange,de=ne.afterVisibleChange,Se=ne.showMask,Le=ne.maskClosable,De=ne.maskStyle,qe=ne.onClose,lt=ne.onHandleClick,mt=ne.keyboard,gt=ne.getOpenCount,Ct=ne.switchScrollingEffect,xt=Object(Z.a)(ne,["className","children","style","width","height","defaultOpen","open","prefixCls","placement","level","levelMove","ease","duration","getContainer","handler","onChange","afterVisibleChange","showMask","maskClosable","maskStyle","onClose","onHandleClick","keyboard","getOpenCount","switchScrollingEffect"]),Ae=this.dom?he:!1,Ce=f()(ue,(z={},Object(n.a)(z,"".concat(ue,"-").concat(Me),!0),Object(n.a)(z,"".concat(ue,"-open"),Ae),Object(n.a)(z,se||"",!!se),Object(n.a)(z,"no-mask",!Se),z)),Ve=this.getHorizontalBoolAndPlacementName(),Qe=Ve.placementName,Pe=Me==="left"||Me==="top"?"-100%":"100%",Fe=Ae?"":"".concat(Qe,"(").concat(Pe,")"),be=Ze&&W.cloneElement(Ze,{onClick:function(pe){Ze.props.onClick&&Ze.props.onClick(),lt&<(pe)},ref:function(pe){Q.handlerDom=pe}});return W.createElement("div",Object.assign({},xt,{tabIndex:-1,className:Ce,style:ge,ref:function(pe){Q.dom=pe},onKeyDown:Ae&&mt?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),Se&&W.createElement("div",{className:"".concat(ue,"-mask"),onClick:Le?qe:void 0,style:De,ref:function(pe){Q.maskDom=pe}}),W.createElement("div",{className:"".concat(ue,"-content-wrapper"),style:{transform:Fe,msTransform:Fe,width:w(ve)?"".concat(ve,"px"):ve,height:w(Oe)?"".concat(Oe,"px"):Oe},ref:function(pe){Q.contentWrapper=pe}},W.createElement("div",{className:"".concat(ue,"-content"),ref:function(pe){Q.contentDom=pe},onTouchStart:Ae&&Se?this.removeStartHandler:void 0,onTouchMove:Ae&&Se?this.removeMoveHandler:void 0},xe),be))}}],[{key:"getDerivedStateFromProps",value:function(z,Q){var ne=Q.prevProps,se=Q._self,xe={prevProps:z};if(ne!==void 0){var ge=z.placement,ve=z.level;ge!==ne.placement&&(se.contentDom=null),ve!==ne.level&&se.getLevelDom(z)}return xe}}]),j}(W.Component);g.defaultProps={switchScrollingEffect:function(){}};var p=g;function C(A){var H=E();return function(){var T=Object(M.a)(A),z;if(H){var Q=Object(M.a)(this).constructor;z=Reflect.construct(T,arguments,Q)}else z=T.apply(this,arguments);return Object(U.a)(this,z)}}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(A){return!1}}var v=function(A){Object(V.a)(j,A);var H=C(j);function j(T){var z;Object(X.a)(this,j),z=H.call(this,T),z.onHandleClick=function(ne){var se=z.props,xe=se.onHandleClick,ge=se.open;if(xe&&xe(ne),typeof ge=="undefined"){var ve=z.state.open;z.setState({open:!ve})}},z.onClose=function(ne){var se=z.props,xe=se.onClose,ge=se.open;xe&&xe(ne),typeof ge=="undefined"&&z.setState({open:!1})};var Q=typeof T.open!="undefined"?T.open:!!T.defaultOpen;return z.state={open:Q},"onMaskClick"in T&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),z}return Object(P.a)(j,[{key:"render",value:function(){var z=this,Q=this.props,ne=Q.defaultOpen,se=Q.getContainer,xe=Q.wrapperClassName,ge=Q.forceRender,ve=Q.handler,Oe=Object(Z.a)(Q,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),Re=this.state.open;if(!se)return W.createElement("div",{className:xe,ref:function(Me){z.dom=Me}},W.createElement(p,Object.assign({},Oe,{open:Re,handler:ve,getContainer:function(){return z.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var he=!!ve||ge;return W.createElement(G.a,{visible:Re,forceRender:he,getContainer:se,wrapperClassName:xe},function(ue){var Me=ue.visible,et=ue.afterClose,it=Object(Z.a)(ue,["visible","afterClose"]);return W.createElement(p,Object.assign({},Oe,it,{open:Me!==void 0?Me:Re,afterVisibleChange:et!==void 0?et:Oe.afterVisibleChange,handler:ve,onClose:z.onClose,onHandleClick:z.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(z,Q){var ne=Q.prevProps,se={prevProps:z};return typeof ne!="undefined"&&z.open!==ne.open&&(se.open=z.open),se}}]),j}(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 N=v,F=oe.a=N},fcyK:function(je,oe,k){},fjLI:function(je,oe,k){"use strict";k.d(oe,"f",function(){return h}),k.d(oe,"b",function(){return c}),k.d(oe,"a",function(){return o}),k.d(oe,"d",function(){return d}),k.d(oe,"e",function(){return i}),k.d(oe,"c",function(){return a});var Z=k("8HAY"),X=k("Vhoy"),P=k("MI8n"),V=k("JYp7"),U=k("pmY6"),M=k("24hK"),G=k("nnTU"),W=k("T8No"),n=k("Cg/j"),D=k("t9D7"),m=function(r,s,S,w){var x=arguments.length,L=x<3?s:w===null?w=Object.getOwnPropertyDescriptor(s,S):w,O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(r,s,S,w);else for(var _=r.length-1;_>=0;_--)(O=r[_])&&(L=(x<3?O(L):x>3?O(s,S,L):O(s,S))||L);return x>3&&L&&Object.defineProperty(s,S,L),L},f=function(r,s){return function(S,w){s(S,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 o=Object(n.c)("menuService"),d=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new P.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 s of r)this._commands.set(s.id,s);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(U.i)(()=>{let s=!1;for(const S of r)s=this._commands.delete(S.id)||s;s&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(r){return this._commands.get(r)}getCommands(){const r=new Map;return this._commands.forEach((s,S)=>r.set(S,s)),r}appendMenuItem(r,s){return this.appendMenuItems(V.a.single({id:r,item:s}))}appendMenuItems(r){const s=new Set,S=new M.a;for(const{id:w,item:x}of r){let L=this._menuItems.get(w);L||(L=new M.a,this._menuItems.set(w,L)),S.push(L.push(x)),s.add(w)}return this._onDidChangeMenu.fire(s),Object(U.i)(()=>{if(S.size>0){for(let w of S)w();this._onDidChangeMenu.fire(s),S.clear()}})}getMenuItems(r){let s;return this._menuItems.has(r)?s=[...this._menuItems.get(r)]:s=[],r===c.CommandPalette&&this._appendImplicitItems(s),s}_appendImplicitItems(r){const s=new Set;for(const S of r)h(S)&&(s.add(S.command.id),S.alt&&s.add(S.alt.id));this._commands.forEach((S,w)=>{s.has(w)||r.push({command:S})})}};class i extends Z.e{constructor(r,s,S,w){super(`submenuitem.${r.submenu.id}`,typeof r.title=="string"?r.title:r.title.value,[],"submenu");this.item=r,this._menuService=s,this._contextKeyService=S,this._options=w}get actions(){const r=[],s=this._menuService.createMenu(this.item.submenu,this._contextKeyService),S=s.getActions(this._options);s.dispose();for(const[,w]of S)w.length>0&&(r.push(...w),r.push(new Z.d));return r.length&&r.pop(),r}}let a=class r{constructor(s,S,w,x,L){var O,_;if(this._commandService=L,this.id=s.id,this.label=(w==null?void 0:w.renderShortTitle)&&s.shortTitle?typeof s.shortTitle=="string"?s.shortTitle:s.shortTitle.value:typeof s.title=="string"?s.title:s.title.value,this.tooltip=(_=typeof s.tooltip=="string"?s.tooltip:(O=s.tooltip)===null||O===void 0?void 0:O.value)!==null&&_!==void 0?_:"",this.enabled=!s.precondition||x.contextMatchesRules(s.precondition),this.checked=void 0,s.toggled){const b=s.toggled.condition?s.toggled:{condition:s.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=s,this.alt=S?new r(S,void 0,w,x,L):void 0,this._options=w,D.d.isThemeIcon(s.icon)&&(this.class=X.a.asClassName(s.icon))}dispose(){}run(...s){var S,w;let x=[];return((S=this._options)===null||S===void 0?void 0:S.arg)&&(x=[...x,this._options.arg]),((w=this._options)===null||w===void 0?void 0:w.shouldForwardArgs)&&(x=[...x,...s]),this._commandService.executeCommand(this.id,...x)}};a=m([f(3,W.b),f(4,G.b)],a)},fyJ8:function(je,oe,k){"use strict";var Z=k("rePB"),X=k("VTBJ"),P=k("Ff2n"),V=k("U8pU"),U=k("q1tI"),M=k.n(U),G=k("TSYQ"),W=k.n(G),n=k("c+Xe"),D=k("sR1s");function m(d){return d&&Object(V.a)(d)==="object"&&!Array.isArray(d)&&!U.isValidElement(d)}function f(d){return typeof d=="string"?!0:Object(n.c)(d)}function h(d,i){var a,r=d.prefixCls,s=d.className,S=d.record,w=d.index,x=d.dataIndex,L=d.render,O=d.children,_=d.component,b=_===void 0?"td":_,g=d.colSpan,p=d.rowSpan,C=d.fixLeft,E=d.fixRight,v=d.firstFixLeft,N=d.lastFixLeft,F=d.firstFixRight,A=d.lastFixRight,H=d.appendNode,j=d.additionalProps,T=j===void 0?{}:j,z=d.ellipsis,Q=d.align,ne=d.rowType,se=d.isSticky,xe="".concat(r,"-cell"),ge,ve;if(O)ve=O;else{var Oe=Object(D.b)(S,x);if(ve=Oe,L){var Re=L(Oe,S,w);m(Re)?(ve=Re.children,ge=Re.props):ve=Re}}Object(V.a)(ve)==="object"&&!Array.isArray(ve)&&!U.isValidElement(ve)&&(ve=null),z&&(N||F)&&(ve=U.createElement("span",{className:"".concat(xe,"-content")},ve));var he=ge||{},ue=he.colSpan,Me=he.rowSpan,et=he.style,it=he.className,nt=Object(P.a)(he,["colSpan","rowSpan","style","className"]),at=ue!==void 0?ue:g,ze=Me!==void 0?Me:p;if(at===0||ze===0)return null;var Ze={},ot=typeof C=="number",de=typeof E=="number";ot&&(Ze.position="sticky",Ze.left=C),de&&(Ze.position="sticky",Ze.right=E);var Se={};Q&&(Se.textAlign=Q);var Le,De=z===!0?{showTitle:!0}:z;De&&(De.showTitle||ne==="header")&&(typeof ve=="string"||typeof ve=="number"?Le=ve.toString():U.isValidElement(ve)&&typeof ve.props.children=="string"&&(Le=ve.props.children));var qe=Object(X.a)(Object(X.a)(Object(X.a)({title:Le},nt),T),{},{colSpan:at&&at!==1?at:null,rowSpan:ze&&ze!==1?ze:null,className:W()(xe,s,(a={},Object(Z.a)(a,"".concat(xe,"-fix-left"),ot),Object(Z.a)(a,"".concat(xe,"-fix-left-first"),v),Object(Z.a)(a,"".concat(xe,"-fix-left-last"),N),Object(Z.a)(a,"".concat(xe,"-fix-right"),de),Object(Z.a)(a,"".concat(xe,"-fix-right-first"),F),Object(Z.a)(a,"".concat(xe,"-fix-right-last"),A),Object(Z.a)(a,"".concat(xe,"-ellipsis"),z),Object(Z.a)(a,"".concat(xe,"-with-append"),H),Object(Z.a)(a,"".concat(xe,"-fix-sticky"),(ot||de)&&se),a),T.className,it),style:Object(X.a)(Object(X.a)(Object(X.a)(Object(X.a)({},T.style),Se),Ze),et),ref:f(b)?i:null});return U.createElement(b,Object.assign({},qe),H,ve)}var c=U.forwardRef(h);c.displayName="Cell";var o=U.memo(c,function(d,i){return i.shouldCellUpdate?!i.shouldCellUpdate(i.record,d.record):!1});oe.a=o},gRFJ:function(je,oe,k){je.exports=[k("rdUC"),k("ynwM"),k("RELg"),k("DlR+"),k("CrYA"),k("PD8m")]},gaXo:function(module,exports){typeof JSON!="object"&&(JSON={}),function(){"use strict";var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;function f(je){return je<10?"0"+je:je}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(je){return rx_escapable.lastIndex=0,rx_escapable.test(je)?'"'+je.replace(rx_escapable,function(oe){var k=meta[oe];return typeof k=="string"?k:"\\u"+("0000"+oe.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+je+'"'}function str(je,oe){var k,Z,X,P,V=gap,U,M=oe[je];M&&typeof M=="object"&&typeof M.toJSON=="function"&&(M=M.toJSON(je)),typeof rep=="function"&&(M=rep.call(oe,je,M));switch(typeof M){case"string":return quote(M);case"number":return isFinite(M)?String(M):"null";case"boolean":case"null":return String(M);case"object":if(!M)return"null";if(gap+=indent,U=[],Object.prototype.toString.apply(M)==="[object Array]"){for(P=M.length,k=0;k<P;k+=1)U[k]=str(k,M)||"null";return X=U.length===0?"[]":gap?`[
|
|
`+gap+U.join(`,
|
|
`+gap)+`
|
|
`+V+"]":"["+U.join(",")+"]",gap=V,X}if(rep&&typeof rep=="object")for(P=rep.length,k=0;k<P;k+=1)typeof rep[k]=="string"&&(Z=rep[k],X=str(Z,M),X&&U.push(quote(Z)+(gap?": ":":")+X));else for(Z in M)Object.prototype.hasOwnProperty.call(M,Z)&&(X=str(Z,M),X&&U.push(quote(Z)+(gap?": ":":")+X));return X=U.length===0?"{}":gap?`{
|
|
`+gap+U.join(`,
|
|
`+gap)+`
|
|
`+V+"}":"{"+U.join(",")+"}",gap=V,X}}typeof JSON.stringify!="function"&&(meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(je,oe,k){var Z;if(gap="",indent="",typeof k=="number")for(Z=0;Z<k;Z+=1)indent+=" ";else typeof k=="string"&&(indent=k);if(rep=oe,oe&&typeof oe!="function"&&(typeof oe!="object"||typeof oe.length!="number"))throw new Error("JSON.stringify");return str("",{"":je})}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){var j;function walk(je,oe){var k,Z,X=je[oe];if(X&&typeof X=="object")for(k in X)Object.prototype.hasOwnProperty.call(X,k)&&(Z=walk(X,k),Z!==void 0?X[k]=Z:delete X[k]);return reviver.call(je,oe,X)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(je){return"\\u"+("0000"+je.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(je,oe,k){"use strict";k.d(oe,"a",function(){return V}),k.d(oe,"c",function(){return U}),k.d(oe,"b",function(){return M});var Z=k("VTBJ"),X=k("Ff2n"),P=k("Kwbf"),V="RC_TABLE_INTERNAL_COL_DEFINE";function U(G){var W=G.expandable,n=Object(X.a)(G,["expandable"]);return"expandable"in G?Object(Z.a)(Object(Z.a)({},n),W):n}function M(G){return Object.keys(G).reduce(function(W,n){return(n.substr(0,5)==="data-"||n.substr(0,5)==="aria-")&&(W[n]=G[n]),W},{})}},i3hx:function(je,oe,k){},ic2d:function(je,oe,k){"use strict";k.d(oe,"a",function(){return V});var Z=k("FWmy"),X=k("746U");class P{constructor(){this.data=new Map}add(U,M){Z.a(X.l(U)),Z.a(X.k(M)),Z.a(!this.data.has(U),"There is already an extension with this id"),this.data.set(U,M)}as(U){return this.data.get(U)||null}}const V=new P},je13:function(je,oe,k){var Z=k("5nXd"),X=k("gRFJ"),P=[k("uQRt")];je.exports=Z.createStore(X,P)},kSUc:function(je,oe,k){},"kaH+":function(je,oe,k){"use strict";var Z=k("+L6B"),X=k("2/Rp"),P=k("tJVT"),V=k("q1tI"),U=k.n(V),M=k("UZu5"),G=k.n(M),W=k("dhSg"),n=k("rLCj"),D=k("dF/Y"),m=k("4i/N");oe.a=function(){var f=Object(V.useState)(""),h=Object(P.a)(f,2),c=h[0],o=h[1],d=Object(V.useState)(0),i=Object(P.a)(d,2),a=i[0],r=i[1],s=Object(V.useRef)("");Object(V.useEffect)(function(){var b=W.a.subscribe("preview-image",function(g){o(g),document.body.style.overflow="hidden"});return b},[]),Object(V.useEffect)(function(){return document.addEventListener("keydown",S),function(){document.removeEventListener("keydown",S)}},[]),Object(V.useEffect)(function(){s.current=c},[c]);function S(b){b.keyCode==27&&s.current&&w()}function w(){document.body.style.overflow="auto",o("")}function x(){r(a+90)}var L=Object(V.useRef)(),O=Object(V.useRef)(),_=function(g){(g.nativeEvent.target===L.current||g.nativeEvent.target===O.current)&&w()};return U.a.createElement(V.Fragment,null,c?U.a.createElement("div",{className:"image-preview-container",ref:L,onClick:_},U.a.createElement("div",{className:"button-group"},U.a.createElement(X.a,{onClick:x},"\u65CB\u8F6C",U.a.createElement(n.a,null)),U.a.createElement(X.a,{href:c},"\u4E0B\u8F7D",U.a.createElement(D.a,null)),U.a.createElement(X.a,{onClick:w},"\u5173\u95ED",U.a.createElement(m.a,null))),U.a.createElement("div",{className:"preview-wrp-group",ref:O},U.a.createElement("img",{className:"image-preview",src:c,alt:"\u9884\u89C8\u5927\u56FE",style:{transform:"rotate(".concat(a,"deg)")}}))):null)}},lOMy:function(je,oe,k){},lZu9:function(je,oe,k){(function(Z){Z(k("VrN/"),k("1eCo"),k("8EBN"))})(function(Z){"use strict";Z.defineMode("markdown",function(X,P){var V=Z.getMode(X,"text/html"),U=V.name=="null";function M(j){if(Z.findModeByName){var T=Z.findModeByName(j);T&&(j=T.mime||T.mimes[0])}var z=Z.getMode(X,j);return z.name=="null"?null:z}P.highlightFormatting===void 0&&(P.highlightFormatting=!1),P.maxBlockquoteDepth===void 0&&(P.maxBlockquoteDepth=0),P.taskLists===void 0&&(P.taskLists=!1),P.strikethrough===void 0&&(P.strikethrough=!1),P.emoji===void 0&&(P.emoji=!1),P.fencedCodeBlockHighlighting===void 0&&(P.fencedCodeBlockHighlighting=!0),P.fencedCodeBlockDefaultMode===void 0&&(P.fencedCodeBlockDefaultMode="text/plain"),P.xml===void 0&&(P.xml=!0),P.tokenTypeOverrides===void 0&&(P.tokenTypeOverrides={});var G={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 G)G.hasOwnProperty(W)&&P.tokenTypeOverrides[W]&&(G[W]=P.tokenTypeOverrides[W]);var n=/^([*\-_])(?:\s*\1){2,}\s*$/,D=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,m=/^\[(x| )\](?=\s)/i,f=P.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,h=/^ {0,3}(?:\={1,}|-{2,})\s*$/,c=/^[^#!\[\]*_\\<>` "'(~:]+/,o=/^(~~~+|```+)[ \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(j,T,z){return T.f=T.inline=z,z(j,T)}function s(j,T,z){return T.f=T.block=z,z(j,T)}function S(j){return!j||!/\S/.test(j.string)}function w(j){if(j.linkTitle=!1,j.linkHref=!1,j.linkText=!1,j.em=!1,j.strong=!1,j.strikethrough=!1,j.quote=0,j.indentedCode=!1,j.f==L){var T=U;if(!T){var z=Z.innerMode(V,j.htmlState);T=z.mode.name=="xml"&&z.state.tagStart===null&&!z.state.context&&z.state.tokenize.isInText}T&&(j.f=g,j.block=x,j.htmlState=null)}return j.trailingSpace=0,j.trailingSpaceNewLine=!1,j.prevLine=j.thisLine,j.thisLine={stream:null},null}function x(j,T){var z=j.column()===T.indentation,Q=S(T.prevLine.stream),ne=T.indentedCode,se=T.prevLine.hr,xe=T.list!==!1,ge=(T.listStack[T.listStack.length-1]||0)+3;T.indentedCode=!1;var ve=T.indentation;if(T.indentationDiff===null&&(T.indentationDiff=T.indentation,xe)){for(T.list=null;ve<T.listStack[T.listStack.length-1];)T.listStack.pop(),T.listStack.length?T.indentation=T.listStack[T.listStack.length-1]:T.list=!1;T.list!==!1&&(T.indentationDiff=ve-T.listStack[T.listStack.length-1])}var Oe=!Q&&!se&&!T.prevLine.header&&(!xe||!ne)&&!T.prevLine.fencedCodeEnd,Re=(T.list===!1||se||Q)&&T.indentation<=ge&&j.match(n),he=null;if(T.indentationDiff>=4&&(ne||T.prevLine.fencedCodeEnd||T.prevLine.header||Q))return j.skipToEnd(),T.indentedCode=!0,G.code;if(j.eatSpace())return null;if(z&&T.indentation<=ge&&(he=j.match(f))&&he[1].length<=6)return T.quote=0,T.header=he[1].length,T.thisLine.header=!0,P.highlightFormatting&&(T.formatting="header"),T.f=T.inline,_(T);if(T.indentation<=ge&&j.eat(">"))return T.quote=z?1:T.quote+1,P.highlightFormatting&&(T.formatting="quote"),j.eatSpace(),_(T);if(!Re&&!T.setext&&z&&T.indentation<=ge&&(he=j.match(D))){var ue=he[1]?"ol":"ul";return T.indentation=ve+j.current().length,T.list=!0,T.quote=0,T.listStack.push(T.indentation),T.em=!1,T.strong=!1,T.code=!1,T.strikethrough=!1,P.taskLists&&j.match(m,!1)&&(T.taskList=!0),T.f=T.inline,P.highlightFormatting&&(T.formatting=["list","list-"+ue]),_(T)}else{if(z&&T.indentation<=ge&&(he=j.match(o,!0)))return T.quote=0,T.fencedEndRE=new RegExp(he[1]+"+ *$"),T.localMode=P.fencedCodeBlockHighlighting&&M(he[2]||P.fencedCodeBlockDefaultMode),T.localMode&&(T.localState=Z.startState(T.localMode)),T.f=T.block=O,P.highlightFormatting&&(T.formatting="code-block"),T.code=-1,_(T);if(T.setext||(!Oe||!xe)&&!T.quote&&T.list===!1&&!T.code&&!Re&&!d.test(j.string)&&(he=j.lookAhead(1))&&(he=he.match(h)))return T.setext?(T.header=T.setext,T.setext=0,j.skipToEnd(),P.highlightFormatting&&(T.formatting="header")):(T.header=he[0].charAt(0)=="="?1:2,T.setext=T.header),T.thisLine.header=!0,T.f=T.inline,_(T);if(Re)return j.skipToEnd(),T.hr=!0,T.thisLine.hr=!0,G.hr;if(j.peek()==="[")return r(j,T,N)}return r(j,T,T.inline)}function L(j,T){var z=V.token(j,T.htmlState);if(!U){var Q=Z.innerMode(V,T.htmlState);(Q.mode.name=="xml"&&Q.state.tagStart===null&&!Q.state.context&&Q.state.tokenize.isInText||T.md_inside&&j.current().indexOf(">")>-1)&&(T.f=g,T.block=x,T.htmlState=null)}return z}function O(j,T){var z=T.listStack[T.listStack.length-1]||0,Q=T.indentation<z,ne=z+3;if(T.fencedEndRE&&T.indentation<=ne&&(Q||j.match(T.fencedEndRE))){P.highlightFormatting&&(T.formatting="code-block");var se;return Q||(se=_(T)),T.localMode=T.localState=null,T.block=x,T.f=g,T.fencedEndRE=null,T.code=0,T.thisLine.fencedCodeEnd=!0,Q?s(j,T,T.block):se}else return T.localMode?T.localMode.token(j,T.localState):(j.skipToEnd(),G.code)}function _(j){var T=[];if(j.formatting){T.push(G.formatting),typeof j.formatting=="string"&&(j.formatting=[j.formatting]);for(var z=0;z<j.formatting.length;z++)T.push(G.formatting+"-"+j.formatting[z]),j.formatting[z]==="header"&&T.push(G.formatting+"-"+j.formatting[z]+"-"+j.header),j.formatting[z]==="quote"&&(!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=j.quote?T.push(G.formatting+"-"+j.formatting[z]+"-"+j.quote):T.push("error"))}if(j.taskOpen)return T.push("meta"),T.length?T.join(" "):null;if(j.taskClosed)return T.push("property"),T.length?T.join(" "):null;if(j.linkHref?T.push(G.linkHref,"url"):(j.strong&&T.push(G.strong),j.em&&T.push(G.em),j.strikethrough&&T.push(G.strikethrough),j.emoji&&T.push(G.emoji),j.linkText&&T.push(G.linkText),j.code&&T.push(G.code),j.image&&T.push(G.image),j.imageAltText&&T.push(G.imageAltText,"link"),j.imageMarker&&T.push(G.imageMarker)),j.header&&T.push(G.header,G.header+"-"+j.header),j.quote&&(T.push(G.quote),!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=j.quote?T.push(G.quote+"-"+j.quote):T.push(G.quote+"-"+P.maxBlockquoteDepth)),j.list!==!1){var Q=(j.listStack.length-1)%3;Q?Q===1?T.push(G.list2):T.push(G.list3):T.push(G.list1)}return j.trailingSpaceNewLine?T.push("trailing-space-new-line"):j.trailingSpace&&T.push("trailing-space-"+(j.trailingSpace%2?"a":"b")),T.length?T.join(" "):null}function b(j,T){return j.match(c,!0)?_(T):void 0}function g(j,T){var z=T.text(j,T);if(typeof z!="undefined")return z;if(T.list)return T.list=null,_(T);if(T.taskList){var Q=j.match(m,!0)[1]===" ";return Q?T.taskOpen=!0:T.taskClosed=!0,P.highlightFormatting&&(T.formatting="task"),T.taskList=!1,_(T)}if(T.taskOpen=!1,T.taskClosed=!1,T.header&&j.match(/^#+$/,!0))return P.highlightFormatting&&(T.formatting="header"),_(T);var ne=j.next();if(T.linkTitle){T.linkTitle=!1;var se=ne;ne==="("&&(se=")"),se=(se+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var xe="^\\s*(?:[^"+se+"\\\\]+|\\\\\\\\|\\\\.)"+se;if(j.match(new RegExp(xe),!0))return G.linkHref}if(ne==="`"){var ge=T.formatting;P.highlightFormatting&&(T.formatting="code"),j.eatWhile("`");var ve=j.current().length;if(T.code==0&&(!T.quote||ve==1))return T.code=ve,_(T);if(ve==T.code){var Oe=_(T);return T.code=0,Oe}else return T.formatting=ge,_(T)}else if(T.code)return _(T);if(ne==="\\"&&(j.next(),P.highlightFormatting)){var Re=_(T),he=G.formatting+"-escape";return Re?Re+" "+he:he}if(ne==="!"&&j.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return T.imageMarker=!0,T.image=!0,P.highlightFormatting&&(T.formatting="image"),_(T);if(ne==="["&&T.imageMarker&&j.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return T.imageMarker=!1,T.imageAltText=!0,P.highlightFormatting&&(T.formatting="image"),_(T);if(ne==="]"&&T.imageAltText){P.highlightFormatting&&(T.formatting="image");var Re=_(T);return T.imageAltText=!1,T.image=!1,T.inline=T.f=C,Re}if(ne==="["&&!T.image)return T.linkText&&j.match(/^.*?\]/)||(T.linkText=!0,P.highlightFormatting&&(T.formatting="link")),_(T);if(ne==="]"&&T.linkText){P.highlightFormatting&&(T.formatting="link");var Re=_(T);return T.linkText=!1,T.inline=T.f=j.match(/\(.*?\)| ?\[.*?\]/,!1)?C:g,Re}if(ne==="<"&&j.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){T.f=T.inline=p,P.highlightFormatting&&(T.formatting="link");var Re=_(T);return Re?Re+=" ":Re="",Re+G.linkInline}if(ne==="<"&&j.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){T.f=T.inline=p,P.highlightFormatting&&(T.formatting="link");var Re=_(T);return Re?Re+=" ":Re="",Re+G.linkEmail}if(P.xml&&ne==="<"&&j.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ue=j.string.indexOf(">",j.pos);if(ue!=-1){var Me=j.string.substring(j.start,ue);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Me)&&(T.md_inside=!0)}return j.backUp(1),T.htmlState=Z.startState(V),s(j,T,L)}if(P.xml&&ne==="<"&&j.match(/^\/\w*?>/))return T.md_inside=!1,"tag";if(ne==="*"||ne==="_"){for(var et=1,it=j.pos==1?" ":j.string.charAt(j.pos-2);et<3&&j.eat(ne);)et++;var nt=j.peek()||" ",at=!/\s/.test(nt)&&(!i.test(nt)||/\s/.test(it)||i.test(it)),ze=!/\s/.test(it)&&(!i.test(it)||/\s/.test(nt)||i.test(nt)),Ze=null,ot=null;if(et%2&&(!T.em&&at&&(ne==="*"||!ze||i.test(it))?Ze=!0:T.em==ne&&ze&&(ne==="*"||!at||i.test(nt))&&(Ze=!1)),et>1&&(!T.strong&&at&&(ne==="*"||!ze||i.test(it))?ot=!0:T.strong==ne&&ze&&(ne==="*"||!at||i.test(nt))&&(ot=!1)),ot!=null||Ze!=null){P.highlightFormatting&&(T.formatting=Ze==null?"strong":ot==null?"em":"strong em"),Ze===!0&&(T.em=ne),ot===!0&&(T.strong=ne);var Oe=_(T);return Ze===!1&&(T.em=!1),ot===!1&&(T.strong=!1),Oe}}else if(ne===" "&&(j.eat("*")||j.eat("_"))){if(j.peek()===" ")return _(T);j.backUp(1)}if(P.strikethrough){if(ne==="~"&&j.eatWhile(ne)){if(T.strikethrough){P.highlightFormatting&&(T.formatting="strikethrough");var Oe=_(T);return T.strikethrough=!1,Oe}else if(j.match(/^[^\s]/,!1))return T.strikethrough=!0,P.highlightFormatting&&(T.formatting="strikethrough"),_(T)}else if(ne===" "&&j.match(/^~~/,!0)){if(j.peek()===" ")return _(T);j.backUp(2)}}if(P.emoji&&ne===":"&&j.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){T.emoji=!0,P.highlightFormatting&&(T.formatting="emoji");var de=_(T);return T.emoji=!1,de}return ne===" "&&(j.match(/^ +$/,!1)?T.trailingSpace++:T.trailingSpace&&(T.trailingSpaceNewLine=!0)),_(T)}function p(j,T){var z=j.next();if(z===">"){T.f=T.inline=g,P.highlightFormatting&&(T.formatting="link");var Q=_(T);return Q?Q+=" ":Q="",Q+G.linkInline}return j.match(/^[^>]+/,!0),G.linkInline}function C(j,T){if(j.eatSpace())return null;var z=j.next();return z==="("||z==="["?(T.f=T.inline=v(z==="("?")":"]"),P.highlightFormatting&&(T.formatting="link-string"),T.linkHref=!0,_(T)):"error"}var E={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function v(j){return function(T,z){var Q=T.next();if(Q===j){z.f=z.inline=g,P.highlightFormatting&&(z.formatting="link-string");var ne=_(z);return z.linkHref=!1,ne}return T.match(E[j]),z.linkHref=!0,_(z)}}function N(j,T){return j.match(/^([^\]\\]|\\.)*\]:/,!1)?(T.f=F,j.next(),P.highlightFormatting&&(T.formatting="link"),T.linkText=!0,_(T)):r(j,T,g)}function F(j,T){if(j.match(/^\]:/,!0)){T.f=T.inline=A,P.highlightFormatting&&(T.formatting="link");var z=_(T);return T.linkText=!1,z}return j.match(/^([^\]\\]|\\.)+/,!0),G.linkText}function A(j,T){return j.eatSpace()?null:(j.match(/^[^\s]+/,!0),j.peek()===void 0?T.linkTitle=!0:j.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),T.f=T.inline=g,G.linkHref+" url")}var H={startState:function(){return{f:x,prevLine:{stream:null},thisLine:{stream:null},block:x,htmlState:null,indentation:0,inline:g,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(j){return{f:j.f,prevLine:j.prevLine,thisLine:j.thisLine,block:j.block,htmlState:j.htmlState&&Z.copyState(V,j.htmlState),indentation:j.indentation,localMode:j.localMode,localState:j.localMode?Z.copyState(j.localMode,j.localState):null,inline:j.inline,text:j.text,formatting:!1,linkText:j.linkText,linkTitle:j.linkTitle,linkHref:j.linkHref,code:j.code,em:j.em,strong:j.strong,strikethrough:j.strikethrough,emoji:j.emoji,header:j.header,setext:j.setext,hr:j.hr,taskList:j.taskList,list:j.list,listStack:j.listStack.slice(0),quote:j.quote,indentedCode:j.indentedCode,trailingSpace:j.trailingSpace,trailingSpaceNewLine:j.trailingSpaceNewLine,md_inside:j.md_inside,fencedEndRE:j.fencedEndRE}},token:function(j,T){if(T.formatting=!1,j!=T.thisLine.stream){if(T.header=0,T.hr=!1,j.match(/^\s*$/,!0))return w(T),null;if(T.prevLine=T.thisLine,T.thisLine={stream:j},T.taskList=!1,T.trailingSpace=0,T.trailingSpaceNewLine=!1,!T.localState&&(T.f=T.block,T.f!=L)){var z=j.match(/^\s*/,!0)[0].replace(/\t/g,a).length;if(T.indentation=z,T.indentationDiff=null,z>0)return null}}return T.f(j,T)},innerMode:function(j){return j.block==L?{state:j.htmlState,mode:V}:j.localState?{state:j.localState,mode:j.localMode}:{state:j,mode:H}},indent:function(j,T,z){return j.block==L&&V.indent?V.indent(j.htmlState,T,z):j.localState&&j.localMode.indent?j.localMode.indent(j.localState,T,z):Z.Pass},blankLine:w,getType:_,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return H},"xml"),Z.defineMIME("text/markdown","markdown"),Z.defineMIME("text/x-markdown","markdown")})},n6Qo:function(je,oe,k){"use strict";k.d(oe,"a",function(){return W});var Z=k("q1tI"),X=k("biw7"),P=k("fyJ8");function V(n){var D=n.className,m=n.index,f=n.children,h=n.colSpan,c=n.rowSpan,o=Z.useContext(X.a),d=o.prefixCls,i=o.fixedInfoList,a=i[m];return Z.createElement(P.a,Object.assign({className:D,index:m,component:"td",prefixCls:d,record:null,dataIndex:null,render:function(){return{children:f,props:{colSpan:h,rowSpan:c}}}},a))}function U(n){return Z.createElement("tr",Object.assign({},n))}function M(n){var D=n.children,m=Z.useContext(X.a),f=m.prefixCls;return Z.createElement("tfoot",{className:"".concat(f,"-summary")},D)}var G=oe.b=M,W={Cell:V,Row:U}},nEHx:function(je,oe,k){"use strict";k.d(oe,"a",function(){return Z});var Z;(function(X){X.DARK="dark",X.LIGHT="light",X.HIGH_CONTRAST="hc"})(Z||(Z={}))},nWbc:function(je,oe,k){},nnTU:function(je,oe,k){"use strict";k.d(oe,"b",function(){return G}),k.d(oe,"a",function(){return W});var Z=k("MI8n"),X=k("JYp7"),P=k("pmY6"),V=k("24hK"),U=k("746U"),M=k("Cg/j");const G=Object(M.c)("commandService"),W=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Z.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,D){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!D)throw new Error("invalid command");return this.registerCommand({id:n,handler:D})}if(n.description){const o=[];for(let i of n.description.args)o.push(i.constraint);const d=n.handler;n.handler=function(i,...a){return Object(U.o)(a,o),d(i,...a)}}const{id:m}=n;let f=this._commands.get(m);f||(f=new V.a,this._commands.set(m,f));let h=f.unshift(n),c=Object(P.i)(()=>{h();const o=this._commands.get(m);(o==null?void 0:o.isEmpty())&&this._commands.delete(m)});return this._onDidRegisterCommand.fire(m),c}registerCommandAlias(n,D){return W.registerCommand(n,(m,...f)=>m.get(G).executeCommand(D,...f))}getCommand(n){const D=this._commands.get(n);return!D||D.isEmpty()?void 0:X.a.first(D)}getCommands(){const n=new Map;for(const D of this._commands.keys()){const m=this.getCommand(D);m&&n.set(D,m)}return n}};W.registerCommand("noop",()=>{})},oFv4:function(je,oe,k){je.exports=k.p+"static/internal.da228387.png"},osHv:function(je,oe,k){(function(Z){Z(k("VrN/"))})(function(Z){"use strict";var X=Z.Pos;function P(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",U=V+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",M=new RegExp("<(/?)(["+V+"]["+U+"]*)","g");function G(i,a,r,s){this.line=a,this.ch=r,this.cm=i,this.text=i.getLine(a),this.min=s?Math.max(s.from,i.firstLine()):i.firstLine(),this.max=s?Math.min(s.to-1,i.lastLine()):i.lastLine()}function W(i,a){var r=i.cm.getTokenTypeAt(X(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 D(i){return i.line<=i.min?void 0:(i.text=i.cm.getLine(--i.line),i.ch=i.text.length,!0)}function m(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),s=r>-1&&!/\S/.test(i.text.slice(r+1,a));return i.ch=a+1,s?"selfClose":"regular"}}function f(i){for(;;){var a=i.ch?i.text.lastIndexOf("<",i.ch-1):-1;if(a==-1){if(D(i))continue;return}if(!W(i,a+1)){i.ch=a;continue}M.lastIndex=a,i.ch=a;var r=M.exec(i.text);if(r&&r.index==a)return r}}function h(i){for(;;){M.lastIndex=i.ch;var a=M.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(D(i))continue;return}if(!W(i,a+1)){i.ch=a;continue}var r=i.text.lastIndexOf("/",a),s=r>-1&&!/\S/.test(i.text.slice(r+1,a));return i.ch=a+1,s?"selfClose":"regular"}}function o(i,a){for(var r=[];;){var s=h(i),S,w=i.line,x=i.ch-(s?s[0].length:0);if(!s||!(S=m(i)))return;if(S=="selfClose")continue;if(s[1]){for(var L=r.length-1;L>=0;--L)if(r[L]==s[2]){r.length=L;break}if(L<0&&(!a||a==s[2]))return{tag:s[2],from:X(w,x),to:X(i.line,i.ch)}}else r.push(s[2])}}function d(i,a){for(var r=[];;){var s=c(i);if(!s)return;if(s=="selfClose"){f(i);continue}var S=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:X(i.line,i.ch),to:X(S,w)}}}}Z.registerHelper("fold","xml",function(i,a){for(var r=new G(i,a.line,0);;){var s=h(r);if(!s||r.line!=a.line)return;var S=m(r);if(!S)return;if(!s[1]&&S!="selfClose"){var w=X(r.line,r.ch),x=o(r,s[2]);return x&&P(x.from,w)>0?{from:w,to:x.from}:null}}}),Z.findMatchingTag=function(i,a,r){var s=new G(i,a.line,a.ch,r);if(s.text.indexOf(">")==-1&&s.text.indexOf("<")==-1)return;var S=m(s),w=S&&X(s.line,s.ch),x=S&&f(s);if(!S||!x||P(s,a)>0)return;var L={from:X(s.line,s.ch),to:w,tag:x[2]};return S=="selfClose"?{open:L,close:null,at:"open"}:x[1]?{open:d(s,x[2]),close:L,at:"close"}:(s=new G(i,w.line,w.ch,r),{open:L,close:o(s,x[2]),at:"open"})},Z.findEnclosingTag=function(i,a,r,s){for(var S=new G(i,a.line,a.ch,r);;){var w=d(S,s);if(!w)break;var x=new G(i,a.line,a.ch,r),L=o(x,w.tag);if(L)return{open:w,close:L}}},Z.scanForClosingTag=function(i,a,r,s){var S=new G(i,a.line,a.ch,s?{from:0,to:s}:null);return o(S,r)}})},"p/48":function(je,oe,k){},p5ED:function(je,oe,k){"use strict";var Z=k("+L6B"),X=k("2/Rp"),P=k("5Dmo"),V=k("3S7+"),U=k("k1fw"),M=k("9og8"),G=k("tJVT"),W=k("WmNS"),n=k.n(W),D=k("q1tI"),m=k.n(D),f=k("vHTk"),h=k.n(f),c=k("yEEn"),o=k("ZW9T"),d=k("1vsH"),i=k("V0Rq"),a=k("m3rI");oe.a=function(r){var s,S,w,x,L,O,_,b=r.editOffice,g=b===void 0?"view":b,p=r.data,C=r.theme,E=r.type,v=r.filename,N=r.monacoEditor,F=r.className,A=r.style,H=r.close,j=r.onClose,T=r.hasMask,z=r.disabledDownload,Q=Object(D.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),ne=Object(G.a)(Q,2),se=ne[0],xe=ne[1],ge=Object(D.useState)(""),ve=Object(G.a)(ge,2),Oe=ve[0],Re=ve[1],he=Object(D.useState)(),ue=Object(G.a)(he,2),Me=ue[0],et=ue[1],it=window.ENV==="build"?"/react/build":"",nt=a.a.PROXY_SERVER||location.origin,at,ze=1024*1024,Ze=10*ze,ot=Object(D.useRef)();(s=p)!==null&&s!==void 0&&s.startsWith("/api")&&E!=="txt"&&(p=a.a.API_SERVER+p),E==="office"&&(at=Object(d.T)(p).filesize,at>Ze&&(E="other")),v&&N&&(N.filename=v),Object(D.useEffect)(function(){var De,qe,lt=(De=document.cookie)===null||De===void 0||((qe=De.replace(/\s/g,""))===null||qe===void 0)?void 0:qe.split(";");lt==null||lt.map(function(mt){var gt=mt.split("=");gt[0]==="_educoder_session"&&Re(gt[1])})},[]),Object(D.useEffect)(function(){E==="office"&&de()},[E,p]);var de=function(){var De=Object(M.a)(n.a.mark(function qe(){var lt,mt,gt;return n.a.wrap(function(xt){for(;;)switch(xt.prev=xt.next){case 0:return console.log("data:",p),lt=p,p.startsWith("http")||(lt=location.origin+lt),mt=new URL(lt).pathname.split("/").pop(),xt.next=6,Object(i.V)({attachment_id:mt});case 6:gt=xt.sent,et(gt);case 8:case"end":return xt.stop()}},qe)}));return function(){return De.apply(this,arguments)}}(),Se=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 m.a.createElement("div",{style:Object(U.a)({},A||{}),className:"".concat(T&&h.a.bgBlack," ").concat(E?h.a.wrp:"hide")},H&&m.a.createElement("div",{className:h.a.close,ref:ot},!z&&m.a.createElement(V.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return ot.current}},m.a.createElement("span",{onClick:Le},m.a.createElement("i",{className:"icon-quxiaozhiding"}))),m.a.createElement(V.a,{title:"\u5173\u95ED",getPopupContainer:function(){return ot.current}},m.a.createElement("span",{className:"",onClick:j},m.a.createElement("i",{className:"icon-guanbi1"})))),m.a.createElement("div",{className:"".concat(h.a[F]," ").concat(F," ").concat(h.a.monaco," ").concat(E==="txt"?"show":"hide")},E==="txt"&&m.a.createElement(o.b,N)),E==="audio"&&m.a.createElement("audio",{src:"".concat(((S=p)===null||S===void 0?void 0:S.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"&&m.a.createElement(m.a.Fragment,null,((x=p)===null||x===void 0?void 0:x.indexOf("http"))>-1?m.a.createElement("video",{controls:!0,src:"".concat(p),autoPlay:!0}):m.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(p),autoPlay:!0})),E==="office"&&Me&&m.a.createElement("iframe",{src:"".concat(it,"/office.html?key=").concat(Me.key,"&url=").concat(nt+Me.url,"&callbackUrl=").concat(nt+Me.callbackUrl,"&fileType=").concat(Me.fileType,"&title=").concat(Me.title,"&model=").concat(g,"&officeServer=").concat(a.a.OFFICE_SERVER,"&disabledDownload=").concat(!!z)}),E==="html"&&m.a.createElement("iframe",{src:p+"&disposition=inline"}),E==="pdf"&&m.a.createElement("iframe",{src:"".concat(it,"/js/pdfview/index.html?url=").concat(p,"&disabledDownload=").concat(!!z)}),E==="image"&&m.a.createElement("img",{src:"".concat(((L=p)===null||L===void 0?void 0:L.indexOf("http://"))>-1||((O=p)===null||O===void 0?void 0:O.indexOf("https://"))>-1||(_=p)!==null&&_!==void 0&&_.startsWith("/api")?"":"data:image/png;base64,").concat(p)}),E==="other"&&m.a.createElement("div",null,m.a.createElement(X.a,{type:"primary",size:"large",onClick:Se},m.a.createElement(c.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),E==="download"&&m.a.createElement(X.a,{type:"primary",size:"large",onClick:Se},m.a.createElement(c.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(je,oe,k){},pPuO:function(je,oe,k){je.exports={desc:"desc___2o_2w",info:"info___Uro3x","commit-info":"commit-info___o2-Ex"}},pmY6:function(je,oe,k){"use strict";k.d(oe,"h",function(){return D}),k.d(oe,"g",function(){return f}),k.d(oe,"f",function(){return h}),k.d(oe,"e",function(){return c}),k.d(oe,"i",function(){return o}),k.d(oe,"b",function(){return d}),k.d(oe,"a",function(){return i}),k.d(oe,"d",function(){return a}),k.d(oe,"c",function(){return r});var Z=k("C/vA"),X=k("JYp7");const P=!1;let V=null;function U(s){V=s}if(P){const s="__is_disposable_tracked__";U(new class{trackDisposable(S){const w=new Error("Potentially leaked disposable").stack;setTimeout(()=>{S[s]||console.log(w)},3e3)}setParent(S,w){if(S&&S!==i.None)try{S[s]=!0}catch(x){}}markAsDisposed(S){if(S&&S!==i.None)try{S[s]=!0}catch(w){}}markAsSingleton(S){}})}function M(s){return V==null||V.trackDisposable(s),s}function G(s){V==null||V.markAsDisposed(s)}function W(s,S){V==null||V.setParent(s,S)}function n(s,S){if(!V)return;for(const w of s)V.setParent(w,S)}function D(s){return V==null||V.markAsSingleton(s),s}class m extends Error{constructor(s){super(`Encountered errors while disposing of store. Errors: [${s.join(", ")}]`);this.errors=s}}function f(s){return typeof s.dispose=="function"&&s.dispose.length===0}function h(s){if(X.a.is(s)){let S=[];for(const w of s)if(w)try{w.dispose()}catch(x){S.push(x)}if(S.length===1)throw S[0];if(S.length>1)throw new m(S);return Array.isArray(s)?[]:s}else if(s)return s.dispose(),s}function c(...s){const S=o(()=>h(s));return n(s,S),S}function o(s){const S=M({dispose:Object(Z.a)(()=>{G(S),s()})});return S}class d{constructor(){this._toDispose=new Set,this._isDisposed=!1,M(this)}dispose(){if(this._isDisposed)return;G(this),this._isDisposed=!0,this.clear()}clear(){try{h(this._toDispose.values())}finally{this._toDispose.clear()}}add(s){if(!s)return s;if(s===this)throw new Error("Cannot register a disposable on itself!");return W(s,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(s),s}}d.DISABLE_DISPOSED_WARNING=!1;class i{constructor(){this._store=new d,M(this),W(this._store,this)}dispose(){G(this),this._store.dispose()}_register(s){if(s===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(s)}}i.None=Object.freeze({dispose(){}});class a{constructor(){this._isDisposed=!1,M(this)}get value(){return this._isDisposed?void 0:this._value}set value(s){var S;if(this._isDisposed||s===this._value)return;(S=this._value)===null||S===void 0||S.dispose(),s&&W(s,this),this._value=s}clear(){this.value=void 0}dispose(){var s;this._isDisposed=!0,G(this),(s=this._value)===null||s===void 0||s.dispose(),this._value=void 0}clearAndLeak(){const s=this._value;return this._value=void 0,s&&W(s,null),s}}class r{constructor(s){this.object=s}dispose(){}}},psGv:function(je,oe,k){var Z,X;(function(){var P;(function(){"use strict";var G=[,,function(m){function f(o){this.__parent=o,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 o=new f(this.__parent);return o.set_indent(this.__indent_count,this.__alignment_count),o},f.prototype.item=function(o){return o<0?this.__items[this.__items.length+o]:this.__items[o]},f.prototype.has_match=function(o){for(var d=this.__items.length-1;d>=0;d--)if(this.__items[d].match(o))return!0;return!1},f.prototype.set_indent=function(o,d){this.is_empty()&&(this.__indent_count=o||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 o=this.__parent.current_line;return o.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),o.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),o.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,o.__items[0]===" "&&(o.__items.splice(0,1),o.__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(o){this.__items.push(o);var d=o.lastIndexOf(`
|
|
`);d!==-1?this.__character_count=o.length-d:this.__character_count+=o.length},f.prototype.pop=function(){var o=null;return this.is_empty()||(o=this.__items.pop(),this.__character_count-=o.length),o},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 o="";return this.is_empty()?this.__parent.indent_empty_lines&&(o=this.__parent.get_indent_string(this.__indent_count)):(o=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),o+=this.__items.join("")),o};function h(o,d){this.__cache=[""],this.__indent_size=o.indent_size,this.__indent_string=o.indent_char,o.indent_with_tabs||(this.__indent_string=new Array(o.indent_size+1).join(o.indent_char)),d=d||"",o.indent_level>0&&(d=new Array(o.indent_level+1).join(this.__indent_string)),this.__base_string=d,this.__base_string_length=d.length}h.prototype.get_indent_size=function(o,d){var i=this.__base_string_length;return d=d||0,o<0&&(i=0),i+=o*this.__indent_size,i+=d,i},h.prototype.get_indent_string=function(o,d){var i=this.__base_string;return d=d||0,o<0&&(o=0,i=""),d+=o*this.__indent_size,this.__ensure_cache(d),i+=this.__cache[d],i},h.prototype.__ensure_cache=function(o){for(;o>=this.__cache.length;)this.__add_column()},h.prototype.__add_column=function(){var o=this.__cache.length,d=0,i="";this.__indent_size&&o>=this.__indent_size&&(d=Math.floor(o/this.__indent_size),o-=d*this.__indent_size,i=new Array(d+1).join(this.__indent_string)),o&&(i+=new Array(o+1).join(" ")),this.__cache.push(i)};function c(o,d){this.__indent_cache=new h(o,d),this.raw=!1,this._end_with_newline=o.end_with_newline,this.indent_size=o.indent_size,this.wrap_line_length=o.wrap_line_length,this.indent_empty_lines=o.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(o,d){return this.__indent_cache.get_indent_string(o,d)},c.prototype.get_indent_size=function(o,d){return this.__indent_cache.get_indent_size(o,d)},c.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},c.prototype.add_new_line=function(o){return this.is_empty()||!o&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},c.prototype.get_code=function(o){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 o!==`
|
|
`&&(i=i.replace(/[\n]/g,o)),i},c.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},c.prototype.set_indent=function(o,d){return o=o||0,d=d||0,this.next_line.set_indent(o,d),this.__lines.length>1?(this.current_line.set_indent(o,d),!0):(this.current_line.set_indent(),!1)},c.prototype.add_raw_token=function(o){for(var d=0;d<o.newlines;d++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(o.whitespace_before),this.current_line.push(o.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},c.prototype.add_token=function(o){this.__add_space_before_token(),this.current_line.push(o),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(o){for(var d=this.__lines.length;o<d;)this.__lines[o]._remove_indent(),o++;this.current_line._remove_wrap_indent()},c.prototype.trim=function(o){for(o=o===void 0?!1:o,this.current_line.trim();o&&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(o,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(o)!==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--}},m.exports.Output=c},function(m){function f(h,c,o,d){this.type=h,this.text=c,this.comments_before=null,this.newlines=o||0,this.whitespace_before=d||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}m.exports.Token=f},,,function(m){function f(o,d){this.raw_options=h(o,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(o,d){var i=this.raw_options[o],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(o,d){var i=this.raw_options[o],a=i===void 0?!!d:!!i;return a},f.prototype._get_characters=function(o,d){var i=this.raw_options[o],a=d||"";return typeof i=="string"&&(a=i.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),a},f.prototype._get_number=function(o,d){var i=this.raw_options[o];d=parseInt(d,10),isNaN(d)&&(d=0);var a=parseInt(i,10);return isNaN(a)&&(a=d),a},f.prototype._get_selection=function(o,d,i){var a=this._get_selection_list(o,d,i);if(a.length!==1)throw new Error("Invalid Option Value: The option '"+o+`' can only be one of the following values:
|
|
`+d+`
|
|
You passed in: '`+this.raw_options[o]+"'");return a[0]},f.prototype._get_selection_list=function(o,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(o,i);if(!this._is_valid_selection(a,d))throw new Error("Invalid Option Value: The option '"+o+`' can contain only the following values:
|
|
`+d+`
|
|
You passed in: '`+this.raw_options[o]+"'");return a},f.prototype._is_valid_selection=function(o,d){return o.length&&d.length&&!o.some(function(i){return d.indexOf(i)===-1})};function h(o,d){var i={};o=c(o);var a;for(a in o)a!==d&&(i[a]=o[a]);if(d&&o[d])for(a in o[d])i[a]=o[d][a];return i}function c(o){var d={},i;for(i in o){var a=i.replace(/-/g,"_");d[a]=o[i]}return d}m.exports.Options=f,m.exports.normalizeOpts=c,m.exports.mergeOpts=h},,function(m){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 o=null;return c=c||0,c+=this.__position,c>=0&&c<this.__input_length&&(o=this.__input.charAt(c)),o},h.prototype.__match=function(c,o){c.lastIndex=o;var d=c.exec(this.__input);return d&&!(f&&c.sticky)&&(d.index!==o&&(d=null)),d},h.prototype.test=function(c,o){return o=o||0,o+=this.__position,o>=0&&o<this.__input_length?!!this.__match(c,o):!1},h.prototype.testChar=function(c,o){var d=this.peek(o);return c.lastIndex=0,d!==null&&c.test(d)},h.prototype.match=function(c){var o=this.__match(c,this.__position);return o?this.__position+=o[0].length:o=null,o},h.prototype.read=function(c,o,d){var i="",a;return c&&(a=this.match(c),a&&(i+=a[0])),o&&(a||!c)&&(i+=this.readUntil(o,d)),i},h.prototype.readUntil=function(c,o){var d="",i=this.__position;c.lastIndex=this.__position;var a=c.exec(this.__input);return a?(i=a.index,o&&(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,o){var d=null,i="g";return o&&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 o=this.__position,d=this.readUntilAfter(c);return this.__position=o,d},h.prototype.lookBack=function(c){var o=this.__position-1;return o>=c.length&&this.__input.substring(o-c.length,o).toLowerCase()===c},m.exports.InputScanner=h},function(m,f,h){var c=h(8).InputScanner,o=h(3).Token,d=h(10).TokenStream,i=h(11).WhitespacePattern,a={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},r=function(s,S){this._input=new c(s),this._options=S||{},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 s,S=new o(a.START,""),w=null,x=[],L=new d;S.type!==a.EOF;){for(s=this._get_next_token(S,w);this._is_comment(s);)L.add(s),s=this._get_next_token(S,w);L.isEmpty()||(s.comments_before=L,L=new d),s.parent=w,this._is_opening(s)?(x.push(w),w=s):w&&this._is_closing(s,w)&&(s.opened=w,w.closed=s,w=x.pop(),s.parent=w),s.previous=S,S.next=s,this.__tokens.add(s),S=s}return this.__tokens},r.prototype._is_first_token=function(){return this.__tokens.isEmpty()},r.prototype._reset=function(){},r.prototype._get_next_token=function(s,S){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(s){return!1},r.prototype._is_opening=function(s){return!1},r.prototype._is_closing=function(s,S){return!1},r.prototype._create_token=function(s,S){var w=new o(s,S,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return w},r.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},m.exports.Tokenizer=r,m.exports.TOKEN=a},function(m){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},m.exports.TokenStream=f},function(m,f,h){var c=h(12).Pattern;function o(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=""}o.prototype=new c,o.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+"]")},o.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},o.prototype.matching=function(d,i){var a=this._create();return a.__set_whitespace_patterns(d,i),a._update(),a},o.prototype._create=function(){return new o(this._input,this)},o.prototype.__split=function(d,i){d.lastIndex=0;for(var a=0,r=[],s=d.exec(i);s;)r.push(i.substring(a,s.index)),a=s.index+s[0].length,s=d.exec(i);return a<i.length?r.push(i.substring(a,i.length)):r.push(""),r},m.exports.WhitespacePattern=o},function(m){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(){},m.exports.Pattern=f},function(m){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 o=this.__directive_pattern.exec(h);o;)c[o[1]]=o[2],o=this.__directive_pattern.exec(h);return c},f.prototype.readIgnored=function(h){return h.readUntilAfter(this.__directives_end_ignore_pattern)},m.exports.Directives=f},function(m,f,h){var c=h(12).Pattern,o={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({},o),this._excluded=Object.assign({},o),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 o)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},m.exports.TemplatablePattern=d},,,,function(m,f,h){var c=h(19).Beautifier,o=h(20).Options;function d(i,a,r,s){var S=new c(i,a,r,s);return S.beautify()}m.exports=d,m.exports.defaultOptions=function(){return new o}},function(m,f,h){var c=h(20).Options,o=h(2).Output,d=h(21).Tokenizer,i=h(21).TOKEN,a=/\r\n|[\r\n]/,r=/\r\n|[\r\n]/g,s=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 o(C,E)};s.prototype.current_line_has_match=function(C){return this._output.current_line.has_match(C)},s.prototype.set_space_before_token=function(C,E){this._output.space_before_token=C,this._output.non_breaking_space=E},s.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},s.prototype.add_raw_token=function(C){this._output.add_raw_token(C)},s.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},s.prototype.traverse_whitespace=function(C){return C.whitespace_before||C.newlines?(this.print_preserved_newlines(C)||(this._output.space_before_token=!0),!0):!1},s.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},s.prototype.print_newline=function(C){this._output.add_new_line(C)},s.prototype.print_token=function(C){C.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(C.text))},s.prototype.indent=function(){this.indent_level++},s.prototype.get_full_indent=function(C){return C=this.indent_level+(C||0),C<1?"":this._output.get_indent_string(C)};var S=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,N=null;return E.closed?(C==="script"?v="text/javascript":C==="style"&&(v="text/css"),v=S(E)||v,v.search("text/css")>-1?N="css":v.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?N="javascript":v.search(/(text|application|dojo)\/(x-)?(html)/)>-1?N="html":v.search(/test\/null/)>-1&&(N="null"),N):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 O(C){this._printer=C,this._current_frame=null}O.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},O.prototype.record_tag=function(C){var E=new L(this._current_frame,C,this._printer.indent_level);this._current_frame=E},O.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},O.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},O.prototype.try_pop=function(C,E){var v=this._get_frame([C],E);return this._try_pop_frame(v)},O.prototype.indent_to_tag=function(C){var E=this._get_frame(C);E&&(this._printer.indent_level=E.indent_level)};function _(C,E,v,N){this._source_text=C||"",E=E||{},this._js_beautify=v,this._css_beautify=N,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],N={text:"",type:""},F=new b,A=new s(this._options,v),H=new d(C,this._options).tokenize();this._tag_stack=new O(A);for(var j=null,T=H.next();T.type!==i.EOF;)T.type===i.TAG_OPEN||T.type===i.COMMENT?(j=this._handle_tag_open(A,T,F,N),F=j):T.type===i.ATTRIBUTE||T.type===i.EQUALS||T.type===i.VALUE||T.type===i.TEXT&&!F.tag_complete?j=this._handle_inside_tag(A,T,F,H):T.type===i.TAG_CLOSE?j=this._handle_tag_close(A,T,F):T.type===i.TEXT?j=this._handle_text(A,T,F):A.add_raw_token(T),N=j,T=H.next();var z=A._output.get_code(E);return z},_.prototype._handle_tag_close=function(C,E,v){var N={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(),N},_.prototype._handle_inside_tag=function(C,E,v,N){var F=v.has_wrapped_attrs,A={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 j=!0,T=0,z;do{if(z=N.peek(T),z.type===i.ATTRIBUTE){j=!1;break}T+=1}while(T<4&&z.type!==i.EOF&&z.type!==i.TAG_CLOSE);H=!j}H&&(C.print_newline(!1),F=!0)}C.print_token(E),F=F||C.previous_token_wrapped(),v.has_wrapped_attrs=F}return A},_.prototype._handle_text=function(C,E,v){var N={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)),N},_.prototype._print_custom_beatifier_text=function(C,E,v){var N=this;if(E.text!==""){var F=E.text,A,H=1,j="",T="";v.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?A=this._js_beautify:v.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?A=this._css_beautify:v.custom_beautifier_name==="html"&&(A=function(ge,ve){var Oe=new _(ge,ve,N._js_beautify,N._css_beautify);return Oe.beautify()}),this._options.indent_scripts==="keep"?H=0:this._options.indent_scripts==="separate"&&(H=-C.indent_level);var z=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}j=z+Q[1]+`
|
|
`,F=Q[4],Q[5]&&(T=z+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(A){var ne=function(){this.eol=`
|
|
`};ne.prototype=this._options.raw_options;var se=new ne;F=A(z+F,se)}else{var xe=E.whitespace_before;xe&&(F=F.replace(new RegExp(`
|
|
(`+xe+")?","g"),`
|
|
`)),F=z+F.replace(/\n/g,`
|
|
`+z)}j&&(F?F=j+F+`
|
|
`+T:F=j+T),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,N){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,N),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 N=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(N=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(N)))}};_.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,N,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 A=C.current_line_has_match(/{{#if/);A||C.print_newline(!1)}v.tag_name==="!--"&&F.type===i.TAG_CLOSE&&N.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&&!(N.is_inline_element||N.is_unformatted)&&!(F.type===i.TAG_CLOSE&&v.start_tag_token===N)&&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 g=["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"&&g.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},m.exports.Beautifier=_},function(m,f,h){var c=h(6).Options;function o(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"])}o.prototype=new c,m.exports.Options=o},function(m,f,h){var c=h(9).Tokenizer,o=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:o.START,RAW:o.RAW,EOF:o.EOF},s=new d(/<\!--/,/-->/),S=function(w,x){c.call(this,w,x),this._current_tag_name="";var L=new i(this._input).read_options(this._options),O=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:O.starting_with(/{{!--/).until_after(/--}}/),handlebars:O.starting_with(/{{/).until_after(/}}/),handlebars_open:O.until(/[\n\r\t }]/),handlebars_raw_close:O.until(/}}/),comment:O.starting_with(/<!--/).until_after(/-->/),cdata:O.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:O.starting_with(/<!\[/).until_after(/]>/),processing:O.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=O.matching(_).until_after(_)}};S.prototype=new c,S.prototype._is_comment=function(w){return!1},S.prototype._is_opening=function(w){return w.type===r.TAG_OPEN},S.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]==="{")},S.prototype._reset=function(){this._current_tag_name=""},S.prototype._get_next_token=function(w,x){var L=null;this._readWhitespace();var O=this._input.peek();return O===null?this._create_token(r.EOF,""):(L=L||this._read_open_handlebars(O,x),L=L||this._read_attribute(O,w,x),L=L||this._read_close(O,x),L=L||this._read_raw_content(O,w,x),L=L||this._read_content_word(O),L=L||this._read_comment_or_cdata(O),L=L||this._read_processing(O),L=L||this._read_open(O,x),L=L||this._create_token(r.UNKNOWN,this._input.next()),L)},S.prototype._read_comment_or_cdata=function(w){var x=null,L=null,O=null;if(w==="<"){var _=this._input.peek(1);_==="!"&&(L=this.__patterns.comment.read(),L?(O=s.get_directives(L),O&&O.ignore==="start"&&(L+=s.readIgnored(this._input))):L=this.__patterns.cdata.read()),L&&(x=this._create_token(r.COMMENT,L),x.directives=O)}return x},S.prototype._read_processing=function(w){var x=null,L=null,O=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=O)}return x},S.prototype._read_open=function(w,x){var L=null,O=null;return x||w==="<"&&(L=this._input.next(),this._input.peek()==="/"&&(L+=this._input.next()),L+=this.__patterns.element_name.read(),O=this._create_token(r.TAG_OPEN,L)),O},S.prototype._read_open_handlebars=function(w,x){var L=null,O=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(),O=this._create_token(r.COMMENT,L)):(L=this.__patterns.handlebars_open.read(),O=this._create_token(r.TAG_OPEN,L))),O},S.prototype._read_close=function(w,x){var L=null,O=null;return x&&(x.text[0]==="<"&&(w===">"||w==="/"&&this._input.peek(1)===">")?(L=this._input.next(),w==="/"&&(L+=this._input.next()),O=this._create_token(r.TAG_CLOSE,L)):x.text[0]==="{"&&w==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),O=this._create_token(r.TAG_CLOSE,"}}"))),O},S.prototype._read_attribute=function(w,x,L){var O=null,_="";if(L&&L.text[0]==="<")if(w==="=")O=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(),O=this._create_token(r.VALUE,b)}else _=this.__patterns.attribute.read(),_&&(x.type===r.EQUALS?O=this._create_token(r.VALUE,_):O=this._create_token(r.ATTRIBUTE,_));return O},S.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)},S.prototype._read_raw_content=function(w,x,L){var O="";if(L&&L.text[0]==="{")O=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;O=this._input.readUntil(new RegExp("</"+_+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(_)&&(O=this._input.readUntil(new RegExp("</"+_+"[\\n\\r\\t ]*?>","ig")))}return O?this._create_token(r.TEXT,O):null},S.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)},m.exports.Tokenizer=S,m.exports.TOKEN=r}],W={};function n(m){var f=W[m];if(f!==void 0)return f.exports;var h=W[m]={exports:{}};return G[m](h,h.exports,n),h.exports}var D=n(18);P=D})();var V=P;if(!0)!(Z=[k,k("6UM0"),k("TXwP")],X=function(G){var W=k("6UM0"),n=k("TXwP");return{html_beautify:function(D,m){return V(D,m,W.js_beautify,n.css_beautify)}}}.apply(oe,Z),X!==void 0&&(je.exports=X));else var U,M})()},"qJ4+":function(je,oe,k){},"rAM+":function(je,oe,k){"use strict";k.d(oe,"a",function(){return X});var Z=k("Qw5x");function X(P,V){var U;if(typeof Symbol=="undefined"||P[Symbol.iterator]==null){if(Array.isArray(P)||(U=Object(Z.a)(P))||V&&P&&typeof P.length=="number"){U&&(P=U);var M=0,G=function(){};return{s:G,n:function(){return M>=P.length?{done:!0}:{done:!1,value:P[M++]}},e:function(f){throw f},f:G}}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,D;return{s:function(){U=P[Symbol.iterator]()},n:function(){var f=U.next();return W=f.done,f},e:function(f){n=!0,D=f},f:function(){try{!W&&U.return!=null&&U.return()}finally{if(n)throw D}}}}},rUJ1:function(je,oe){const k=/[&<>"']/,Z=/[&<>"']/g,X=/[<>"']|&(?!#?\w+;)/,P=/[<>"']|&(?!#?\w+;)/g,V={"&":"&","<":"<",">":">",'"':""","'":"'"},U=O=>V[O];function M(O,_){if(_){if(k.test(O))return O.replace(Z,U)}else if(X.test(O))return O.replace(P,U);return O}const G=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function W(O){return O.replace(G,(_,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 D(O,_){O=O.source||O,_=_||"";const b={replace:(g,p)=>(p=p.source||p,p=p.replace(n,"$1"),O=O.replace(g,p),b),getRegex:()=>new RegExp(O,_)};return b}const m=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function h(O,_,b){if(O){let g;try{g=decodeURIComponent(W(b)).replace(m,"").toLowerCase()}catch(p){return null}if(g.indexOf("javascript:")===0||g.indexOf("vbscript:")===0||g.indexOf("data:")===0)return null}_&&!f.test(b)&&(b=a(_,b));try{b=encodeURI(b).replace(/%25/g,"%")}catch(g){return null}return b}const c={},o=/^[^:]+:\/*[^/]*$/,d=/^([^:]+:)[\s\S]*$/,i=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(O,_){c[" "+O]||(o.test(O)?c[" "+O]=O+"/":c[" "+O]=w(O,"/",!0)),O=c[" "+O];const b=O.indexOf(":")===-1;return _.substring(0,2)==="//"?b?_:O.replace(d,"$1")+_:_.charAt(0)==="/"?b?_:O.replace(i,"$1")+_:O+_}const r={exec:function(){}};function s(O){let _=1,b,g;for(;_<arguments.length;_++){b=arguments[_];for(g in b)Object.prototype.hasOwnProperty.call(b,g)&&(O[g]=b[g])}return O}function S(O,_){const b=O.replace(/\|/g,(C,E,v)=>{let N=!1,F=E;for(;--F>=0&&v[F]==="\\";)N=!N;return N?"|":" |"}),g=b.split(/ \|/);let p=0;if(g.length>_)g.splice(_);else for(;g.length<_;)g.push("");for(;p<g.length;p++)g[p]=g[p].trim().replace(/\\\|/g,"|");return g}function w(O,_,b){const g=O.length;if(g===0)return"";let p=0;for(;p<g;){const C=O.charAt(g-p-1);if(C===_&&!b)p++;else if(C!==_&&b)p++;else break}return O.substr(0,g-p)}function x(O,_){if(O.indexOf(_[1])===-1)return-1;const b=O.length;let g=0,p=0;for(;p<b;p++)if(O[p]==="\\")p++;else if(O[p]===_[0])g++;else if(O[p]===_[1]&&(g--,g<0))return p;return-1}function L(O){O&&O.sanitize&&!O.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")}je.exports={escape:M,unescape:W,edit:D,cleanUrl:h,resolveUrl:a,noopTest:r,merge:s,splitCells:S,rtrim:w,findClosingBracket:x,checkSanitizeDeprecation:L}},rdUC:function(je,oe,k){var Z=k("MFOe"),X=Z.Global;je.exports={name:"localStorage",read:V,write:U,each:M,remove:G,clearAll:W};function P(){return X.localStorage}function V(n){return P().getItem(n)}function U(n,D){return P().setItem(n,D)}function M(n){for(var D=P().length-1;D>=0;D--){var m=P().key(D);n(V(m),m)}}function G(n){return P().removeItem(n)}function W(){return P().clear()}},sR1s:function(je,oe,k){"use strict";k.d(oe,"b",function(){return V}),k.d(oe,"a",function(){return U}),k.d(oe,"c",function(){return M}),k.d(oe,"d",function(){return G});var Z=k("U8pU"),X="RC_TABLE_KEY";function P(W){return W==null?[]:Array.isArray(W)?W:[W]}function V(W,n){if(!n&&typeof n!="number")return W;for(var D=P(n),m=W,f=0;f<D.length;f+=1){if(!m)return null;var h=D[f];m=m[h]}return m}function U(W){var n=[],D={};return W.forEach(function(m){for(var f=m||{},h=f.key,c=f.dataIndex,o=h||P(c).join("-")||X;D[o];)o="".concat(o,"_next");D[o]=!0,n.push(o)}),n}function M(){var W={};function n(h,c){c&&Object.keys(c).forEach(function(o){var d=c[o];d&&Object(Z.a)(d)==="object"?(h[o]=h[o]||{},n(h[o],d)):h[o]=d})}for(var D=arguments.length,m=new Array(D),f=0;f<D;f++)m[f]=arguments[f];return m.forEach(function(h){n(W,h)}),W}function G(W){return W!=null}},sboe:function(je,oe,k){"use strict";k.d(oe,"a",function(){return P});var Z=k("q1tI"),X=k.n(Z),P=Z.createContext(null)},"t/PP":function(je,oe,k){je.exports=k.p+"static/title.b0fa77f7.svg"},t23M:function(je,oe,k){"use strict";var Z=k("VTBJ"),X=k("1OyB"),P=k("vuIU"),V=k("Ji7U"),U=k("LK+K"),M=k("q1tI"),G=k.n(M),W=k("m+aA"),n=k("Zm9Q"),D=k("Kwbf"),m=k("c+Xe"),f=k("bdgK"),h="rc-observer-key",c=function(o){Object(V.a)(i,o);var d=Object(U.a)(i);function i(){var a;return Object(X.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 s=a.props.onResize,S=r[0].target,w=S.getBoundingClientRect(),x=w.width,L=w.height,O=S.offsetWidth,_=S.offsetHeight,b=Math.floor(x),g=Math.floor(L);if(a.state.width!==b||a.state.height!==g||a.state.offsetWidth!==O||a.state.offsetHeight!==_){var p={width:b,height:g,offsetWidth:O,offsetHeight:_};a.setState(p),s&&Promise.resolve().then(function(){s(Object(Z.a)(Object(Z.a)({},p),{},{offsetWidth:O,offsetHeight:_}))})}},a.setChildNode=function(r){a.childNode=r},a}return Object(P.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 s=Object(W.a)(this.childNode||this),S=s!==this.currentElement;S&&(this.destroyObserver(),this.currentElement=s),!this.resizeObserver&&s&&(this.resizeObserver=new f.default(this.onResize),this.resizeObserver.observe(s))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var r=this.props.children,s=Object(n.a)(r);if(s.length>1)Object(D.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(s.length===0)return Object(D.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var S=s[0];if(M.isValidElement(S)&&Object(m.c)(S)){var w=S.ref;s[0]=M.cloneElement(S,{ref:Object(m.a)(w,this.setChildNode)})}return s.length===1?s[0]:s.map(function(x,L){return!M.isValidElement(x)||"key"in x&&x.key!==null?x:M.cloneElement(x,{key:"".concat(h,"-").concat(L)})})}}]),i}(M.Component);c.displayName="ResizeObserver",oe.a=c},t9D7:function(je,oe,k){"use strict";k.d(oe,"b",function(){return G}),k.d(oe,"g",function(){return n}),k.d(oe,"d",function(){return D}),k.d(oe,"e",function(){return m}),k.d(oe,"a",function(){return f}),k.d(oe,"f",function(){return o}),k.d(oe,"c",function(){return d});var Z=k("Vhoy"),X=k("MI8n"),P=k("pmY6"),V=k("Cg/j"),U=k("ic2d"),M=k("nEHx");const G=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 D;(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(`^\\$\\((${Z.a.iconNameExpression}(?:${Z.a.iconModifierExpression})?)\\)$`);function s(L){const O=r.exec(L);if(!O)return;let[,_]=O;return{id:_}}i.fromString=s;function S(L,O){let _=L.id;const b=_.lastIndexOf("~");return b!==-1&&(_=_.substring(0,b)),O&&(_=`${_}~${O}`),{id:_}}i.modify=S;function w(L,O){var _,b;return L.id===O.id&&((_=L.color)===null||_===void 0?void 0:_.id)===((b=O.color)===null||b===void 0?void 0:b.id)}i.isEqual=w;function x(L,O){return{id:L.id,color:O?n(O):void 0}}i.asThemeIcon=x,i.asClassNameArray=Z.a.asClassNameArray,i.asClassName=Z.a.asClassName,i.asCSSSelector=Z.a.asCSSSelector})(D||(D={}));function m(i){switch(i){case M.a.DARK:return"vs-dark";case M.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 X.b}onColorThemeChange(i){return this.themingParticipants.push(i),this.onThemingParticipantAddedEmitter.fire(i),Object(P.i)(()=>{const a=this.themingParticipants.indexOf(i);this.themingParticipants.splice(a,1)})}getThemingParticipants(){return this.themingParticipants}}let c=new h;U.a.add(f.ThemingContribution,c);function o(i){return c.onColorThemeChange(i)}class d extends P.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(je,oe,k){je.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(je,oe,k){je.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(je,oe,k){je.exports=Z;function Z(){return k("gaXo"),{}}},ulZh:function(je,oe,k){typeof window!="undefined"&&function(X,P){je.exports=P()}(this,function(){return function(Z){var X={};function P(V){if(X[V])return X[V].exports;var U=X[V]={i:V,l:!1,exports:{}};return Z[V].call(U.exports,U,U.exports,P),U.l=!0,U.exports}return P.m=Z,P.c=X,P.d=function(V,U,M){P.o(V,U)||Object.defineProperty(V,U,{enumerable:!0,get:M})},P.r=function(V){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(V,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(V,"__esModule",{value:!0})},P.t=function(V,U){if(U&1&&(V=P(V)),U&8)return V;if(U&4&&typeof V=="object"&&V&&V.__esModule)return V;var M=Object.create(null);if(P.r(M),Object.defineProperty(M,"default",{enumerable:!0,value:V}),U&2&&typeof V!="string")for(var G in V)P.d(M,G,function(W){return V[W]}.bind(null,G));return M},P.n=function(V){var U=V&&V.__esModule?function(){return V.default}:function(){return V};return P.d(U,"a",U),U},P.o=function(V,U){return Object.prototype.hasOwnProperty.call(V,U)},P.p="/dist/",P(P.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(Z,X,P){"use strict";var V=Object.prototype.hasOwnProperty,U="~";function M(){}Object.create&&(M.prototype=Object.create(null),new M().__proto__||(U=!1));function G(m,f,h){this.fn=m,this.context=f,this.once=h||!1}function W(m,f,h,c,o){if(typeof h!="function")throw new TypeError("The listener must be a function");var d=new G(h,c||m,o),i=U?U+f:f;return m._events[i]?m._events[i].fn?m._events[i]=[m._events[i],d]:m._events[i].push(d):(m._events[i]=d,m._eventsCount++),m}function n(m,f){--m._eventsCount===0?m._events=new M:delete m._events[f]}function D(){this._events=new M,this._eventsCount=0}D.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(U?c.slice(1):c);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(h)):f},D.prototype.listeners=function(f){var h=U?U+f:f,c=this._events[h];if(!c)return[];if(c.fn)return[c.fn];for(var o=0,d=c.length,i=new Array(d);o<d;o++)i[o]=c[o].fn;return i},D.prototype.listenerCount=function(f){var h=U?U+f:f,c=this._events[h];return c?c.fn?1:c.length:0},D.prototype.emit=function(f,h,c,o,d,i){var a=U?U+f:f;if(!this._events[a])return!1;var r=this._events[a],s=arguments.length,S,w;if(r.fn){r.once&&this.removeListener(f,r.fn,void 0,!0);switch(s){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,o),!0;case 5:return r.fn.call(r.context,h,c,o,d),!0;case 6:return r.fn.call(r.context,h,c,o,d,i),!0}for(w=1,S=new Array(s-1);w<s;w++)S[w-1]=arguments[w];r.fn.apply(r.context,S)}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(s){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,o);break;default:if(!S)for(L=1,S=new Array(s-1);L<s;L++)S[L-1]=arguments[L];r[w].fn.apply(r[w].context,S)}}}return!0},D.prototype.on=function(f,h,c){return W(this,f,h,c,!1)},D.prototype.once=function(f,h,c){return W(this,f,h,c,!0)},D.prototype.removeListener=function(f,h,c,o){var d=U?U+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&&(!o||i.once)&&(!c||i.context===c)&&n(this,d);else{for(var a=0,r=[],s=i.length;a<s;a++)(i[a].fn!==h||o&&!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},D.prototype.removeAllListeners=function(f){var h;return f?(h=U?U+f:f,this._events[h]&&n(this,h)):(this._events=new M,this._eventsCount=0),this},D.prototype.off=D.prototype.removeListener,D.prototype.addListener=D.prototype.on,D.prefixed=U,D.EventEmitter=D,Z.exports=D},"./node_modules/url-toolkit/src/url-toolkit.js":function(Z,X,P){(function(V){var U=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,M=/^([^\/?#]*)([^]*)$/,G=/(?:\/|^)\.(?=\/)/g,W=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,n={buildAbsoluteURL:function(D,m,f){if(f=f||{},D=D.trim(),m=m.trim(),!m){if(!f.alwaysNormalize)return D;var h=n.parseURL(D);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(m);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)):m;var o=n.parseURL(D);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&o.path[0]!=="/"){var d=M.exec(o.path);o.netLoc=d[1],o.path=d[2]}o.netLoc&&!o.path&&(o.path="/");var i={scheme:o.scheme,netLoc:c.netLoc,path:null,params:c.params,query:c.query,fragment:c.fragment};if(!c.netLoc&&(i.netLoc=o.netLoc,c.path[0]!=="/"))if(!c.path)i.path=o.path,c.params||(i.params=o.params,c.query||(i.query=o.query));else{var a=o.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(D){var m=U.exec(D);return m?{scheme:m[1]||"",netLoc:m[2]||"",path:m[3]||"",params:m[4]||"",query:m[5]||"",fragment:m[6]||""}:null},normalizePath:function(D){for(D=D.split("").reverse().join("").replace(G,"");D.length!==(D=D.replace(W,"")).length;);return D.split("").reverse().join("")},buildURLFromParts:function(D){return D.scheme+D.netLoc+D.path+D.params+D.query+D.fragment}};Z.exports=n})(this)},"./node_modules/webworkify-webpack/index.js":function(Z,X,P){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 o=c(c.s=ENTRY_MODULE);return o.default||o}var U="[\\.|\\-|\\+|\\w|/|@]+",M="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+U+").*?\\)";function G(f){return(f+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function W(f){return!isNaN(1*f)}function n(f,h,c){var o={};o[c]=[];var d=h.toString(),i=d.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!i)return o;for(var a=i[1],r=new RegExp("(\\\\n|\\W)"+G(a)+M,"g"),s;s=r.exec(d);){if(s[3]==="dll-reference")continue;o[c].push(s[3])}for(r=new RegExp("\\("+G(a)+'\\("(dll-reference\\s('+U+'))"\\)\\)'+M,"g");s=r.exec(d);)f[s[2]]||(o[c].push(s[1]),f[s[2]]=P(s[1]).m),o[s[2]]=o[s[2]]||[],o[s[2]].push(s[4]);for(var S=Object.keys(o),w=0;w<S.length;w++)for(var x=0;x<o[S[w]].length;x++)W(o[S[w]][x])&&(o[S[w]][x]=1*o[S[w]][x]);return o}function D(f){var h=Object.keys(f);return h.reduce(function(c,o){return c||f[o].length>0},!1)}function m(f,h){for(var c={main:[h]},o={main:[]},d={main:{}};D(c);)for(var i=Object.keys(c),a=0;a<i.length;a++){var r=i[a],s=c[r],S=s.pop();if(d[r]=d[r]||{},d[r][S]||!f[r][S])continue;d[r][S]=!0,o[r]=o[r]||[],o[r].push(S);for(var w=n(f,f[r][S],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 o}Z.exports=function(f,h){h=h||{};var c={main:P.m},o=h.all?{main:Object.keys(c.main)}:m(c,f),d="";Object.keys(o).filter(function(S){return S!=="main"}).forEach(function(S){for(var w=0;o[S][w];)w++;o[S].push(w),c[S][w]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",d=d+"var "+S+" = ("+V.toString().replace("ENTRY_MODULE",JSON.stringify(w))+")({"+o[S].map(function(x){return""+JSON.stringify(x)+": "+c[S][x].toString()}).join(",")+`});
|
|
`}),d=d+"new (("+V.toString().replace("ENTRY_MODULE",JSON.stringify(f))+")({"+o.main.map(function(S){return""+JSON.stringify(S)+": "+c.main[S].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),s=new window.Worker(r);return s.objectURL=r,s}},"./src/config.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"hlsDefaultConfig",function(){return L}),P.d(X,"mergeConfig",function(){return _}),P.d(X,"enableStreamingMode",function(){return b});var V=P("./src/controller/abr-controller.ts"),U=P("./src/controller/audio-stream-controller.ts"),M=P("./src/controller/audio-track-controller.ts"),G=P("./src/controller/subtitle-stream-controller.ts"),W=P("./src/controller/subtitle-track-controller.ts"),n=P("./src/controller/buffer-controller.ts"),D=P("./src/controller/timeline-controller.ts"),m=P("./src/controller/cap-level-controller.ts"),f=P("./src/controller/fps-controller.ts"),h=P("./src/controller/eme-controller.ts"),c=P("./src/controller/cmcd-controller.ts"),o=P("./src/utils/xhr-loader.ts"),d=P("./src/utils/fetch-loader.ts"),i=P("./src/utils/cues.ts"),a=P("./src/utils/mediakeys-helper.ts"),r=P("./src/utils/logger.ts");function s(){return s=Object.assign||function(g){for(var p=1;p<arguments.length;p++){var C=arguments[p];for(var E in C)Object.prototype.hasOwnProperty.call(C,E)&&(g[E]=C[E])}return g},s.apply(this,arguments)}function S(g,p){var C=Object.keys(g);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(g);p&&(E=E.filter(function(v){return Object.getOwnPropertyDescriptor(g,v).enumerable})),C.push.apply(C,E)}return C}function w(g){for(var p=1;p<arguments.length;p++){var C=arguments[p]!=null?arguments[p]:{};p%2?S(Object(C),!0).forEach(function(E){x(g,E,C[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(C)):S(Object(C)).forEach(function(E){Object.defineProperty(g,E,Object.getOwnPropertyDescriptor(C,E))})}return g}function x(g,p,C){return p in g?Object.defineProperty(g,p,{value:C,enumerable:!0,configurable:!0,writable:!0}):g[p]=C,g}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:o.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:V.default,bufferController:n.default,capLevelController:m.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},O()),{},{subtitleStreamController:G.SubtitleStreamController,subtitleTrackController:W.default,timelineController:D.TimelineController,audioStreamController:U.default,audioTrackController:M.default,emeController:h.default,cmcdController:c.default});function O(){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 _(g,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 s({},g,p)}function b(g){var p=g.loader;if(p!==d.default&&p!==o.default)r.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),g.progressive=!1;else{var C=Object(d.fetchSupported)();C&&(g.loader=d.default,g.progressive=!0,g.enableSoftwareAES=!0,r.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(Z,X,P){"use strict";P.r(X);var V=P("./src/polyfills/number.ts"),U=P("./src/utils/ewma-bandwidth-estimator.ts"),M=P("./src/events.ts"),G=P("./src/utils/buffer-helper.ts"),W=P("./src/errors.ts"),n=P("./src/types/loader.ts"),D=P("./src/utils/logger.ts");function m(c,o){for(var d=0;d<o.length;d++){var i=o[d];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(c,i.key,i)}}function f(c,o,d){return o&&m(c.prototype,o),d&&m(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 U.default(i.abrEwmaSlowVoD,i.abrEwmaFastVoD,i.abrEwmaDefaultEstimate),this.registerListeners()}var o=c.prototype;return o.registerListeners=function(){var i=this.hls;i.on(M.Events.FRAG_LOADING,this.onFragLoading,this),i.on(M.Events.FRAG_LOADED,this.onFragLoaded,this),i.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.on(M.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var i=this.hls;i.off(M.Events.FRAG_LOADING,this.onFragLoading,this),i.off(M.Events.FRAG_LOADED,this.onFragLoaded,this),i.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.off(M.Events.ERROR,this.onError,this)},o.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},o.onFragLoading=function(i,a){var r=a.frag;if(r.type===n.PlaylistLevelType.MAIN&&!this.timer){var s;this.fragCurrent=r,this.partCurrent=(s=a.part)!=null?s:null,this.timer=self.setInterval(this.onCheck,100)}},o.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)},o._abandonRulesCheck=function(){var i=this.fragCurrent,a=this.partCurrent,r=this.hls,s=r.autoLevelEnabled,S=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){D.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!s||w.paused||!w.playbackRate||!w.readyState)return;var O=performance.now()-x.loading.start,_=Math.abs(w.playbackRate);if(O<=500*L/_)return;var b=r.levels,g=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/O),v=(C-x.loaded)/E,N=w.currentTime,F=(G.BufferHelper.bufferInfo(w,N,S.maxBufferHole).end-N)/_;if(F>=2*L/_||v<=F)return;var A=Number.POSITIVE_INFINITY,H;for(H=i.level-1;H>g;H--){var j=b[H].maxBitrate;if(A=L*j/(8*.8*E),A<F)break}if(A>=v)return;var T=this.bwEstimator.getEstimate();D.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)(T)?(T/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+v.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+A.toFixed(3)+` s
|
|
Time to underbuffer: `+F.toFixed(3)+" s"),r.nextLoadLevel=H,this.bwEstimator.sample(O,x.loaded),this.clearTimer(),i.loader&&(this.fragCurrent=this.partCurrent=null,i.loader.abort()),r.trigger(M.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:a,stats:x})},o.onFragLoaded=function(i,a){var r=a.frag,s=a.part;if(r.type===n.PlaylistLevelType.MAIN&&Object(V.isFiniteNumber)(r.sn)){var S=s?s.stats:r.stats,w=s?s.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)+S.loaded,O=(x.loaded?x.loaded.duration:0)+w;x.loaded={bytes:L,duration:O},x.realBitrate=Math.round(8*L/O)}if(r.bitrateTest){var _={stats:S,frag:r,part:s,id:r.type};this.onFragBuffered(M.Events.FRAG_BUFFERED,_),r.bitrateTest=!1}}},o.onFragBuffered=function(i,a){var r=a.frag,s=a.part,S=s?s.stats:r.stats;if(S.aborted)return;if(r.type!==n.PlaylistLevelType.MAIN||r.sn==="initSegment")return;var w=S.parsing.end-S.loading.start;this.bwEstimator.sample(w,S.loaded),S.bwEstimate=this.bwEstimator.getEstimate(),r.bitrateTest?this.bitrateTestDelay=w/1e3:this.bitrateTestDelay=0},o.onError=function(i,a){switch(a.details){case W.ErrorDetails.FRAG_LOAD_ERROR:case W.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},o.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},o.getNextABRAutoLevel=function(){var i=this.fragCurrent,a=this.partCurrent,r=this.hls,s=r.maxAutoLevel,S=r.config,w=r.minAutoLevel,x=r.media,L=a?a.duration:i?i.duration:0,O=x?x.currentTime:0,_=x&&x.playbackRate!==0?Math.abs(x.playbackRate):1,b=this.bwEstimator?this.bwEstimator.getEstimate():S.abrEwmaDefaultEstimate,g=(G.BufferHelper.bufferInfo(x,O,S.maxBufferHole).end-O)/_,p=this.findBestLevel(b,w,s,g,S.abrBandWidthFactor,S.abrBandWidthUpFactor);if(p>=0)return p;D.logger.trace((g?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var C=L?Math.min(L,S.maxStarvationDelay):S.maxStarvationDelay,E=S.abrBandWidthFactor,v=S.abrBandWidthUpFactor;if(!g){var N=this.bitrateTestDelay;if(N){var F=L?Math.min(L,S.maxLoadingDelay):S.maxLoadingDelay;C=F-N,D.logger.trace("bitrate test took "+Math.round(1e3*N)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*C)+" ms"),E=v=1}}return p=this.findBestLevel(b,w,s,g+C,E,v),Math.max(p,0)},o.findBestLevel=function(i,a,r,s,S,w){for(var x,L=this.fragCurrent,O=this.partCurrent,_=this.lastLoadedFragLevel,b=this.hls.levels,g=b[_],p=!!(g!=null&&(x=g.details)!==null&&x!==void 0&&x.live),C=g==null?void 0:g.codecSet,E=O?O.duration:L?L.duration:0,v=r;v>=a;v--){var N=b[v];if(!N||C&&N.codecSet!==C)continue;var F=N.details,A=(O?F==null?void 0:F.partTarget:F==null?void 0:F.averagetargetduration)||E,H=void 0;v<=_?H=S*i:H=w*i;var j=b[v].maxBitrate,T=j*A/H;if(D.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+v+"/"+Math.round(H)+"/"+j+"/"+A+"/"+s+"/"+T),H>j&&(!T||p&&!this.bitrateTestDelay||T<s))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}();X.default=h},"./src/controller/audio-stream-controller.ts":function(Z,X,P){"use strict";P.r(X);var V=P("./src/polyfills/number.ts"),U=P("./src/controller/base-stream-controller.ts"),M=P("./src/events.ts"),G=P("./src/utils/buffer-helper.ts"),W=P("./src/controller/fragment-tracker.ts"),n=P("./src/types/level.ts"),D=P("./src/types/loader.ts"),m=P("./src/loader/fragment.ts"),f=P("./src/demux/chunk-cache.ts"),h=P("./src/demux/transmuxer-interface.ts"),c=P("./src/types/transmuxer.ts"),o=P("./src/controller/fragment-finders.ts"),d=P("./src/utils/discontinuities.ts"),i=P("./src/errors.ts"),a=P("./src/utils/logger.ts");function r(){return r=Object.assign||function(L){for(var O=1;O<arguments.length;O++){var _=arguments[O];for(var b in _)Object.prototype.hasOwnProperty.call(_,b)&&(L[b]=_[b])}return L},r.apply(this,arguments)}function s(L,O){L.prototype=Object.create(O.prototype),L.prototype.constructor=L,S(L,O)}function S(L,O){return S=Object.setPrototypeOf||function(b,g){return b.__proto__=g,b},S(L,O)}var w=100,x=function(L){s(O,L);function O(b,g){var p;return p=L.call(this,b,g,"[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 _=O.prototype;return _.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},_._registerListeners=function(){var g=this.hls;g.on(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),g.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),g.on(M.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),g.on(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),g.on(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),g.on(M.Events.ERROR,this.onError,this),g.on(M.Events.BUFFER_RESET,this.onBufferReset,this),g.on(M.Events.BUFFER_CREATED,this.onBufferCreated,this),g.on(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),g.on(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),g.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_._unregisterListeners=function(){var g=this.hls;g.off(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.off(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),g.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),g.off(M.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),g.off(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),g.off(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),g.off(M.Events.ERROR,this.onError,this),g.off(M.Events.BUFFER_RESET,this.onBufferReset,this),g.off(M.Events.BUFFER_CREATED,this.onBufferCreated,this),g.off(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),g.off(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),g.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_.onInitPtsFound=function(g,p){var C=p.frag,E=p.id,v=p.initPTS;if(E==="main"){var N=C.cc;this.initPTS[C.cc]=v,this.log("InitPTS for cc: "+N+" found from main: "+v),this.videoTrackCC=N,this.state===U.State.WAITING_INIT_PTS&&this.tick()}},_.startLoad=function(g){if(!this.levels){this.startPosition=g,this.state=U.State.STOPPED;return}var p=this.lastCurrentTime;this.stopLoad(),this.setInterval(w),this.fragLoadError=0,p>0&&g===-1?(this.log("Override startPosition with lastCurrentTime @"+p.toFixed(3)),this.state=U.State.IDLE):(this.loadedmetadata=!1,this.state=U.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=g,this.tick()},_.doTick=function(){switch(this.state){case U.State.IDLE:this.doTickIdle();break;case U.State.WAITING_TRACK:{var g,p=this.levels,C=this.trackId,E=p==null||((g=p[C])===null||g===void 0)?void 0:g.details;if(E){if(this.waitForCdnTuneIn(E))break;this.state=U.State.WAITING_INIT_PTS}break}case U.State.FRAG_LOADING_WAITING_RETRY:{var v,N=performance.now(),F=this.retryDate;(!F||N>=F||(v=this.media)!==null&&v!==void 0&&v.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=U.State.IDLE);break}case U.State.WAITING_INIT_PTS:{var A=this.waitingData;if(A){var H=A.frag,j=A.part,T=A.cache,z=A.complete;if(this.initPTS[H.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=U.State.FRAG_LOADING;var Q=T.flush(),ne={frag:H,part:j,payload:Q,networkDetails:null};this._handleFragmentLoadProgress(ne),z&&L.prototype._handleFragmentLoadComplete.call(this,ne)}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 se=this.getLoadPosition(),xe=G.BufferHelper.bufferInfo(this.mediaBuffer,se,this.config.maxBufferHole),ge=Object(o.fragmentWithinToleranceTest)(xe.end,this.config.maxFragLookUpTolerance,H);ge<0&&(a.logger.log("Waiting fragment cc ("+H.cc+") @ "+H.start+" cancelled because another fragment at "+xe.end+" is needed"),this.clearWaitingFragment())}}else this.state=U.State.IDLE}}this.onTickEnd()},_.clearWaitingFragment=function(){var g=this.waitingData;g&&(this.fragmentTracker.removeFragment(g.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=U.State.IDLE)},_.onTickEnd=function(){var g=this.media;if(!g||!g.readyState)return;var p=this.mediaBuffer?this.mediaBuffer:g,C=p.buffered;!this.loadedmetadata&&C.length&&(this.loadedmetadata=!0),this.lastCurrentTime=g.currentTime},_.doTickIdle=function(){var g,p,C=this.hls,E=this.levels,v=this.media,N=this.trackId,F=C.config;if(!E||!E[N])return;if(!v&&(this.startFragRequested||!F.startFragPrefetch))return;var A=E[N],H=A.details;if(!H||H.live&&this.levelLastLoaded!==N||this.waitForCdnTuneIn(H)){this.state=U.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,m.ElementaryStreamTypes.AUDIO,D.PlaylistLevelType.AUDIO));var j=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,D.PlaylistLevelType.AUDIO);if(j===null)return;var T=j.len,z=this.getMaxBufferLength(),Q=this.audioSwitch;if(T>=z&&!Q)return;if(!Q&&this._streamEnded(j,H)){C.trigger(M.Events.BUFFER_EOS,{type:"audio"}),this.state=U.State.ENDED;return}var ne=H.fragments,se=ne[0].start,xe=j.end;if(Q){var ge=this.getLoadPosition();xe=ge,H.PTSKnown&&ge<se&&((j.end>se||j.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),v.currentTime=se+.05))}var ve=this.getNextFragment(xe,H);if(!ve){this.bufferFlushed=!0;return}((g=ve.decryptdata)===null||g===void 0?void 0:g.keyFormat)==="identity"&&!((p=ve.decryptdata)!==null&&p!==void 0&&p.key)?this.loadKey(ve,H):this.loadFragment(ve,H,xe)},_.getMaxBufferLength=function(){var g=L.prototype.getMaxBufferLength.call(this),p=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,D.PlaylistLevelType.MAIN);return p===null?g:Math.max(g,p.len)},_.onMediaDetaching=function(){this.videoBuffer=null,L.prototype.onMediaDetaching.call(this)},_.onAudioTracksUpdated=function(g,p){var C=p.audioTracks;this.resetTransmuxer(),this.levels=C.map(function(E){return new n.Level(E)})},_.onAudioTrackSwitching=function(g,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=U.State.IDLE):this.state=U.State.STOPPED,this.tick()},_.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},_.onLevelLoaded=function(g,p){this.mainDetails=p.details},_.onAudioTrackLoaded=function(g,p){var C,E=this.levels,v=p.details,N=p.id;if(!E){this.warn("Audio tracks were reset while loading level "+N);return}this.log("Track "+N+" loaded ["+v.startSN+","+v.endSN+"],duration:"+v.totalduration);var F=E[N],A=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),A=v.fragments[0].start):A=this.alignPlaylists(v,F.details)}F.details=v,this.levelLastLoaded=N,!this.startFragRequested&&(this.mainDetails||!v.live)&&this.setStartPosition(F.details,A),this.state===U.State.WAITING_TRACK&&!this.waitForCdnTuneIn(v)&&(this.state=U.State.IDLE),this.tick()},_._handleFragmentLoadProgress=function(g){var p,C=g.frag,E=g.part,v=g.payload,N=this.config,F=this.trackId,A=this.levels;if(!A){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=A[F];console.assert(H,"Audio track is defined on fragment load progress");var j=H.details;console.assert(j,"Audio track details are defined on fragment load progress");var T=N.defaultAudioCodec||H.audioCodec||"mp4a.40.2",z=this.transmuxer;z||(z=this.transmuxer=new h.default(this.hls,D.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var Q=this.initPTS[C.cc],ne=(p=C.initSegment)===null||p===void 0?void 0:p.data;if(Q!==void 0){var se=!1,xe=E?E.index:-1,ge=xe!==-1,ve=new c.ChunkMetadata(C.level,C.sn,C.stats.chunkCount,v.byteLength,xe,ge);z.push(v,ne,T,"",C,E,j.totalduration,se,ve,Q)}else{a.logger.log("Unknown video PTS for cc "+C.cc+", waiting for video PTS before demuxing audio frag "+C.sn+" of ["+j.startSN+" ,"+j.endSN+"],track "+F);var Oe=this.waitingData=this.waitingData||{frag:C,part:E,cache:new f.default,complete:!1},Re=Oe.cache;Re.push(new Uint8Array(v)),this.waitingVideoCC=this.videoTrackCC,this.state=U.State.WAITING_INIT_PTS}},_._handleFragmentLoadComplete=function(g){if(this.waitingData){this.waitingData.complete=!0;return}L.prototype._handleFragmentLoadComplete.call(this,g)},_.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},_.onBufferCreated=function(g,p){var C=p.tracks.audio;C&&(this.mediaBuffer=C.buffer),p.tracks.video&&(this.videoBuffer=p.tracks.video.buffer)},_.onFragBuffered=function(g,p){var C=p.frag,E=p.part;if(C.type!==D.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(M.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(C,E)},_.onError=function(g,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(D.PlaylistLevelType.AUDIO,p);break;case i.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case i.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==U.State.ERROR&&this.state!==U.State.STOPPED&&(this.state=p.fatal?U.State.ERROR:U.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===U.State.PARSING||this.state===U.State.PARSED)){var C=!0,E=this.getFwdBufferInfo(this.mediaBuffer,D.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(g,p){var C=p.type;C===m.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},_._handleTransmuxComplete=function(g){var p,C="audio",E=this.hls,v=g.remuxResult,N=g.chunkMeta,F=this.getCurrentContext(N);if(!F){this.warn("The loading context changed while buffering fragment "+N.sn+" of level "+N.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(N.level);return}var A=F.frag,H=F.part,j=v.audio,T=v.text,z=v.id3,Q=v.initSegment;if(this.fragContextChanged(A))return;if(this.state=U.State.PARSING,this.audioSwitch&&j&&this.completeAudioSwitch(),Q!=null&&Q.tracks&&(this._bufferInitSegment(Q.tracks,A,N),E.trigger(M.Events.FRAG_PARSING_INIT_SEGMENT,{frag:A,id:C,tracks:Q.tracks})),j){var ne=j.startPTS,se=j.endPTS,xe=j.startDTS,ge=j.endDTS;H&&(H.elementaryStreams[m.ElementaryStreamTypes.AUDIO]={startPTS:ne,endPTS:se,startDTS:xe,endDTS:ge}),A.setElementaryStreamInfo(m.ElementaryStreamTypes.AUDIO,ne,se,xe,ge),this.bufferFragmentData(j,A,H,N)}if(z!=null&&(p=z.samples)!==null&&p!==void 0&&p.length){var ve=r({frag:A,id:C},z);E.trigger(M.Events.FRAG_PARSING_METADATA,ve)}if(T){var Oe=r({frag:A,id:C},T);E.trigger(M.Events.FRAG_PARSING_USERDATA,Oe)}},_._bufferInitSegment=function(g,p,C){if(this.state!==U.State.PARSING)return;g.video&&delete g.video;var E=g.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(M.Events.BUFFER_CODECS,g);var v=E.initSegment;if(v!=null&&v.byteLength){var N={type:"audio",frag:p,part:null,chunkMeta:C,parent:p.type,data:v};this.hls.trigger(M.Events.BUFFER_APPENDING,N)}this.tick()},_.loadFragment=function(g,p,C){var E=this.fragmentTracker.getState(g);this.fragCurrent=g,(this.audioSwitch||E===W.FragmentState.NOT_LOADED||E===W.FragmentState.PARTIAL)&&(g.sn==="initSegment"?this._loadInitSegment(g):p.live&&!Object(V.isFiniteNumber)(this.initPTS[g.cc])?(this.log("Waiting for video PTS in continuity counter "+g.cc+" of live stream before loading audio fragment "+g.sn+" of level "+this.trackId),this.state=U.State.WAITING_INIT_PTS):(this.startFragRequested=!0,L.prototype.loadFragment.call(this,g,p,C)))},_.completeAudioSwitch=function(){var g=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,g.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:C})},O}(U.default);X.default=x},"./src/controller/audio-track-controller.ts":function(Z,X,P){"use strict";P.r(X);var V=P("./src/events.ts"),U=P("./src/errors.ts"),M=P("./src/controller/base-playlist-controller.ts"),G=P("./src/types/loader.ts");function W(h,c){for(var o=0;o<c.length;o++){var d=c[o];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(h,d.key,d)}}function n(h,c,o){return c&&W(h.prototype,c),o&&W(h,o),h}function D(h,c){h.prototype=Object.create(c.prototype),h.prototype.constructor=h,m(h,c)}function m(h,c){return m=Object.setPrototypeOf||function(d,i){return d.__proto__=i,d},m(h,c)}var f=function(h){D(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 o=c.prototype;return o.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)},o.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)},o.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,h.prototype.destroy.call(this)},o.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},o.onManifestParsed=function(i,a){this.tracks=a.audioTracks||[]},o.onAudioTrackLoaded=function(i,a){var r=a.id,s=a.details,S=this.tracksInGroup[r];if(!S){this.warn("Invalid audio track id "+r);return}var w=S.details;S.details=a.details,this.log("audioTrack "+r+" loaded ["+s.startSN+"-"+s.endSN+"]"),r===this.trackId&&(this.retryCount=0,this.playlistLoaded(r,a,w))},o.onLevelLoading=function(i,a){this.switchLevel(a.level)},o.onLevelSwitching=function(i,a){this.switchLevel(a.level)},o.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 s=this.tracks.filter(function(w){return!r||w.groupId===r});this.selectDefaultTrack&&!s.some(function(w){return w.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=s;var S={audioTracks:s};this.log("Updating audio tracks, "+s.length+' track(s) found in "'+r+'" group-id'),this.hls.trigger(V.Events.AUDIO_TRACKS_UPDATED,S),this.selectInitialTrack()}},o.onError=function(i,a){if(h.prototype.onError.call(this,i,a),a.fatal||!a.context)return;a.context.type===G.PlaylistContextType.AUDIO_TRACK&&a.context.id===this.trackId&&a.context.groupId===this.groupId&&this.retryLoadingOrFail(a)},o.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 s=a[i],S=s.id,w=s.groupId,x=w===void 0?"":w,L=s.name,O=s.type,_=s.url;if(this.trackId=i,this.trackName=L,this.selectDefaultTrack=!1,this.hls.trigger(V.Events.AUDIO_TRACK_SWITCHING,{id:S,groupId:x,name:L,type:O,url:_}),s.details&&!s.details.live)return;var b=this.switchParams(s.url,r==null?void 0:r.details);this.loadPlaylist(b)},o.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:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},o.findTrackId=function(i){for(var a=this.tracksInGroup,r=0;r<a.length;r++){var s=a[r];if((!this.selectDefaultTrack||s.default)&&(!i||i===s.name))return s.id}return-1},o.loadPlaylist=function(i){var a=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(a)){var r=a.id,s=a.groupId,S=a.url;if(i)try{S=i.addDirectives(S)}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:S,id:r,groupId:s,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}(M.default);X.default=f},"./src/controller/base-playlist-controller.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return n});var V=P("./src/polyfills/number.ts"),U=P("./src/types/level.ts"),M=P("./src/controller/level-helper.ts"),G=P("./src/utils/logger.ts"),W=P("./src/errors.ts"),n=function(){function D(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=G.logger.log.bind(G.logger,h+":"),this.warn=G.logger.warn.bind(G.logger,h+":"),this.hls=f}var m=D.prototype;return m.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},m.onError=function(h,c){c.fatal&&c.type===W.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},m.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},m.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},m.stopLoad=function(){this.canLoad=!1,this.clearTimer()},m.switchParams=function(h,c){var o=c==null?void 0:c.renditionReports;if(o)for(var d=0;d<o.length;d++){var i=o[d],a=""+i.URI;if(a===h.substr(-a.length)){var r=parseInt(i["LAST-MSN"]),s=parseInt(i["LAST-PART"]);if(c&&this.hls.config.lowLatencyMode){var S=Math.min(c.age-c.partTarget,c.targetduration);s!==void 0&&S>c.partTarget&&(s+=1)}if(Object(V.isFiniteNumber)(r))return new U.HlsUrlParameters(r,Object(V.isFiniteNumber)(s)?s:void 0,U.HlsSkip.No)}}},m.loadPlaylist=function(h){},m.shouldLoadTrack=function(h){return this.canLoad&&h&&!!h.url&&(!h.details||h.details.live)},m.playlistLoaded=function(h,c,o){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||o!=null&&o.live){if(i.reloaded(o),o&&this.log("live playlist "+h+" "+(i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:"MISSED")),o&&i.fragments.length>0&&Object(M.mergeDetails)(o,i),!this.canLoad||!i.live)return;var s,S=void 0,w=void 0;if(i.canBlockReload&&i.endSN&&i.advanced){var x=this.hls.config.lowLatencyMode,L=i.lastPartSn,O=i.endSN,_=i.lastPartIndex,b=_!==-1,g=L===O,p=x?0:_;b?(S=g?O+1:L,w=g?p:_+1):S=O+1;var C=i.age,E=C+i.ageHeader,v=Math.min(E-i.partTarget,i.targetduration*1.5);if(v>0){if(o&&v>o.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+o.tuneInGoal+" to: "+v+" with playlist age: "+i.age),v=0;else{var N=Math.floor(v/i.targetduration);if(S+=N,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 "+N+" to part "+w)}i.tuneInGoal=v}if(s=this.getDeliveryDirectives(i,c.deliveryDirectives,S,w),x||!g){this.loadPlaylist(s);return}}else s=this.getDeliveryDirectives(i,c.deliveryDirectives,S,w);var A=Object(M.computeReloadInterval)(i,a);S!==void 0&&i.canBlockReload&&(A-=i.partTarget||1),this.log("reload live playlist "+h+" in "+Math.round(A)+" ms"),this.timer=self.setTimeout(function(){return d.loadPlaylist(s)},A)}else this.clearTimer()},m.getDeliveryDirectives=function(h,c,o,d){var i=Object(U.getSkipValue)(h,o);return c!=null&&c.skip&&h.deltaUpdateFailed&&(o=c.msn,d=c.part,i=U.HlsSkip.No),new U.HlsUrlParameters(o,d,i)},m.retryLoadingOrFail=function(h){var c=this,o=this.hls.config,d=this.retryCount<o.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)*o.levelLoadingRetryDelay,o.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},D}()},"./src/controller/base-stream-controller.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"State",function(){return O}),P.d(X,"default",function(){return _});var V=P("./src/polyfills/number.ts"),U=P("./src/task-loop.ts"),M=P("./src/controller/fragment-tracker.ts"),G=P("./src/utils/buffer-helper.ts"),W=P("./src/utils/logger.ts"),n=P("./src/events.ts"),D=P("./src/errors.ts"),m=P("./src/types/transmuxer.ts"),f=P("./src/utils/mp4-tools.ts"),h=P("./src/utils/discontinuities.ts"),c=P("./src/controller/fragment-finders.ts"),o=P("./src/controller/level-helper.ts"),d=P("./src/loader/fragment-loader.ts"),i=P("./src/crypt/decrypter.ts"),a=P("./src/utils/time-ranges.ts"),r=P("./src/types/loader.ts");function s(b,g){for(var p=0;p<g.length;p++){var C=g[p];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(b,C.key,C)}}function S(b,g,p){return g&&s(b.prototype,g),p&&s(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,g){b.prototype=Object.create(g.prototype),b.prototype.constructor=b,L(b,g)}function L(b,g){return L=Object.setPrototypeOf||function(C,E){return C.__proto__=E,C},L(b,g)}var O={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(g,b);function g(C,E,v){var N;return N=b.call(this)||this,N.hls=void 0,N.fragPrevious=null,N.fragCurrent=null,N.fragmentTracker=void 0,N.transmuxer=null,N._state=O.STOPPED,N.media=void 0,N.mediaBuffer=void 0,N.config=void 0,N.bitrateTest=!1,N.lastCurrentTime=0,N.nextLoadPosition=0,N.startPosition=0,N.loadedmetadata=!1,N.fragLoadError=0,N.retryDate=0,N.levels=null,N.fragmentLoader=void 0,N.levelLastLoaded=null,N.startFragRequested=!1,N.decrypter=void 0,N.initPTS=[],N.onvseeking=null,N.onvended=null,N.logPrefix="",N.log=void 0,N.warn=void 0,N.logPrefix=v,N.log=W.logger.log.bind(W.logger,v+":"),N.warn=W.logger.warn.bind(W.logger,v+":"),N.hls=C,N.fragmentLoader=new d.default(C.config),N.fragmentTracker=E,N.config=C.config,N.decrypter=new i.default(C,C.config),C.on(n.Events.KEY_LOADED,N.onKeyLoaded,w(N)),N}var p=g.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=O.STOPPED},p._streamEnded=function(E,v){var N=this.fragCurrent,F=this.fragmentTracker;if(!v.live&&N&&N.sn===v.endSN&&!E.nextStart){var A=F.getState(N);return A===M.FragmentState.PARTIAL||A===M.FragmentState.OK}return!1},p.onMediaAttached=function(E,v){var N=this.media=this.mediaBuffer=v.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),N.addEventListener("seeking",this.onvseeking),N.addEventListener("ended",this.onvended);var F=this.config;this.levels&&F.autoStartLoad&&this.state===O.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,N=this.media,F=this.mediaBuffer,A=this.state,H=N?N.currentTime:0,j=G.BufferHelper.bufferInfo(F||N,H,E.maxBufferHole);if(this.log("media seeking to "+(Object(V.isFiniteNumber)(H)?H.toFixed(3):H)+", state: "+A),A===O.ENDED)this.resetLoadingState();else if(v&&!j.len){var T=E.maxFragLookUpTolerance,z=v.start-T,Q=v.start+v.duration+T,ne=H>Q;(H<z||ne)&&(ne&&v.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),v.loader.abort()),this.resetLoadingState())}N&&(this.lastCurrentTime=H),!this.loadedmetadata&&!j.len&&(this.nextLoadPosition=this.startPosition=H),this.tickImmediate()},p.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},p.onKeyLoaded=function(E,v){if(this.state!==O.KEY_LOADING||v.frag!==this.fragCurrent||!this.levels)return;this.state=O.IDLE;var N=this.levels[v.frag.level].details;N&&this.loadFragment(v.frag,N,v.frag.start)},p.onHandlerDestroying=function(){this.stopLoad(),b.prototype.onHandlerDestroying.call(this)},p.onHandlerDestroyed=function(){this.state=O.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=O.KEY_LOADING,this.fragCurrent=E,this.hls.trigger(n.Events.KEY_LOADING,{frag:E})},p.loadFragment=function(E,v,N){this._loadFragForPlayback(E,v,N)},p._loadFragForPlayback=function(E,v,N){var F=this,A=function(j){if(F.fragContextChanged(E)){F.warn("Fragment "+E.sn+(j.part?" p: "+j.part.index:"")+" of level "+E.level+" was dropped during download."),F.fragmentTracker.removeFragment(E);return}E.stats.chunkCount++,F._handleFragmentLoadProgress(j)};this._doFragLoad(E,v,N,A).then(function(H){if(!H)return;F.fragLoadError=0;var j=F.state;if(F.fragContextChanged(E)){(j===O.FRAG_LOADING||j===O.BACKTRACKING||!F.fragCurrent&&j===O.PARSING)&&(F.fragmentTracker.removeFragment(E),F.state=O.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===O.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,N){if(N===void 0&&(N=null),!(E-v))return;var F={startOffset:E,endOffset:v,type:N};this.fragLoadError=0,this.hls.trigger(n.Events.BUFFER_FLUSHING,F)},p._loadInitSegment=function(E){var v=this;this._doFragLoad(E).then(function(N){if(!N||v.fragContextChanged(E)||!v.levels)throw new Error("init load aborted");return N}).then(function(N){var F=v.hls,A=N.payload,H=E.decryptdata;if(A&&A.byteLength>0&&H&&H.key&&H.iv&&H.method==="AES-128"){var j=self.performance.now();return v.decrypter.webCryptoDecrypt(new Uint8Array(A),H.key.buffer,H.iv.buffer).then(function(T){var z=self.performance.now();return F.trigger(n.Events.FRAG_DECRYPTED,{frag:E,payload:T,stats:{tstart:j,tdecrypt:z}}),N.payload=T,N})}return N}).then(function(N){var F=v.fragCurrent,A=v.hls,H=v.levels;if(!H)throw new Error("init load aborted, missing levels");var j=H[E.level].details;console.assert(j,"Level details are defined when init segment is loaded");var T=E.stats;v.state=O.IDLE,v.fragLoadError=0,E.data=new Uint8Array(N.payload),T.parsing.start=T.buffering.start=self.performance.now(),T.parsing.end=T.buffering.end=self.performance.now(),N.frag===F&&A.trigger(n.Events.FRAG_BUFFERED,{stats:T,frag:F,part:null,id:E.type}),v.tick()}).catch(function(N){v.warn(N),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 N=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(G.BufferHelper.getBuffered(N))),this.state=O.IDLE,this.tick()},p._handleFragmentLoadComplete=function(E){var v=this.transmuxer;if(!v)return;var N=E.frag,F=E.part,A=E.partsLoaded,H=!A||A.length===0||A.some(function(T){return!T}),j=new m.ChunkMetadata(N.level,N.sn,N.stats.chunkCount+1,0,F?F.index:-1,!H);v.flush(j)},p._handleFragmentLoadProgress=function(E){},p._doFragLoad=function(E,v,N,F){var A=this;if(N===void 0&&(N=null),!this.levels)throw new Error("frag load aborted, missing levels");if(N=Math.max(E.start,N||0),this.config.lowLatencyMode&&v){var H=v.partList;if(H&&F){N>E.end&&v.fragmentHint&&(E=v.fragmentHint);var j=this.getNextPart(H,E,N);if(j>-1){var T=H[j];return this.log("Loading part sn: "+E.sn+" p: "+T.index+" cc: "+E.cc+" of playlist ["+v.startSN+"-"+v.endSN+"] parts [0-"+j+"-"+(H.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+E.level+", target: "+parseFloat(N.toFixed(3))),this.nextLoadPosition=T.start+T.duration,this.state=O.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:E,part:H[j],targetBufferTime:N}),this.doFragPartsLoad(E,H,j,F).catch(function(z){return A.handleFragLoadError(z)})}else if(!E.url||this.loadedEndOfParts(H,N))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(N.toFixed(3))),Object(V.isFiniteNumber)(E.sn)&&!this.bitrateTest&&(this.nextLoadPosition=E.start+E.duration),this.state=O.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:E,targetBufferTime:N}),this.fragmentLoader.load(E,F).catch(function(z){return A.handleFragLoadError(z)})},p.doFragPartsLoad=function(E,v,N,F){var A=this;return new Promise(function(H,j){var T=[],z=function Q(ne){var se=v[ne];A.fragmentLoader.loadPart(E,se,F).then(function(xe){T[se.index]=xe;var ge=xe.part;A.hls.trigger(n.Events.FRAG_LOADED,xe);var ve=v[ne+1];if(ve&&ve.fragment===E)Q(ne+1);else return H({frag:E,part:ge,partsLoaded:T})}).catch(j)};z(N)})},p.handleFragLoadError=function(E){var v=E.data;return v&&v.details===D.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!==O.PARSING){this.fragCurrent||(this.state=O.IDLE);return}var N=v.frag,F=v.part,A=v.level,H=self.performance.now();N.stats.parsing.end=H,F&&(F.stats.parsing.end=H),this.updateLevelTiming(N,F,A,E.partial)},p.getCurrentContext=function(E){var v=this.levels,N=E.level,F=E.sn,A=E.part;if(!v||!v[N])return this.warn("Levels object was unset while buffering fragment "+F+" of level "+N+". The current chunk will not be buffered."),null;var H=v[N],j=A>-1?Object(o.getPartWith)(H,F,A):null,T=j?j.fragment:Object(o.getFragmentWithSN)(H,F,this.fragCurrent);return T?{frag:T,part:j,level:H}:null},p.bufferFragmentData=function(E,v,N,F){if(!E||this.state!==O.PARSING)return;var A=E.data1,H=E.data2,j=A;if(A&&H&&(j=Object(f.appendUint8Array)(A,H)),!j||!j.length)return;var T={type:E.type,frag:v,part:N,chunkMeta:F,parent:v.type,data:j};this.hls.trigger(n.Events.BUFFER_APPENDING,T),E.dropped&&E.independent&&!N&&this.flushBufferGap(v)},p.flushBufferGap=function(E){var v=this.media;if(!v)return;if(!G.BufferHelper.isBuffered(v,v.currentTime)){this.flushMainBuffer(0,E.start);return}var N=v.currentTime,F=G.BufferHelper.bufferInfo(v,N,0),A=E.duration,H=Math.min(this.config.maxFragLookUpTolerance*2,A*.25),j=Math.max(Math.min(E.start-H,F.end-H),N+H);E.start-j>H&&this.flushMainBuffer(j,E.start)},p.getFwdBufferInfo=function(E,v){var N=this.config,F=this.getLoadPosition();if(!Object(V.isFiniteNumber)(F))return null;var A=G.BufferHelper.bufferInfo(E,F,N.maxBufferHole);if(A.len===0&&A.nextStart!==void 0){var H=this.fragmentTracker.getBufferedFrag(F,v);if(H&&A.nextStart<H.end)return G.BufferHelper.bufferInfo(E,F,Math.max(A.nextStart,N.maxBufferHole))}return A},p.getMaxBufferLength=function(E){var v=this.config,N;return E?N=Math.max(8*v.maxBufferSize/E,v.maxBufferLength):N=v.maxBufferLength,Math.min(N,v.maxMaxBufferLength)},p.reduceMaxBufferLength=function(E){var v=this.config,N=E||v.maxBufferLength;return v.maxMaxBufferLength>=N?(v.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+v.maxMaxBufferLength+"s"),!0):!1},p.getNextFragment=function(E,v){var N,F,A=v.fragments,H=A.length;if(!H)return null;var j=this.config,T=A[0].start,z;if(v.live){var Q=j.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&&(z=this.getInitialLiveFragment(v,A),this.startPosition=z?this.hls.liveSyncPosition||z.start:E)}else E<=T&&(z=A[0]);if(!z){var ne=j.lowLatencyMode?v.partEnd:v.fragmentEnd;z=this.getFragmentAtPosition(E,ne,v)}return(N=z)!==null&&N!==void 0&&N.initSegment&&!((F=z)!==null&&F!==void 0&&F.initSegment.data)&&!this.bitrateTest&&(z=z.initSegment),z},p.getNextPart=function(E,v,N){for(var F=-1,A=!1,H=!0,j=0,T=E.length;j<T;j++){var z=E[j];if(H=H&&!z.independent,F>-1&&N<z.start)break;var Q=z.loaded;!Q&&(A||z.independent||H)&&z.fragment===v&&(F=j),A=Q}return F},p.loadedEndOfParts=function(E,v){var N=E[E.length-1];return N&&v>N.start&&N.loaded},p.getInitialLiveFragment=function(E,v){var N=this.fragPrevious,F=null;if(N){if(E.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+N.programDateTime),F=Object(c.findFragmentByPDT)(v,N.endProgramDateTime,this.config.maxFragLookUpTolerance)),!F){var A=N.sn+1;if(A>=E.startSN&&A<=E.endSN){var H=v[A-E.startSN];N.cc===H.cc&&(F=H,this.log("Live playlist, switching playlist, load frag with next SN: "+F.sn))}F||(F=Object(c.findFragWithCC)(v,N.cc),F&&this.log("Live playlist, switching playlist, load frag with same CC: "+F.sn))}}else{var j=this.hls.liveSyncPosition;j!==null&&(F=this.getFragmentAtPosition(j,this.bitrateTest?E.fragmentEnd:E.edge,E))}return F},p.getFragmentAtPosition=function(E,v,N){var F=this.config,A=this.fragPrevious,H=N.fragments,j=N.endSN,T=N.fragmentHint,z=F.maxFragLookUpTolerance,Q=!!(F.lowLatencyMode&&N.partList&&T);Q&&T&&!this.bitrateTest&&(H=H.concat(T),j=T.sn);var ne;if(E<v){var se=E>v-z?0:z;ne=Object(c.findFragmentByPTS)(A,H,E,se)}else ne=H[H.length-1];if(ne){var xe=ne.sn-N.startSN,ge=A&&ne.level===A.level,ve=H[xe+1],Oe=this.fragmentTracker.getState(ne);if(Oe===M.FragmentState.BACKTRACKED){ne=null;for(var Re=xe;H[Re]&&this.fragmentTracker.getState(H[Re])===M.FragmentState.BACKTRACKED;)A?ne=H[Re--]:ne=H[--Re];ne||(ne=ve)}else A&&ne.sn===A.sn&&!Q&&(ge&&(ne.sn<j&&this.fragmentTracker.getState(ve)!==M.FragmentState.OK?(this.log("SN "+ne.sn+" just loaded, load next one: "+ve.sn),ne=ve):ne=null))}return ne},p.synchronizeToLiveEdge=function(E){var v=this.config,N=this.media;if(!N)return;var F=this.hls.liveSyncPosition,A=N.currentTime,H=E.fragments[0].start,j=E.edge,T=A>=H-v.maxFragLookUpTolerance&&A<=j;if(F!==null&&N.duration>F&&(A<F||!T)){var z=v.liveMaxLatencyDuration!==void 0?v.liveMaxLatencyDuration:v.liveMaxLatencyDurationCount*E.targetduration;(!T&&N.readyState<4||A<j-z)&&(this.loadedmetadata||(this.nextLoadPosition=F),N.readyState&&(this.warn("Playback: "+A.toFixed(3)+" is located too far from the end of live sliding playlist: "+j+", reset currentTime to : "+F.toFixed(3)),N.currentTime=F))}},p.alignPlaylists=function(E,v){var N=this.levels,F=this.levelLastLoaded,A=this.fragPrevious,H=F!==null?N[F]:null,j=E.fragments.length;if(!j)return this.warn("No fragments in live playlist"),0;var T=E.fragments[0].start,z=!v,Q=E.alignedSliding&&Object(V.isFiniteNumber)(T);if(z||!Q&&!T){Object(h.alignStream)(A,H,E);var ne=E.fragments[0].start;return this.log("Live playlist sliding: "+ne.toFixed(2)+" start-sn: "+(v?v.startSN:"na")+"->"+E.startSN+" prev-sn: "+(A?A.sn:"na")+" fragments: "+j),ne}return T},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 N=this.startPosition;if(N<v&&(N=-1),N===-1||this.lastCurrentTime===-1){var F=E.startTimeOffset;Object(V.isFiniteNumber)(F)?(N=v+F,F<0&&(N+=E.totalduration),N=Math.min(Math.max(v,N),v+E.totalduration),this.log("Start time offset "+F+" found in playlist, adjust startPosition to "+N),this.startPosition=N):E.live?N=this.hls.liveSyncPosition||v:this.startPosition=N=0,this.lastCurrentTime=N}this.nextLoadPosition=N},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=O.IDLE)},p.onFragmentOrKeyLoadError=function(E,v){if(v.fatal)return;var N=v.frag;if(!N||N.type!==E)return;var F=this.fragCurrent;console.assert(F&&N.sn===F.sn&&N.level===F.level&&N.urlId===F.urlId,"Frag load error must match current frag to retry");var A=this.config;if(this.fragLoadError+1<=A.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(N.level))return;var H=Math.min(Math.pow(2,this.fragLoadError)*A.fragLoadingRetryDelay,A.fragLoadingMaxRetryTimeout);this.warn("Fragment "+N.sn+" of "+E+" "+N.level+" failed to load, retrying in "+H+"ms"),this.retryDate=self.performance.now()+H,this.fragLoadError++,this.state=O.FRAG_LOADING_WAITING_RETRY}else v.levelRetry?(E===r.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=O.IDLE):(W.logger.error(v.details+" reaches max retry, redispatch as fatal ..."),v.fatal=!0,this.hls.stopLoad(),this.state=O.ERROR)},p.afterBufferFlushed=function(E,v,N){if(!E)return;var F=G.BufferHelper.getBuffered(E);this.fragmentTracker.detectEvictedFragments(v,F,N),this.state===O.ENDED&&this.resetLoadingState()},p.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=O.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,N,F){var A=this,H=N.details;console.assert(!!H,"level.details must be defined");var j=Object.keys(E.elementaryStreams).reduce(function(T,z){var Q=E.elementaryStreams[z];if(Q){var ne=Q.endPTS-Q.startPTS;if(ne<=0)return A.warn("Could not parse fragment "+E.sn+" "+z+" duration reliably ("+ne+") resetting transmuxer to fallback to playlist timing"),A.resetTransmuxer(),T||!1;var se=F?0:Object(o.updateFragPTSDTS)(H,E,Q.startPTS,Q.endPTS,Q.startDTS,Q.endDTS);return A.hls.trigger(n.Events.LEVEL_PTS_UPDATED,{details:H,level:N,drift:se,type:z,frag:E,start:Q.startPTS,end:Q.endPTS}),!0}return T},!1);j?(this.state=O.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)},S(g,[{key:"state",get:function(){return this._state},set:function(E){var v=this._state;v!==E&&(this._state=E,this.log(v+"->"+E))}}]),g}(U.default)},"./src/controller/buffer-controller.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return c});var V=P("./src/polyfills/number.ts"),U=P("./src/events.ts"),M=P("./src/utils/logger.ts"),G=P("./src/errors.ts"),W=P("./src/utils/buffer-helper.ts"),n=P("./src/utils/mediasource-helper.ts"),D=P("./src/loader/fragment.ts"),m=P("./src/controller/buffer-operation-queue.ts"),f=Object(n.getMediaSource)(),h=/([ha]vc.)(?:\.[^.,]+)+/,c=function(){function o(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,s=a.media,S=a.mediaSource;M.logger.log("[buffer-controller]: Media source opened"),s&&(a.updateMediaElementDuration(),r.trigger(U.Events.MEDIA_ATTACHED,{media:s})),S&&S.removeEventListener("sourceopen",a._onMediaSourceOpen),a.checkPendingTracks()},this._onMediaSourceClose=function(){M.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){M.logger.log("[buffer-controller]: Media source ended")},this.hls=i,this._initSourceBuffer(),this.registerListeners()}var d=o.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(U.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.on(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(U.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(U.Events.BUFFER_RESET,this.onBufferReset,this),a.on(U.Events.BUFFER_APPENDING,this.onBufferAppending,this),a.on(U.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.on(U.Events.BUFFER_EOS,this.onBufferEos,this),a.on(U.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),a.on(U.Events.LEVEL_UPDATED,this.onLevelUpdated,this),a.on(U.Events.FRAG_PARSED,this.onFragParsed,this),a.on(U.Events.FRAG_CHANGED,this.onFragChanged,this)},d.unregisterListeners=function(){var a=this.hls;a.off(U.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.off(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(U.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(U.Events.BUFFER_RESET,this.onBufferReset,this),a.off(U.Events.BUFFER_APPENDING,this.onBufferAppending,this),a.off(U.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.off(U.Events.BUFFER_EOS,this.onBufferEos,this),a.off(U.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),a.off(U.Events.LEVEL_UPDATED,this.onLevelUpdated,this),a.off(U.Events.FRAG_PARSED,this.onFragParsed,this),a.off(U.Events.FRAG_CHANGED,this.onFragChanged,this)},d._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new m.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},d.onManifestParsed=function(a,r){var s=2;(r.audio&&!r.video||!r.altAudio)&&(s=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=s,this.details=null,M.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},d.onMediaAttaching=function(a,r){var s=this.media=r.media;if(s&&f){var S=this.mediaSource=new f;S.addEventListener("sourceopen",this._onMediaSourceOpen),S.addEventListener("sourceended",this._onMediaSourceEnded),S.addEventListener("sourceclose",this._onMediaSourceClose),s.src=self.URL.createObjectURL(S),this._objectUrl=s.src}},d.onMediaDetaching=function(){var a=this.media,r=this.mediaSource,s=this._objectUrl;if(r){if(M.logger.log("[buffer-controller]: media source detaching"),r.readyState==="open")try{r.endOfStream()}catch(S){M.logger.warn("[buffer-controller]: onMediaDetaching: "+S.message+" while calling endOfStream")}this.onBufferReset(),r.removeEventListener("sourceopen",this._onMediaSourceOpen),r.removeEventListener("sourceended",this._onMediaSourceEnded),r.removeEventListener("sourceclose",this._onMediaSourceClose),a&&(s&&self.URL.revokeObjectURL(s),a.src===s?(a.removeAttribute("src"),a.load()):M.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(U.Events.MEDIA_DETACHED,void 0)},d.onBufferReset=function(){var a=this;this.getSourceBufferTypes().forEach(function(r){var s=a.sourceBuffer[r];try{s&&(a.removeBufferListeners(r),a.mediaSource&&a.mediaSource.removeSourceBuffer(s),a.sourceBuffer[r]=void 0)}catch(S){M.logger.warn("[buffer-controller]: Failed to reset the "+r+" buffer",S)}}),this._initSourceBuffer()},d.onBufferCodecs=function(a,r){var s=this,S=this.getSourceBufferTypes().length;if(Object.keys(r).forEach(function(w){if(S){var x=s.tracks[w];if(x&&typeof x.buffer.changeType=="function"){var L=r[w],O=L.codec,_=L.levelCodec,b=L.container,g=(x.levelCodec||x.codec).replace(h,"$1"),p=(_||O).replace(h,"$1");if(g!==p){var C=b+";codecs="+(_||O);s.appendChangeType(w,C)}}}else s.pendingTracks[w]=r[w]}),S)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},d.appendChangeType=function(a,r){var s=this,S=this.operationQueue,w={execute:function(){var L=s.sourceBuffer[a];L&&(M.logger.log("[buffer-controller]: changing "+a+" sourceBuffer type to "+r),L.changeType(r)),S.shiftAndExecuteNext(a)},onStart:function(){},onComplete:function(){},onError:function(L){M.logger.warn("[buffer-controller]: Failed to change "+a+" SourceBuffer type",L)}};S.append(w,a)},d.onBufferAppending=function(a,r){var s=this,S=this.hls,w=this.operationQueue,x=this.tracks,L=r.data,O=r.type,_=r.frag,b=r.part,g=r.chunkMeta,p=g.buffering[O],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 N=x.audio,F=O==="audio"&&g.id===1&&(N==null?void 0:N.container)==="audio/mpeg",A={execute:function(){if(p.executeStart=self.performance.now(),F){var j=s.sourceBuffer[O];if(j){var T=_.start-j.timestampOffset;Math.abs(T)>=.1&&(M.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+_.start+" (delta: "+T+") sn: "+_.sn+")"),j.timestampOffset=_.start)}}s.appendExecutor(L,O)},onStart:function(){},onComplete:function(){var j=self.performance.now();p.executeEnd=p.end=j,E.first===0&&(E.first=j),v&&v.first===0&&(v.first=j);var T=s.sourceBuffer,z={};for(var Q in T)z[Q]=W.BufferHelper.getBuffered(T[Q]);s.appendError=0,s.hls.trigger(U.Events.BUFFER_APPENDED,{type:O,frag:_,part:b,chunkMeta:g,parent:_.type,timeRanges:z})},onError:function(j){M.logger.error("[buffer-controller]: Error encountered while trying to append to the "+O+" SourceBuffer",j);var T={type:G.ErrorTypes.MEDIA_ERROR,parent:_.type,details:G.ErrorDetails.BUFFER_APPEND_ERROR,err:j,fatal:!1};j.code===DOMException.QUOTA_EXCEEDED_ERR?T.details=G.ErrorDetails.BUFFER_FULL_ERROR:(s.appendError++,T.details=G.ErrorDetails.BUFFER_APPEND_ERROR,s.appendError>S.config.appendErrorMaxRetry&&(M.logger.error("[buffer-controller]: Failed "+S.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),T.fatal=!0)),S.trigger(U.Events.ERROR,T)}};w.append(A,O)},d.onBufferFlushing=function(a,r){var s=this,S=this.operationQueue,w=function(L){return{execute:s.removeExecutor.bind(s,L,r.startOffset,r.endOffset),onStart:function(){},onComplete:function(){s.hls.trigger(U.Events.BUFFER_FLUSHED,{type:L})},onError:function(_){M.logger.warn("[buffer-controller]: Failed to remove from "+L+" SourceBuffer",_)}}};r.type?S.append(w(r.type),r.type):this.getSourceBufferTypes().forEach(function(x){S.append(w(x),x)})},d.onFragParsed=function(a,r){var s=this,S=r.frag,w=r.part,x=[],L=w?w.elementaryStreams:S.elementaryStreams;L[D.ElementaryStreamTypes.AUDIOVIDEO]?x.push("audiovideo"):(L[D.ElementaryStreamTypes.AUDIO]&&x.push("audio"),L[D.ElementaryStreamTypes.VIDEO]&&x.push("video"));var O=function(){var b=self.performance.now();S.stats.buffering.end=b,w&&(w.stats.buffering.end=b);var g=w?w.stats:S.stats;s.hls.trigger(U.Events.FRAG_BUFFERED,{frag:S,part:w,stats:g,id:S.type})};x.length===0&&M.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+S.type+" level: "+S.level+" sn: "+S.sn),this.blockBuffers(O,x)},d.onFragChanged=function(a,r){this.flushBackBuffer()},d.onBufferEos=function(a,r){var s=this,S=this.getSourceBufferTypes().reduce(function(w,x){var L=s.sourceBuffer[x];return(!r.type||r.type===x)&&(L&&!L.ended&&(L.ended=!0,M.logger.log("[buffer-controller]: "+x+" sourceBuffer now EOS"))),w&&!!(!L||L.ended)},!0);S&&this.blockBuffers(function(){var w=s.mediaSource;if(!w||w.readyState!=="open")return;w.endOfStream()})},d.onLevelUpdated=function(a,r){var s=r.details;if(!s.fragments.length)return;this.details=s,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},d.flushBackBuffer=function(){var a=this.hls,r=this.details,s=this.media,S=this.sourceBuffer;if(!s||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=s.currentTime,O=r.levelTargetDuration,_=Math.max(x,O),b=Math.floor(L/O)*O-_;w.forEach(function(g){var p=S[g];if(p){var C=W.BufferHelper.getBuffered(p);C.length>0&&b>C.start(0)&&(a.trigger(U.Events.BACK_BUFFER_REACHED,{bufferEnd:b}),r.live&&a.trigger(U.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:b}),a.trigger(U.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:b,type:g}))}})},d.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var a=this.details,r=this.hls,s=this.media,S=this.mediaSource,w=a.fragments[0].start+a.totalduration,x=s.duration,L=Object(V.isFiniteNumber)(S.duration)?S.duration:0;a.live&&r.config.liveDurationInfinity?(M.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),S.duration=Infinity,this.updateSeekableRange(a)):(w>L&&w>x||!Object(V.isFiniteNumber)(x))&&(M.logger.log("[buffer-controller]: Updating Media Source duration to "+w.toFixed(3)),S.duration=w)},d.updateSeekableRange=function(a){var r=this.mediaSource,s=a.fragments,S=s.length;if(S&&a.live&&r!==null&&r!==void 0&&r.setLiveSeekableRange){var w=Math.max(0,s[0].start),x=Math.max(w,w+a.totalduration);r.setLiveSeekableRange(w,x)}},d.checkPendingTracks=function(){var a=this.bufferCodecEventsExpected,r=this.operationQueue,s=this.pendingTracks,S=Object.keys(s).length;if(S&&!a||S===2){this.createSourceBuffers(s),this.pendingTracks={};var w=this.getSourceBufferTypes();if(w.length===0){this.hls.trigger(U.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.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,s=this.mediaSource;if(!s)throw Error("createSourceBuffers called when mediaSource was null");var S=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,O=x.container+";codecs="+L;M.logger.log("[buffer-controller]: creating sourceBuffer("+O+")");try{var _=r[w]=s.addSourceBuffer(O),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},S++}catch(g){M.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+g.message),this.hls.trigger(U.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:g,mimeType:O})}}S&&this.hls.trigger(U.Events.BUFFER_CREATED,{tracks:this.tracks})},d._onSBUpdateStart=function(a){var r=this.operationQueue,s=r.current(a);s.onStart()},d._onSBUpdateEnd=function(a){var r=this.operationQueue,s=r.current(a);s.onComplete(),r.shiftAndExecuteNext(a)},d._onSBUpdateError=function(a,r){M.logger.error("[buffer-controller]: "+a+" SourceBuffer error",r),this.hls.trigger(U.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var s=this.operationQueue.current(a);s&&s.onError(r)},d.removeExecutor=function(a,r,s){var S=this.media,w=this.mediaSource,x=this.operationQueue,L=this.sourceBuffer,O=L[a];if(!S||!w||!O){M.logger.warn("[buffer-controller]: Attempting to remove from the "+a+" SourceBuffer, but it does not exist"),x.shiftAndExecuteNext(a);return}var _=Object(V.isFiniteNumber)(S.duration)?S.duration:Infinity,b=Object(V.isFiniteNumber)(w.duration)?w.duration:Infinity,g=Math.max(0,r),p=Math.min(s,_,b);p>g?(M.logger.log("[buffer-controller]: Removing ["+g+","+p+"] from the "+a+" SourceBuffer"),console.assert(!O.updating,a+" sourceBuffer must not be updating"),O.remove(g,p)):x.shiftAndExecuteNext(a)},d.appendExecutor=function(a,r){var s=this.operationQueue,S=this.sourceBuffer,w=S[r];if(!w){M.logger.warn("[buffer-controller]: Attempting to append to the "+r+" SourceBuffer, but it does not exist"),s.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 s=this;if(r===void 0&&(r=this.getSourceBufferTypes()),!r.length){M.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(a);return}var S=this.operationQueue,w=r.map(function(x){return S.appendBlocker(x)});Promise.all(w).then(function(){a(),r.forEach(function(x){var L=s.sourceBuffer[x];(!L||!L.updating)&&S.shiftAndExecuteNext(x)})})},d.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},d.addBufferListener=function(a,r,s){var S=this.sourceBuffer[a];if(!S)return;var w=s.bind(this,a);this.listeners[a].push({event:r,listener:w}),S.addEventListener(r,w)},d.removeBufferListeners=function(a){var r=this.sourceBuffer[a];if(!r)return;this.listeners[a].forEach(function(s){r.removeEventListener(s.event,s.listener)})},o}()},"./src/controller/buffer-operation-queue.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return U});var V=P("./src/utils/logger.ts"),U=function(){function M(W){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=W}var G=M.prototype;return G.append=function(n,D){var m=this.queues[D];m.push(n),m.length===1&&this.buffers[D]&&this.executeNext(D)},G.insertAbort=function(n,D){var m=this.queues[D];m.unshift(n),this.executeNext(D)},G.appendBlocker=function(n){var D,m=new Promise(function(h){D=h}),f={execute:D,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(f,n),m},G.executeNext=function(n){var D=this.buffers,m=this.queues,f=D[n],h=m[n];if(h.length){var c=h[0];try{c.execute()}catch(o){V.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),c.onError(o),(!f||!f.updating)&&(h.shift(),this.executeNext(n))}}},G.shiftAndExecuteNext=function(n){this.queues[n].shift(),this.executeNext(n)},G.current=function(n){return this.queues[n][0]},M}()},"./src/controller/cap-level-controller.ts":function(Z,X,P){"use strict";P.r(X);var V=P("./src/events.ts");function U(W,n){for(var D=0;D<n.length;D++){var m=n[D];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(W,m.key,m)}}function M(W,n,D){return n&&U(W.prototype,n),D&&U(W,D),W}var G=function(){function W(D){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=D,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(m){this.streamController=m},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 m=this.hls;m.on(V.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),m.on(V.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),m.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),m.on(V.Events.BUFFER_CODECS,this.onBufferCodecs,this),m.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.unregisterListener=function(){var m=this.hls;m.off(V.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),m.off(V.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),m.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),m.off(V.Events.BUFFER_CODECS,this.onBufferCodecs,this),m.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.onFpsDropLevelCapping=function(m,f){W.isLevelAllowed(f.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(f.droppedLevel)},n.onMediaAttaching=function(m,f){this.media=f.media instanceof HTMLVideoElement?f.media:null},n.onManifestParsed=function(m,f){var h=this.hls;this.restrictedLevels=[],this.firstLevel=f.firstLevel,h.config.capLevelToPlayerSize&&f.video&&this.startCapping()},n.onBufferCodecs=function(m,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 m=this.hls.levels;if(m.length){var f=this.hls;f.autoLevelCapping=this.getMaxLevel(m.length-1),f.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=f.autoLevelCapping}}},n.getMaxLevel=function(m){var f=this,h=this.hls.levels;if(!h.length)return-1;var c=h.filter(function(o,d){return W.isLevelAllowed(d,f.restrictedLevels)&&d<=m});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 m=this.media,f={width:0,height:0};if(m){var h=m.getBoundingClientRect();f.width=h.width,f.height=h.height,!f.width&&!f.height&&(f.width=h.right-h.left||m.width||0,f.height=h.bottom-h.top||m.height||0)}return this.clientRect=f,f},W.isLevelAllowed=function(m,f){return f===void 0&&(f=[]),f.indexOf(m)===-1},W.getMaxLevelByMediaSize=function(m,f,h){if(!m||!m.length)return-1;for(var c=function(r,s){return s?r.width!==s.width||r.height!==s.height:!0},o=m.length-1,d=0;d<m.length;d+=1){var i=m[d];if((i.width>=f||i.height>=h)&&c(i,m[d+1])){o=d;break}}return o},M(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 m=1;try{m=self.devicePixelRatio}catch(f){}return m}}]),W}();X.default=G},"./src/controller/cmcd-controller.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return c});var V=P("./src/events.ts"),U=P("./src/types/cmcd.ts"),M=P("./src/utils/buffer-helper.ts"),G=P("./src/utils/logger.ts");function W(o,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(o,a.key,a)}}function n(o,d,i){return d&&W(o.prototype,d),i&&W(o,i),o}function D(o,d){var i=typeof Symbol!="undefined"&&o[Symbol.iterator]||o["@@iterator"];if(i)return(i=i.call(o)).next.bind(i);if(Array.isArray(o)||(i=m(o))||d&&o&&typeof o.length=="number"){i&&(o=i);var a=0;return function(){return a>=o.length?{done:!0}:{done:!1,value:o[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 m(o,d){if(!o)return;if(typeof o=="string")return f(o,d);var i=Object.prototype.toString.call(o).slice(8,-1);if(i==="Object"&&o.constructor&&(i=o.constructor.name),i==="Map"||i==="Set")return Array.from(o);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return f(o,d)}function f(o,d){(d==null||d>o.length)&&(d=o.length);for(var i=0,a=new Array(d);i<d;i++)a[i]=o[i];return a}function h(){return h=Object.assign||function(o){for(var d=1;d<arguments.length;d++){var i=arguments[d];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(o[a]=i[a])}return o},h.apply(this,arguments)}var c=function(){function o(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(S){try{a.apply(S,{ot:U.CMCDObjectType.MANIFEST,su:!a.initialized})}catch(w){G.logger.warn("Could not generate manifest CMCD data.",w)}},this.applyFragmentData=function(S){try{var w=S.frag,x=a.hls.levels[w.level],L=a.getObjectType(w),O={d:w.duration*1e3,ot:L};(L===U.CMCDObjectType.VIDEO||L===U.CMCDObjectType.AUDIO||L==U.CMCDObjectType.MUXED)&&(O.br=x.bitrate/1e3,O.tb=a.getTopBandwidth(L),O.bl=a.getBufferLength(L)),a.apply(S,O)}catch(_){G.logger.warn("Could not generate segment CMCD data.",_)}},this.hls=i;var r=this.config=i.config,s=r.cmcd;s!=null&&(r.pLoader=this.createPlaylistLoader(),r.fLoader=this.createFragmentLoader(),this.sid=s.sessionId||o.uuid(),this.cid=s.contentId,this.useHeaders=s.useHeaders===!0,this.registerListeners())}var d=o.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 s,S;this.audioBuffer=(s=r.tracks.audio)===null||s===void 0?void 0:s.buffer,this.videoBuffer=(S=r.tracks.video)===null||S===void 0?void 0:S.buffer},d.createData=function(){var a;return{v:U.CMCDVersion,sf:U.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 s=r.ot===U.CMCDObjectType.INIT||r.ot===U.CMCDObjectType.VIDEO||r.ot===U.CMCDObjectType.MUXED;if(this.starved&&s&&(r.bs=!0,r.su=!0,this.starved=!1),r.su==null&&(r.su=this.buffering),this.useHeaders){var S=o.toHeaders(r);if(!Object.keys(S).length)return;a.headers||(a.headers={}),h(a.headers,S)}else{var w=o.toQuery(r);if(!w)return;a.url=o.appendQueryToUri(a.url,w)}},d.getObjectType=function(a){var r=a.type;return r==="subtitle"?U.CMCDObjectType.TIMED_TEXT:a.sn==="initSegment"?U.CMCDObjectType.INIT:r==="audio"?U.CMCDObjectType.AUDIO:r==="main"?this.hls.audioTracks.length?U.CMCDObjectType.VIDEO:U.CMCDObjectType.MUXED:void 0},d.getTopBandwidth=function(a){for(var r=0,s=a===U.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,S=D(s),w;!(w=S()).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,s=a===U.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!s||!r)return NaN;var S=M.BufferHelper.bufferInfo(s,r.currentTime,this.config.maxBufferHole);return S.len*1e3},d.createPlaylistLoader=function(){var a=this.config.pLoader,r=this.applyPlaylistData,s=a||this.config.loader;return function(){function S(x){this.loader=void 0,this.loader=new s(x)}var w=S.prototype;return w.destroy=function(){this.loader.destroy()},w.abort=function(){this.loader.abort()},w.load=function(L,O,_){r(L),this.loader.load(L,O,_)},n(S,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),S}()},d.createFragmentLoader=function(){var a=this.config.fLoader,r=this.applyFragmentData,s=a||this.config.loader;return function(){function S(x){this.loader=void 0,this.loader=new s(x)}var w=S.prototype;return w.destroy=function(){this.loader.destroy()},w.abort=function(){this.loader.abort()},w.load=function(L,O,_){r(L),this.loader.load(L,O,_)},n(S,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),S}()},o.uuid=function(){var a=URL.createObjectURL(new Blob),r=a.toString();return URL.revokeObjectURL(a),r.substr(r.lastIndexOf("/")+1)},o.serialize=function(a){for(var r=[],s=function(F){return!Number.isNaN(F)&&F!=null&&F!==""&&F!==!1},S=function(F){return Math.round(F)},w=function(F){return S(F/100)*100},x=function(F){return encodeURIComponent(F)},L={br:S,d:S,bl:w,dl:w,mtp:w,nor:x,rtp:w,tb:S},O=Object.keys(a||{}).sort(),_=D(O),b;!(b=_()).done;){var g=b.value,p=a[g];if(!s(p))continue;if(g==="v"&&p===1)continue;if(g=="pr"&&p===1)continue;var C=L[g];C&&(p=C(p));var E=typeof p,v=void 0;g==="ot"||g==="sf"||g==="st"?v=g+"="+p:E==="boolean"?v=g:E==="number"?v=g+"="+p:v=g+"="+JSON.stringify(p),r.push(v)}return r.join(",")},o.toHeaders=function(a){for(var r=Object.keys(a),s={},S=["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,O=r;L<O.length;L++){var _=O[L],b=x[_]!=null?x[_]:1;w[b][_]=a[_]}for(var g=0;g<w.length;g++){var p=o.serialize(w[g]);p&&(s["CMCD-"+S[g]]=p)}return s},o.toQuery=function(a){return"CMCD="+encodeURIComponent(o.serialize(a))},o.appendQueryToUri=function(a,r){if(!r)return a;var s=a.includes("?")?"&":"?";return""+a+s+r},o}()},"./src/controller/eme-controller.ts":function(Z,X,P){"use strict";P.r(X);var V=P("./src/events.ts"),U=P("./src/errors.ts"),M=P("./src/utils/logger.ts"),G=P("./src/utils/mediakeys-helper.ts");function W(c,o){for(var d=0;d<o.length;d++){var i=o[d];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(c,i.key,i)}}function n(c,o,d){return o&&W(c.prototype,o),d&&W(c,d),c}var D=3,m=function(o,d,i){var a={audioCapabilities:[],videoCapabilities:[]};return o.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(o,d,i,a){switch(o){case G.KeySystems.WIDEVINE:return m(d,i,a);default:throw new Error("Unknown key-system: "+o)}},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 o=c.prototype;return o.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},o._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)},o._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)},o.getLicenseServerUrl=function(i){switch(i){case G.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+i+'"')},o._attemptKeySystemAccess=function(i,a,r){var s=this,S=f(i,a,r,this._drmSystemOptions);M.logger.log("Requesting encrypted media key-system access");var w=this.requestMediaKeySystemAccess(i,S);this.mediaKeysPromise=w.then(function(x){return s._onMediaKeySystemAccessObtained(i,x)}),w.catch(function(x){M.logger.error('Failed to obtain key-system "'+i+'" access:',x)})},o._onMediaKeySystemAccessObtained=function(i,a){var r=this;M.logger.log('Access for key-system "'+i+'" obtained');var s={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:a,mediaKeySystemDomain:i};this._mediaKeysList.push(s);var S=Promise.resolve().then(function(){return a.createMediaKeys()}).then(function(w){return s.mediaKeys=w,M.logger.log('Media-keys created for key-system "'+i+'"'),r._onMediaKeysCreated(),w});return S.catch(function(w){M.logger.error("Failed to create media-keys:",w)}),S},o._onMediaKeysCreated=function(){var i=this;this._mediaKeysList.forEach(function(a){a.mediaKeysSession||(a.mediaKeysSession=a.mediaKeys.createSession(),i._onNewMediaKeySession(a.mediaKeysSession))})},o._onNewMediaKeySession=function(i){var a=this;M.logger.log("New key-system session "+i.sessionId),i.addEventListener("message",function(r){a._onKeySessionMessage(i,r.message)},!1)},o._onKeySessionMessage=function(i,a){M.logger.log("Got EME message event, creating license request"),this._requestLicense(a,function(r){M.logger.log("Received license data (length: "+(r&&r.byteLength)+"), updating key-session"),i.update(r)})},o.onMediaEncrypted=function(i){var a=this;if(M.logger.log('Media is encrypted using "'+i.initDataType+'" init data type'),!this.mediaKeysPromise){M.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(V.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var r=function(S){if(!a._media)return;a._attemptSetMediaKeys(S),a._generateRequestWithPreferredKeySession(i.initDataType,i.initData)};this.mediaKeysPromise.then(r).catch(r)},o._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){M.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(V.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}M.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(a.mediaKeys),this._hasSetMediaKeys=!0}},o._generateRequestWithPreferredKeySession=function(i,a){var r=this,s=this._mediaKeysList[0];if(!s){M.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(V.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(s.mediaKeysSessionInitialized){M.logger.warn("Key-Session already initialized but requested again");return}var S=s.mediaKeysSession;if(!S){M.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(V.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!a){M.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(V.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}M.logger.log('Generating key-session request for "'+i+'" init data type'),s.mediaKeysSessionInitialized=!0,S.generateRequest(i,a).then(function(){M.logger.debug("Key-session generation succeeded")}).catch(function(w){M.logger.error("Error generating key-session request:",w),r.hls.trigger(V.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},o._createLicenseXhr=function(i,a,r){var s=new XMLHttpRequest;s.responseType="arraybuffer",s.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,s,i,a,r);var S=this._licenseXhrSetup;if(S)try{S.call(this.hls,s,i),S=void 0}catch(w){M.logger.error(w)}try{s.readyState||s.open("POST",i,!0),S&&S.call(this.hls,s,i)}catch(w){throw new Error("issue setting up KeySystem license XHR "+w)}return s},o._onLicenseRequestReadyStageChange=function(i,a,r,s){switch(i.readyState){case 4:if(i.status===200){this._requestLicenseFailureCount=0,M.logger.log("License request succeeded");var S=i.response,w=this._licenseResponseCallback;if(w)try{S=w.call(this.hls,i,a)}catch(L){M.logger.error(L)}s(S)}else{if(M.logger.error("License Request XHR failed ("+a+"). Status: "+i.status+" ("+i.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>D){this.hls.trigger(V.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var x=D-this._requestLicenseFailureCount+1;M.logger.warn("Retrying license request, "+x+" attempts left"),this._requestLicense(r,s)}break}},o._generateLicenseRequestChallenge=function(i,a){switch(i.mediaKeySystemDomain){case G.KeySystems.WIDEVINE:return a}throw new Error("unsupported key-system: "+i.mediaKeySystemDomain)},o._requestLicense=function(i,a){M.logger.log("Requesting content license for key-system");var r=this._mediaKeysList[0];if(!r){M.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(V.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var s=this.getLicenseServerUrl(r.mediaKeySystemDomain),S=this._createLicenseXhr(s,i,a);M.logger.log("Sending license request to URL: "+s);var w=this._generateLicenseRequestChallenge(r,i);S.send(w)}catch(x){M.logger.error("Failure requesting DRM license: "+x),this.hls.trigger(V.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},o.onMediaAttached=function(i,a){if(!this._emeEnabled)return;var r=a.media;this._media=r,r.addEventListener("encrypted",this._onMediaEncrypted)},o.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(){})},o.onManifestParsed=function(i,a){if(!this._emeEnabled)return;var r=a.levels.map(function(S){return S.audioCodec}).filter(function(S){return!!S}),s=a.levels.map(function(S){return S.videoCodec}).filter(function(S){return!!S});this._attemptKeySystemAccess(G.KeySystems.WIDEVINE,r,s)},n(c,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),c}();X.default=h},"./src/controller/fps-controller.ts":function(Z,X,P){"use strict";P.r(X);var V=P("./src/events.ts"),U=P("./src/utils/logger.ts"),M=function(){function G(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=G.prototype;return W.setStreamController=function(D){this.streamController=D},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(D,m){var f=this.hls.config;if(f.capLevelOnFPSDrop){var h=m.media instanceof self.HTMLVideoElement?m.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(D,m,f){var h=performance.now();if(m){if(this.lastTime){var c=h-this.lastTime,o=f-this.lastDroppedFrames,d=m-this.lastDecodedFrames,i=1e3*o/c,a=this.hls;if(a.trigger(V.Events.FPS_DROP,{currentDropped:o,currentDecoded:d,totalDroppedFrames:f}),i>0&&o>a.config.fpsDroppedMonitoringThreshold*d){var r=a.currentLevel;U.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=m}},W.checkFPSInterval=function(){var D=this.media;if(D)if(this.isVideoPlaybackQualityAvailable){var m=D.getVideoPlaybackQuality();this.checkFPS(D,m.totalVideoFrames,m.droppedVideoFrames)}else this.checkFPS(D,D.webkitDecodedFrameCount,D.webkitDroppedFrameCount)},G}();X.default=M},"./src/controller/fragment-finders.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"findFragmentByPDT",function(){return M}),P.d(X,"findFragmentByPTS",function(){return G}),P.d(X,"fragmentWithinToleranceTest",function(){return W}),P.d(X,"pdtWithinToleranceTest",function(){return n}),P.d(X,"findFragWithCC",function(){return D});var V=P("./src/polyfills/number.ts"),U=P("./src/utils/binary-search.ts");function M(m,f,h){if(f===null||!Array.isArray(m)||!m.length||!Object(V.isFiniteNumber)(f))return null;var c=m[0].programDateTime;if(f<(c||0))return null;var o=m[m.length-1].endProgramDateTime;if(f>=(o||0))return null;h=h||0;for(var d=0;d<m.length;++d){var i=m[d];if(n(f,h,i))return i}return null}function G(m,f,h,c){h===void 0&&(h=0),c===void 0&&(c=0);var o=null;if(m?o=f[m.sn-f[0].sn+1]||null:h===0&&f[0].start===0&&(o=f[0]),o&&W(h,c,o)===0)return o;var d=U.default.search(f,W.bind(null,h,c));return d||o}function W(m,f,h){m===void 0&&(m=0),f===void 0&&(f=0);var c=Math.min(f,h.duration+(h.deltaPTS?h.deltaPTS:0));return h.start+h.duration-c<=m?1:h.start-c>m&&h.start?-1:0}function n(m,f,h){var c=Math.min(f,h.duration+(h.deltaPTS?h.deltaPTS:0))*1e3,o=h.endProgramDateTime||0;return o-c>m}function D(m,f){return U.default.search(m,function(h){return h.cc<f?1:h.cc>f?-1:0})}},"./src/controller/fragment-tracker.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"FragmentState",function(){return M}),P.d(X,"FragmentTracker",function(){return G});var V=P("./src/events.ts"),U=P("./src/types/loader.ts"),M;(function(D){D.NOT_LOADED="NOT_LOADED",D.BACKTRACKED="BACKTRACKED",D.APPENDING="APPENDING",D.PARTIAL="PARTIAL",D.OK="OK"})(M||(M={}));var G=function(){function D(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 m=D.prototype;return m._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)},m._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)},m.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},m.getAppendedFrag=function(h,c){if(c===U.PlaylistLevelType.MAIN){var o=this.activeFragment,d=this.activeParts;if(!o)return null;if(d)for(var i=d.length;i--;){var a=d[i],r=a?a.end:o.appendedPTS;if(a.start<=h&&r!==void 0&&h<=r)return i>9&&(this.activeParts=d.slice(i-9)),a}else if(o.start<=h&&o.appendedPTS!==void 0&&h<=o.appendedPTS)return o}return this.getBufferedFrag(h,c)},m.getBufferedFrag=function(h,c){for(var o=this.fragments,d=Object.keys(o),i=d.length;i--;){var a=o[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},m.detectEvictedFragments=function(h,c,o){var d=this;Object.keys(this.fragments).forEach(function(i){var a=d.fragments[i];if(!a)return;if(!a.buffered){a.body.type===o&&d.removeFragment(a.body);return}var r=a.range[h];if(!r)return;r.time.some(function(s){var S=!d.isTimeBuffered(s.startPTS,s.endPTS,c);return S&&d.removeFragment(a.body),S})})},m.detectPartialFragments=function(h){var c=this,o=this.timeRanges,d=h.frag,i=h.part;if(!o||d.sn==="initSegment")return;var a=n(d),r=this.fragments[a];if(!r)return;Object.keys(o).forEach(function(s){var S=d.elementaryStreams[s];if(!S)return;var w=o[s],x=i!==null||S.partial===!0;r.range[s]=c.getBufferedTimes(d,i,x,w)}),r.backtrack=r.loaded=null,Object.keys(r.range).length?r.buffered=!0:this.removeFragment(r.body)},m.fragBuffered=function(h){var c=n(h),o=this.fragments[c];o&&(o.backtrack=o.loaded=null,o.buffered=!0)},m.getBufferedTimes=function(h,c,o,d){for(var i={time:[],partial:o},a=c?c.start:h.start,r=c?c.end:h.end,s=h.minEndPTS||r,S=h.maxStartPTS||a,w=0;w<d.length;w++){var x=d.start(w)-this.bufferPadding,L=d.end(w)+this.bufferPadding;if(S>=x&&s<=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},m.getPartialFragment=function(h){var c=null,o,d,i,a=0,r=this.bufferPadding,s=this.fragments;return Object.keys(s).forEach(function(S){var w=s[S];if(!w)return;W(w)&&(d=w.body.start-r,i=w.body.end+r,h>=d&&h<=i&&(o=Math.min(h-d,i-h),a<=o&&(c=w.body,a=o)))}),c},m.getState=function(h){var c=n(h),o=this.fragments[c];return o?o.buffered?W(o)?M.PARTIAL:M.OK:o.backtrack?M.BACKTRACKED:M.APPENDING:M.NOT_LOADED},m.backtrack=function(h,c){var o=n(h),d=this.fragments[o];if(!d||d.backtrack)return null;var i=d.backtrack=c||d.loaded;return d.loaded=null,i},m.getBacktrackData=function(h){var c=n(h),o=this.fragments[c];if(o){var d,i=o.backtrack;if(i!=null&&(d=i.payload)!==null&&d!==void 0&&d.byteLength)return i;this.removeFragment(h)}return null},m.isTimeBuffered=function(h,c,o){for(var d,i,a=0;a<o.length;a++){if(d=o.start(a)-this.bufferPadding,i=o.end(a)+this.bufferPadding,h>=d&&c<=i)return!0;if(c<=d)return!1}return!1},m.onFragLoaded=function(h,c){var o=c.frag,d=c.part;if(o.sn==="initSegment"||o.bitrateTest||d)return;var i=n(o);this.fragments[i]={body:o,loaded:c,backtrack:null,buffered:!1,range:Object.create(null)}},m.onBufferAppended=function(h,c){var o=this,d=c.frag,i=c.part,a=c.timeRanges;if(d.type===U.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(s){var S=a[s];if(o.detectEvictedFragments(s,S),!i)for(var w=0;w<S.length;w++)d.appendedPTS=Math.max(S.end(w),d.appendedPTS||0)})},m.onFragBuffered=function(h,c){this.detectPartialFragments(c)},m.hasFragment=function(h){var c=n(h);return!!this.fragments[c]},m.removeFragmentsInRange=function(h,c,o){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===o&&r.start<c&&r.end>h&&d.removeFragment(r)}})},m.removeFragment=function(h){var c=n(h);h.stats.loaded=0,h.clearElementaryStreamInfo(),delete this.fragments[c]},m.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},D}();function W(D){var m,f;return D.buffered&&(((m=D.range.video)===null||m===void 0?void 0:m.partial)||((f=D.range.audio)===null||f===void 0?void 0:f.partial))}function n(D){return D.type+"_"+D.level+"_"+D.urlId+"_"+D.sn}},"./src/controller/gap-controller.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"STALL_MINIMUM_DURATION_MS",function(){return W}),P.d(X,"MAX_START_GAP_JUMP",function(){return n}),P.d(X,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return D}),P.d(X,"SKIP_BUFFER_RANGE_START",function(){return m}),P.d(X,"default",function(){return f});var V=P("./src/utils/buffer-helper.ts"),U=P("./src/errors.ts"),M=P("./src/events.ts"),G=P("./src/utils/logger.ts"),W=250,n=2,D=.1,m=.05,f=function(){function h(o,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=o,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,s=a.currentTime,S=a.seeking,w=this.seeking&&!S,x=!this.seeking&&S;if(this.seeking=S,s!==d){if(this.moved=!0,r!==null){if(this.stallReported){var L=self.performance.now()-r;G.logger.warn("playback not stuck anymore @"+s+", 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 O=V.BufferHelper.bufferInfo(a,s,0),_=O.len>0,b=O.nextStart||0;if(!_&&!b)return;if(S){var g=O.len>n,p=!b||b-s>n&&!this.fragmentTracker.getPartialFragment(s);if(g||p)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var C,E=Math.max(b,O.start||0)-s,v=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,N=v==null||((C=v.details)===null||C===void 0)?void 0:C.live,F=N?v.details.targetduration*2:n;if(E>0&&E<=F){this._trySkipBufferHole(null);return}}var A=self.performance.now();if(r===null){this.stalled=A;return}var H=A-r;!S&&H>=W&&this._reportStall(O.len);var j=V.BufferHelper.bufferInfo(a,s,i.maxBufferHole);this._tryFixBufferStall(j,H)},c._tryFixBufferStall=function(d,i){var a=this.config,r=this.fragmentTracker,s=this.media,S=s.currentTime,w=r.getPartialFragment(S);if(w){var x=this._trySkipBufferHole(w);if(x)return}d.len>a.maxBufferHole&&i>a.highBufferWatchdogPeriod*1e3&&(G.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,G.logger.warn("Playback stalling at @"+a.currentTime+" due to low buffer (buffer="+d+")"),i.trigger(M.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:d}))},c._trySkipBufferHole=function(d){for(var i=this.config,a=this.hls,r=this.media,s=r.currentTime,S=0,w=V.BufferHelper.getBuffered(r),x=0;x<w.length;x++){var L=w.start(x);if(s+i.maxBufferHole>=S&&s<L){var O=Math.max(L+m,r.currentTime+D);return G.logger.warn("skipping hole, adjusting currentTime from "+s+" to "+O),this.moved=!0,this.stalled=null,r.currentTime=O,d&&a.trigger(M.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+s+" to "+O,frag:d}),O}S=w.end(x)}return 0},c._tryNudgeBuffer=function(){var d=this.config,i=this.hls,a=this.media,r=a.currentTime,s=(this.nudgeRetry||0)+1;if(this.nudgeRetry=s,s<d.nudgeMaxRetry){var S=r+s*d.nudgeOffset;G.logger.warn("Nudging 'currentTime' from "+r+" to "+S),a.currentTime=S,i.trigger(M.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else G.logger.error("Playhead still not moving while enough data buffered @"+r+" after "+d.nudgeMaxRetry+" nudges"),i.trigger(M.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},h}()},"./src/controller/id3-track-controller.ts":function(Z,X,P){"use strict";P.r(X);var V=P("./src/events.ts"),U=P("./src/utils/texttrack-utils.ts"),M=P("./src/demux/id3.ts"),G=.25,W=function(){function n(m){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=m,this._registerListeners()}var D=n.prototype;return D.destroy=function(){this._unregisterListeners()},D._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)},D._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)},D.onMediaAttached=function(f,h){this.media=h.media},D.onMediaDetaching=function(){if(!this.id3Track)return;Object(U.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},D.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(U.sendAddTrackEvent)(c,this.media),c}return this.media.addTextTrack("metadata","id3")},D.onFragParsingMetadata=function(f,h){if(!this.media)return;var c=h.frag,o=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<o.length;i++){var a=M.getID3Frames(o[i].data);if(a){var r=o[i].pts,s=i<o.length-1?o[i+1].pts:c.end,S=s-r;S<=0&&(s=r+G);for(var w=0;w<a.length;w++){var x=a[w];if(!M.isTimeStampFrame(x)){var L=new d(r,s,"");L.value=x,this.id3Track.addCue(L)}}}}},D.onBufferFlushing=function(f,h){var c=h.startOffset,o=h.endOffset,d=h.type;if(!d||d==="audio"){var i=this.id3Track;i&&Object(U.removeCuesInRange)(i,c,o)}},n}();X.default=W},"./src/controller/latency-controller.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return n});var V=P("./src/errors.ts"),U=P("./src/events.ts"),M=P("./src/utils/logger.ts");function G(D,m){for(var f=0;f<m.length;f++){var h=m[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(D,h.key,h)}}function W(D,m,f){return m&&G(D.prototype,m),f&&G(D,f),D}var n=function(){function D(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 m=D.prototype;return m.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},m.registerListeners=function(){this.hls.on(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(U.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(U.Events.ERROR,this.onError,this)},m.unregisterListeners=function(){this.hls.off(U.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(U.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(U.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(U.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(U.Events.ERROR,this.onError)},m.onMediaAttached=function(h,c){this.media=c.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},m.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},m.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},m.onLevelUpdated=function(h,c){var o=c.details;this.levelDetails=o,o.advanced&&this.timeupdate(),!o.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},m.onError=function(h,c){if(c.details!==V.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,M.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},m.timeupdate=function(){var h=this.media,c=this.levelDetails;if(!h||!c)return;this.currentTime=h.currentTime;var o=this.computeLatency();if(o===null)return;this._latency=o;var d=this.config,i=d.lowLatencyMode,a=d.maxLiveSyncPlaybackRate;if(!i||a===1)return;var r=this.targetLatency;if(r===null)return;var s=o-r,S=Math.min(this.maxLatency,r+c.targetduration),w=s<S;if(c.live&&w&&s>.05&&this.forwardBufferLength>1){var x=Math.min(2,Math.max(1,a)),L=Math.round(2/(1+Math.exp(-.75*s-this.edgeStalled))*20)/20;h.playbackRate=Math.min(x,Math.max(1,L))}else h.playbackRate!==1&&h.playbackRate!==0&&(h.playbackRate=1)},m.estimateLiveEdge=function(){var h=this.levelDetails;return h===null?null:h.edge+h.age},m.computeLatency=function(){var h=this.estimateLiveEdge();return h===null?null:h-this.currentTime},W(D,[{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,o=h.partHoldBack,d=h.targetduration,i=this.config,a=i.liveSyncDuration,r=i.liveSyncDurationCount,s=i.lowLatencyMode,S=this.hls.userConfig,w=s&&o||c;(S.liveSyncDuration||S.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,o=this.levelDetails;if(h===null||c===null||o===null)return null;var d=o.edge,i=h-c-this.edgeStalled,a=d-o.totalduration,r=d-(this.config.lowLatencyMode&&o.partTarget||o.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 o=h.buffered.length;return o?h.buffered.end(o-1):c.edge-this.currentTime}}]),D}()},"./src/controller/level-controller.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return i});var V=P("./src/types/level.ts"),U=P("./src/events.ts"),M=P("./src/errors.ts"),G=P("./src/utils/codecs.ts"),W=P("./src/controller/level-helper.ts"),n=P("./src/controller/base-playlist-controller.ts"),D=P("./src/types/loader.ts");function m(){return m=Object.assign||function(a){for(var r=1;r<arguments.length;r++){var s=arguments[r];for(var S in s)Object.prototype.hasOwnProperty.call(s,S)&&(a[S]=s[S])}return a},m.apply(this,arguments)}function f(a,r){for(var s=0;s<r.length;s++){var S=r[s];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(a,S.key,S)}}function h(a,r,s){return r&&f(a.prototype,r),s&&f(a,s),a}function c(a,r){a.prototype=Object.create(r.prototype),a.prototype.constructor=a,o(a,r)}function o(a,r){return o=Object.setPrototypeOf||function(S,w){return S.__proto__=w,S},o(a,r)}var d=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),i=function(a){c(r,a);function r(S){var w;return w=a.call(this,S,"[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 s=r.prototype;return s._registerListeners=function(){var w=this.hls;w.on(U.Events.MANIFEST_LOADED,this.onManifestLoaded,this),w.on(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.on(U.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),w.on(U.Events.FRAG_LOADED,this.onFragLoaded,this),w.on(U.Events.ERROR,this.onError,this)},s._unregisterListeners=function(){var w=this.hls;w.off(U.Events.MANIFEST_LOADED,this.onManifestLoaded,this),w.off(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.off(U.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),w.off(U.Events.FRAG_LOADED,this.onFragLoaded,this),w.off(U.Events.ERROR,this.onError,this)},s.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,a.prototype.destroy.call(this)},s.startLoad=function(){var w=this._levels;w.forEach(function(x){x.loadError=0}),a.prototype.startLoad.call(this)},s.onManifestLoaded=function(w,x){var L=[],O=[],_=[],b,g={},p,C=!1,E=!1,v=!1;if(x.levels.forEach(function(H){var j=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 T=H.bitrate+"-"+H.attrs.RESOLUTION+"-"+H.attrs.CODECS;p=g[T],p?p.url.push(H.url):(p=new V.Level(H),g[T]=p,L.push(p)),j&&(j.AUDIO&&Object(W.addGroupId)(p,"audio",j.AUDIO),j.SUBTITLES&&Object(W.addGroupId)(p,"text",j.SUBTITLES))}),(C||E)&&v&&(L=L.filter(function(H){var j=H.videoCodec,T=H.width,z=H.height;return!!j||!!(T&&z)})),L=L.filter(function(H){var j=H.audioCodec,T=H.videoCodec;return(!j||Object(G.isCodecSupportedInMp4)(j,"audio"))&&(!T||Object(G.isCodecSupportedInMp4)(T,"video"))}),x.audioTracks&&(O=x.audioTracks.filter(function(H){return!H.audioCodec||Object(G.isCodecSupportedInMp4)(H.audioCodec,"audio")}),Object(W.assignTrackIdsByGroup)(O)),x.subtitles&&(_=x.subtitles,Object(W.assignTrackIdsByGroup)(_)),L.length>0){b=L[0].bitrate,L.sort(function(H,j){return H.bitrate-j.bitrate}),this._levels=L;for(var N=0;N<L.length;N++)if(L[N].bitrate===b){this._firstLevel=N,this.log("manifest loaded, "+L.length+" level(s) found, first bitrate: "+b);break}var F=v&&!E,A={levels:L,audioTracks:O,subtitleTracks:_,firstLevel:this._firstLevel,stats:x.stats,audio:v,video:E,altAudio:!F&&O.some(function(H){return!!H.url})};this.hls.trigger(U.Events.MANIFEST_PARSED,A),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(U.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:x.url,reason:"no level with compatible codecs found in manifest"})},s.onError=function(w,x){if(a.prototype.onError.call(this,w,x),x.fatal)return;var L=x.context,O=this._levels[this.currentLevelIndex];if(L&&(L.type===D.PlaylistContextType.AUDIO_TRACK&&O.audioGroupIds&&L.groupId===O.audioGroupIds[O.urlId]||L.type===D.PlaylistContextType.SUBTITLE_TRACK&&O.textGroupIds&&L.groupId===O.textGroupIds[O.urlId])){this.redundantFailover(this.currentLevelIndex);return}var _=!1,b=!0,g;switch(x.details){case M.ErrorDetails.FRAG_LOAD_ERROR:case M.ErrorDetails.FRAG_LOAD_TIMEOUT:case M.ErrorDetails.KEY_LOAD_ERROR:case M.ErrorDetails.KEY_LOAD_TIMEOUT:if(x.frag){var p=this._levels[x.frag.level];p?(p.fragmentError++,p.fragmentError>this.hls.config.fragLoadingMaxRetry&&(g=x.frag.level)):g=x.frag.level}break;case M.ErrorDetails.LEVEL_LOAD_ERROR:case M.ErrorDetails.LEVEL_LOAD_TIMEOUT:L&&(L.deliveryDirectives&&(b=!1),g=L.level),_=!0;break;case M.ErrorDetails.REMUX_ALLOC_ERROR:g=x.level,_=!0;break}g!==void 0&&this.recoverLevel(x,g,_,b)},s.recoverLevel=function(w,x,L,O){var _=w.details,b=this._levels[x];if(b.loadError++,L){var g=this.retryLoadingOrFail(w);if(g)w.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(O){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)}}},s.redundantFailover=function(w){var x=this._levels[w],L=x.url.length;if(L>1){var O=(x.urlId+1)%L;this.warn("Switching to redundant URL-id "+O),this._levels.forEach(function(_){_.urlId=O}),this.level=w}},s.onFragLoaded=function(w,x){var L=x.frag;if(L!==void 0&&L.type===D.PlaylistLevelType.MAIN){var O=this._levels[L.level];O!==void 0&&(O.fragmentError=0,O.loadError=0)}},s.onLevelLoaded=function(w,x){var L,O=x.level,_=x.details,b=this._levels[O];if(!b){var g;this.warn("Invalid level index "+O),(g=x.deliveryDirectives)!==null&&g!==void 0&&g.skip&&(_.deltaUpdateFailed=!0);return}O===this.currentLevelIndex?(b.fragmentError===0&&(b.loadError=0,this.retryCount=0),this.playlistLoaded(O,x,b.details)):(L=x.deliveryDirectives)!==null&&L!==void 0&&L.skip&&(_.deltaUpdateFailed=!0)},s.onAudioTrackSwitched=function(w,x){var L=this.hls.levels[this.currentLevelIndex];if(!L)return;if(L.audioGroupIds){for(var O=-1,_=this.hls.audioTracks[x.id].groupId,b=0;b<L.audioGroupIds.length;b++)if(L.audioGroupIds[b]===_){O=b;break}O!==L.urlId&&(L.urlId=O,this.startLoad())}},s.loadPlaylist=function(w){var x=this.currentLevelIndex,L=this._levels[x];if(this.canLoad&&L&&L.url.length>0){var O=L.urlId,_=L.url[O];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 "+O+" "+_),this.clearTimer(),this.hls.trigger(U.Events.LEVEL_LOADING,{url:_,level:x,id:O,deliveryDirectives:w||null})}},s.removeLevel=function(w,x){var L=function(b,g){return g!==x},O=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 g=_.details;return g!=null&&g.fragments&&g.fragments.forEach(function(p){p.level=b}),_});this._levels=O,this.hls.trigger(U.Events.LEVELS_UPDATED,{levels:O})},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 O=w<0;if(this.hls.trigger(U.Events.ERROR,{type:M.ErrorTypes.OTHER_ERROR,details:M.ErrorDetails.LEVEL_SWITCH_ERROR,level:w,fatal:O,reason:"invalid level idx"}),O)return;w=Math.min(w,L.length-1)}this.clearTimer();var _=this.currentLevelIndex,b=L[_],g=L[w];this.log("switching to level "+w+" from "+_),this.currentLevelIndex=w;var p=m({},g,{level:w,maxBitrate:g.maxBitrate,uri:g.uri,urlId:g.urlId});delete p._urlId,this.hls.trigger(U.Events.LEVEL_SWITCHING,p);var C=g.details;if(!C||C.live){var E=this.switchParams(g.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(Z,X,P){"use strict";P.r(X),P.d(X,"addGroupId",function(){return M}),P.d(X,"assignTrackIdsByGroup",function(){return G}),P.d(X,"updatePTS",function(){return W}),P.d(X,"updateFragPTSDTS",function(){return D}),P.d(X,"mergeDetails",function(){return m}),P.d(X,"mapPartIntersection",function(){return f}),P.d(X,"mapFragmentIntersection",function(){return h}),P.d(X,"adjustSliding",function(){return c}),P.d(X,"addSliding",function(){return o}),P.d(X,"computeReloadInterval",function(){return d}),P.d(X,"getFragmentWithSN",function(){return i}),P.d(X,"getPartWith",function(){return a});var V=P("./src/polyfills/number.ts"),U=P("./src/utils/logger.ts");function M(r,s,S){switch(s){case"audio":r.audioGroupIds||(r.audioGroupIds=[]),r.audioGroupIds.push(S);break;case"text":r.textGroupIds||(r.textGroupIds=[]),r.textGroupIds.push(S);break}}function G(r){var s={};r.forEach(function(S){var w=S.groupId||"";S.id=s[w]=s[w]||0,s[w]++})}function W(r,s,S){var w=r[s],x=r[S];n(w,x)}function n(r,s){var S=s.startPTS;if(Object(V.isFiniteNumber)(S)){var w=0,x;s.sn>r.sn?(w=S-r.start,x=r):(w=r.start-S,x=s),x.duration!==w&&(x.duration=w)}else if(s.sn>r.sn){var L=r.cc===s.cc;L&&r.minEndPTS?s.start=r.start+(r.minEndPTS-r.start):s.start=r.start+r.duration}else s.start=Math.max(r.start-s.duration,0)}function D(r,s,S,w,x,L){var O=w-S;O<=0&&(U.logger.warn("Fragment should have a positive duration",s),w=S+s.duration,L=x+s.duration);var _=S,b=w,g=s.startPTS,p=s.endPTS;if(Object(V.isFiniteNumber)(g)){var C=Math.abs(g-S);Object(V.isFiniteNumber)(s.deltaPTS)?s.deltaPTS=Math.max(C,s.deltaPTS):s.deltaPTS=C,_=Math.max(S,g),S=Math.min(S,g),x=Math.min(x,s.startDTS),b=Math.min(w,p),w=Math.max(w,p),L=Math.max(L,s.endDTS)}s.duration=w-S;var E=S-s.start;s.appendedPTS=w,s.start=s.startPTS=S,s.maxStartPTS=_,s.startDTS=x,s.endPTS=w,s.minEndPTS=b,s.endDTS=L;var v=s.sn;if(!r||v<r.startSN||v>r.endSN)return 0;var N,F=v-r.startSN,A=r.fragments;for(A[F]=s,N=F;N>0;N--)n(A[N],A[N-1]);for(N=F;N<A.length-1;N++)n(A[N],A[N+1]);return r.fragmentHint&&n(A[A.length-1],r.fragmentHint),r.PTSKnown=r.alignedSliding=!0,E}function m(r,s){for(var S=null,w=r.fragments,x=w.length-1;x>=0;x--){var L=w[x].initSegment;if(L){S=L;break}}r.fragmentHint&&delete r.fragmentHint.endPTS;var O=0,_;if(h(r,s,function(N,F){N.relurl&&(O=N.cc-F.cc),Object(V.isFiniteNumber)(N.startPTS)&&Object(V.isFiniteNumber)(N.endPTS)&&(F.start=F.startPTS=N.startPTS,F.startDTS=N.startDTS,F.appendedPTS=N.appendedPTS,F.maxStartPTS=N.maxStartPTS,F.endPTS=N.endPTS,F.endDTS=N.endDTS,F.minEndPTS=N.minEndPTS,F.duration=N.endPTS-N.startPTS,F.duration&&(_=F),s.PTSKnown=s.alignedSliding=!0),F.elementaryStreams=N.elementaryStreams,F.loader=N.loader,F.stats=N.stats,F.urlId=N.urlId,N.initSegment&&(F.initSegment=N.initSegment,S=N.initSegment)}),S){var b=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments;b.forEach(function(N){var F;(!N.initSegment||N.initSegment.relurl===((F=S)===null||F===void 0?void 0:F.relurl))&&(N.initSegment=S)})}if(s.skippedSegments&&(s.deltaUpdateFailed=s.fragments.some(function(N){return!N}),s.deltaUpdateFailed)){U.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var g=s.skippedSegments;g--;)s.fragments.shift();s.startSN=s.fragments[0].sn,s.startCC=s.fragments[0].cc}var p=s.fragments;if(O){U.logger.warn("discontinuity sliding from playlist, take drift into account");for(var C=0;C<p.length;C++)p[C].cc+=O}s.skippedSegments&&(s.startCC=s.fragments[0].cc),f(r.partList,s.partList,function(N,F){F.elementaryStreams=N.elementaryStreams,F.stats=N.stats}),_?D(s,_,_.startPTS,_.endPTS,_.startDTS,_.endDTS):c(r,s),p.length&&(s.totalduration=s.edge-p[0].start),s.driftStartTime=r.driftStartTime,s.driftStart=r.driftStart;var E=s.advancedDateTime;if(s.advanced&&E){var v=s.edge;s.driftStart||(s.driftStartTime=E,s.driftStart=v),s.driftEndTime=E,s.driftEnd=v}else s.driftEndTime=r.driftEndTime,s.driftEnd=r.driftEnd,s.advancedDateTime=r.advancedDateTime}function f(r,s,S){if(r&&s)for(var w=0,x=0,L=r.length;x<=L;x++){var O=r[x],_=s[x+w];O&&_&&O.index===_.index&&O.fragment.sn===_.fragment.sn?S(O,_):w--}}function h(r,s,S){for(var w=s.skippedSegments,x=Math.max(r.startSN,s.startSN)-s.startSN,L=(r.fragmentHint?1:0)+(w?s.endSN:Math.min(r.endSN,s.endSN))-s.startSN,O=s.startSN-r.startSN,_=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments,b=r.fragmentHint?r.fragments.concat(r.fragmentHint):r.fragments,g=x;g<=L;g++){var p=b[O+g],C=_[g];w&&!C&&g<w&&(C=s.fragments[g]=p),p&&C&&S(p,C)}}function c(r,s){var S=s.startSN+s.skippedSegments-r.startSN,w=r.fragments;if(S<0||S>=w.length)return;o(s,w[S].start)}function o(r,s){if(s){for(var S=r.fragments,w=r.skippedSegments;w<S.length;w++)S[w].start+=s;r.fragmentHint&&(r.fragmentHint.start+=s)}}function d(r,s){var S=1e3*r.levelTargetDuration,w=S/2,x=r.age,L=x>0&&x<S*3,O=s.loading.end-s.loading.start,_,b=r.availabilityDelay;if(r.updated===!1)if(L){var g=333*r.misses;_=Math.max(Math.min(w,O*2),g),r.availabilityDelay=(r.availabilityDelay||0)+_}else _=w;else L?(b=Math.min(b||S/2,x),r.availabilityDelay=b,_=b+S-x):_=S-O;return Math.round(_)}function i(r,s,S){if(!r||!r.details)return null;var w=r.details,x=w.fragments[s-w.startSN];return x||(x=w.fragmentHint,x&&x.sn===s?x:s<w.startSN&&S&&S.sn===s?S:null)}function a(r,s,S){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===S&&L.fragment.sn===s)return L}return null}},"./src/controller/stream-controller.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return w});var V=P("./src/polyfills/number.ts"),U=P("./src/controller/base-stream-controller.ts"),M=P("./src/is-supported.ts"),G=P("./src/events.ts"),W=P("./src/utils/buffer-helper.ts"),n=P("./src/controller/fragment-tracker.ts"),D=P("./src/types/loader.ts"),m=P("./src/loader/fragment.ts"),f=P("./src/demux/transmuxer-interface.ts"),h=P("./src/types/transmuxer.ts"),c=P("./src/controller/gap-controller.ts"),o=P("./src/errors.ts"),d=P("./src/utils/logger.ts");function i(x,L){for(var O=0;O<L.length;O++){var _=L[O];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(x,_.key,_)}}function a(x,L,O){return L&&i(x.prototype,L),O&&i(x,O),x}function r(x,L){x.prototype=Object.create(L.prototype),x.prototype.constructor=x,s(x,L)}function s(x,L){return s=Object.setPrototypeOf||function(_,b){return _.__proto__=b,_},s(x,L)}var S=100,w=function(x){r(L,x);function L(_,b){var g;return g=x.call(this,_,b,"[stream-controller]")||this,g.audioCodecSwap=!1,g.gapController=null,g.level=-1,g._forceStartLoad=!1,g.altAudio=!1,g.audioOnly=!1,g.fragPlaying=null,g.onvplaying=null,g.onvseeked=null,g.fragLastKbps=0,g.stalled=!1,g.couldBacktrack=!1,g.audioCodecSwitch=!1,g.videoBuffer=null,g._registerListeners(),g}var O=L.prototype;return O._registerListeners=function(){var b=this.hls;b.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.on(G.Events.LEVEL_LOADING,this.onLevelLoading,this),b.on(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.on(G.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),b.on(G.Events.ERROR,this.onError,this),b.on(G.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),b.on(G.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),b.on(G.Events.BUFFER_CREATED,this.onBufferCreated,this),b.on(G.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),b.on(G.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),b.on(G.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O._unregisterListeners=function(){var b=this.hls;b.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.off(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.off(G.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),b.off(G.Events.ERROR,this.onError,this),b.off(G.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),b.off(G.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),b.off(G.Events.BUFFER_CREATED,this.onBufferCreated,this),b.off(G.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),b.off(G.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),b.off(G.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},O.startLoad=function(b){if(this.levels){var g=this.lastCurrentTime,p=this.hls;if(this.stopLoad(),this.setInterval(S),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}g>0&&b===-1&&(this.log("Override startPosition with lastCurrentTime @"+g.toFixed(3)),b=g),this.state=U.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=b,this.tick()}else this._forceStartLoad=!0,this.state=U.State.STOPPED},O.stopLoad=function(){this._forceStartLoad=!1,x.prototype.stopLoad.call(this)},O.doTick=function(){switch(this.state){case U.State.IDLE:this.doTickIdle();break;case U.State.WAITING_LEVEL:{var b,g=this.levels,p=this.level,C=g==null||((b=g[p])===null||b===void 0)?void 0:b.details;if(C&&(!C.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(C))break;this.state=U.State.IDLE;break}break}case U.State.FRAG_LOADING_WAITING_RETRY:{var E,v=self.performance.now(),N=this.retryDate;(!N||v>=N||(E=this.media)!==null&&E!==void 0&&E.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=U.State.IDLE)}break;default:break}this.onTickEnd()},O.onTickEnd=function(){x.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},O.doTickIdle=function(){var b,g,p=this.hls,C=this.levelLastLoaded,E=this.levels,v=this.media,N=p.config,F=p.nextLoadLevel;if(C===null||!v&&(this.startFragRequested||!N.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!E||!E[F])return;var A=E[F];this.level=p.nextLoadLevel=F;var H=A.details;if(!H||this.state===U.State.WAITING_LEVEL||H.live&&this.levelLastLoaded!==F){this.state=U.State.WAITING_LEVEL;return}var j=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:v,D.PlaylistLevelType.MAIN);if(j===null)return;var T=j.len,z=this.getMaxBufferLength(A.maxBitrate);if(T>=z)return;if(this._streamEnded(j,H)){var Q={};this.altAudio&&(Q.type="video"),this.hls.trigger(G.Events.BUFFER_EOS,Q),this.state=U.State.ENDED;return}var ne=j.end,se=this.getNextFragment(ne,H);if(this.couldBacktrack&&!this.fragPrevious&&se&&se.sn!=="initSegment"){var xe=se.sn-H.startSN;xe>1&&(se=H.fragments[xe-1],this.fragmentTracker.removeFragment(se))}if(se&&this.fragmentTracker.getState(se)===n.FragmentState.OK&&this.nextLoadPosition>ne){var ge=this.audioOnly&&!this.altAudio?m.ElementaryStreamTypes.AUDIO:m.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(v,ge,D.PlaylistLevelType.MAIN),se=this.getNextFragment(this.nextLoadPosition,H)}if(!se)return;se.initSegment&&!se.initSegment.data&&!this.bitrateTest&&(se=se.initSegment),((b=se.decryptdata)===null||b===void 0?void 0:b.keyFormat)==="identity"&&!((g=se.decryptdata)!==null&&g!==void 0&&g.key)?this.loadKey(se,H):this.loadFragment(se,H,ne)},O.loadFragment=function(b,g,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,g,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()},O.getAppendedFrag=function(b){var g=this.fragmentTracker.getAppendedFrag(b,D.PlaylistLevelType.MAIN);return g&&"fragment"in g?g.fragment:g},O.getBufferedFrag=function(b){return this.fragmentTracker.getBufferedFrag(b,D.PlaylistLevelType.MAIN)},O.followingBufferedFrag=function(b){return b?this.getBufferedFrag(b.end+.5):null},O.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},O.nextLevelSwitch=function(){var b=this.levels,g=this.media;if(g!=null&&g.readyState){var p,C=this.getAppendedFrag(g.currentTime);if(C&&C.start>1&&this.flushMainBuffer(0,C.start-1),!g.paused&&b){var E=this.hls.nextLoadLevel,v=b[E],N=this.fragLastKbps;N&&this.fragCurrent?p=this.fragCurrent.duration*v.maxBitrate/(1e3*N)+1:p=0}else p=0;var F=this.getBufferedFrag(g.currentTime+p);if(F){var A=this.followingBufferedFrag(F);if(A){this.abortCurrentFrag();var H=A.maxStartPTS?A.maxStartPTS:A.start,j=A.duration,T=Math.max(F.end,H+Math.min(Math.max(j-this.config.maxFragLookUpTolerance,j*.5),j*.75));this.flushMainBuffer(T,Number.POSITIVE_INFINITY)}}}},O.abortCurrentFrag=function(){var b=this.fragCurrent;this.fragCurrent=null,b!=null&&b.loader&&b.loader.abort(),this.state===U.State.KEY_LOADING&&(this.state=U.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},O.flushMainBuffer=function(b,g){x.prototype.flushMainBuffer.call(this,b,g,this.altAudio?"video":null)},O.onMediaAttached=function(b,g){x.prototype.onMediaAttached.call(this,b,g);var p=g.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)},O.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)},O.onMediaPlaying=function(){this.tick()},O.onMediaSeeked=function(){var b=this.media,g=b?b.currentTime:null;Object(V.isFiniteNumber)(g)&&this.log("Media seeked to "+g.toFixed(3)),this.tick()},O.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(G.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},O.onManifestParsed=function(b,g){var p=!1,C=!1,E;g.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(M.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=g.levels,this.startFragRequested=!1},O.onLevelLoading=function(b,g){var p=this.levels;if(!p||this.state!==U.State.IDLE)return;var C=p[g.level];(!C.details||C.details.live&&this.levelLastLoaded!==g.level||this.waitForCdnTuneIn(C.details))&&(this.state=U.State.WAITING_LEVEL)},O.onLevelLoaded=function(b,g){var p,C=this.levels,E=g.level,v=g.details,N=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:"+N);var F=this.fragCurrent;F&&(this.state===U.State.FRAG_LOADING||this.state===U.State.FRAG_LOADING_WAITING_RETRY)&&(F.level!==g.level&&F.loader&&(this.state=U.State.IDLE,F.loader.abort()));var A=C[E],H=0;if(v.live||(p=A.details)!==null&&p!==void 0&&p.live){if(v.fragments[0]||(v.deltaUpdateFailed=!0),v.deltaUpdateFailed)return;H=this.alignPlaylists(v,A.details)}if(A.details=v,this.levelLastLoaded=E,this.hls.trigger(G.Events.LEVEL_UPDATED,{details:v,level:E}),this.state===U.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(v))return;this.state=U.State.IDLE}this.startFragRequested?v.live&&this.synchronizeToLiveEdge(v):this.setStartPosition(v,H),this.tick()},O._handleFragmentLoadProgress=function(b){var g,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 N=v[p.level],F=N.details;if(!F){this.warn("Dropping fragment "+p.sn+" of level "+p.level+" after level details were reset");return}var A=N.videoCodec,H=F.PTSKnown||!F.live,j=(g=p.initSegment)===null||g===void 0?void 0:g.data,T=this._getAudioCodec(N),z=this.transmuxer=this.transmuxer||new f.default(this.hls,D.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),Q=C?C.index:-1,ne=Q!==-1,se=new h.ChunkMetadata(p.level,p.sn,p.stats.chunkCount,E.byteLength,Q,ne),xe=this.initPTS[p.cc];z.push(E,j,T,A,p,C,F.totalduration,H,se,xe)},O.onAudioTrackSwitching=function(b,g){var p=this.altAudio,C=!!g.url,E=g.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 N=this.hls;p&&N.trigger(G.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),N.trigger(G.Events.AUDIO_TRACK_SWITCHED,{id:E})}},O.onAudioTrackSwitched=function(b,g){var p=g.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()},O.onBufferCreated=function(b,g){var p=g.tracks,C,E,v=!1;for(var N in p){var F=p[N];if(F.id==="main"){if(E=N,C=F,N==="video"){var A=p[N];A&&(this.videoBuffer=A.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},O.onFragBuffered=function(b,g){var p=g.frag,C=g.part;if(p&&p.type!==D.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===U.State.PARSED&&(this.state=U.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)},O.onError=function(b,g){switch(g.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:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.MAIN,g);break;case o.ErrorDetails.LEVEL_LOAD_ERROR:case o.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==U.State.ERROR&&(g.fatal?(this.warn(""+g.details),this.state=U.State.ERROR):!g.levelRetry&&this.state===U.State.WAITING_LEVEL&&(this.state=U.State.IDLE));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(g.parent==="main"&&(this.state===U.State.PARSING||this.state===U.State.PARSED)){var p=!0,C=this.getFwdBufferInfo(this.media,D.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}},O.checkBuffer=function(){var b=this.media,g=this.gapController;if(!b||!g||!b.readyState)return;var p=W.BufferHelper.getBuffered(b);!this.loadedmetadata&&p.length?(this.loadedmetadata=!0,this.seekToStartPos()):g.poll(this.lastCurrentTime),this.lastCurrentTime=b.currentTime},O.onFragLoadEmergencyAborted=function(){this.state=U.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},O.onBufferFlushed=function(b,g){var p=g.type;if(p!==m.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var C=(p===m.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(C,p,D.PlaylistLevelType.MAIN)}},O.onLevelsUpdated=function(b,g){this.levels=g.levels},O.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},O.seekToStartPos=function(){var b=this.media,g=b.currentTime,p=this.startPosition;if(p>=0&&g<p){if(b.seeking){d.logger.log("could not seek to "+p+", already seeking at "+g);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 "+g),b.currentTime=p}},O._getAudioCodec=function(b){var g=this.config.defaultAudioCodec||b.audioCodec;return this.audioCodecSwap&&g&&(this.log("Swapping audio codec"),g.indexOf("mp4a.40.5")!==-1?g="mp4a.40.2":g="mp4a.40.5"),g},O._loadBitrateTestFrag=function(b){var g=this;this._doFragLoad(b).then(function(p){var C=g.hls;if(!p||C.nextLoadLevel||g.fragContextChanged(b))return;g.fragLoadError=0,g.state=U.State.IDLE,g.startFragRequested=!1,g.bitrateTest=!1;var E=b.stats;E.parsing.start=E.parsing.end=E.buffering.start=E.buffering.end=self.performance.now(),C.trigger(G.Events.FRAG_LOADED,p)})},O._handleTransmuxComplete=function(b){var g,p="main",C=this.hls,E=b.remuxResult,v=b.chunkMeta,N=this.getCurrentContext(v);if(!N){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=N.frag,A=N.part,H=N.level,j=E.video,T=E.text,z=E.id3,Q=E.initSegment,ne=this.altAudio?void 0:E.audio;if(this.fragContextChanged(F))return;if(this.state=U.State.PARSING,Q){Q.tracks&&(this._bufferInitSegment(H,Q.tracks,F,v),C.trigger(G.Events.FRAG_PARSING_INIT_SEGMENT,{frag:F,id:p,tracks:Q.tracks}));var se=Q.initPTS,xe=Q.timescale;Object(V.isFiniteNumber)(se)&&(this.initPTS[F.cc]=se,C.trigger(G.Events.INIT_PTS_FOUND,{frag:F,id:p,initPTS:se,timescale:xe}))}if(j&&E.independent!==!1){if(H.details){var ge=j.startPTS,ve=j.endPTS,Oe=j.startDTS,Re=j.endDTS;if(A)A.elementaryStreams[j.type]={startPTS:ge,endPTS:ve,startDTS:Oe,endDTS:Re};else if(j.firstKeyFrame&&j.independent&&(this.couldBacktrack=!0),j.dropped&&j.independent){var he=this.getLoadPosition()+this.config.maxBufferHole;if(he<ge){this.backtrack(F);return}F.setElementaryStreamInfo(j.type,F.start,ve,F.start,Re,!0)}F.setElementaryStreamInfo(j.type,ge,ve,Oe,Re),this.bufferFragmentData(j,F,A,v)}}else if(E.independent===!1){this.backtrack(F);return}if(ne){var ue=ne.startPTS,Me=ne.endPTS,et=ne.startDTS,it=ne.endDTS;A&&(A.elementaryStreams[m.ElementaryStreamTypes.AUDIO]={startPTS:ue,endPTS:Me,startDTS:et,endDTS:it}),F.setElementaryStreamInfo(m.ElementaryStreamTypes.AUDIO,ue,Me,et,it),this.bufferFragmentData(ne,F,A,v)}if(z!=null&&(g=z.samples)!==null&&g!==void 0&&g.length){var nt={frag:F,id:p,samples:z.samples};C.trigger(G.Events.FRAG_PARSING_METADATA,nt)}if(T){var at={frag:F,id:p,samples:T.samples};C.trigger(G.Events.FRAG_PARSING_USERDATA,at)}},O._bufferInitSegment=function(b,g,p,C){var E=this;if(this.state!==U.State.PARSING)return;this.audioOnly=!!g.audio&&!g.video,this.altAudio&&!this.audioOnly&&delete g.audio;var v=g.audio,N=g.video,F=g.audiovideo;if(v){var A=b.audioCodec,H=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(A&&(A.indexOf("mp4a.40.5")!==-1?A="mp4a.40.2":A="mp4a.40.5"),v.metadata.channelCount!==1&&H.indexOf("firefox")===-1&&(A="mp4a.40.5")),H.indexOf("android")!==-1&&v.container!=="audio/mpeg"&&(A="mp4a.40.2",this.log("Android: force audio codec to "+A)),b.audioCodec&&b.audioCodec!==A&&this.log('Swapping manifest audio codec "'+b.audioCodec+'" for "'+A+'"'),v.levelCodec=A,v.id="main",this.log("Init audio buffer, container:"+v.container+", codecs[selected/level/parsed]=["+(A||"")+"/"+(b.audioCodec||"")+"/"+v.codec+"]")}N&&(N.levelCodec=b.videoCodec,N.id="main",this.log("Init video buffer, container:"+N.container+", codecs[level/parsed]=["+(b.videoCodec||"")+"/"+N.codec+"]")),F&&this.log("Init audiovideo buffer, container:"+F.container+", codecs[level/parsed]=["+(b.attrs.CODECS||"")+"/"+F.codec+"]"),this.hls.trigger(G.Events.BUFFER_CODECS,g),Object.keys(g).forEach(function(j){var T=g[j],z=T.initSegment;z!=null&&z.byteLength&&E.hls.trigger(G.Events.BUFFER_APPENDING,{type:j,data:z,frag:p,part:null,chunkMeta:C,parent:p.type})}),this.tick()},O.backtrack=function(b){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(b);var g=this.fragmentTracker.backtrack(b);this.fragPrevious=null,this.nextLoadPosition=b.start,g?this.resetFragmentLoading(b):this.state=U.State.BACKTRACKING},O.checkFragmentChanged=function(){var b=this.media,g=null;if(b&&b.readyState>1&&b.seeking===!1){var p=b.currentTime;if(W.BufferHelper.isBuffered(b,p)?g=this.getAppendedFrag(p):W.BufferHelper.isBuffered(b,p+.1)&&(g=this.getAppendedFrag(p+.1)),g){var C=this.fragPlaying,E=g.level;(!C||g.sn!==C.sn||C.level!==E||g.urlId!==C.urlId)&&(this.hls.trigger(G.Events.FRAG_CHANGED,{frag:g}),(!C||C.level!==E)&&this.hls.trigger(G.Events.LEVEL_SWITCHED,{level:E}),this.fragPlaying=g)}}},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 g=this.getAppendedFrag(b.currentTime);if(g)return g.level}return-1}},{key:"nextBufferedFrag",get:function(){var b=this.media;if(b){var g=this.getAppendedFrag(b.currentTime);return this.followingBufferedFrag(g)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),L}(U.default)},"./src/controller/subtitle-stream-controller.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"SubtitleStreamController",function(){return r});var V=P("./src/events.ts"),U=P("./src/utils/logger.ts"),M=P("./src/utils/buffer-helper.ts"),G=P("./src/controller/fragment-finders.ts"),W=P("./src/utils/discontinuities.ts"),n=P("./src/controller/level-helper.ts"),D=P("./src/controller/fragment-tracker.ts"),m=P("./src/controller/base-stream-controller.ts"),f=P("./src/types/loader.ts"),h=P("./src/types/level.ts");function c(s,S){for(var w=0;w<S.length;w++){var x=S[w];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(s,x.key,x)}}function o(s,S,w){return S&&c(s.prototype,S),w&&c(s,w),s}function d(s,S){s.prototype=Object.create(S.prototype),s.prototype.constructor=s,i(s,S)}function i(s,S){return i=Object.setPrototypeOf||function(x,L){return x.__proto__=L,x},i(s,S)}var a=500,r=function(s){d(S,s);function S(x,L){var O;return O=s.call(this,x,L,"[subtitle-stream-controller]")||this,O.levels=[],O.currentTrackId=-1,O.tracksBuffered=[],O.mainDetails=null,O._registerListeners(),O}var w=S.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=m.State.IDLE,this.setInterval(a),this.tick()},w.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},w.onLevelLoaded=function(L,O){this.mainDetails=O.details},w.onSubtitleFragProcessed=function(L,O){var _=O.frag,b=O.success;if(this.fragPrevious=_,this.state=m.State.IDLE,!b)return;var g=this.tracksBuffered[this.currentTrackId];if(!g)return;for(var p,C=_.start,E=0;E<g.length;E++)if(C>=g[E].start&&C<=g[E].end){p=g[E];break}var v=_.start+_.duration;p?p.end=v:(p={start:C,end:v},g.push(p)),this.fragmentTracker.fragBuffered(_)},w.onBufferFlushing=function(L,O){var _=O.startOffset,b=O.endOffset;if(_===0&&b!==Number.POSITIVE_INFINITY){var g=this.currentTrackId,p=this.levels;if(!p.length||!p[g]||!p[g].details)return;var C=p[g].details,E=C.targetduration,v=b-E;if(v<=0)return;O.endOffsetSubtitles=Math.max(0,v),this.tracksBuffered.forEach(function(N){for(var F=0;F<N.length;){if(N[F].end<=v){N.shift();continue}else if(N[F].start<v)N[F].start=v;else break;F++}}),this.fragmentTracker.removeFragmentsInRange(_,v,f.PlaylistLevelType.SUBTITLE)}},w.onError=function(L,O){var _,b=O.frag;if(!b||b.type!==f.PlaylistLevelType.SUBTITLE)return;(_=this.fragCurrent)!==null&&_!==void 0&&_.loader&&this.fragCurrent.loader.abort(),this.state=m.State.IDLE},w.onSubtitleTracksUpdated=function(L,O){var _=this,b=O.subtitleTracks;this.tracksBuffered=[],this.levels=b.map(function(g){return new h.Level(g)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(g){_.tracksBuffered[g.id]=[]}),this.mediaBuffer=null},w.onSubtitleTrackSwitch=function(L,O){if(this.currentTrackId=O.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,O){var _,b=O.details,g=O.id,p=this.currentTrackId,C=this.levels;if(!C.length)return;var E=C[p];if(g>=C.length||g!==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 N=v.fragments[0];if(!E.details)b.hasProgramDateTime&&v.hasProgramDateTime?Object(W.alignMediaPlaylistByPDT)(b,v):N&&Object(n.addSliding)(b,N.start);else{var F=this.alignPlaylists(b,E.details);F===0&&N&&Object(n.addSliding)(b,N.start)}}if(E.details=b,this.levelLastLoaded=g,this.tick(),b.live&&!this.fragCurrent&&this.media&&this.state===m.State.IDLE){var A=Object(G.findFragmentByPTS)(null,b.fragments,this.media.currentTime,0);A||(this.warn("Subtitle playlist not aligned with playback"),E.details=void 0)}},w._handleFragmentLoadComplete=function(L){var O=L.frag,_=L.payload,b=O.decryptdata,g=this.hls;if(this.fragContextChanged(O))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();g.trigger(V.Events.FRAG_DECRYPTED,{frag:O,payload:C,stats:{tstart:p,tdecrypt:E}})})}},w.doTick=function(){if(!this.media){this.state=m.State.IDLE;return}if(this.state===m.State.IDLE){var L,O=this.currentTrackId,_=this.levels;if(!_.length||!_[O]||!_[O].details)return;var b=_[O].details,g=b.targetduration,p=this.config,C=this.media,E=M.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,C.currentTime-g,p.maxBufferHole),v=E.end,N=E.len,F=this.getMaxBufferLength()+g;if(N>F)return;console.assert(b,"Subtitle track details are defined on idle subtitle stream controller tick");var A=b.fragments,H=A.length,j=b.edge,T,z=this.fragPrevious;if(v<j){var Q=p.maxFragLookUpTolerance;z&&b.hasProgramDateTime&&(T=Object(G.findFragmentByPDT)(A,z.endProgramDateTime,Q)),T||(T=Object(G.findFragmentByPTS)(z,A,v,Q),!T&&z&&z.start<A[0].start&&(T=A[0]))}else T=A[H-1];(L=T)!==null&&L!==void 0&&L.encrypted?(U.logger.log("Loading key for "+T.sn),this.state=m.State.KEY_LOADING,this.hls.trigger(V.Events.KEY_LOADING,{frag:T})):T&&this.fragmentTracker.getState(T)===D.FragmentState.NOT_LOADED&&this.loadFragment(T,b,v)}},w.loadFragment=function(L,O,_){this.fragCurrent=L,s.prototype.loadFragment.call(this,L,O,_)},o(S,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),S}(m.default)},"./src/controller/subtitle-track-controller.ts":function(Z,X,P){"use strict";P.r(X);var V=P("./src/events.ts"),U=P("./src/utils/texttrack-utils.ts"),M=P("./src/controller/base-playlist-controller.ts"),G=P("./src/types/loader.ts");function W(c,o){for(var d=0;d<o.length;d++){var i=o[d];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(c,i.key,i)}}function n(c,o,d){return o&&W(c.prototype,o),d&&W(c,d),c}function D(c,o){c.prototype=Object.create(o.prototype),c.prototype.constructor=c,m(c,o)}function m(c,o){return m=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},m(c,o)}var f=function(c){D(o,c);function o(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=o.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(U.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 s=r.id,S=r.details,w=this.trackId,x=this.tracksInGroup[w];if(!x){this.warn("Invalid subtitle track id "+s);return}var L=x.details;x.details=r.details,this.log("subtitle track "+s+" loaded ["+S.startSN+"-"+S.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,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 s=r.textGroupIds[r.urlId];if(this.groupId!==s){var S=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,w=this.tracks.filter(function(O){return!s||O.groupId===s});this.tracksInGroup=w;var x=this.findTrackId(S==null?void 0:S.name)||this.findTrackId();this.groupId=s;var L={subtitleTracks:w};this.log("Updating subtitle tracks, "+w.length+' track(s) found in "'+s+'" group-id'),this.hls.trigger(V.Events.SUBTITLE_TRACKS_UPDATED,L),x!==-1&&this.setSubtitleTrack(x,S)}},d.findTrackId=function(a){for(var r=this.tracksInGroup,s=0;s<r.length;s++){var S=r[s];if((!this.selectDefaultTrack||S.default)&&(!a||a===S.name))return S.id}return-1},d.onError=function(a,r){if(c.prototype.onError.call(this,a,r),r.fatal||!r.context)return;r.context.type===G.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 s=r.id,S=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 "+s),this.hls.trigger(V.Events.SUBTITLE_TRACK_LOADING,{url:w,id:s,groupId:S,deliveryDirectives:a||null})}},d.toggleTrackModes=function(a){var r=this,s=this.media,S=this.subtitleDisplay,w=this.trackId;if(!s)return;var x=h(s.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 O=L[w];O&&(O.mode="disabled")}var _=L[a];_&&(_.mode=S?"showing":"hidden")},d.setSubtitleTrack=function(a,r){var s,S=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=a;return}if(this.trackId!==a&&this.toggleTrackModes(a),this.trackId===a&&(a===-1||(s=S[a])!==null&&s!==void 0&&s.details)||a<-1||a>=S.length)return;this.clearTimer();var w=S[a];if(this.log("Switching to subtitle track "+a),this.trackId=a,w){var x=w.id,L=w.groupId,O=L===void 0?"":L,_=w.name,b=w.type,g=w.url;this.hls.trigger(V.Events.SUBTITLE_TRACK_SWITCH,{id:x,groupId:O,name:_,type:b,url:g});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),s=0;s<r.length;s++)if(r[s].mode==="hidden")a=s;else if(r[s].mode==="showing"){a=s;break}this.subtitleTrack!==a&&(this.subtitleTrack=a)},n(o,[{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)}}]),o}(M.default);function h(c){for(var o=[],d=0;d<c.length;d++){var i=c[d];i.kind==="subtitles"&&i.label&&o.push(c[d])}return o}X.default=f},"./src/controller/timeline-controller.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"TimelineController",function(){return h});var V=P("./src/polyfills/number.ts"),U=P("./src/events.ts"),M=P("./src/utils/cea-608-parser.ts"),G=P("./src/utils/output-filter.ts"),W=P("./src/utils/webvtt-parser.ts"),n=P("./src/utils/texttrack-utils.ts"),D=P("./src/utils/imsc1-ttml-parser.ts"),m=P("./src/types/loader.ts"),f=P("./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 s=new G.default(this,"textTrack1"),S=new G.default(this,"textTrack2"),w=new G.default(this,"textTrack3"),x=new G.default(this,"textTrack4");this.cea608Parser1=new M.default(1,s,S),this.cea608Parser2=new M.default(3,w,x)}r.on(U.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.on(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(U.Events.MANIFEST_LOADED,this.onManifestLoaded,this),r.on(U.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),r.on(U.Events.FRAG_LOADING,this.onFragLoading,this),r.on(U.Events.FRAG_LOADED,this.onFragLoaded,this),r.on(U.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),r.on(U.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),r.on(U.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),r.on(U.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),r.on(U.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var a=i.prototype;return a.destroy=function(){var s=this.hls;s.off(U.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.off(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(U.Events.MANIFEST_LOADED,this.onManifestLoaded,this),s.off(U.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),s.off(U.Events.FRAG_LOADING,this.onFragLoading,this),s.off(U.Events.FRAG_LOADED,this.onFragLoaded,this),s.off(U.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),s.off(U.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),s.off(U.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.off(U.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),s.off(U.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},a.addCues=function(s,S,w,x,L){for(var O=!1,_=L.length;_--;){var b=L[_],g=o(b[0],b[1],S,w);if(g>=0&&(b[0]=Math.min(b[0],S),b[1]=Math.max(b[1],w),O=!0,g/(w-S)>.5))return}if(O||L.push([S,w]),this.config.renderTextTracksNatively){var p=this.captionsTracks[s];this.Cues.newCue(p,S,w,x)}else{var C=this.Cues.newCue(null,S,w,x);this.hls.trigger(U.Events.CUES_PARSED,{type:"captions",cues:C,track:s})}},a.onInitPtsFound=function(s,S){var w=this,x=S.frag,L=S.id,O=S.initPTS,_=S.timescale,b=this.unparsedVttFrags;L==="main"&&(this.initPTS[x.cc]=O,this.timescale[x.cc]=_),b.length&&(this.unparsedVttFrags=[],b.forEach(function(g){w.onFragLoaded(U.Events.FRAG_LOADED,g)}))},a.getExistingTrack=function(s){var S=this.media;if(S)for(var w=0;w<S.textTracks.length;w++){var x=S.textTracks[w];if(x[s])return x}return null},a.createCaptionsTrack=function(s){this.config.renderTextTracksNatively?this.createNativeTrack(s):this.createNonNativeTrack(s)},a.createNativeTrack=function(s){if(this.captionsTracks[s])return;var S=this.captionsProperties,w=this.captionsTracks,x=this.media,L=S[s],O=L.label,_=L.languageCode,b=this.getExistingTrack(s);if(b)w[s]=b,Object(n.clearCurrentCues)(w[s]),Object(n.sendAddTrackEvent)(w[s],x);else{var g=this.createTextTrack("captions",O,_);g&&(g[s]=!0,w[s]=g)}},a.createNonNativeTrack=function(s){if(this.nonNativeCaptionsTracks[s])return;var S=this.captionsProperties[s];if(!S)return;var w=S.label,x={_id:s,label:w,kind:"captions",default:S.media?!!S.media.default:!1,closedCaptions:S.media};this.nonNativeCaptionsTracks[s]=x,this.hls.trigger(U.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[x]})},a.createTextTrack=function(s,S,w){var x=this.media;return x?x.addTextTrack(s,S,w):void 0},a.onMediaAttaching=function(s,S){this.media=S.media,this._cleanTracks()},a.onMediaDetaching=function(){var s=this.captionsTracks;Object.keys(s).forEach(function(S){Object(n.clearCurrentCues)(s[S]),delete s[S]}),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 s=this.media;if(!s)return;var S=s.textTracks;if(S)for(var w=0;w<S.length;w++)Object(n.clearCurrentCues)(S[w])},a.onSubtitleTracksUpdated=function(s,S){var w=this;this.textTracks=[];var x=S.subtitleTracks||[],L=x.some(function(g){return g.textCodec===D.IMSC1_CODEC});if(this.config.enableWebVTT||L&&this.config.enableIMSC1){var O=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(g,p){var C;if(p<_.length){for(var E=null,v=0;v<_.length;v++)if(c(_[v],g)){E=_[v];break}E&&(C=E)}C?Object(n.clearCurrentCues)(C):(C=w.createTextTrack("subtitles",g.name,g.lang),C&&(C.mode="disabled")),C&&(C.groupId=g.groupId,w.textTracks.push(C))})}else if(!O&&this.tracks&&this.tracks.length){var b=this.tracks.map(function(g){return{label:g.name,kind:g.type.toLowerCase(),default:g.default,subtitleTrack:g}});this.hls.trigger(U.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:b})}}},a.onManifestLoaded=function(s,S){var w=this;this.config.enableCEA708Captions&&S.captions&&S.captions.forEach(function(x){var L=/(?:CC|SERVICE)([1-4])/.exec(x.instreamId);if(!L)return;var O="textTrack"+L[1],_=w.captionsProperties[O];if(!_)return;_.label=x.name,x.lang&&(_.languageCode=x.lang),_.media=x})},a.onFragLoading=function(s,S){var w=this.cea608Parser1,x=this.cea608Parser2,L=this.lastSn,O=this.lastPartIndex;if(!this.enabled||!(w&&x))return;if(S.frag.type===m.PlaylistLevelType.MAIN){var _,b,g=S.frag.sn,p=(_=S==null||((b=S.part)===null||b===void 0)?void 0:b.index)!=null?_:-1;g===L+1||g===L&&p===O+1||(w.reset(),x.reset()),this.lastSn=g,this.lastPartIndex=p}},a.onFragLoaded=function(s,S){var w=S.frag,x=S.payload,L=this.initPTS,O=this.unparsedVttFrags;if(w.type===m.PlaylistLevelType.SUBTITLE)if(x.byteLength){if(!Object(V.isFiniteNumber)(L[w.cc])){O.push(S),L.length&&this.hls.trigger(U.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],g=this.vttCCs;g[w.cc]||(g[w.cc]={start:w.start,prevCC:this.prevCC,new:!0},this.prevCC=w.cc),b&&b.textCodec===D.IMSC1_CODEC?this._parseIMSC1(w,x):this._parseVTTs(w,x,g)}}else this.hls.trigger(U.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:w,error:new Error("Empty subtitle payload")})},a._parseIMSC1=function(s,S){var w=this,x=this.hls;Object(D.parseIMSC1)(S,this.initPTS[s.cc],this.timescale[s.cc],function(L){w._appendCues(L,s.level),x.trigger(U.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},function(L){f.logger.log("Failed to parse IMSC1: "+L),x.trigger(U.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:L})})},a._parseVTTs=function(s,S,w){var x=this,L=this.hls;Object(W.parseWebVTT)(S,this.initPTS[s.cc],this.timescale[s.cc],w,s.cc,s.start,function(O){x._appendCues(O,s.level),L.trigger(U.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},function(O){x._fallbackToIMSC1(s,S),f.logger.log("Failed to parse VTT cue: "+O),L.trigger(U.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:O})})},a._fallbackToIMSC1=function(s,S){var w=this,x=this.tracks[s.level];x.textCodec||Object(D.parseIMSC1)(S,this.initPTS[s.cc],this.timescale[s.cc],function(){x.textCodec=D.IMSC1_CODEC,w._parseIMSC1(s,S)},function(){x.textCodec="wvtt"})},a._appendCues=function(s,S){var w=this.hls;if(this.config.renderTextTracksNatively){var x=this.textTracks[S];if(x.mode==="disabled")return;s.forEach(function(_){return Object(n.addCueToTrack)(x,_)})}else{var L=this.tracks[S],O=L.default?"default":"subtitles"+S;w.trigger(U.Events.CUES_PARSED,{type:"subtitles",cues:s,track:O})}},a.onFragDecrypted=function(s,S){var w=S.frag;if(w.type===m.PlaylistLevelType.SUBTITLE){if(!Object(V.isFiniteNumber)(this.initPTS[w.cc])){this.unparsedVttFrags.push(S);return}this.onFragLoaded(U.Events.FRAG_LOADED,S)}},a.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},a.onFragParsingUserdata=function(s,S){var w=this.cea608Parser1,x=this.cea608Parser2;if(!this.enabled||!(w&&x))return;for(var L=0;L<S.samples.length;L++){var O=S.samples[L].bytes;if(O){var _=this.extractCea608Data(O);w.addData(S.samples[L].pts,_[0]),x.addData(S.samples[L].pts,_[1])}}},a.onBufferFlushing=function(s,S){var w=S.startOffset,x=S.endOffset,L=S.endOffsetSubtitles,O=S.type,_=this.media;if(!_||_.currentTime<x)return;if(!O||O==="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 g=this.textTracks;Object.keys(g).forEach(function(p){return Object(n.removeCuesInRange)(g[p],w,L)})}},a.extractCea608Data=function(s){for(var S=s[0]&31,w=2,x=[[],[]],L=0;L<S;L++){var O=s[w++],_=127&s[w++],b=127&s[w++],g=(4&O)!==0,p=3&O;if(_===0&&b===0)continue;g&&((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 o(i,a,r,s){return Math.min(a,s)-Math.max(i,r)}function d(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return V});var V=function(){function U(G,W){this.subtle=void 0,this.aesIV=void 0,this.subtle=G,this.aesIV=W}var M=U.prototype;return M.decrypt=function(W,n){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},n,W)},U}()},"./src/crypt/aes-decryptor.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"removePadding",function(){return U}),P.d(X,"default",function(){return M});var V=P("./src/utils/typed-array.ts");function U(G){var W=G.byteLength,n=W&&new DataView(G.buffer).getUint8(W-1);return n?Object(V.sliceUint8)(G,0,W-n):G}var M=function(){function G(){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=G.prototype;return W.uint8ArrayToUint32Array_=function(D){for(var m=new DataView(D),f=new Uint32Array(4),h=0;h<4;h++)f[h]=m.getUint32(h*4);return f},W.initTable=function(){var D=this.sBox,m=this.invSBox,f=this.subMix,h=f[0],c=f[1],o=f[2],d=f[3],i=this.invSubMix,a=i[0],r=i[1],s=i[2],S=i[3],w=new Uint32Array(256),x=0,L=0,O=0;for(O=0;O<256;O++)O<128?w[O]=O<<1:w[O]=O<<1^283;for(O=0;O<256;O++){var _=L^L<<1^L<<2^L<<3^L<<4;_=_>>>8^_&255^99,D[x]=_,m[_]=x;var b=w[x],g=w[b],p=w[g],C=w[_]*257^_*16843008;h[x]=C<<24|C>>>8,c[x]=C<<16|C>>>16,o[x]=C<<8|C>>>24,d[x]=C,C=p*16843009^g*65537^b*257^x*16843008,a[_]=C<<24|C>>>8,r[_]=C<<16|C>>>16,s[_]=C<<8|C>>>24,S[_]=C,x?(x=b^w[w[w[p^b]]],L^=w[w[L]]):x=L=1}},W.expandKey=function(D){for(var m=this.uint8ArrayToUint32Array_(D),f=!0,h=0;h<m.length&&f;)f=m[h]===this.key[h],h++;if(f)return;this.key=m;var c=this.keySize=m.length;if(c!==4&&c!==6&&c!==8)throw new Error("Invalid aes key size="+c);var o=this.ksRows=(c+6+1)*4,d,i,a=this.keySchedule=new Uint32Array(o),r=this.invKeySchedule=new Uint32Array(o),s=this.sBox,S=this.rcon,w=this.invSubMix,x=w[0],L=w[1],O=w[2],_=w[3],b,g;for(d=0;d<o;d++){if(d<c){b=a[d]=m[d];continue}g=b,d%c===0?(g=g<<8|g>>>24,g=s[g>>>24]<<24|s[g>>>16&255]<<16|s[g>>>8&255]<<8|s[g&255],g^=S[d/c|0]<<24):c>6&&d%c===4&&(g=s[g>>>24]<<24|s[g>>>16&255]<<16|s[g>>>8&255]<<8|s[g&255]),a[d]=b=(a[d-c]^g)>>>0}for(i=0;i<o;i++)d=o-i,i&3?g=a[d]:g=a[d-4],i<4||d<=4?r[i]=g:r[i]=x[s[g>>>24]]^L[s[g>>>16&255]]^O[s[g>>>8&255]]^_[s[g&255]],r[i]=r[i]>>>0},W.networkToHostOrderSwap=function(D){return D<<24|(D&65280)<<8|(D&16711680)>>8|D>>>24},W.decrypt=function(D,m,f){for(var h=this.keySize+6,c=this.invKeySchedule,o=this.invSBox,d=this.invSubMix,i=d[0],a=d[1],r=d[2],s=d[3],S=this.uint8ArrayToUint32Array_(f),w=S[0],x=S[1],L=S[2],O=S[3],_=new Int32Array(D),b=new Int32Array(_.length),g,p,C,E,v,N,F,A,H,j,T,z,Q,ne,se=this.networkToHostOrderSwap;m<_.length;){for(H=se(_[m]),j=se(_[m+1]),T=se(_[m+2]),z=se(_[m+3]),v=H^c[0],N=z^c[1],F=T^c[2],A=j^c[3],Q=4,ne=1;ne<h;ne++)g=i[v>>>24]^a[N>>16&255]^r[F>>8&255]^s[A&255]^c[Q],p=i[N>>>24]^a[F>>16&255]^r[A>>8&255]^s[v&255]^c[Q+1],C=i[F>>>24]^a[A>>16&255]^r[v>>8&255]^s[N&255]^c[Q+2],E=i[A>>>24]^a[v>>16&255]^r[N>>8&255]^s[F&255]^c[Q+3],v=g,N=p,F=C,A=E,Q=Q+4;g=o[v>>>24]<<24^o[N>>16&255]<<16^o[F>>8&255]<<8^o[A&255]^c[Q],p=o[N>>>24]<<24^o[F>>16&255]<<16^o[A>>8&255]<<8^o[v&255]^c[Q+1],C=o[F>>>24]<<24^o[A>>16&255]<<16^o[v>>8&255]<<8^o[N&255]^c[Q+2],E=o[A>>>24]<<24^o[v>>16&255]<<16^o[N>>8&255]<<8^o[F&255]^c[Q+3],b[m]=se(g^w),b[m+1]=se(E^x),b[m+2]=se(C^L),b[m+3]=se(p^O),w=H,x=j,L=T,O=z,m=m+4}return b.buffer},G}()},"./src/crypt/decrypter.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return m});var V=P("./src/crypt/aes-crypto.ts"),U=P("./src/crypt/fast-aes-key.ts"),M=P("./src/crypt/aes-decryptor.ts"),G=P("./src/utils/logger.ts"),W=P("./src/utils/mp4-tools.ts"),n=P("./src/utils/typed-array.ts"),D=16,m=function(){function f(c,o,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=o,this.removePKCS7Padding=r,r)try{var s=self.crypto;s&&(this.subtle=s.subtle||s.webkitSubtle)}catch(S){}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 o=this.currentResult;if(!o){this.reset();return}var d=new Uint8Array(o);return this.reset(),this.removePKCS7Padding?Object(M.removePadding)(d):d},h.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},h.decrypt=function(o,d,i,a){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(o),d,i);var r=this.flush();r&&a(r.buffer)}else this.webCryptoDecrypt(new Uint8Array(o),d,i).then(a)},h.softwareDecrypt=function(o,d,i){var a=this.currentIV,r=this.currentResult,s=this.remainderData;this.logOnce("JS AES decrypt"),s&&(o=Object(W.appendUint8Array)(s,o),this.remainderData=null);var S=this.getValidChunk(o);if(!S.length)return null;a&&(i=a);var w=this.softwareDecrypter;w||(w=this.softwareDecrypter=new M.default),w.expandKey(d);var x=r;return this.currentResult=w.decrypt(S.buffer,0,i),this.currentIV=Object(n.sliceUint8)(S,-16).buffer,x||null},h.webCryptoDecrypt=function(o,d,i){var a=this,r=this.subtle;return(this.key!==d||!this.fastAesKey)&&(this.key=d,this.fastAesKey=new U.default(r,d)),this.fastAesKey.expandKey().then(function(s){if(!r)return Promise.reject(new Error("web crypto not initialized"));var S=new V.default(r,i);return S.decrypt(o.buffer,s)}).catch(function(s){return a.onWebCryptoError(s,o,d,i)})},h.onWebCryptoError=function(o,d,i,a){return G.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",o),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(d,i,a)},h.getValidChunk=function(o){var d=o,i=o.length-o.length%D;return i!==o.length&&(d=Object(n.sliceUint8)(o,0,i),this.remainderData=Object(n.sliceUint8)(o,i)),d},h.logOnce=function(o){if(!this.logEnabled)return;G.logger.log("[decrypter.ts]: "+o),this.logEnabled=!1},f}()},"./src/crypt/fast-aes-key.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return V});var V=function(){function U(G,W){this.subtle=void 0,this.key=void 0,this.subtle=G,this.key=W}var M=U.prototype;return M.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},U}()},"./src/demux/aacdemuxer.ts":function(Z,X,P){"use strict";P.r(X);var V=P("./src/demux/base-audio-demuxer.ts"),U=P("./src/demux/adts.ts"),M=P("./src/utils/logger.ts"),G=P("./src/demux/id3.ts");function W(m,f){m.prototype=Object.create(f.prototype),m.prototype.constructor=m,n(m,f)}function n(m,f){return n=Object.setPrototypeOf||function(c,o){return c.__proto__=o,c},n(m,f)}var D=function(m){W(f,m);function f(c,o){var d;return d=m.call(this)||this,d.observer=void 0,d.config=void 0,d.observer=c,d.config=o,d}var h=f.prototype;return h.resetInitSegment=function(o,d,i){m.prototype.resetInitSegment.call(this,o,d,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:o,duration:i,inputTimeScale:9e4,dropped:0}},f.probe=function(o){if(!o)return!1;for(var d=G.getID3Data(o,0)||[],i=d.length,a=o.length;i<a;i++)if(U.probe(o,i))return M.logger.log("ADTS sync word found !"),!0;return!1},h.canParse=function(o,d){return U.canParse(o,d)},h.appendFrame=function(o,d,i){U.initTrackConfig(o,this.observer,d,i,o.manifestCodec);var a=U.appendFrame(o,d,i,this.initPTS,this.frameIndex);if(a&&a.missing===0)return a},f}(V.default);D.minProbeByteLength=9,X.default=D},"./src/demux/adts.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"getAudioConfig",function(){return G}),P.d(X,"isHeaderPattern",function(){return W}),P.d(X,"getHeaderLength",function(){return n}),P.d(X,"getFullFrameLength",function(){return D}),P.d(X,"canGetFrameLength",function(){return m}),P.d(X,"isHeader",function(){return f}),P.d(X,"canParse",function(){return h}),P.d(X,"probe",function(){return c}),P.d(X,"initTrackConfig",function(){return o}),P.d(X,"getFrameDuration",function(){return d}),P.d(X,"parseFrameHeader",function(){return i}),P.d(X,"appendFrame",function(){return a});var V=P("./src/utils/logger.ts"),U=P("./src/errors.ts"),M=P("./src/events.ts");function G(r,s,S,w){var x,L,O,_,b=navigator.userAgent.toLowerCase(),g=w,p=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];x=((s[S+2]&192)>>>6)+1;var C=(s[S+2]&60)>>>2;if(C>p.length-1){r.trigger(M.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+C});return}return O=(s[S+2]&1)<<2,O|=(s[S+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&&O===1||/vivaldi/i.test(b))||!w&&O===1)&&(x=2,_=new Array(2)),L=C)),_[0]=x<<3,_[0]|=(C&14)>>1,_[1]|=(C&1)<<7,_[1]|=O<<3,x===5&&(_[1]|=(L&14)>>1,_[2]=(L&1)<<7,_[2]|=2<<2,_[3]=0),{config:_,samplerate:p[C],channelCount:O,codec:"mp4a.40."+x,manifestCodec:g}}function W(r,s){return r[s]===255&&(r[s+1]&246)===240}function n(r,s){return r[s+1]&1?7:9}function D(r,s){return(r[s+3]&3)<<11|r[s+4]<<3|(r[s+5]&224)>>>5}function m(r,s){return s+5<r.length}function f(r,s){return s+1<r.length&&W(r,s)}function h(r,s){return m(r,s)&&W(r,s)&&D(r,s)<=r.length-s}function c(r,s){if(f(r,s)){var S=n(r,s);if(s+S>=r.length)return!1;var w=D(r,s);if(w<=S)return!1;var x=s+w;return x===r.length||f(r,x)}return!1}function o(r,s,S,w,x){if(!r.samplerate){var L=G(s,S,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,s,S,w,x){var L=n(r,s),O=D(r,s);if(O-=L,O>0){var _=S+w*x;return{headerLength:L,frameLength:O,stamp:_}}}function a(r,s,S,w,x){var L=d(r.samplerate),O=i(s,S,w,x,L);if(O){var _=O.frameLength,b=O.headerLength,g=O.stamp,p=b+_,C=Math.max(0,S+p-s.length),E;C?(E=new Uint8Array(p-b),E.set(s.subarray(S+b,s.length),0)):E=s.subarray(S+b,S+p);var v={unit:E,pts:g};return C||r.samples.push(v),{sample:v,length:p,missing:C}}}},"./src/demux/base-audio-demuxer.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"initPTSFn",function(){return D});var V=P("./src/polyfills/number.ts"),U=P("./src/demux/id3.ts"),M=P("./src/demux/dummy-demuxed-track.ts"),G=P("./src/utils/mp4-tools.ts"),W=P("./src/utils/typed-array.ts"),n=function(){function m(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var f=m.prototype;return f.resetInitSegment=function(c,o,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,o){return!1},f.appendFrame=function(c,o,d){},f.demux=function(c,o){this.cachedData&&(c=Object(G.appendUint8Array)(this.cachedData,c),this.cachedData=null);var d=U.getID3Data(c,0),i=d?d.length:0,a,r,s=this._audioTrack,S=this._id3Track,w=d?U.getTimeStamp(d):void 0,x=c.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=D(w,o)),d&&d.length>0&&S.samples.push({pts:this.initPTS,dts:this.initPTS,data:d}),r=this.initPTS;i<x;){if(this.canParse(c,i)){var L=this.appendFrame(s,c,i);L?(this.frameIndex++,r=L.sample.pts,i+=L.length,a=i):i=x}else U.canParse(c,i)?(d=U.getID3Data(c,i),S.samples.push({pts:r,dts:r,data:d}),i+=d.length,a=i):i++;if(i===x&&a!==x){var O=Object(W.sliceUint8)(c,a);this.cachedData?this.cachedData=Object(G.appendUint8Array)(this.cachedData,O):this.cachedData=O}}return{audioTrack:s,avcTrack:Object(M.dummyTrack)(),id3Track:S,textTrack:Object(M.dummyTrack)()}},f.demuxSampleAes=function(c,o,d){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},f.flush=function(c){var o=this.cachedData;return o&&(this.cachedData=null,this.demux(o,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(M.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(M.dummyTrack)()}},f.destroy=function(){},m}(),D=function(f,h){return Object(V.isFiniteNumber)(f)?f*90:h*9e4};X.default=n},"./src/demux/chunk-cache.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return V});var V=function(){function M(){this.chunks=[],this.dataLength=0}var G=M.prototype;return G.push=function(n){this.chunks.push(n),this.dataLength+=n.length},G.flush=function(){var n=this.chunks,D=this.dataLength,m;if(n.length)n.length===1?m=n[0]:m=U(n,D);else return new Uint8Array(0);return this.reset(),m},G.reset=function(){this.chunks.length=0,this.dataLength=0},M}();function U(M,G){for(var W=new Uint8Array(G),n=0,D=0;D<M.length;D++){var m=M[D];W.set(m,n),n+=m.length}return W}},"./src/demux/dummy-demuxed-track.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"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(Z,X,P){"use strict";P.r(X);var V=P("./src/utils/logger.ts"),U=function(){function M(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 G=M.prototype;return G.loadWord=function(){var n=this.data,D=this.bytesAvailable,m=n.byteLength-D,f=new Uint8Array(4),h=Math.min(4,D);if(h===0)throw new Error("no bytes available");f.set(n.subarray(m,m+h)),this.word=new DataView(f.buffer).getUint32(0),this.bitsAvailable=h*8,this.bytesAvailable-=h},G.skipBits=function(n){var D;this.bitsAvailable>n?(this.word<<=n,this.bitsAvailable-=n):(n-=this.bitsAvailable,D=n>>3,n-=D>>3,this.bytesAvailable-=D,this.loadWord(),this.word<<=n,this.bitsAvailable-=n)},G.readBits=function(n){var D=Math.min(this.bitsAvailable,n),m=this.word>>>32-D;return n>32&&V.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=D,this.bitsAvailable>0?this.word<<=D:this.bytesAvailable>0&&this.loadWord(),D=n-D,D>0&&this.bitsAvailable?m<<D|this.readBits(D):m},G.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()},G.skipUEG=function(){this.skipBits(1+this.skipLZ())},G.skipEG=function(){this.skipBits(1+this.skipLZ())},G.readUEG=function(){var n=this.skipLZ();return this.readBits(n+1)-1},G.readEG=function(){var n=this.readUEG();return 1&n?1+n>>>1:-1*(n>>>1)},G.readBoolean=function(){return this.readBits(1)===1},G.readUByte=function(){return this.readBits(8)},G.readUShort=function(){return this.readBits(16)},G.readUInt=function(){return this.readBits(32)},G.skipScalingList=function(n){for(var D=8,m=8,f,h=0;h<n;h++)m!==0&&(f=this.readEG(),m=(D+f+256)%256),D=m===0?D:m},G.readSPS=function(){var n=0,D=0,m=0,f=0,h,c,o,d=this.readUByte.bind(this),i=this.readBits.bind(this),a=this.readUEG.bind(this),r=this.readBoolean.bind(this),s=this.skipBits.bind(this),S=this.skipEG.bind(this),w=this.skipUEG.bind(this),x=this.skipScalingList.bind(this);d();var L=d();if(i(5),s(3),d(),w(),L===100||L===110||L===122||L===244||L===44||L===83||L===86||L===118||L===128){var O=a();if(O===3&&s(1),w(),w(),s(1),r())for(c=O!==3?8:12,o=0;o<c;o++)r()&&(o<6?x(16):x(64))}w();var _=a();if(_===0)a();else if(_===1)for(s(1),S(),S(),h=a(),o=0;o<h;o++)S();w(),s(1);var b=a(),g=a(),p=i(1);p===0&&s(1),s(1),r()&&(n=a(),D=a(),m=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-D*2),height:(2-p)*(g+1)*16-(p?2:4)*(m+f),pixelRatio:C}},G.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},M}();X.default=U},"./src/demux/id3.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"isHeader",function(){return V}),P.d(X,"isFooter",function(){return U}),P.d(X,"getID3Data",function(){return M}),P.d(X,"canParse",function(){return W}),P.d(X,"getTimeStamp",function(){return n}),P.d(X,"isTimeStampFrame",function(){return D}),P.d(X,"getID3Frames",function(){return f}),P.d(X,"decodeFrame",function(){return h}),P.d(X,"utf8ArrayToStr",function(){return a}),P.d(X,"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)))},U=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)))},M=function(x,L){for(var O=L,_=0;V(x,L);){_+=10;var b=G(x,L+6);_+=b,U(x,L+10)&&(_+=10),L+=_}return _>0?x.subarray(O,O+_):void 0},G=function(x,L){var O=0;return O=(x[L]&127)<<21,O|=(x[L+1]&127)<<14,O|=(x[L+2]&127)<<7,O|=x[L+3]&127,O},W=function(x,L){return V(x,L)&&G(x,L+6)+10<=x.length-L},n=function(x){for(var L=f(x),O=0;O<L.length;O++){var _=L[O];if(D(_))return i(_)}return},D=function(x){return x&&x.key==="PRIV"&&x.info==="com.apple.streaming.transportStreamTimestamp"},m=function(x){var L=String.fromCharCode(x[0],x[1],x[2],x[3]),O=G(x,4),_=10;return{type:L,size:O,data:x.subarray(_,_+O)}},f=function(x){for(var L=0,O=[];V(x,L);){var _=G(x,L+6);L+=10;for(var b=L+_;L+8<b;){var g=m(x.subarray(L)),p=h(g);p&&O.push(p),L+=g.size+10}U(x,L)&&(L+=10)}return O},h=function(x){return x.type==="PRIV"?c(x):x.type[0]==="W"?d(x):o(x)},c=function(x){if(x.size<2)return;var L=a(x.data,!0),O=new Uint8Array(x.data.subarray(L.length+1));return{key:x.type,info:L,data:O.buffer}},o=function(x){if(x.size<2)return;if(x.type==="TXXX"){var L=1,O=a(x.data.subarray(L),!0);L+=O.length+1;var _=a(x.data.subarray(L));return{key:x.type,info:O,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,O=a(x.data.subarray(L),!0);L+=O.length+1;var _=a(x.data.subarray(L));return{key:x.type,info:O,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),O=L[3]&1,_=(L[4]<<23)+(L[5]<<15)+(L[6]<<7)+L[7];return _/=45,O&&(_+=4772185884e-2),Math.round(_)}return},a=function(x,L){L===void 0&&(L=!1);var O=S();if(O){var _=O.decode(x);if(L){var b=_.indexOf("\0");return b!==-1?_.substring(0,b):_}return _.replace(/\0/g,"")}for(var g=x.length,p,C,E,v="",N=0;N<g;){if(p=x[N++],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[N++],v+=String.fromCharCode((p&31)<<6|C&63);break;case 14:C=x[N++],E=x[N++],v+=String.fromCharCode((p&15)<<12|(C&63)<<6|(E&63)<<0);break;default:}}return v},r={decodeTextFrame:o},s;function S(){return!s&&typeof self.TextDecoder!="undefined"&&(s=new self.TextDecoder("utf-8")),s}},"./src/demux/mp3demuxer.ts":function(Z,X,P){"use strict";P.r(X);var V=P("./src/demux/base-audio-demuxer.ts"),U=P("./src/demux/id3.ts"),M=P("./src/utils/logger.ts"),G=P("./src/demux/mpegaudio.ts");function W(m,f){m.prototype=Object.create(f.prototype),m.prototype.constructor=m,n(m,f)}function n(m,f){return n=Object.setPrototypeOf||function(c,o){return c.__proto__=o,c},n(m,f)}var D=function(m){W(f,m);function f(){return m.apply(this,arguments)||this}var h=f.prototype;return h.resetInitSegment=function(o,d,i){m.prototype.resetInitSegment.call(this,o,d,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:o,duration:i,inputTimeScale:9e4,dropped:0}},f.probe=function(o){if(!o)return!1;for(var d=U.getID3Data(o,0)||[],i=d.length,a=o.length;i<a;i++)if(G.probe(o,i))return M.logger.log("MPEG Audio sync word found !"),!0;return!1},h.canParse=function(o,d){return G.canParse(o,d)},h.appendFrame=function(o,d,i){return this.initPTS===null?void 0:G.appendFrame(o,d,i,this.initPTS,this.frameIndex)},f}(V.default);D.minProbeByteLength=4,X.default=D},"./src/demux/mp4demuxer.ts":function(Z,X,P){"use strict";P.r(X);var V=P("./src/utils/mp4-tools.ts"),U=P("./src/demux/dummy-demuxed-track.ts"),M=function(){function G(n,D){this.remainderData=null,this.config=void 0,this.config=D}var W=G.prototype;return W.resetTimeStamp=function(){},W.resetInitSegment=function(){},W.resetContiguity=function(){},G.probe=function(D){return Object(V.findBox)({data:D,start:0,end:Math.min(D.length,16384)},["moof"]).length>0},W.demux=function(D){var m=D,f=Object(U.dummyTrack)();if(this.config.progressive){this.remainderData&&(m=Object(V.appendUint8Array)(this.remainderData,D));var h=Object(V.segmentValidRange)(m);this.remainderData=h.remainder,f.samples=h.valid||new Uint8Array}else f.samples=m;return{audioTrack:Object(U.dummyTrack)(),avcTrack:f,id3Track:Object(U.dummyTrack)(),textTrack:Object(U.dummyTrack)()}},W.flush=function(){var D=Object(U.dummyTrack)();return D.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(U.dummyTrack)(),avcTrack:D,id3Track:Object(U.dummyTrack)(),textTrack:Object(U.dummyTrack)()}},W.demuxSampleAes=function(D,m,f){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},W.destroy=function(){},G}();M.minProbeByteLength=1024,X.default=M},"./src/demux/mpegaudio.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"appendFrame",function(){return n}),P.d(X,"parseHeader",function(){return D}),P.d(X,"isHeaderPattern",function(){return m}),P.d(X,"isHeader",function(){return f}),P.d(X,"canParse",function(){return h}),P.d(X,"probe",function(){return c});var V=null,U=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],M=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],G=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],W=[0,1,1,4];function n(o,d,i,a,r){if(i+24>d.length)return;var s=D(d,i);if(s&&i+s.frameLength<=d.length){var S=s.samplesPerFrame*9e4/s.sampleRate,w=a+r*S,x={unit:d.subarray(i,i+s.frameLength),pts:w,dts:w};return o.config=[],o.channelCount=s.channelCount,o.samplerate=s.sampleRate,o.samples.push(x),{sample:x,length:s.frameLength,missing:0}}}function D(o,d){var i=o[d+1]>>3&3,a=o[d+1]>>1&3,r=o[d+2]>>4&15,s=o[d+2]>>2&3;if(i!==1&&r!==0&&r!==15&&s!==3){var S=o[d+2]>>1&1,w=o[d+3]>>6,x=i===3?3-a:a===3?3:4,L=U[x*14+r-1]*1e3,O=i===3?0:i===2?1:2,_=M[O*3+s],b=w===3?1:2,g=G[i][a],p=W[a],C=g*8*p,E=Math.floor(g*L/_+S)*p;if(V===null){var v=navigator.userAgent||"",N=v.match(/Chrome\/(\d+)/i);V=N?parseInt(N[1]):0}var F=!!V&&V<=87;return F&&a===2&&L>=224e3&&w===0&&(o[d+3]=o[d+3]|128),{sampleRate:_,channelCount:b,frameLength:E,samplesPerFrame:C}}}function m(o,d){return o[d]===255&&(o[d+1]&224)===224&&(o[d+1]&6)!==0}function f(o,d){return d+1<o.length&&m(o,d)}function h(o,d){var i=4;return m(o,d)&&i<=o.length-d}function c(o,d){if(d+1<o.length&&m(o,d)){var i=4,a=D(o,d),r=i;a!=null&&a.frameLength&&(r=a.frameLength);var s=d+r;return s===o.length||f(o,s)}return!1}},"./src/demux/sample-aes.ts":function(Z,X,P){"use strict";P.r(X);var V=P("./src/crypt/decrypter.ts"),U=P("./src/demux/tsdemuxer.ts"),M=function(){function G(n,D,m){this.keyData=void 0,this.decrypter=void 0,this.keyData=m,this.decrypter=new V.default(n,D,{removePKCS7Padding:!1})}var W=G.prototype;return W.decryptBuffer=function(D,m){this.decrypter.decrypt(D,this.keyData.key.buffer,this.keyData.iv.buffer,m)},W.decryptAacSample=function(D,m,f,h){var c=D[m].unit,o=c.subarray(16,c.length-c.length%16),d=o.buffer.slice(o.byteOffset,o.byteOffset+o.length),i=this;this.decryptBuffer(d,function(a){var r=new Uint8Array(a);c.set(r,16),h||i.decryptAacSamples(D,m+1,f)})},W.decryptAacSamples=function(D,m,f){for(;;m++){if(m>=D.length){f();return}if(D[m].unit.length<32)continue;var h=this.decrypter.isSync();if(this.decryptAacSample(D,m,f,h),!h)return}},W.getAvcEncryptedData=function(D){for(var m=Math.floor((D.length-48)/160)*16+16,f=new Int8Array(m),h=0,c=32;c<=D.length-16;c+=160,h+=16)f.set(D.subarray(c,c+16),h);return f},W.getAvcDecryptedUnit=function(D,m){for(var f=new Uint8Array(m),h=0,c=32;c<=D.length-16;c+=160,h+=16)D.set(f.subarray(h,h+16),c);return D},W.decryptAvcSample=function(D,m,f,h,c,o){var d=Object(U.discardEPB)(c.data),i=this.getAvcEncryptedData(d),a=this;this.decryptBuffer(i.buffer,function(r){c.data=a.getAvcDecryptedUnit(d,r),o||a.decryptAvcSamples(D,m,f+1,h)})},W.decryptAvcSamples=function(D,m,f,h){if(D instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;m++,f=0){if(m>=D.length){h();return}for(var c=D[m].units;!(f>=c.length);f++){var o=c[f];if(o.data.length<=48||o.type!==1&&o.type!==5)continue;var d=this.decrypter.isSync();if(this.decryptAvcSample(D,m,f,h,o,d),!d)return}}},G}();X.default=M},"./src/demux/transmuxer-interface.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return c});var V=P("./node_modules/webworkify-webpack/index.js"),U=P.n(V),M=P("./src/events.ts"),G=P("./src/demux/transmuxer.ts"),W=P("./src/utils/logger.ts"),n=P("./src/errors.ts"),D=P("./src/utils/mediasource-helper.ts"),m=P("./node_modules/eventemitter3/index.js"),f=P.n(m),h=Object(D.getMediaSource)()||{isTypeSupported:function(){return!1}},c=function(){function o(i,a,r,s){var S=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=s;var w=i.config,x=function(g,p){p=p||{},p.frag=S.frag,p.id=S.id,i.trigger(g,p)};this.observer=new m.EventEmitter,this.observer.on(M.Events.FRAG_DECRYPTED,x),this.observer.on(M.Events.ERROR,x);var L={mp4:h.isTypeSupported("video/mp4"),mpeg:h.isTypeSupported("audio/mpeg"),mp3:h.isTypeSupported('audio/mp4; codecs="mp3"')},O=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(M.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:O,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 G.default(this.observer,L,w,O,a),this.worker=null}}else this.transmuxer=new G.default(this.observer,L,w,O,a)}var d=o.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 s=this.observer;s&&s.removeAllListeners(),this.observer=null},d.push=function(a,r,s,S,w,x,L,O,_,b){var g=this;_.transmuxing.start=self.performance.now();var p=this.transmuxer,C=this.worker,E=x?x.start:w.start,v=w.decryptdata,N=this.frag,F=!(N&&w.cc===N.cc),A=!(N&&_.level===N.level),H=N?_.sn-N.sn:-1,j=this.part?_.part-this.part.index:1,T=!A&&(H===1||H===0&&j===1),z=self.performance.now();(A||H||w.stats.parsing.start===0)&&(w.stats.parsing.start=z),x&&(j||!T)&&(x.stats.parsing.start=z);var Q=new G.TransmuxState(F,T,O,A,E);if(!T||F){W.logger.log("[transmuxer-interface, "+w.type+"]: Starting new transmux session for sn: "+_.sn+" p: "+_.part+" level: "+_.level+" id: "+_.id+`
|
|
discontinuity: `+F+`
|
|
trackSwitch: `+A+`
|
|
contiguous: `+T+`
|
|
accurateTimeOffset: `+O+`
|
|
timeOffset: `+E);var ne=new G.TransmuxConfig(s,S,r,L,b);this.configureTransmuxer(ne)}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 se=p.push(a,v,_,Q);Object(G.isPromise)(se)?se.then(function(xe){g.handleTransmuxComplete(xe)}):this.handleTransmuxComplete(se)}},d.flush=function(a){var r=this;a.transmuxing.start=self.performance.now();var s=this.transmuxer,S=this.worker;if(S)S.postMessage({cmd:"flush",chunkMeta:a});else if(s){var w=s.flush(a);Object(G.isPromise)(w)?w.then(function(x){r.handleFlushResult(x,a)}):this.handleFlushResult(w,a)}},d.handleFlushResult=function(a,r){var s=this;a.forEach(function(S){s.handleTransmuxComplete(S)}),this.onFlush(r)},d.onWorkerMessage=function(a){var r=a.data,s=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,s.trigger(r.event,r.data);break}}},d.configureTransmuxer=function(a){var r=this.worker,s=this.transmuxer;r?r.postMessage({cmd:"configure",config:a}):s&&s.configure(a)},d.handleTransmuxComplete=function(a){a.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(a)},o}()},"./src/demux/transmuxer-worker.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return n});var V=P("./src/demux/transmuxer.ts"),U=P("./src/events.ts"),M=P("./src/utils/logger.ts"),G=P("./node_modules/eventemitter3/index.js"),W=P.n(G);function n(c){var o=new G.EventEmitter,d=function(a,r){c.postMessage({event:a,data:r})};o.on(U.Events.FRAG_DECRYPTED,d),o.on(U.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(o,a.typeSupported,r,a.vendor,a.id),Object(M.enableLogs)(r.debug),d("init",null);break}case"configure":{c.transmuxer.configure(a.config);break}case"demux":{var s=c.transmuxer.push(a.data,a.decryptdata,a.chunkMeta,a.state);Object(V.isPromise)(s)?s.then(function(x){D(c,x)}):D(c,s);break}case"flush":{var S=a.chunkMeta,w=c.transmuxer.flush(S);Object(V.isPromise)(w)?w.then(function(x){f(c,x,S)}):f(c,w,S);break}default:break}})}function D(c,o){if(h(o.remuxResult))return;var d=[],i=o.remuxResult,a=i.audio,r=i.video;a&&m(d,a),r&&m(d,r),c.postMessage({event:"transmuxComplete",data:o},d)}function m(c,o){o.data1&&c.push(o.data1.buffer),o.data2&&c.push(o.data2.buffer)}function f(c,o,d){o.forEach(function(i){D(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(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return r}),P.d(X,"isPromise",function(){return w}),P.d(X,"TransmuxConfig",function(){return x}),P.d(X,"TransmuxState",function(){return L});var V=P("./src/events.ts"),U=P("./src/errors.ts"),M=P("./src/crypt/decrypter.ts"),G=P("./src/demux/aacdemuxer.ts"),W=P("./src/demux/mp4demuxer.ts"),n=P("./src/demux/tsdemuxer.ts"),D=P("./src/demux/mp3demuxer.ts"),m=P("./src/remux/mp4-remuxer.ts"),f=P("./src/remux/passthrough-remuxer.ts"),h=P("./src/demux/chunk-cache.ts"),c=P("./src/utils/mp4-tools.ts"),o=P("./src/utils/logger.ts"),d;try{d=self.performance.now.bind(self.performance)}catch(O){o.logger.debug("Unable to use Performance API on this environment"),d=self.Date.now}var i=[{demux:n.default,remux:m.default},{demux:W.default,remux:f.default},{demux:G.default,remux:m.default},{demux:D.default,remux:m.default}],a=1024;i.forEach(function(O){var _=O.demux;a=Math.max(a,_.minProbeByteLength)});var r=function(){function O(b,g,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=g,this.config=p,this.vendor=C,this.id=E}var _=O.prototype;return _.configure=function(g){this.transmuxConfig=g,this.decrypter&&this.decrypter.reset()},_.push=function(g,p,C,E){var v=this,N=C.transmuxing;N.executeStart=d();var F=new Uint8Array(g),A=this.cache,H=this.config,j=this.currentTransmuxState,T=this.transmuxConfig;E&&(this.currentTransmuxState=E);var z=s(F,p);if(z&&z.method==="AES-128"){var Q=this.getDecrypter();if(H.enableSoftwareAES){var ne=Q.softwareDecrypt(F,z.key.buffer,z.iv.buffer);if(!ne)return N.executeEnd=d(),S(C);F=new Uint8Array(ne)}else return this.decryptionPromise=Q.webCryptoDecrypt(F,z.key.buffer,z.iv.buffer).then(function(Ze){var ot=v.push(Ze,null,C);return v.decryptionPromise=null,ot}),this.decryptionPromise}var se=E||j,xe=se.contiguous,ge=se.discontinuity,ve=se.trackSwitch,Oe=se.accurateTimeOffset,Re=se.timeOffset,he=T.audioCodec,ue=T.videoCodec,Me=T.defaultInitPts,et=T.duration,it=T.initSegmentData;if((ge||ve)&&this.resetInitSegment(it,he,ue,et),ge&&this.resetInitialTimestamp(Me),xe||this.resetContiguity(),this.needsProbing(F,ge,ve)){if(A.dataLength){var nt=A.flush();F=Object(c.appendUint8Array)(nt,F)}this.configureTransmuxer(F,T)}var at=this.transmux(F,z,Re,Oe,C),ze=this.currentTransmuxState;return ze.contiguous=!0,ze.discontinuity=!1,ze.trackSwitch=!1,N.executeEnd=d(),at},_.flush=function(g){var p=this,C=g.transmuxing;C.executeStart=d();var E=this.decrypter,v=this.cache,N=this.currentTransmuxState,F=this.decryptionPromise;if(F)return F.then(function(){return p.flush(g)});var A=[],H=N.timeOffset;if(E){var j=E.flush();j&&A.push(this.push(j,null,g))}var T=v.dataLength;v.reset();var z=this.demuxer,Q=this.remuxer;if(!z||!Q)return T>=a&&this.observer.emit(V.Events.ERROR,V.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),C.executeEnd=d(),[S(g)];var ne=z.flush(H);return w(ne)?ne.then(function(se){return p.flushRemux(A,se,g),A}):(this.flushRemux(A,ne,g),A)},_.flushRemux=function(g,p,C){var E=p.audioTrack,v=p.avcTrack,N=p.id3Track,F=p.textTrack,A=this.currentTransmuxState,H=A.accurateTimeOffset,j=A.timeOffset;o.logger.log("[transmuxer.ts]: Flushed fragment "+C.sn+(C.part>-1?" p: "+C.part:"")+" of level "+C.level);var T=this.remuxer.remux(E,v,N,F,j,H,!0,this.id);g.push({remuxResult:T,chunkMeta:C}),C.transmuxing.executeEnd=d()},_.resetInitialTimestamp=function(g){var p=this.demuxer,C=this.remuxer;if(!p||!C)return;p.resetTimeStamp(g),C.resetTimeStamp(g)},_.resetContiguity=function(){var g=this.demuxer,p=this.remuxer;if(!g||!p)return;g.resetContiguity(),p.resetNextTimestamp()},_.resetInitSegment=function(g,p,C,E){var v=this.demuxer,N=this.remuxer;if(!v||!N)return;v.resetInitSegment(p,C,E),N.resetInitSegment(g,p,C)},_.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},_.transmux=function(g,p,C,E,v){var N;return p&&p.method==="SAMPLE-AES"?N=this.transmuxSampleAes(g,p,C,E,v):N=this.transmuxUnencrypted(g,C,E,v),N},_.transmuxUnencrypted=function(g,p,C,E){var v=this.demuxer.demux(g,p,!1,!this.config.progressive),N=v.audioTrack,F=v.avcTrack,A=v.id3Track,H=v.textTrack,j=this.remuxer.remux(N,F,A,H,p,C,!1,this.id);return{remuxResult:j,chunkMeta:E}},_.transmuxSampleAes=function(g,p,C,E,v){var N=this;return this.demuxer.demuxSampleAes(g,p,C).then(function(F){var A=N.remuxer.remux(F.audioTrack,F.avcTrack,F.id3Track,F.textTrack,C,E,!1,N.id);return{remuxResult:A,chunkMeta:v}})},_.configureTransmuxer=function(g,p){for(var C=this.config,E=this.observer,v=this.typeSupported,N=this.vendor,F=p.audioCodec,A=p.defaultInitPts,H=p.duration,j=p.initSegmentData,T=p.videoCodec,z,Q=0,ne=i.length;Q<ne;Q++)if(i[Q].demux.probe(g)){z=i[Q];break}z||(o.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),z={demux:W.default,remux:f.default});var se=this.demuxer,xe=this.remuxer,ge=z.remux,ve=z.demux;(!xe||!(xe instanceof ge))&&(this.remuxer=new ge(E,C,v,N)),(!se||!(se instanceof ve))&&(this.demuxer=new ve(E,C,v),this.probe=ve.probe),this.resetInitSegment(j,F,T,H),this.resetInitialTimestamp(A)},_.needsProbing=function(g,p,C){return!this.demuxer||!this.remuxer||p||C},_.getDecrypter=function(){var g=this.decrypter;return g||(g=this.decrypter=new M.default(this.observer,this.config)),g},O}();function s(O,_){var b=null;return O.byteLength>0&&_!=null&&_.key!=null&&_.iv!==null&&_.method!=null&&(b=_),b}var S=function(_){return{remuxResult:{},chunkMeta:_}};function w(O){return"then"in O&&O.then instanceof Function}var x=function(_,b,g,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=g,this.duration=p,this.defaultInitPts=C},L=function(_,b,g,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=g,this.trackSwitch=p,this.timeOffset=C}},"./src/demux/tsdemuxer.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"discardEPB",function(){return S});var V=P("./src/demux/adts.ts"),U=P("./src/demux/mpegaudio.ts"),M=P("./src/demux/exp-golomb.ts"),G=P("./src/demux/id3.ts"),W=P("./src/demux/sample-aes.ts"),n=P("./src/events.ts"),D=P("./src/utils/mp4-tools.ts"),m=P("./src/utils/logger.ts"),f=P("./src/errors.ts"),h={video:1,audio:2,id3:3,text:4},c=function(){function w(L,O,_){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=O,this.typeSupported=_}w.probe=function(O){var _=w.syncOffset(O);return _<0?!1:(_&&m.logger.warn("MPEG2-TS detected but first sync word found @ offset "+_+", junk ahead ?"),!0)},w.syncOffset=function(O){for(var _=Math.min(1e3,O.length-3*188),b=0;b<_;){if(O[b]===71&&O[b+188]===71&&O[b+2*188]===71)return b;b++}return-1},w.createTrack=function(O,_){return{container:O==="video"||O==="audio"?"video/mp2t":void 0,type:O,id:h[O],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:O==="audio"?_:void 0}};var x=w.prototype;return x.resetInitSegment=function(O,_,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=O,this.videoCodec=_,this._duration=b},x.resetTimeStamp=function(){},x.resetContiguity=function(){var O=this._audioTrack,_=this._avcTrack,b=this._id3Track;O&&(O.pesData=null),_&&(_.pesData=null),b&&(b.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},x.demux=function(O,_,b,g){b===void 0&&(b=!1),g===void 0&&(g=!1),b||(this.sampleAes=null);var p,C=this._avcTrack,E=this._audioTrack,v=this._id3Track,N=C.pid,F=C.pesData,A=E.pid,H=v.pid,j=E.pesData,T=v.pesData,z=!1,Q=this.pmtParsed,ne=this._pmtId,se=O.length;if(this.remainderData&&(O=Object(D.appendUint8Array)(this.remainderData,O),se=O.length,this.remainderData=null),se<188&&!g)return this.remainderData=O,{audioTrack:E,avcTrack:C,id3Track:v,textTrack:this._txtTrack};var xe=Math.max(0,w.syncOffset(O));se-=(se+xe)%188,se<O.byteLength&&!g&&(this.remainderData=new Uint8Array(O.buffer,se,O.buffer.byteLength-se));for(var ge=xe;ge<se;ge+=188)if(O[ge]===71){var ve=!!(O[ge+1]&64),Oe=((O[ge+1]&31)<<8)+O[ge+2],Re=(O[ge+3]&48)>>4,he=void 0;if(Re>1){if(he=ge+5+O[ge+4],he===ge+188)continue}else he=ge+4;switch(Oe){case N:ve&&(F&&(p=a(F))&&this.parseAVCPES(p,!1),F={data:[],size:0}),F&&(F.data.push(O.subarray(he,ge+188)),F.size+=ge+188-he);break;case A:ve&&(j&&(p=a(j))&&(E.isAAC?this.parseAACPES(p):this.parseMPEGPES(p)),j={data:[],size:0}),j&&(j.data.push(O.subarray(he,ge+188)),j.size+=ge+188-he);break;case H:ve&&(T&&(p=a(T))&&this.parseID3PES(p),T={data:[],size:0}),T&&(T.data.push(O.subarray(he,ge+188)),T.size+=ge+188-he);break;case 0:ve&&(he+=O[he]+1),ne=this._pmtId=d(O,he);break;case ne:{ve&&(he+=O[he]+1);var ue=i(O,he,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,b);N=ue.avc,N>0&&(C.pid=N),A=ue.audio,A>0&&(E.pid=A,E.isAAC=ue.isAAC),H=ue.id3,H>0&&(v.pid=H),z&&!Q&&(m.logger.log("reparse from beginning"),z=!1,ge=xe-188),Q=this.pmtParsed=!0;break}case 17:case 8191:break;default:z=!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=j,v.pesData=T;var Me={audioTrack:E,avcTrack:C,id3Track:v,textTrack:this._txtTrack};return g&&this.extractRemainingSamples(Me),Me},x.flush=function(){var O=this.remainderData;this.remainderData=null;var _;return O?_=this.demux(O,-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(O){var _=O.audioTrack,b=O.avcTrack,g=O.id3Track,p=b.pesData,C=_.pesData,E=g.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&&m.logger.log("last AAC PES packet truncated,might overlap between fragments"),_.pesData=C),E&&(v=a(E))?(this.parseID3PES(v),g.pesData=null):g.pesData=E},x.demuxSampleAes=function(O,_,b){var g=this.demux(O,b,!0,!this.config.progressive),p=this.sampleAes=new W.default(this.observer,this.config,_);return this.decrypt(g,p)},x.decrypt=function(O,_){return new Promise(function(b){var g=O.audioTrack,p=O.avcTrack;g.samples&&g.isAAC?_.decryptAacSamples(g.samples,0,function(){p.samples?_.decryptAvcSamples(p.samples,0,0,function(){b(O)}):b(O)}):p.samples&&_.decryptAvcSamples(p.samples,0,0,function(){b(O)})})},x.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},x.parseAVCPES=function(O,_){var b=this,g=this._avcTrack,p=this.parseAVCNALu(O.data),C=!1,E=this.avcSample,v,N=!1;O.data=null,E&&p.length&&!g.audFound&&(r(E,g),E=this.avcSample=o(!1,O.pts,O.dts,"")),p.forEach(function(F){switch(F.type){case 1:{v=!0,E||(E=b.avcSample=o(!0,O.pts,O.dts,"")),C&&(E.debug+="NDR "),E.frame=!0;var A=F.data;if(N&&A.length>4){var H=new M.default(A).readSliceType();(H===2||H===4||H===7||H===9)&&(E.key=!0)}break}case 5:v=!0,E||(E=b.avcSample=o(!0,O.pts,O.dts,"")),C&&(E.debug+="IDR "),E.key=!0,E.frame=!0;break;case 6:{v=!0,C&&E&&(E.debug+="SEI ");var j=new M.default(S(F.data));j.readUByte();for(var T=0,z=0,Q=!1,ne=0;!Q&&j.bytesAvailable>1;){T=0;do ne=j.readUByte(),T+=ne;while(ne===255);z=0;do ne=j.readUByte(),z+=ne;while(ne===255);if(T===4&&j.bytesAvailable!==0){Q=!0;var se=j.readUByte();if(se===181){var xe=j.readUShort();if(xe===49){var ge=j.readUInt();if(ge===1195456820){var ve=j.readUByte();if(ve===3){for(var Oe=j.readUByte(),Re=j.readUByte(),he=31&Oe,ue=[Oe,Re],Me=0;Me<he;Me++)ue.push(j.readUByte()),ue.push(j.readUByte()),ue.push(j.readUByte());s(b._txtTrack.samples,{type:3,pts:O.pts,bytes:ue})}}}}}else if(T===5&&j.bytesAvailable!==0){if(Q=!0,z>16){for(var et=[],it=0;it<16;it++)et.push(j.readUByte().toString(16)),(it===3||it===5||it===7||it===9)&&et.push("-");for(var nt=z-16,at=new Uint8Array(nt),ze=0;ze<nt;ze++)at[ze]=j.readUByte();s(b._txtTrack.samples,{pts:O.pts,payloadType:T,uuid:et.join(""),userData:Object(G.utf8ArrayToStr)(at),userDataBytes:at})}}else if(z<j.bytesAvailable)for(var Ze=0;Ze<z;Ze++)j.readUByte()}break}case 7:if(v=!0,N=!0,C&&E&&(E.debug+="SPS "),!g.sps){var ot=new M.default(F.data),de=ot.readSPS();g.width=de.width,g.height=de.height,g.pixelRatio=de.pixelRatio,g.sps=[F.data],g.duration=b._duration;for(var Se=F.data.subarray(1,4),Le="avc1.",De=0;De<3;De++){var qe=Se[De].toString(16);qe.length<2&&(qe="0"+qe),Le+=qe}g.codec=Le}break;case 8:v=!0,C&&E&&(E.debug+="PPS "),g.pps||(g.pps=[F.data]);break;case 9:v=!1,g.audFound=!0,E&&r(E,g),E=b.avcSample=o(!1,O.pts,O.dts,C?"AUD ":"");break;case 12:v=!1;break;default:v=!1,E&&(E.debug+="unknown NAL "+F.type+" ");break}if(E&&v){var lt=E.units;lt.push(F)}}),_&&E&&(r(E,g),this.avcSample=null)},x.getLastNalUnit=function(){var O,_=this.avcSample,b;if(!_||_.units.length===0){var g=this._avcTrack.samples;_=g[g.length-1]}if((O=_)!==null&&O!==void 0&&O.units){var p=_.units;b=p[p.length-1]}return b},x.parseAVCNALu=function(O){var _=O.byteLength,b=this._avcTrack,g=b.naluState||0,p=g,C=[],E=0,v,N,F,A=-1,H=0;for(g===-1&&(A=0,H=O[0]&31,g=0,E=1);E<_;){if(v=O[E++],!g){g=v?0:1;continue}if(g===1){g=v?0:2;continue}if(!v)g=3;else if(v===1){if(A>=0){var j={data:O.subarray(A,E-g-1),type:H};C.push(j)}else{var T=this.getLastNalUnit();if(T&&(p&&E<=4-p&&(T.state&&(T.data=T.data.subarray(0,T.data.byteLength-p))),N=E-g-1,N>0)){var z=new Uint8Array(T.data.byteLength+N);z.set(T.data,0),z.set(O.subarray(0,N),T.data.byteLength),T.data=z,T.state=0}}E<_?(F=O[E]&31,A=E,H=F,g=0):g=-1}else g=0}if(A>=0&&g>=0){var Q={data:O.subarray(A,_),type:H,state:g};C.push(Q)}if(C.length===0){var ne=this.getLastNalUnit();if(ne){var se=new Uint8Array(ne.data.byteLength+O.byteLength);se.set(ne.data,0),se.set(O,ne.data.byteLength),ne.data=se}}return b.naluState=g,C},x.parseAACPES=function(O){var _=0,b=this._audioTrack,g=this.aacOverFlow,p=O.data;if(g){this.aacOverFlow=null;var C=g.sample.unit.byteLength,E=Math.min(g.missing,C),v=C-E;g.sample.unit.set(p.subarray(0,E),v),b.samples.push(g.sample),_=g.missing}var N,F;for(N=_,F=p.length;N<F-1&&!V.isHeader(p,N);N++);if(N!==_){var A,H;if(N<F-1?(A="AAC PES did not start with ADTS header,offset:"+N,H=!1):(A="no ADTS header found in AAC PES",H=!0),m.logger.warn("parsing error:"+A),this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.FRAG_PARSING_ERROR,fatal:H,reason:A}),H)return}V.initTrackConfig(b,this.observer,p,N,this.audioCodec);var j;if(O.pts!==void 0)j=O.pts;else if(g){var T=V.getFrameDuration(b.samplerate);j=g.sample.pts+T}else{m.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var z=0;N<F;)if(V.isHeader(p,N)){if(N+5<F){var Q=V.appendFrame(b,p,N,j,z);if(Q)if(Q.missing)this.aacOverFlow=Q;else{N+=Q.length,z++;continue}}break}else N++},x.parseMPEGPES=function(O){var _=O.data,b=_.length,g=0,p=0,C=O.pts;if(C===void 0){m.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;p<b;)if(U.isHeader(_,p)){var E=U.appendFrame(this._audioTrack,_,p,C,g);if(E)p+=E.length,g++;else break}else p++},x.parseID3PES=function(O){if(O.pts===void 0){m.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(O)},w}();c.minProbeByteLength=188;function o(w,x,L,O){return{key:w,frame:!1,pts:x,dts:L,units:[],debug:O,length:0}}function d(w,x){return(w[x+10]&31)<<8|w[x+11]}function i(w,x,L,O){var _={audio:-1,avc:-1,id3:-1,isAAC:!0},b=(w[x+1]&15)<<8|w[x+2],g=x+3+b-4,p=(w[x+10]&15)<<8|w[x+11];for(x+=12+p;x<g;){var C=(w[x+1]&31)<<8|w[x+2];switch(w[x]){case 207:if(!O){m.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(!O){m.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):m.logger.log("MPEG audio found, not supported in this browser");break;case 36:m.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,O,_,b,g,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(O=(L[4]<<8)+L[5],O&&O>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?(g=(L[14]&14)*536870912+(L[15]&255)*4194304+(L[16]&254)*16384+(L[17]&255)*128+(L[18]&254)/2,b-g>60*9e4&&(m.logger.warn(Math.round((b-g)/9e4)+"s delta between PTS and DTS, align them"),b=g)):g=b),_=L[8];var N=_+9;if(w.size<=N)return null;w.size-=N;for(var F=new Uint8Array(w.size),A=0,H=p.length;A<H;A++){L=p[A];var j=L.byteLength;if(N)if(N>j){N-=j;continue}else L=L.subarray(N),j-=N,N=0;F.set(L,x),x+=j}return O&&(O-=_+3),{data:F,pts:b,dts:g,len:O}}return null}function r(w,x){if(w.units.length&&w.frame){if(w.pts===void 0){var L=x.samples,O=L.length;if(O){var _=L[O-1];w.pts=_.pts,w.dts=_.dts}else{x.dropped++;return}}x.samples.push(w)}w.debug.length&&m.logger.log(w.pts+"/"+w.dts+":"+w.debug)}function s(w,x){var L=w.length;if(L>0){if(x.pts>=w[L-1].pts)w.push(x);else for(var O=L-1;O>=0;O--)if(x.pts<w[O].pts){w.splice(O,0,x);break}}else w.push(x)}function S(w){for(var x=w.byteLength,L=[],O=1;O<x-2;)w[O]===0&&w[O+1]===0&&w[O+2]===3?(L.push(O+2),O+=2):O++;if(L.length===0)return w;var _=x-L.length,b=new Uint8Array(_),g=0;for(O=0;O<_;g++,O++)g===L[0]&&(g++,L.shift()),b[O]=w[g];return b}X.default=c},"./src/errors.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"ErrorTypes",function(){return V}),P.d(X,"ErrorDetails",function(){return U});var V;(function(M){M.NETWORK_ERROR="networkError",M.MEDIA_ERROR="mediaError",M.KEY_SYSTEM_ERROR="keySystemError",M.MUX_ERROR="muxError",M.OTHER_ERROR="otherError"})(V||(V={}));var U;(function(M){M.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",M.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",M.KEY_SYSTEM_NO_SESSION="keySystemNoSession",M.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",M.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",M.MANIFEST_LOAD_ERROR="manifestLoadError",M.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",M.MANIFEST_PARSING_ERROR="manifestParsingError",M.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",M.LEVEL_EMPTY_ERROR="levelEmptyError",M.LEVEL_LOAD_ERROR="levelLoadError",M.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",M.LEVEL_SWITCH_ERROR="levelSwitchError",M.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",M.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",M.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",M.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",M.FRAG_LOAD_ERROR="fragLoadError",M.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",M.FRAG_DECRYPT_ERROR="fragDecryptError",M.FRAG_PARSING_ERROR="fragParsingError",M.REMUX_ALLOC_ERROR="remuxAllocError",M.KEY_LOAD_ERROR="keyLoadError",M.KEY_LOAD_TIMEOUT="keyLoadTimeOut",M.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",M.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",M.BUFFER_APPEND_ERROR="bufferAppendError",M.BUFFER_APPENDING_ERROR="bufferAppendingError",M.BUFFER_STALLED_ERROR="bufferStalledError",M.BUFFER_FULL_ERROR="bufferFullError",M.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",M.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",M.INTERNAL_EXCEPTION="internalException",M.INTERNAL_ABORTED="aborted",M.UNKNOWN="unknown"})(U||(U={}))},"./src/events.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"Events",function(){return V});var V;(function(U){U.MEDIA_ATTACHING="hlsMediaAttaching",U.MEDIA_ATTACHED="hlsMediaAttached",U.MEDIA_DETACHING="hlsMediaDetaching",U.MEDIA_DETACHED="hlsMediaDetached",U.BUFFER_RESET="hlsBufferReset",U.BUFFER_CODECS="hlsBufferCodecs",U.BUFFER_CREATED="hlsBufferCreated",U.BUFFER_APPENDING="hlsBufferAppending",U.BUFFER_APPENDED="hlsBufferAppended",U.BUFFER_EOS="hlsBufferEos",U.BUFFER_FLUSHING="hlsBufferFlushing",U.BUFFER_FLUSHED="hlsBufferFlushed",U.MANIFEST_LOADING="hlsManifestLoading",U.MANIFEST_LOADED="hlsManifestLoaded",U.MANIFEST_PARSED="hlsManifestParsed",U.LEVEL_SWITCHING="hlsLevelSwitching",U.LEVEL_SWITCHED="hlsLevelSwitched",U.LEVEL_LOADING="hlsLevelLoading",U.LEVEL_LOADED="hlsLevelLoaded",U.LEVEL_UPDATED="hlsLevelUpdated",U.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",U.LEVELS_UPDATED="hlsLevelsUpdated",U.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",U.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",U.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",U.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",U.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",U.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",U.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",U.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",U.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",U.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",U.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",U.CUES_PARSED="hlsCuesParsed",U.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",U.INIT_PTS_FOUND="hlsInitPtsFound",U.FRAG_LOADING="hlsFragLoading",U.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",U.FRAG_LOADED="hlsFragLoaded",U.FRAG_DECRYPTED="hlsFragDecrypted",U.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",U.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",U.FRAG_PARSING_METADATA="hlsFragParsingMetadata",U.FRAG_PARSED="hlsFragParsed",U.FRAG_BUFFERED="hlsFragBuffered",U.FRAG_CHANGED="hlsFragChanged",U.FPS_DROP="hlsFpsDrop",U.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",U.ERROR="hlsError",U.DESTROYING="hlsDestroying",U.KEY_LOADING="hlsKeyLoading",U.KEY_LOADED="hlsKeyLoaded",U.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",U.BACK_BUFFER_REACHED="hlsBackBufferReached"})(V||(V={}))},"./src/hls.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return w});var V=P("./node_modules/url-toolkit/src/url-toolkit.js"),U=P.n(V),M=P("./src/loader/playlist-loader.ts"),G=P("./src/loader/key-loader.ts"),W=P("./src/controller/id3-track-controller.ts"),n=P("./src/controller/latency-controller.ts"),D=P("./src/controller/level-controller.ts"),m=P("./src/controller/fragment-tracker.ts"),f=P("./src/controller/stream-controller.ts"),h=P("./src/is-supported.ts"),c=P("./src/utils/logger.ts"),o=P("./src/config.ts"),d=P("./node_modules/eventemitter3/index.js"),i=P.n(d),a=P("./src/events.ts"),r=P("./src/errors.ts");function s(x,L){for(var O=0;O<L.length;O++){var _=L[O];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(x,_.key,_)}}function S(x,L,O){return L&&s(x.prototype,L),O&&s(x,O),x}var w=function(){x.isSupported=function(){return Object(h.isSupported)()};function x(O){O===void 0&&(O={}),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(o.mergeConfig)(x.DefaultConfig,O);this.userConfig=O,Object(c.enableLogs)(_.debug),this._autoLevelCapping=-1,_.progressive&&Object(o.enableStreamingMode)(_);var b=_.abrController,g=_.bufferController,p=_.capLevelController,C=_.fpsController,E=this.abrController=new b(this),v=this.bufferController=new g(this),N=this.capLevelController=new p(this),F=new C(this),A=new M.default(this),H=new G.default(this),j=new W.default(this),T=this.levelController=new D.default(this),z=new m.FragmentTracker(this),Q=this.streamController=new f.default(this,z);N.setStreamController(Q),F.setStreamController(Q);var ne=[T,Q];this.networkControllers=ne;var se=[A,H,E,v,N,F,j,z];this.audioTrackController=this.createController(_.audioTrackController,null,ne),this.createController(_.audioStreamController,z,ne),this.subtitleTrackController=this.createController(_.subtitleTrackController,null,ne),this.createController(_.subtitleStreamController,z,ne),this.createController(_.timelineController,null,se),this.emeController=this.createController(_.emeController,null,se),this.cmcdController=this.createController(_.cmcdController,null,se),this.latencyController=this.createController(n.default,null,se),this.coreComponents=se}var L=x.prototype;return L.createController=function(_,b,g){if(_){var p=b?new _(this,b):new _(this);return g&&g.push(p),p}return null},L.on=function(_,b,g){g===void 0&&(g=this),this._emitter.on(_,b,g)},L.once=function(_,b,g){g===void 0&&(g=this),this._emitter.once(_,b,g)},L.removeAllListeners=function(_){this._emitter.removeAllListeners(_)},L.off=function(_,b,g,p){g===void 0&&(g=this),this._emitter.off(_,b,g,p)},L.listeners=function(_){return this._emitter.listeners(_)},L.emit=function(_,b,g){return this._emitter.emit(_,b,g)},L.trigger=function(_,b){if(this.config.debug)return this.emit(_,_,b);try{return this.emit(_,_,b)}catch(g){c.logger.error("An internal error happened while handling event "+_+'. Error message: "'+g.message+'". Here is a stacktrace:',g),this.trigger(a.Events.ERROR,{type:r.ErrorTypes.OTHER_ERROR,details:r.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:_,error:g})}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,g=this.url,p=this.url=V.buildAbsoluteURL(self.location.href,_,{alwaysNormalize:!0});c.logger.log("loadSource:"+p),b&&g&&g!==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)},S(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 g=_.length,p=0;p<g;p++)if(_[p].maxBitrate>b)return p;return 0}},{key:"maxAutoLevel",get:function(){var _=this.levels,b=this.autoLevelCapping,g;return b===-1&&_&&_.length?g=_.length-1:g=b,g}},{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:o.hlsDefaultConfig},set:function(_){x.defaultConfig=_}}]),x}();w.defaultConfig=void 0},"./src/is-supported.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"isSupported",function(){return M}),P.d(X,"changeTypeSupported",function(){return G});var V=P("./src/utils/mediasource-helper.ts");function U(){return self.SourceBuffer||self.WebKitSourceBuffer}function M(){var W=Object(V.getMediaSource)();if(!W)return!1;var n=U(),D=W&&typeof W.isTypeSupported=="function"&&W.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),m=!n||n.prototype&&typeof n.prototype.appendBuffer=="function"&&typeof n.prototype.remove=="function";return!!D&&!!m}function G(){var W,n=U();return typeof(n==null||((W=n.prototype)===null||W===void 0)?void 0:W.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return c}),P.d(X,"LoadError",function(){return d});var V=P("./src/polyfills/number.ts"),U=P("./src/errors.ts");function M(i,a){i.prototype=Object.create(a.prototype),i.prototype.constructor=i,m(i,a)}function G(i){var a=typeof Map=="function"?new Map:void 0;return G=function(s){if(s===null||!D(s))return s;if(typeof s!="function")throw new TypeError("Super expression must either be null or a function");if(typeof a!="undefined"){if(a.has(s))return a.get(s);a.set(s,S)}function S(){return W(s,arguments,f(this).constructor)}return S.prototype=Object.create(s.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),m(S,s)},G(i)}function W(i,a,r){return n()?W=Reflect.construct:W=function(S,w,x){var L=[null];L.push.apply(L,w);var O=Function.bind.apply(S,L),_=new O;return x&&m(_,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 D(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function m(i,a){return m=Object.setPrototypeOf||function(s,S){return s.__proto__=S,s},m(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(s,S){var w=this,x=s.url;if(!x)return Promise.reject(new d({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,networkDetails:null},"Fragment does not have a "+(x?"part list":"url")));this.abort();var L=this.config,O=L.fLoader,_=L.loader;return new Promise(function(b,g){w.loader&&w.loader.destroy();var p=w.loader=s.loader=O?new O(L):new _(L),C=o(s),E={timeout:L.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:L.fragLoadingMaxRetryTimeout,highWaterMark:h};s.stats=p.stats,p.load(C,E,{onSuccess:function(N,F,A,H){w.resetLoader(s,p),b({frag:s,part:null,payload:N.data,networkDetails:H})},onError:function(N,F,A){w.resetLoader(s,p),g(new d({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,response:N,networkDetails:A}))},onAbort:function(N,F,A){w.resetLoader(s,p),g(new d({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:s,networkDetails:A}))},onTimeout:function(N,F,A){w.resetLoader(s,p),g(new d({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:s,networkDetails:A}))},onProgress:function(N,F,A,H){S&&S({frag:s,part:null,payload:A,networkDetails:H})}})})},a.loadPart=function(s,S,w){var x=this;this.abort();var L=this.config,O=L.fLoader,_=L.loader;return new Promise(function(b,g){x.loader&&x.loader.destroy();var p=x.loader=s.loader=O?new O(L):new _(L),C=o(s,S),E={timeout:L.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:L.fragLoadingMaxRetryTimeout,highWaterMark:h};S.stats=p.stats,p.load(C,E,{onSuccess:function(N,F,A,H){x.resetLoader(s,p),x.updateStatsFromPart(s,S);var j={frag:s,part:S,payload:N.data,networkDetails:H};w(j),b(j)},onError:function(N,F,A){x.resetLoader(s,p),g(new d({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,part:S,response:N,networkDetails:A}))},onAbort:function(N,F,A){s.stats.aborted=S.stats.aborted,x.resetLoader(s,p),g(new d({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:s,part:S,networkDetails:A}))},onTimeout:function(N,F,A){x.resetLoader(s,p),g(new d({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:s,part:S,networkDetails:A}))}})})},a.updateStatsFromPart=function(s,S){var w=s.stats,x=S.stats,L=x.total;if(w.loaded+=x.loaded,L){var O=Math.round(s.duration/S.duration),_=Math.min(Math.round(w.loaded/L),O),b=O-_,g=b*Math.round(w.loaded/_);w.total=w.loaded+g}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(s,S){s.loader=null,this.loader===S&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),S.destroy()},i}();function o(i,a){a===void 0&&(a=null);var r=a||i,s={frag:i,part:a,responseType:"arraybuffer",url:r.url,headers:{},rangeStart:0,rangeEnd:0},S=r.byteRangeStartOffset,w=r.byteRangeEndOffset;return Object(V.isFiniteNumber)(S)&&Object(V.isFiniteNumber)(w)&&(s.rangeStart=S,s.rangeEnd=w),s}var d=function(i){M(a,i);function a(r){for(var s,S=arguments.length,w=new Array(S>1?S-1:0),x=1;x<S;x++)w[x-1]=arguments[x];return s=i.call.apply(i,[this].concat(w))||this,s.data=void 0,s.data=r,s}return a}(G(Error))},"./src/loader/fragment.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"ElementaryStreamTypes",function(){return c}),P.d(X,"BaseSegment",function(){return o}),P.d(X,"Fragment",function(){return d}),P.d(X,"Part",function(){return i});var V=P("./src/polyfills/number.ts"),U=P("./node_modules/url-toolkit/src/url-toolkit.js"),M=P.n(U),G=P("./src/utils/logger.ts"),W=P("./src/loader/level-key.ts"),n=P("./src/loader/load-stats.ts");function D(a,r){a.prototype=Object.create(r.prototype),a.prototype.constructor=a,m(a,r)}function m(a,r){return m=Object.setPrototypeOf||function(S,w){return S.__proto__=w,S},m(a,r)}function f(a,r){for(var s=0;s<r.length;s++){var S=r[s];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(a,S.key,S)}}function h(a,r,s){return r&&f(a.prototype,r),s&&f(a,s),a}var c;(function(a){a.AUDIO="audio",a.VIDEO="video",a.AUDIOVIDEO="audiovideo"})(c||(c={}));var o=function(){function a(s){var S;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(S={},S[c.AUDIO]=null,S[c.VIDEO]=null,S[c.AUDIOVIDEO]=null,S),this.baseurl=s}var r=a.prototype;return r.setByteRange=function(S,w){var x=S.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(U.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(S){this._url=S}}]),a}(),d=function(a){D(r,a);function r(S,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=S,x}var s=r.prototype;return s.createInitializationVector=function(w){for(var x=new Uint8Array(16),L=12;L<16;L++)x[L]=w>>8*(15-L)&255;return x},s.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},s.setElementaryStreamInfo=function(w,x,L,O,_,b){b===void 0&&(b=!1);var g=this.elementaryStreams,p=g[w];if(!p){g[w]={startPTS:x,endPTS:L,startDTS:O,endDTS:_,partial:b};return}p.startPTS=Math.min(p.startPTS,x),p.endPTS=Math.max(p.endPTS,L),p.startDTS=Math.min(p.startDTS,O),p.endDTS=Math.max(p.endDTS,_)},s.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&&G.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}(o),i=function(a){D(r,a);function r(s,S,w,x,L){var O;O=a.call(this,w)||this,O.fragOffset=0,O.duration=0,O.gap=!1,O.independent=!1,O.relurl=void 0,O.fragment=void 0,O.index=void 0,O.stats=new n.LoadStats,O.duration=s.decimalFloatingPoint("DURATION"),O.gap=s.bool("GAP"),O.independent=s.bool("INDEPENDENT"),O.relurl=s.enumeratedString("URI"),O.fragment=S,O.index=x;var _=s.enumeratedString("BYTERANGE");return _&&O.setByteRange(_,L),L&&(O.fragOffset=L.fragOffset+L.duration),O}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 S=this.elementaryStreams;return!!(S.audio||S.video||S.audiovideo)}}]),r}(o)},"./src/loader/key-loader.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return G});var V=P("./src/events.ts"),U=P("./src/errors.ts"),M=P("./src/utils/logger.ts"),G=function(){function W(D){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=D,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 m in this.loaders){var f=this.loaders[m];f&&f.destroy()}this.loaders={}},n.onKeyLoading=function(m,f){var h=f.frag,c=h.type,o=this.loaders[c];if(!h.decryptdata){M.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(o&&(M.logger.warn("abort previous key loader for type:"+c),o.abort()),!d){M.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 s={url:d,frag:h,responseType:"arraybuffer"},S={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(s,S,w)}else this.decryptkey&&(h.decryptdata.key=this.decryptkey,this.hls.trigger(V.Events.KEY_LOADED,{frag:h}))},n.loadsuccess=function(m,f,h){var c=h.frag;if(!c.decryptdata){M.logger.error("after key load, decryptdata unset");return}this.decryptkey=c.decryptdata.key=new Uint8Array(m.data),c.loader=null,delete this.loaders[c.type],this.hls.trigger(V.Events.KEY_LOADED,{frag:c})},n.loaderror=function(m,f){var h=f.frag,c=h.loader;c&&c.abort(),delete this.loaders[h.type],this.hls.trigger(V.Events.ERROR,{type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:h,response:m})},n.loadtimeout=function(m,f){var h=f.frag,c=h.loader;c&&c.abort(),delete this.loaders[h.type],this.hls.trigger(V.Events.ERROR,{type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:h})},W}()},"./src/loader/level-details.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"LevelDetails",function(){return W});var V=P("./src/polyfills/number.ts");function U(n,D){for(var m=0;m<D.length;m++){var f=D[m];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(n,f.key,f)}}function M(n,D,m){return D&&U(n.prototype,D),m&&U(n,m),n}var G=10,W=function(){function n(m){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=m}var D=n.prototype;return D.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},M(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||G}},{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(Z,X,P){"use strict";P.r(X),P.d(X,"LevelKey",function(){return W});var V=P("./node_modules/url-toolkit/src/url-toolkit.js"),U=P.n(V);function M(n,D){for(var m=0;m<D.length;m++){var f=D[m];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(n,f.key,f)}}function G(n,D,m){return D&&M(n.prototype,D),m&&M(n,m),n}var W=function(){n.fromURL=function(m,f){return new n(m,f)},n.fromURI=function(m){return new n(m)};function n(D,m){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,m?this._uri=Object(V.buildAbsoluteURL)(D,m,{alwaysNormalize:!0}):this._uri=D}return G(n,[{key:"uri",get:function(){return this._uri}}]),n}()},"./src/loader/load-stats.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"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(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return r});var V=P("./src/polyfills/number.ts"),U=P("./node_modules/url-toolkit/src/url-toolkit.js"),M=P.n(U),G=P("./src/loader/fragment.ts"),W=P("./src/loader/level-details.ts"),n=P("./src/loader/level-key.ts"),D=P("./src/utils/attr-list.ts"),m=P("./src/utils/logger.ts"),f=P("./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,o=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 O,_;return i.test((O=(_=U.parseURL(L))===null||_===void 0?void 0:_.path)!=null?O:"")}var r=function(){function L(){}return L.findGroup=function(_,b){for(var g=0;g<_.length;g++){var p=_[g];if(p.id===b)return p}},L.convertAVC1ToAVCOTI=function(_){var b=_.split(".");if(b.length>2){var g=b.shift()+".";return g+=parseInt(b.shift()).toString(16),g+=("000"+parseInt(b.shift()).toString(16)).substr(-4),g}return _},L.resolve=function(_,b){return U.buildAbsoluteURL(b,_,{alwaysNormalize:!0})},L.parseMasterPlaylist=function(_,b){var g=[],p={},C=!1;h.lastIndex=0;for(var E;(E=h.exec(_))!=null;)if(E[1]){var v=new D.AttrList(E[1]),N={attrs:v,bitrate:v.decimalInteger("AVERAGE-BANDWIDTH")||v.decimalInteger("BANDWIDTH"),name:v.NAME,url:L.resolve(E[2],b)},F=v.decimalResolution("RESOLUTION");F&&(N.width=F.width,N.height=F.height),s((v.CODECS||"").split(/[ ,]+/).filter(function(H){return H}),N),N.videoCodec&&N.videoCodec.indexOf("avc1")!==-1&&(N.videoCodec=L.convertAVC1ToAVCOTI(N.videoCodec)),g.push(N)}else if(E[3]){var A=new D.AttrList(E[3]);A["DATA-ID"]&&(C=!0,p[A["DATA-ID"]]=A)}return{levels:g,sessionData:C?p:null}},L.parseMasterPlaylistMedia=function(_,b,g,p){p===void 0&&(p=[]);var C,E=[],v=0;for(c.lastIndex=0;(C=c.exec(_))!==null;){var N=new D.AttrList(C[1]);if(N.TYPE===g){var F={attrs:N,bitrate:0,id:v++,groupId:N["GROUP-ID"],instreamId:N["INSTREAM-ID"],name:N.NAME||N.LANGUAGE||"",type:g,default:N.bool("DEFAULT"),autoselect:N.bool("AUTOSELECT"),forced:N.bool("FORCED"),lang:N.LANGUAGE,url:N.URI?L.resolve(N.URI,b):""};if(p.length){var A=L.findGroup(p,F.groupId)||p[0];S(F,A,"audioCodec"),S(F,A,"textCodec")}E.push(F)}}return E},L.parseLevelPlaylist=function(_,b,g,p,C){var E=new W.LevelDetails(b),v=E.fragments,N=null,F=0,A=0,H=0,j=0,T=null,z=new G.Fragment(p,b),Q,ne,se,xe=-1,ge=!1;for(o.lastIndex=0,E.m3u8=_;(Q=o.exec(_))!==null;){ge&&(ge=!1,z=new G.Fragment(p,b),z.start=H,z.sn=F,z.cc=j,z.level=g,N&&(z.initSegment=N,z.rawProgramDateTime=N.rawProgramDateTime));var ve=Q[1];if(ve){z.duration=parseFloat(ve);var Oe=(" "+Q[2]).slice(1);z.title=Oe||null,z.tagList.push(Oe?["INF",ve,Oe]:["INF",ve])}else if(Q[3])Object(V.isFiniteNumber)(z.duration)&&(z.start=H,se&&(z.levelkey=se),z.sn=F,z.level=g,z.cc=j,z.urlId=C,v.push(z),z.relurl=(" "+Q[3]).slice(1),x(z,T),T=z,H+=z.duration,F++,A=0,ge=!0);else if(Q[4]){var Re=(" "+Q[4]).slice(1);T?z.setByteRange(Re,T):z.setByteRange(Re)}else if(Q[5])z.rawProgramDateTime=(" "+Q[5]).slice(1),z.tagList.push(["PROGRAM-DATE-TIME",z.rawProgramDateTime]),xe===-1&&(xe=v.length);else{if(Q=Q[0].match(d),!Q){m.logger.warn("No matches on slow regex match for level playlist!");continue}for(ne=1;ne<Q.length&&!(typeof Q[ne]!="undefined");ne++);var he=(" "+Q[ne]).slice(1),ue=(" "+Q[ne+1]).slice(1),Me=Q[ne+2]?(" "+Q[ne+2]).slice(1):"";switch(he){case"PLAYLIST-TYPE":E.type=ue.toUpperCase();break;case"MEDIA-SEQUENCE":F=E.startSN=parseInt(ue);break;case"SKIP":{var et=new D.AttrList(ue),it=et.decimalInteger("SKIPPED-SEGMENTS");if(Object(V.isFiniteNumber)(it)){E.skippedSegments=it;for(var nt=it;nt--;)v.unshift(null);F+=it}var at=et.enumeratedString("RECENTLY-REMOVED-DATERANGES");at&&(E.recentlyRemovedDateranges=at.split(" "));break}case"TARGETDURATION":E.targetduration=parseFloat(ue);break;case"VERSION":E.version=parseInt(ue);break;case"EXTM3U":break;case"ENDLIST":E.live=!1;break;case"#":(ue||Me)&&z.tagList.push(Me?[ue,Me]:[ue]);break;case"DIS":j++;case"GAP":z.tagList.push([he]);break;case"BITRATE":z.tagList.push([he,ue]);break;case"DISCONTINUITY-SEQ":j=parseInt(ue);break;case"KEY":{var ze,Ze=new D.AttrList(ue),ot=Ze.enumeratedString("METHOD"),de=Ze.URI,Se=Ze.hexadecimalInteger("IV"),Le=Ze.enumeratedString("KEYFORMATVERSIONS"),De=Ze.enumeratedString("KEYID"),qe=(ze=Ze.enumeratedString("KEYFORMAT"))!=null?ze:"identity",lt=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(lt.indexOf(qe)>-1){m.logger.warn("Keyformat "+qe+" is not supported from the manifest");continue}else if(qe!=="identity")continue;ot&&(se=n.LevelKey.fromURL(b,de),de&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(ot)>=0&&(se.method=ot,se.keyFormat=qe,De&&(se.keyID=De),Le&&(se.keyFormatVersions=Le),se.iv=Se));break}case"START":{var mt=new D.AttrList(ue),gt=mt.decimalFloatingPoint("TIME-OFFSET");Object(V.isFiniteNumber)(gt)&&(E.startTimeOffset=gt);break}case"MAP":{var Ct=new D.AttrList(ue);z.relurl=Ct.URI,Ct.BYTERANGE&&z.setByteRange(Ct.BYTERANGE),z.level=g,z.sn="initSegment",se&&(z.levelkey=se),z.initSegment=null,N=z,ge=!0;break}case"SERVER-CONTROL":{var xt=new D.AttrList(ue);E.canBlockReload=xt.bool("CAN-BLOCK-RELOAD"),E.canSkipUntil=xt.optionalFloat("CAN-SKIP-UNTIL",0),E.canSkipDateRanges=E.canSkipUntil>0&&xt.bool("CAN-SKIP-DATERANGES"),E.partHoldBack=xt.optionalFloat("PART-HOLD-BACK",0),E.holdBack=xt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ae=new D.AttrList(ue);E.partTarget=Ae.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ce=E.partList;Ce||(Ce=E.partList=[]);var Ve=A>0?Ce[Ce.length-1]:void 0,Qe=A++,Pe=new G.Part(new D.AttrList(ue),z,b,Qe,Ve);Ce.push(Pe),z.duration+=Pe.duration;break}case"PRELOAD-HINT":{var Fe=new D.AttrList(ue);E.preloadHint=Fe;break}case"RENDITION-REPORT":{var be=new D.AttrList(ue);E.renditionReports=E.renditionReports||[],E.renditionReports.push(be);break}default:m.logger.warn("line parsed but not handled: "+Q);break}}}T&&!T.relurl?(v.pop(),H-=T.duration,E.partList&&(E.fragmentHint=T)):E.partList&&(x(z,T),z.cc=j,E.fragmentHint=z);var fe=v.length,pe=v[0],ie=v[fe-1];if(H+=E.skippedSegments*E.targetduration,H>0&&fe&&ie){E.averagetargetduration=H/fe;var ae=ie.sn;E.endSN=ae!=="initSegment"?ae:0,pe&&(E.startCC=pe.cc,pe.initSegment||E.fragments.every(function(ce){return ce.relurl&&a(ce.relurl)})&&(m.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),z=new G.Fragment(p,b),z.relurl=ie.relurl,z.level=g,z.sn="initSegment",pe.initSegment=z,E.needSidxRanges=!0))}else E.endSN=0,E.startCC=0;return E.fragmentHint&&(H+=E.fragmentHint.duration),E.totalduration=H,E.endCC=j,xe>0&&w(v,xe),E},L}();function s(L,O){["video","audio","text"].forEach(function(_){var b=L.filter(function(p){return Object(f.isCodecType)(p,_)});if(b.length){var g=b.filter(function(p){return p.lastIndexOf("avc1",0)===0||p.lastIndexOf("mp4a",0)===0});O[_+"Codec"]=g.length>0?g[0]:b[0],L=L.filter(function(p){return b.indexOf(p)===-1})}}),O.unknownCodecs=L}function S(L,O,_){var b=O[_];b&&(L[_]=b)}function w(L,O){for(var _=L[O],b=O;b--;){var g=L[b];if(!g)return;g.programDateTime=_.programDateTime-g.duration*1e3,_=g}}function x(L,O){L.rawProgramDateTime?L.programDateTime=Date.parse(L.rawProgramDateTime):O!=null&&O.programDateTime&&(L.programDateTime=O.endProgramDateTime),Object(V.isFiniteNumber)(L.programDateTime)||(L.programDateTime=null,L.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(Z,X,P){"use strict";P.r(X);var V=P("./src/polyfills/number.ts"),U=P("./src/events.ts"),M=P("./src/errors.ts"),G=P("./src/utils/logger.ts"),W=P("./src/utils/mp4-tools.ts"),n=P("./src/loader/m3u8-parser.ts"),D=P("./src/types/loader.ts"),m=P("./src/utils/attr-list.ts");function f(o){var d=o.type;switch(d){case D.PlaylistContextType.AUDIO_TRACK:return D.PlaylistLevelType.AUDIO;case D.PlaylistContextType.SUBTITLE_TRACK:return D.PlaylistLevelType.SUBTITLE;default:return D.PlaylistLevelType.MAIN}}function h(o,d){var i=o.url;return(i===void 0||i.indexOf("data:")===0)&&(i=d.url),i}var c=function(){function o(i){this.hls=void 0,this.loaders=Object.create(null),this.hls=i,this.registerListeners()}var d=o.prototype;return d.registerListeners=function(){var a=this.hls;a.on(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(U.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(U.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),a.on(U.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},d.unregisterListeners=function(){var a=this.hls;a.off(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(U.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(U.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),a.off(U.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},d.createInternalLoader=function(a){var r=this.hls.config,s=r.pLoader,S=r.loader,w=s||S,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 s=r.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:D.PlaylistContextType.MANIFEST,url:s,deliveryDirectives:null})},d.onLevelLoading=function(a,r){var s=r.id,S=r.level,w=r.url,x=r.deliveryDirectives;this.load({id:s,groupId:null,level:S,responseType:"text",type:D.PlaylistContextType.LEVEL,url:w,deliveryDirectives:x})},d.onAudioTrackLoading=function(a,r){var s=r.id,S=r.groupId,w=r.url,x=r.deliveryDirectives;this.load({id:s,groupId:S,level:null,responseType:"text",type:D.PlaylistContextType.AUDIO_TRACK,url:w,deliveryDirectives:x})},d.onSubtitleTrackLoading=function(a,r){var s=r.id,S=r.groupId,w=r.url,x=r.deliveryDirectives;this.load({id:s,groupId:S,level:null,responseType:"text",type:D.PlaylistContextType.SUBTITLE_TRACK,url:w,deliveryDirectives:x})},d.load=function(a){var r,s=this.hls.config,S=this.getInternalLoader(a);if(S){var w=S.context;if(w&&w.url===a.url){G.logger.trace("[playlist-loader]: playlist request ongoing");return}G.logger.log("[playlist-loader]: aborting previous loader for type: "+a.type),S.abort()}var x,L,O,_;switch(a.type){case D.PlaylistContextType.MANIFEST:x=s.manifestLoadingMaxRetry,L=s.manifestLoadingTimeOut,O=s.manifestLoadingRetryDelay,_=s.manifestLoadingMaxRetryTimeout;break;case D.PlaylistContextType.LEVEL:case D.PlaylistContextType.AUDIO_TRACK:case D.PlaylistContextType.SUBTITLE_TRACK:x=0,L=s.levelLoadingTimeOut;break;default:x=s.levelLoadingMaxRetry,L=s.levelLoadingTimeOut,O=s.levelLoadingRetryDelay,_=s.levelLoadingMaxRetryTimeout;break}if(S=this.createInternalLoader(a),(r=a.deliveryDirectives)!==null&&r!==void 0&&r.part){var b;if(a.type===D.PlaylistContextType.LEVEL&&a.level!==null?b=this.hls.levels[a.level].details:a.type===D.PlaylistContextType.AUDIO_TRACK&&a.id!==null?b=this.hls.audioTracks[a.id].details:a.type===D.PlaylistContextType.SUBTITLE_TRACK&&a.id!==null&&(b=this.hls.subtitleTracks[a.id].details),b){var g=b.partTarget,p=b.targetduration;g&&p&&(L=Math.min(Math.max(g*3,p*.8)*1e3,L))}}var C={timeout:L,maxRetry:x,retryDelay:O,maxRetryDelay:_,highWaterMark:0},E={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};S.load(a,C,E)},d.loadsuccess=function(a,r,s,S){if(S===void 0&&(S=null),s.isSidxRequest){this.handleSidxRequest(a,s),this.handlePlaylistLoaded(a,r,s,S);return}this.resetInternalLoader(s.type);var w=a.data;if(w.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(a,s,"no EXTM3U delimiter",S);return}r.parsing.start=performance.now(),w.indexOf("#EXTINF:")>0||w.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(a,r,s,S):this.handleMasterPlaylist(a,r,s,S)},d.loaderror=function(a,r,s){s===void 0&&(s=null),this.handleNetworkError(r,s,!1,a)},d.loadtimeout=function(a,r,s){s===void 0&&(s=null),this.handleNetworkError(r,s,!0)},d.handleMasterPlaylist=function(a,r,s,S){var w=this.hls,x=a.data,L=h(a,s),O=n.default.parseMasterPlaylist(x,L),_=O.levels,b=O.sessionData;if(!_.length){this.handleManifestParsingError(a,s,"no level found in manifest",S);return}var g=_.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",g),E=n.default.parseMasterPlaylistMedia(x,L,"SUBTITLES",p),v=n.default.parseMasterPlaylistMedia(x,L,"CLOSED-CAPTIONS");if(C.length){var N=C.some(function(F){return!F.url});!N&&_[0].audioCodec&&!_[0].attrs.AUDIO&&(G.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 m.AttrList({}),bitrate:0,url:""}))}w.trigger(U.Events.MANIFEST_LOADED,{levels:_,audioTracks:C,subtitles:E,captions:v,url:L,stats:r,networkDetails:S,sessionData:b})},d.handleTrackOrLevelPlaylist=function(a,r,s,S){var w=this.hls,x=s.id,L=s.level,O=s.type,_=h(a,s),b=Object(V.isFiniteNumber)(x)?x:0,g=Object(V.isFiniteNumber)(L)?L:b,p=f(s),C=n.default.parseLevelPlaylist(a.data,_,g,p,b);if(!C.fragments.length){w.trigger(U.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:_,reason:"no fragments found in level",level:typeof s.level=="number"?s.level:void 0});return}if(O===D.PlaylistContextType.MANIFEST){var E={attrs:new m.AttrList({}),bitrate:0,details:C,name:"",url:_};w.trigger(U.Events.MANIFEST_LOADED,{levels:[E],audioTracks:[],url:_,stats:r,networkDetails:S,sessionData:null})}if(r.parsing.end=performance.now(),C.needSidxRanges){var v,N=(v=C.fragments[0].initSegment)===null||v===void 0?void 0:v.url;this.load({url:N,isSidxRequest:!0,type:O,level:L,levelDetails:C,id:x,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}s.levelDetails=C,this.handlePlaylistLoaded(a,r,s,S)},d.handleSidxRequest=function(a,r){var s=Object(W.parseSegmentIndex)(new Uint8Array(a.data));if(!s)return;var S=s.references,w=r.levelDetails;S.forEach(function(x,L){var O=x.info,_=w.fragments[L];_.byteRange.length===0&&_.setByteRange(String(1+O.end-O.start)+"@"+String(O.start)),_.initSegment&&_.initSegment.setByteRange(String(s.moovEndOffset)+"@0")})},d.handleManifestParsingError=function(a,r,s,S){this.hls.trigger(U.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:r.type===D.PlaylistContextType.MANIFEST,url:a.url,reason:s,response:a,context:r,networkDetails:S})},d.handleNetworkError=function(a,r,s,S){s===void 0&&(s=!1),G.logger.warn("[playlist-loader]: A network "+(s?"timeout":"error")+" occurred while loading "+a.type+" level: "+a.level+" id: "+a.id+' group-id: "'+a.groupId+'"');var w=M.ErrorDetails.UNKNOWN,x=!1,L=this.getInternalLoader(a);switch(a.type){case D.PlaylistContextType.MANIFEST:w=s?M.ErrorDetails.MANIFEST_LOAD_TIMEOUT:M.ErrorDetails.MANIFEST_LOAD_ERROR,x=!0;break;case D.PlaylistContextType.LEVEL:w=s?M.ErrorDetails.LEVEL_LOAD_TIMEOUT:M.ErrorDetails.LEVEL_LOAD_ERROR,x=!1;break;case D.PlaylistContextType.AUDIO_TRACK:w=s?M.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:M.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,x=!1;break;case D.PlaylistContextType.SUBTITLE_TRACK:w=s?M.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:M.ErrorDetails.SUBTITLE_LOAD_ERROR,x=!1;break}L&&this.resetInternalLoader(a.type);var O={type:M.ErrorTypes.NETWORK_ERROR,details:w,fatal:x,url:a.url,loader:L,context:a,networkDetails:r};S&&(O.response=S),this.hls.trigger(U.Events.ERROR,O)},d.handlePlaylistLoaded=function(a,r,s,S){var w=s.type,x=s.level,L=s.id,O=s.groupId,_=s.loader,b=s.levelDetails,g=s.deliveryDirectives;if(!(b!=null&&b.targetduration)){this.handleManifestParsingError(a,s,"invalid target duration",S);return}if(!_)return;b.live&&(_.getCacheAge&&(b.ageHeader=_.getCacheAge()||0),(!_.getCacheAge||isNaN(b.ageHeader))&&(b.ageHeader=0));switch(w){case D.PlaylistContextType.MANIFEST:case D.PlaylistContextType.LEVEL:this.hls.trigger(U.Events.LEVEL_LOADED,{details:b,level:x||0,id:L||0,stats:r,networkDetails:S,deliveryDirectives:g});break;case D.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(U.Events.AUDIO_TRACK_LOADED,{details:b,id:L||0,groupId:O||"",stats:r,networkDetails:S,deliveryDirectives:g});break;case D.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(U.Events.SUBTITLE_TRACK_LOADED,{details:b,id:L||0,groupId:O||"",stats:r,networkDetails:S,deliveryDirectives:g});break}},o}();X.default=c},"./src/polyfills/number.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"isFiniteNumber",function(){return V}),P.d(X,"MAX_SAFE_INTEGER",function(){return U});var V=Number.isFinite||function(M){return typeof M=="number"&&isFinite(M)},U=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(Z,X,P){"use strict";P.r(X);var V=function(){function U(){}return U.getSilentFrame=function(G,W){switch(G){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},U}();X.default=V},"./src/remux/mp4-generator.ts":function(Z,X,P){"use strict";P.r(X);var V=Math.pow(2,32)-1,U=function(){function M(){}return M.init=function(){M.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 M.types)M.types.hasOwnProperty(W)&&(M.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]),D=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]);M.HDLR_TYPES={video:n,audio:D};var m=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]);M.STTS=M.STSC=M.STCO=f,M.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),M.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),M.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),M.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]),o=new Uint8Array([0,0,0,1]);M.FTYP=M.box(M.types.ftyp,h,o,h,c),M.DINF=M.box(M.types.dinf,M.box(M.types.dref,m))},M.box=function(W){for(var n=8,D=arguments.length,m=new Array(D>1?D-1:0),f=1;f<D;f++)m[f-1]=arguments[f];for(var h=m.length,c=h;h--;)n+=m[h].byteLength;var o=new Uint8Array(n);for(o[0]=n>>24&255,o[1]=n>>16&255,o[2]=n>>8&255,o[3]=n&255,o.set(W,4),h=0,n=8;h<c;h++)o.set(m[h],n),n+=m[h].byteLength;return o},M.hdlr=function(W){return M.box(M.types.hdlr,M.HDLR_TYPES[W])},M.mdat=function(W){return M.box(M.types.mdat,W)},M.mdhd=function(W,n){n*=W;var D=Math.floor(n/(V+1)),m=Math.floor(n%(V+1));return M.box(M.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,D>>24,D>>16&255,D>>8&255,D&255,m>>24,m>>16&255,m>>8&255,m&255,85,196,0,0]))},M.mdia=function(W){return M.box(M.types.mdia,M.mdhd(W.timescale,W.duration),M.hdlr(W.type),M.minf(W))},M.mfhd=function(W){return M.box(M.types.mfhd,new Uint8Array([0,0,0,0,W>>24,W>>16&255,W>>8&255,W&255]))},M.minf=function(W){return W.type==="audio"?M.box(M.types.minf,M.box(M.types.smhd,M.SMHD),M.DINF,M.stbl(W)):M.box(M.types.minf,M.box(M.types.vmhd,M.VMHD),M.DINF,M.stbl(W))},M.moof=function(W,n,D){return M.box(M.types.moof,M.mfhd(W),M.traf(D,n))},M.moov=function(W){for(var n=W.length,D=[];n--;)D[n]=M.trak(W[n]);return M.box.apply(null,[M.types.moov,M.mvhd(W[0].timescale,W[0].duration)].concat(D).concat(M.mvex(W)))},M.mvex=function(W){for(var n=W.length,D=[];n--;)D[n]=M.trex(W[n]);return M.box.apply(null,[M.types.mvex].concat(D))},M.mvhd=function(W,n){n*=W;var D=Math.floor(n/(V+1)),m=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,D>>24,D>>16&255,D>>8&255,D&255,m>>24,m>>16&255,m>>8&255,m&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 M.box(M.types.mvhd,f)},M.sdtp=function(W){var n=W.samples||[],D=new Uint8Array(4+n.length),m,f;for(m=0;m<n.length;m++)f=n[m].flags,D[m+4]=f.dependsOn<<4|f.isDependedOn<<2|f.hasRedundancy;return M.box(M.types.sdtp,D)},M.stbl=function(W){return M.box(M.types.stbl,M.stsd(W),M.box(M.types.stts,M.STTS),M.box(M.types.stsc,M.STSC),M.box(M.types.stsz,M.STSZ),M.box(M.types.stco,M.STCO))},M.avc1=function(W){var n=[],D=[],m,f,h;for(m=0;m<W.sps.length;m++)f=W.sps[m],h=f.byteLength,n.push(h>>>8&255),n.push(h&255),n=n.concat(Array.prototype.slice.call(f));for(m=0;m<W.pps.length;m++)f=W.pps[m],h=f.byteLength,D.push(h>>>8&255),D.push(h&255),D=D.concat(Array.prototype.slice.call(f));var c=M.box(M.types.avcC,new Uint8Array([1,n[3],n[4],n[5],252|3,224|W.sps.length].concat(n).concat([W.pps.length]).concat(D))),o=W.width,d=W.height,i=W.pixelRatio[0],a=W.pixelRatio[1];return M.box(M.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,o>>8&255,o&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,M.box(M.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),M.box(M.types.pasp,new Uint8Array([i>>24,i>>16&255,i>>8&255,i&255,a>>24,a>>16&255,a>>8&255,a&255])))},M.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]))},M.mp4a=function(W){var n=W.samplerate;return M.box(M.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]),M.box(M.types.esds,M.esds(W)))},M.mp3=function(W){var n=W.samplerate;return M.box(M.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]))},M.stsd=function(W){return W.type==="audio"?!W.isAAC&&W.codec==="mp3"?M.box(M.types.stsd,M.STSD,M.mp3(W)):M.box(M.types.stsd,M.STSD,M.mp4a(W)):M.box(M.types.stsd,M.STSD,M.avc1(W))},M.tkhd=function(W){var n=W.id,D=W.duration*W.timescale,m=W.width,f=W.height,h=Math.floor(D/(V+1)),c=Math.floor(D%(V+1));return M.box(M.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,m>>8&255,m&255,0,0,f>>8&255,f&255,0,0]))},M.traf=function(W,n){var D=M.sdtp(W),m=W.id,f=Math.floor(n/(V+1)),h=Math.floor(n%(V+1));return M.box(M.types.traf,M.box(M.types.tfhd,new Uint8Array([0,0,0,0,m>>24,m>>16&255,m>>8&255,m&255])),M.box(M.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])),M.trun(W,D.length+16+20+8+16+8+8),D)},M.trak=function(W){return W.duration=W.duration||4294967295,M.box(M.types.trak,M.tkhd(W),M.mdia(W))},M.trex=function(W){var n=W.id;return M.box(M.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]))},M.trun=function(W,n){var D=W.samples||[],m=D.length,f=12+16*m,h=new Uint8Array(f),c,o,d,i,a,r;for(n+=8+f,h.set([0,0,15,1,m>>>24&255,m>>>16&255,m>>>8&255,m&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255],0),c=0;c<m;c++)o=D[c],d=o.duration,i=o.size,a=o.flags,r=o.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 M.box(M.types.trun,h)},M.initSegment=function(W){M.types||M.init();var n=M.moov(W),D=new Uint8Array(M.FTYP.byteLength+n.byteLength);return D.set(M.FTYP),D.set(n,M.FTYP.byteLength),D},M}();U.types=void 0,U.HDLR_TYPES=void 0,U.STTS=void 0,U.STSC=void 0,U.STCO=void 0,U.STSZ=void 0,U.VMHD=void 0,U.SMHD=void 0,U.STSD=void 0,U.FTYP=void 0,U.DINF=void 0,X.default=U},"./src/remux/mp4-remuxer.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return r}),P.d(X,"normalizePts",function(){return s});var V=P("./src/polyfills/number.ts"),U=P("./src/remux/aac-helper.ts"),M=P("./src/remux/mp4-generator.ts"),G=P("./src/events.ts"),W=P("./src/errors.ts"),n=P("./src/utils/logger.ts"),D=P("./src/types/loader.ts"),m=P("./src/utils/timescale-conversion.ts");function f(){return f=Object.assign||function(L){for(var O=1;O<arguments.length;O++){var _=arguments[O];for(var b in _)Object.prototype.hasOwnProperty.call(_,b)&&(L[b]=_[b])}return L},f.apply(this,arguments)}var h=10*1e3,c=1024,o=1152,d=null,i=null,a=!1,r=function(){function L(_,b,g,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=g,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 O=L.prototype;return O.destroy=function(){},O.resetTimeStamp=function(b){n.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=b},O.resetNextTimestamp=function(){n.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},O.resetInitSegment=function(){n.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},O.getVideoStartPts=function(b){var g=!1,p=b.reduce(function(C,E){var v=E.pts-C;return v<-4294967296?(g=!0,s(C,E.pts)):v>0?C:E.pts},b[0].pts);return g&&n.logger.debug("PTS rollover detected"),p},O.remux=function(b,g,p,C,E,v,N,F){var A,H,j,T,z,Q,ne=E,se=E,xe=b.pid>-1,ge=g.pid>-1,ve=g.samples.length,Oe=b.samples.length>0,Re=ve>1,he=(!xe||Oe)&&(!ge||Re)||this.ISGenerated||N;if(he){this.ISGenerated||(j=this.generateIS(b,g,E));var ue=this.isVideoContiguous,Me=-1;if(Re&&(Me=S(g.samples),!ue&&this.config.forceKeyFrameOnDiscontinuity))if(Q=!0,Me>0){n.logger.warn("[mp4-remuxer]: Dropped "+Me+" out of "+ve+" video samples due to a missing keyframe");var et=this.getVideoStartPts(g.samples);g.samples=g.samples.slice(Me),g.dropped+=Me,se+=(g.samples[0].pts-et)/(g.timescale||9e4)}else Me===-1&&(n.logger.warn("[mp4-remuxer]: No keyframe found out of "+ve+" video samples"),Q=!1);if(this.ISGenerated){if(Oe&&Re){var it=this.getVideoStartPts(g.samples),nt=s(b.samples[0].pts,it)-it,at=nt/g.inputTimeScale;ne+=Math.max(0,at),se+=Math.max(0,-at)}if(Oe){if(b.samplerate||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),j=this.generateIS(b,g,E)),H=this.remuxAudio(b,ne,this.isAudioContiguous,v,ge||Re||F===D.PlaylistLevelType.AUDIO?se:void 0),Re){var ze=H?H.endPTS-H.startPTS:0;g.inputTimeScale||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),j=this.generateIS(b,g,E)),A=this.remuxVideo(g,se,ue,ze)}}else Re&&(A=this.remuxVideo(g,se,ue,0));A&&(A.firstKeyFrame=Me,A.independent=Me!==-1)}}return this.ISGenerated&&(p.samples.length&&(z=this.remuxID3(p,E)),C.samples.length&&(T=this.remuxText(C,E))),{audio:H,video:A,initSegment:j,independent:Q,text:T,id3:z}},O.generateIS=function(b,g,p){var C=b.samples,E=g.samples,v=this.typeSupported,N={},F=!Object(V.isFiniteNumber)(this._initPTS),A="audio/mp4",H,j,T;if(F&&(H=j=Infinity),b.config&&C.length&&(b.timescale=b.samplerate,b.isAAC||(v.mpeg?(A="audio/mpeg",b.codec=""):v.mp3&&(b.codec="mp3")),N.audio={id:"audio",container:A,codec:b.codec,initSegment:!b.isAAC&&v.mpeg?new Uint8Array(0):M.default.initSegment([b]),metadata:{channelCount:b.channelCount}},F&&(T=b.inputTimeScale,H=j=C[0].pts-Math.round(T*p))),g.sps&&g.pps&&E.length&&(g.timescale=g.inputTimeScale,N.video={id:"main",container:"video/mp4",codec:g.codec,initSegment:M.default.initSegment([g]),metadata:{width:g.width,height:g.height}},F)){T=g.inputTimeScale;var z=this.getVideoStartPts(E),Q=Math.round(T*p);j=Math.min(j,s(E[0].dts,z)-Q),H=Math.min(H,z-Q)}if(Object.keys(N).length)return this.ISGenerated=!0,F&&(this._initPTS=H,this._initDTS=j),{tracks:N,initPTS:H,timescale:T}},O.remuxVideo=function(b,g,p,C){var E=b.inputTimeScale,v=b.samples,N=[],F=v.length,A=this._initPTS,H=this.nextAvcDts,j=8,T,z,Q,ne=Number.POSITIVE_INFINITY,se=Number.NEGATIVE_INFINITY,xe=0,ge=!1;if(!p||H===null){var ve=g*E,Oe=v[0].pts-s(v[0].dts,v[0].pts);H=ve-Oe}for(var Re=0;Re<F;Re++){var he=v[Re];if(he.pts=s(he.pts-A,H),he.dts=s(he.dts-A,H),he.dts>he.pts){var ue=9e4*.2;xe=Math.max(Math.min(xe,he.pts-he.dts),-1*ue)}he.dts<v[Re>0?Re-1:Re].dts&&(ge=!0)}ge&&v.sort(function(st,Ke){var Ge=st.dts-Ke.dts,Ue=st.pts-Ke.pts;return Ge||Ue}),z=v[0].dts,Q=v[v.length-1].dts;var Me=Math.round((Q-z)/(F-1));if(xe<0){if(xe<Me*-2){n.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(m.toMsFromMpegTsClock)(-Me,!0)+" ms");for(var et=xe,it=0;it<F;it++)v[it].dts=et=Math.max(et,v[it].pts-Me),v[it].pts=Math.max(et,v[it].pts)}else{n.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(m.toMsFromMpegTsClock)(xe,!0)+" ms to overcome this issue");for(var nt=0;nt<F;nt++)v[nt].dts=v[nt].dts+xe}z=v[0].dts}if(p){var at=z-H,ze=at>Me,Ze=at<-1;if(ze||Ze){ze?n.logger.warn("AVC: "+Object(m.toMsFromMpegTsClock)(at,!0)+" ms ("+at+"dts) hole between fragments detected, filling it"):n.logger.warn("AVC: "+Object(m.toMsFromMpegTsClock)(-at,!0)+" ms ("+at+"dts) overlapping between fragments detected"),z=H;var ot=v[0].pts-at;v[0].dts=z,v[0].pts=ot,n.logger.log("Video: First PTS/DTS adjusted: "+Object(m.toMsFromMpegTsClock)(ot,!0)+"/"+Object(m.toMsFromMpegTsClock)(z,!0)+", delta: "+Object(m.toMsFromMpegTsClock)(at,!0)+" ms")}}a&&(z=Math.max(0,z));for(var de=0,Se=0,Le=0;Le<F;Le++){for(var De=v[Le],qe=De.units,lt=qe.length,mt=0,gt=0;gt<lt;gt++)mt+=qe[gt].data.length;Se+=mt,de+=lt,De.length=mt,De.dts=Math.max(De.dts,z),De.pts=Math.max(De.pts,De.dts,0),ne=Math.min(De.pts,ne),se=Math.max(De.pts,se)}Q=v[F-1].dts;var Ct=Se+4*de+8,xt;try{xt=new Uint8Array(Ct)}catch(st){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:W.ErrorTypes.MUX_ERROR,details:W.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ct,reason:"fail allocating video mdat "+Ct});return}var Ae=new DataView(xt.buffer);Ae.setUint32(0,Ct),xt.set(M.default.types.mdat,4);for(var Ce=0;Ce<F;Ce++){for(var Ve=v[Ce],Qe=Ve.units,Pe=0,Fe=0,be=Qe.length;Fe<be;Fe++){var fe=Qe[Fe],pe=fe.data,ie=fe.data.byteLength;Ae.setUint32(j,ie),j+=4,xt.set(pe,j),j+=ie,Pe+=4+ie}if(Ce<F-1)T=v[Ce+1].dts-Ve.dts;else{var ae=this.config,ce=Ve.dts-v[Ce>0?Ce-1:Ce].dts;if(ae.stretchShortVideoTrack&&this.nextAudioPts!==null){var me=Math.floor(ae.maxBufferHole*E),Te=(C?ne+C*E:this.nextAudioPts)-Ve.pts;Te>me?(T=Te-ce,T<0&&(T=ce),n.logger.log("[mp4-remuxer]: It is approximately "+Te/90+" ms to the next segment; using duration "+T/90+" ms for the last video frame.")):T=ce}else T=ce}var ke=Math.round(Ve.pts-Ve.dts);N.push(new w(Ve.key,T,Pe,ke))}if(N.length&&d&&d<70){var $e=N[0].flags;$e.dependsOn=2,$e.isNonSync=0}console.assert(T!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=H=Q+T,this.isVideoContiguous=!0;var pt=M.default.moof(b.sequenceNumber++,z,f({},b,{samples:N})),Ot="video",vt={data1:pt,data2:xt,startPTS:ne/E,endPTS:(se+T)/E,startDTS:z/E,endDTS:H/E,type:Ot,hasAudio:!1,hasVideo:!0,nb:N.length,dropped:b.dropped};return b.samples=[],b.dropped=0,console.assert(xt.length,"MDAT length must not be zero"),vt},O.remuxAudio=function(b,g,p,C,E){var v=b.inputTimeScale,N=b.samplerate?b.samplerate:v,F=v/N,A=b.isAAC?c:o,H=A*F,j=this._initPTS,T=!b.isAAC&&this.typeSupported.mpeg,z=[],Q=b.samples,ne=T?0:8,se=this.nextAudioPts||-1,xe=g*v;if(this.isAudioContiguous=p=p||Q.length&&se>0&&(C&&Math.abs(xe-se)<9e3||Math.abs(s(Q[0].pts-j,xe)-se)<20*H),Q.forEach(function(pe){pe.pts=s(pe.pts-j,xe)}),!p||se<0){if(Q=Q.filter(function(pe){return pe.pts>=0}),!Q.length)return;E===0?se=0:C?se=Math.max(0,xe):se=Q[0].pts}if(b.isAAC)for(var ge=E!==void 0,ve=this.config.maxAudioFramesDrift,Oe=0,Re=se;Oe<Q.length;Oe++){var he=Q[Oe],ue=he.pts,Me=ue-Re,et=Math.abs(1e3*Me/v);if(Me<=-ve*H&&ge)Oe===0&&(n.logger.warn("Audio frame @ "+(ue/v).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Me/v)+" ms."),this.nextAudioPts=se=Re=ue);else if(Me>=ve*H&&et<h&&ge){var it=Math.round(Me/H);Re=ue-it*H,Re<0&&(it--,Re+=H),Oe===0&&(this.nextAudioPts=se=Re),n.logger.warn("[mp4-remuxer]: Injecting "+it+" audio frame @ "+(Re/v).toFixed(3)+"s due to "+Math.round(1e3*Me/v)+" ms gap.");for(var nt=0;nt<it;nt++){var at=Math.max(Re,0),ze=U.default.getSilentFrame(b.manifestCodec||b.codec,b.channelCount);ze||(n.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ze=he.unit.subarray()),Q.splice(Oe,0,{unit:ze,pts:at}),Re+=H,Oe++}}he.pts=Re,Re+=H}for(var Ze=null,ot=null,de,Se=0,Le=Q.length;Le--;)Se+=Q[Le].unit.byteLength;for(var De=0,qe=Q.length;De<qe;De++){var lt=Q[De],mt=lt.unit,gt=lt.pts;if(ot!==null){var Ct=z[De-1];Ct.duration=Math.round((gt-ot)/F)}else if(p&&b.isAAC&&(gt=se),Ze=gt,Se>0){Se+=ne;try{de=new Uint8Array(Se)}catch(pe){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:W.ErrorTypes.MUX_ERROR,details:W.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Se,reason:"fail allocating audio mdat "+Se});return}if(!T){var xt=new DataView(de.buffer);xt.setUint32(0,Se),de.set(M.default.types.mdat,4)}}else return;de.set(mt,ne);var Ae=mt.byteLength;ne+=Ae,z.push(new w(!0,A,Ae,0)),ot=gt}var Ce=z.length;if(!Ce)return;var Ve=z[z.length-1];this.nextAudioPts=se=ot+F*Ve.duration;var Qe=T?new Uint8Array(0):M.default.moof(b.sequenceNumber++,Ze/F,f({},b,{samples:z}));b.samples=[];var Pe=Ze/v,Fe=se/v,be="audio",fe={data1:Qe,data2:de,startPTS:Pe,endPTS:Fe,startDTS:Pe,endDTS:Fe,type:be,hasAudio:!0,hasVideo:!1,nb:Ce};return this.isAudioContiguous=!0,console.assert(de.length,"MDAT length must not be zero"),fe},O.remuxEmptyAudio=function(b,g,p,C){var E=b.inputTimeScale,v=b.samplerate?b.samplerate:E,N=E/v,F=this.nextAudioPts,A=(F!==null?F:C.startDTS*E)+this._initDTS,H=C.endDTS*E+this._initDTS,j=N*c,T=Math.ceil((H-A)/j),z=U.default.getSilentFrame(b.manifestCodec||b.codec,b.channelCount);if(n.logger.warn("[mp4-remuxer]: remux empty Audio"),!z){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=[],ne=0;ne<T;ne++){var se=A+ne*j;Q.push({unit:z,pts:se,dts:se})}return b.samples=Q,this.remuxAudio(b,g,p,!1)},O.remuxID3=function(b,g){var p=b.samples.length;if(!p)return;for(var C=b.inputTimeScale,E=this._initPTS,v=this._initDTS,N=0;N<p;N++){var F=b.samples[N];F.pts=s(F.pts-E,g*C)/C,F.dts=s(F.dts-v,g*C)/C}var A=b.samples;return b.samples=[],{samples:A}},O.remuxText=function(b,g){var p=b.samples.length;if(!p)return;for(var C=b.inputTimeScale,E=this._initPTS,v=0;v<p;v++){var N=b.samples[v];N.pts=s(N.pts-E,g*C)/C}b.samples.sort(function(A,H){return A.pts-H.pts});var F=b.samples;return b.samples=[],{samples:F}},L}();function s(L,O){var _;if(O===null)return L;for(O<L?_=-8589934592:_=8589934592;Math.abs(L-O)>4294967296;)L+=_;return L}function S(L){for(var O=0;O<L.length;O++)if(L[O].key)return O;return-1}var w=function(O,_,b,g){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=_,this.size=b,this.cts=g,this.flags=new x(O)},x=function(O){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=O?2:1,this.isNonSync=O?0:1}},"./src/remux/passthrough-remuxer.ts":function(Z,X,P){"use strict";P.r(X);var V=P("./src/polyfills/number.ts"),U=P("./src/utils/mp4-tools.ts"),M=P("./src/loader/fragment.ts"),G=P("./src/utils/logger.ts"),W=function(){function m(){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=m.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,o,d){this.audioCodec=o,this.videoCodec=d,this.generateInitSegment(c),this.emitInitSegment=!0},f.generateInitSegment=function(c){var o=this.audioCodec,d=this.videoCodec;if(!c||!c.byteLength){this.initTracks=void 0,this.initData=void 0;return}var i=this.initData=Object(U.parseInitSegment)(c);o||(o=D(i.audio,M.ElementaryStreamTypes.AUDIO)),d||(d=D(i.video,M.ElementaryStreamTypes.VIDEO));var a={};i.audio&&i.video?a.audiovideo={container:"video/mp4",codec:o+","+d,initSegment:c,id:"main"}:i.audio?a.audio={container:"audio/mp4",codec:o,initSegment:c,id:"audio"}:i.video?a.video={container:"video/mp4",codec:d,initSegment:c,id:"main"}:G.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=a},f.remux=function(c,o,d,i,a){var r=this.initPTS,s=this.lastEndDTS,S={audio:void 0,video:void 0,text:i,id3:d,initSegment:void 0};Object(V.isFiniteNumber)(s)||(s=this.lastEndDTS=a||0);var w=o.samples;if(!w||!w.length)return S;var x={initPTS:void 0,timescale:1},L=this.initData;if((!L||!L.length)&&(this.generateInitSegment(w),L=this.initData),!L||!L.length)return G.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),S;this.emitInitSegment&&(x.tracks=this.initTracks,this.emitInitSegment=!1),Object(V.isFiniteNumber)(r)||(this.initPTS=x.initPTS=r=n(L,w,s));var O=Object(U.getDuration)(w,L),_=s,b=O+_;Object(U.offsetStartDTS)(L,w,r),O>0?this.lastEndDTS=b:(G.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var g=!!L.audio,p=!!L.video,C="";g&&(C+="audio"),p&&(C+="video");var E={data1:w,startPTS:_,startDTS:_,endPTS:b,endDTS:b,type:C,hasAudio:g,hasVideo:p,nb:1,dropped:0};return S.audio=E.type==="audio"?E:void 0,S.video=E.type!=="audio"?E:void 0,S.text=i,S.id3=d,S.initSegment=x,S},m}(),n=function(f,h,c){return Object(U.getStartDTS)(f,h)-c};function D(m,f){var h=m==null?void 0:m.codec;return h&&h.length>4?h:h==="hvc1"?"hvc1.1.c.L120.90":h==="av01"?"av01.0.04M.08":h==="avc1"||f===M.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}X.default=W},"./src/task-loop.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return V});var V=function(){function U(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var M=U.prototype;return M.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},M.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},M.onHandlerDestroyed=function(){},M.hasInterval=function(){return!!this._tickInterval},M.hasNextTick=function(){return!!this._tickTimer},M.setInterval=function(W){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,W),!0)},M.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},M.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},M.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},M.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},M.doTick=function(){},U}()},"./src/types/cmcd.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"CMCDVersion",function(){return V}),P.d(X,"CMCDObjectType",function(){return U}),P.d(X,"CMCDStreamingFormat",function(){return M}),P.d(X,"CMCDStreamType",function(){return G});var V=1,U;(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"})(U||(U={}));var M;(function(W){W.DASH="d",W.HLS="h",W.SMOOTH="s",W.OTHER="o"})(M||(M={}));var G;(function(W){W.VOD="v",W.LIVE="l"})(G||(G={}))},"./src/types/level.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"HlsSkip",function(){return M}),P.d(X,"getSkipValue",function(){return G}),P.d(X,"HlsUrlParameters",function(){return W}),P.d(X,"Level",function(){return n});function V(D,m){for(var f=0;f<m.length;f++){var h=m[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(D,h.key,h)}}function U(D,m,f){return m&&V(D.prototype,m),f&&V(D,f),D}var M;(function(D){D.No="",D.Yes="YES",D.v2="v2"})(M||(M={}));function G(D,m){var f=D.canSkipUntil,h=D.canSkipDateRanges,c=D.endSN,o=m!==void 0?m-c:0;return f&&o<f?h?M.v2:M.Yes:M.No}var W=function(){function D(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 m=D.prototype;return m.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()},D}(),n=function(){function D(m){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=[m.url],this.attrs=m.attrs,this.bitrate=m.bitrate,m.details&&(this.details=m.details),this.id=m.id||0,this.name=m.name,this.width=m.width||0,this.height=m.height||0,this.audioCodec=m.audioCodec,this.videoCodec=m.videoCodec,this.unknownCodecs=m.unknownCodecs,this.codecSet=[m.videoCodec,m.audioCodec].filter(function(f){return f}).join(",").replace(/\.[^.,]+/g,"")}return U(D,[{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)}}]),D}()},"./src/types/loader.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"PlaylistContextType",function(){return V}),P.d(X,"PlaylistLevelType",function(){return U});var V;(function(M){M.MANIFEST="manifest",M.LEVEL="level",M.AUDIO_TRACK="audioTrack",M.SUBTITLE_TRACK="subtitleTrack"})(V||(V={}));var U;(function(M){M.MAIN="main",M.AUDIO="audio",M.SUBTITLE="subtitle"})(U||(U={}))},"./src/types/transmuxer.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"ChunkMetadata",function(){return V});var V=function(G,W,n,D,m,f){D===void 0&&(D=0),m===void 0&&(m=-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=U(),this.buffering={audio:U(),video:U(),audiovideo:U()},this.level=G,this.sn=W,this.id=n,this.size=D,this.part=m,this.partial=f};function U(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"AttrList",function(){return M});var V=/^(\d+)x(\d+)$/,U=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,M=function(){function G(n){typeof n=="string"&&(n=G.parseAttrList(n));for(var D in n)n.hasOwnProperty(D)&&(this[D]=n[D])}var W=G.prototype;return W.decimalInteger=function(D){var m=parseInt(this[D],10);return m>Number.MAX_SAFE_INTEGER?Infinity:m},W.hexadecimalInteger=function(D){if(this[D]){var m=(this[D]||"0x").slice(2);m=(m.length&1?"0":"")+m;for(var f=new Uint8Array(m.length/2),h=0;h<m.length/2;h++)f[h]=parseInt(m.slice(h*2,h*2+2),16);return f}else return null},W.hexadecimalIntegerAsNumber=function(D){var m=parseInt(this[D],16);return m>Number.MAX_SAFE_INTEGER?Infinity:m},W.decimalFloatingPoint=function(D){return parseFloat(this[D])},W.optionalFloat=function(D,m){var f=this[D];return f?parseFloat(f):m},W.enumeratedString=function(D){return this[D]},W.bool=function(D){return this[D]==="YES"},W.decimalResolution=function(D){var m=V.exec(this[D]);return m===null?void 0:{width:parseInt(m[1],10),height:parseInt(m[2],10)}},G.parseAttrList=function(D){var m,f={},h='"';for(U.lastIndex=0;(m=U.exec(D))!==null;){var c=m[2];c.indexOf(h)===0&&c.lastIndexOf(h)===c.length-1&&(c=c.slice(1,-1)),f[m[1]]=c}return f},G}()},"./src/utils/binary-search.ts":function(Z,X,P){"use strict";P.r(X);var V={search:function(M,G){for(var W=0,n=M.length-1,D=null,m=null;W<=n;){D=(W+n)/2|0,m=M[D];var f=G(m);if(f>0)W=D+1;else if(f<0)n=D-1;else return m}return null}};X.default=V},"./src/utils/buffer-helper.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"BufferHelper",function(){return M});var V=P("./src/utils/logger.ts"),U={length:0,start:function(){return 0},end:function(){return 0}},M=function(){function G(){}return G.isBuffered=function(n,D){try{if(n){for(var m=G.getBuffered(n),f=0;f<m.length;f++)if(D>=m.start(f)&&D<=m.end(f))return!0}}catch(h){}return!1},G.bufferInfo=function(n,D,m){try{if(n){var f=G.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,D,m)}}catch(o){}return{len:0,start:D,end:D,nextStart:void 0}},G.bufferedInfo=function(n,D,m){D=Math.max(0,D),n.sort(function(x,L){var O=x.start-L.start;return O||L.end-x.end});var f=[];if(m)for(var h=0;h<n.length;h++){var c=f.length;if(c){var o=f[c-1].end;n[h].start-o<m?n[h].end>o&&(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=D,r=D,s=0;s<f.length;s++){var S=f[s].start,w=f[s].end;if(D+m>=S&&D<w)a=S,r=w,d=r-D;else if(D+m<S){i=S;break}}return{len:d,start:a||0,end:r||0,nextStart:i}},G.getBuffered=function(n){try{return n.buffered}catch(D){return V.logger.log("failed to get media.buffered",D),U}},G}()},"./src/utils/cea-608-parser.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"Row",function(){return r}),P.d(X,"CaptionScreen",function(){return s});var V=P("./src/utils/logger.ts"),U={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},M=function(b){var g=b;return U.hasOwnProperty(b)&&(g=U[b]),String.fromCharCode(g)},G=15,W=100,n={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},D={17:2,18:4,21:6,22:8,23:10,19:13,20:15},m={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 o=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 g=[],p=0;p<b.length;p++)g.push(b[p].toString(16));return g},i=function(){function _(g,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=g||"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 _(g,p,C,E,v,N){this.uchar=void 0,this.penState=void 0,this.uchar=g||" ",this.penState=new i(p,C,E,v,N)}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 _(g){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=g,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=M(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)},_}(),s=function(){function _(g){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<G;p++)this.rows.push(new r(g));this.logger=g,this.currRow=G-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var b=_.prototype;return b.reset=function(){for(var p=0;p<G;p++)this.rows[p].clear();this.currRow=G-1},b.equals=function(p){for(var C=!0,E=0;E<G;E++)if(!this.rows[E].equals(p.rows[E])){C=!1;break}return C},b.copy=function(p){for(var C=0;C<G;C++)this.rows[C].copy(p.rows[C])},b.isEmpty=function(){for(var p=!0,C=0;C<G;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<G;E++)this.rows[E].clear();var v=this.currRow+1-this.nrRollUpRows,N=this.lastOutputScreen;if(N){var F=N.rows[v].cueStartTime,A=this.logger.time;if(F&&A!==null&&F<A)for(var H=0;H<this.nrRollUpRows;H++)this.rows[C-this.nrRollUpRows+H+1].copy(N.rows[v+H])}}this.currRow=C;var j=this.rows[this.currRow];if(p.indent!==null){var T=p.indent,z=Math.max(T-1,0);j.setCursor(p.indent),p.color=j.chars[z].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,N=0;N<G;N++){var F=this.rows[N].getTextString();F&&(v=N+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},_}(),S=function(){function _(g,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=g,this.outputFilter=p,this.mode=null,this.verbose=0,this.displayedMemory=new s(C),this.nonDisplayedMemory=new s(C),this.lastOutputScreen=new s(C),this.currRollUpRow=this.displayedMemory.rows[G-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[G-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 _(g,p,C){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var E=new o;this.channels=[null,new S(g,p,E),new S(g+1,C,E)],this.cmdHistory=O(),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,N,F=!1;this.logger.time=p;for(var A=0;A<C.length;A+=2){if(v=C[A]&127,N=C[A+1]&127,v===0&&N===0)continue;if(this.logger.log(c.DATA,"["+d([C[A],C[A+1]])+"] -> ("+d([v,N])+")"),E=this.parseCmd(v,N),E||(E=this.parseMidrow(v,N)),E||(E=this.parsePAC(v,N)),E||(E=this.parseBackgroundAttributes(v,N)),!E&&(F=this.parseChars(v,N),F)){var H=this.currentChannel;if(H&&H>0){var j=this.channels[H];j.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,N])+" orig: "+d([C[A],C[A+1]]))}},b.parseCmd=function(p,C){var E=this.cmdHistory,v=(p===20||p===28||p===21||p===29)&&C>=32&&C<=47,N=(p===23||p===31)&&C>=33&&C<=35;if(!(v||N))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,A=this.channels[F];return p===20||p===21||p===28||p===29?C===32?A.ccRCL():C===33?A.ccBS():C===34?A.ccAOF():C===35?A.ccAON():C===36?A.ccDER():C===37?A.ccRU(2):C===38?A.ccRU(3):C===39?A.ccRU(4):C===40?A.ccFON():C===41?A.ccRDC():C===42?A.ccTR():C===43?A.ccRTD():C===44?A.ccEDM():C===45?A.ccCR():C===46?A.ccENM():C===47&&A.ccEOC():A.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,N=(p>=17&&p<=23||p>=25&&p<=31)&&C>=64&&C<=127,F=(p===16||p===24)&&C>=64&&C<=95;if(!(N||F))return!1;if(L(p,C,v))return x(null,null,v),!0;var A=p<=23?1:2;C>=64&&C<=95?E=A===1?n[p]:m[p]:E=A===1?D[p]:f[p];var H=this.channels[A];return H?(H.setPAC(this.interpretPAC(E,C)),x(p,C,v),this.currentChannel=A,!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,N=null;if(p>=25?(E=2,N=p-8):(E=1,N=p),N>=17&&N<=19){var F;N===17?F=C+80:N===18?F=C+112:F=C+144,this.logger.log(c.INFO,"Special char '"+M(F)+"' in channel "+E),v=[F]}else p>=32&&p<=127&&(v=C===0?[p]:[p,C]);if(v){var A=d(v);this.logger.log(c.DEBUG,"Char codes = "+A.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 N,F={};p===16||p===24?(N=Math.floor((C-32)/2),F.background=h[N],C%2===1&&(F.background=F.background+"_semi")):C===45?F.background="transparent":(F.foreground="black",C===47&&(F.underline=!0));var A=p<=23?1:2,H=this.channels[A];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=O()},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,g){g.a=_,g.b=b}function L(_,b,g){return g.a===_&&g.b===b}function O(){return{a:null,b:null}}X.default=w},"./src/utils/codecs.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"isCodecType",function(){return U}),P.d(X,"isCodecSupportedInMp4",function(){return M});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 U(G,W){var n=V[W];return!!n&&n[G.slice(0,4)]===!0}function M(G,W){return MediaSource.isTypeSupported((W||"video")+'/mp4;codecs="'+G+'"')}},"./src/utils/cues.ts":function(Z,X,P){"use strict";P.r(X);var V=P("./src/utils/vttparser.ts"),U=P("./src/utils/webvtt-parser.ts"),M=P("./src/utils/texttrack-utils.ts"),G=/\s/,W={newCue:function(D,m,f,h){for(var c=[],o,d,i,a,r,s=self.VTTCue||self.TextTrackCue,S=0;S<h.rows.length;S++)if(o=h.rows[S],i=!0,a=0,r="",!o.isEmpty()){for(var w=0;w<o.chars.length;w++)G.test(o.chars[w].uchar)&&i?a++:(r+=o.chars[w].uchar,i=!1);o.cueStartTime=m,m===f&&(f+=1e-4),a>=16?a--:a++;var x=Object(V.fixLineBreaks)(r.trim()),L=Object(U.generateCueId)(m,f,x);(!D||!D.cues||!D.cues.getCueById(L))&&(d=new s(m,f,x),d.id=L,d.line=S+1,d.align="left",d.position=10+Math.min(80,Math.floor(a*8/32)*10),c.push(d))}return D&&c.length&&(c.sort(function(O,_){return O.line==="auto"||_.line==="auto"?0:O.line>8&&_.line>8?_.line-O.line:O.line-_.line}),c.forEach(function(O){return Object(M.addCueToTrack)(D,O)})),c}};X.default=W},"./src/utils/discontinuities.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"findFirstFragWithCC",function(){return G}),P.d(X,"shouldAlignOnDiscontinuities",function(){return W}),P.d(X,"findDiscontinuousReferenceFrag",function(){return n}),P.d(X,"adjustSlidingStart",function(){return m}),P.d(X,"alignStream",function(){return f}),P.d(X,"alignPDT",function(){return c}),P.d(X,"alignFragmentByPDTDelta",function(){return o}),P.d(X,"alignMediaPlaylistByPDT",function(){return d});var V=P("./src/polyfills/number.ts"),U=P("./src/utils/logger.ts"),M=P("./src/controller/level-helper.ts");function G(i,a){for(var r=null,s=0,S=i.length;s<S;s++){var w=i[s];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,s=a.fragments;if(!s.length||!r.length){U.logger.log("No fragments to align");return}var S=G(r,s[0].cc);if(!S||S&&!S.startPTS){U.logger.log("No frag in previous level to align on");return}return S}function D(i,a){if(i){var r=i.start+a;i.start=i.startPTS=r,i.endPTS=r+i.duration}}function m(i,a){for(var r=a.fragments,s=0,S=r.length;s<S;s++)D(r[s],i);a.fragmentHint&&D(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(M.adjustSliding)(a.details,r)}function h(i,a,r){if(W(i,r,a)){var s=n(r.details,a);s&&Object(V.isFiniteNumber)(s.start)&&(U.logger.log("Adjusting PTS using last level due to CC increase within current level "+a.url),m(s.start,a))}}function c(i,a){if(!a.fragments.length||!i.hasProgramDateTime||!a.hasProgramDateTime)return;var r=a.fragments[0].programDateTime,s=i.fragments[0].programDateTime,S=(s-r)/1e3+a.fragments[0].start;S&&Object(V.isFiniteNumber)(S)&&(U.logger.log("Adjusting PTS using programDateTime delta "+(s-r)+"ms, sliding:"+S.toFixed(3)+" "+i.url+" "),m(S,i))}function o(i,a){var r=i.programDateTime;if(!r)return;var s=(r-a)/1e3;i.start=i.startPTS=s,i.endPTS=s+i.duration}function d(i,a){if(!a.fragments.length||!i.hasProgramDateTime||!a.hasProgramDateTime)return;var r=a.fragments[0].programDateTime,s=a.fragments[0].start,S=r-s*1e3;i.fragments.forEach(function(w){o(w,S)}),i.fragmentHint&&o(i.fragmentHint,S),i.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(Z,X,P){"use strict";P.r(X);var V=P("./src/utils/ewma.ts"),U=function(){function M(W,n,D){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=D,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new V.default(W),this.fast_=new V.default(n)}var G=M.prototype;return G.update=function(n,D){var m=this.slow_,f=this.fast_;this.slow_.halfLife!==n&&(this.slow_=new V.default(n,m.getEstimate(),m.getTotalWeight())),this.fast_.halfLife!==D&&(this.fast_=new V.default(D,f.getEstimate(),f.getTotalWeight()))},G.sample=function(n,D){n=Math.max(n,this.minDelayMs_);var m=8*D,f=n/1e3,h=m/f;this.fast_.sample(f,h),this.slow_.sample(f,h)},G.canEstimate=function(){var n=this.fast_;return n&&n.getTotalWeight()>=this.minWeight_},G.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},G.destroy=function(){},M}();X.default=U},"./src/utils/ewma.ts":function(Z,X,P){"use strict";P.r(X);var V=function(){function U(G,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=G,this.alpha_=G?Math.exp(Math.log(.5)/G):0,this.estimate_=W,this.totalWeight_=n}var M=U.prototype;return M.sample=function(W,n){var D=Math.pow(this.alpha_,W);this.estimate_=n*(1-D)+D*this.estimate_,this.totalWeight_+=W},M.getTotalWeight=function(){return this.totalWeight_},M.getEstimate=function(){if(this.alpha_){var W=1-Math.pow(this.alpha_,this.totalWeight_);if(W)return this.estimate_/W}return this.estimate_},U}();X.default=V},"./src/utils/fetch-loader.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"fetchSupported",function(){return o});var V=P("./src/polyfills/number.ts"),U=P("./src/loader/load-stats.ts"),M=P("./src/demux/chunk-cache.ts");function G(s,S){s.prototype=Object.create(S.prototype),s.prototype.constructor=s,f(s,S)}function W(s){var S=typeof Map=="function"?new Map:void 0;return W=function(x){if(x===null||!m(x))return x;if(typeof x!="function")throw new TypeError("Super expression must either be null or a function");if(typeof S!="undefined"){if(S.has(x))return S.get(x);S.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(s)}function n(s,S,w){return D()?n=Reflect.construct:n=function(L,O,_){var b=[null];b.push.apply(b,O);var g=Function.bind.apply(L,b),p=new g;return _&&f(p,_.prototype),p},n.apply(null,arguments)}function D(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(s){return!1}}function m(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function f(s,S){return f=Object.setPrototypeOf||function(x,L){return x.__proto__=L,x},f(s,S)}function h(s){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(w){return w.__proto__||Object.getPrototypeOf(w)},h(s)}function c(){return c=Object.assign||function(s){for(var S=1;S<arguments.length;S++){var w=arguments[S];for(var x in w)Object.prototype.hasOwnProperty.call(w,x)&&(s[x]=w[x])}return s},c.apply(this,arguments)}function o(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(s){}return!1}var d=function(){function s(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 U.LoadStats}var S=s.prototype;return S.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},S.abortInternal=function(){var x=this.response;(!x||!x.ok)&&(this.stats.aborted=!0,this.controller.abort())},S.abort=function(){var x;this.abortInternal(),(x=this.callbacks)!==null&&x!==void 0&&x.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},S.load=function(x,L,O){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 g=i(x,this.controller.signal),p=O.onProgress,C=x.responseType==="arraybuffer",E=C?"byteLength":"length";this.context=x,this.config=L,this.callbacks=O,this.request=this.fetchSetup(x,g),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){_.abortInternal(),O.onTimeout(b,x,_.response)},L.timeout),self.fetch(this.request).then(function(v){if(_.response=_.loader=v,!v.ok){var N=v.status,F=v.statusText;throw new r(F||"fetch, bad network response",N,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 N=_.response;self.clearTimeout(_.requestTimeout),b.loading.end=Math.max(self.performance.now(),b.loading.first),b.loaded=b.total=v[E];var F={url:N.url,data:v};p&&!Object(V.isFiniteNumber)(L.highWaterMark)&&p(b,x,v,N),O.onSuccess(F,b,x,N)}).catch(function(v){if(self.clearTimeout(_.requestTimeout),b.aborted)return;var N=v.code||0;O.onError({code:N,text:v.message},x,v.details)})},S.getCacheAge=function(){var x=null;if(this.response){var L=this.response.headers.get("age");x=L?parseFloat(L):null}return x},S.loadProgressively=function(x,L,O,_,b){_===void 0&&(_=0);var g=new M.default,p=x.body.getReader(),C=function E(){return p.read().then(function(v){if(v.done)return g.dataLength&&b(L,O,g.flush(),x),Promise.resolve(new ArrayBuffer(0));var N=v.value,F=N.length;return L.loaded+=F,F<_||g.dataLength?(g.push(N),g.dataLength>=_&&b(L,O,g.flush(),x)):b(L,O,N,x),E()}).catch(function(){return Promise.reject()})};return C()},s}();function i(s,S){var w={method:"GET",mode:"cors",credentials:"same-origin",signal:S,headers:new self.Headers(c({},s.headers))};return s.rangeEnd&&w.headers.set("Range","bytes="+s.rangeStart+"-"+String(s.rangeEnd-1)),w}function a(s,S){return new self.Request(s.url,S)}var r=function(s){G(S,s);function S(w,x,L){var O;return O=s.call(this,w)||this,O.code=void 0,O.details=void 0,O.code=x,O.details=L,O}return S}(W(Error));X.default=d},"./src/utils/imsc1-ttml-parser.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"IMSC1_CODEC",function(){return m}),P.d(X,"parseIMSC1",function(){return o});var V=P("./src/utils/mp4-tools.ts"),U=P("./src/utils/vttparser.ts"),M=P("./src/utils/vttcue.ts"),G=P("./src/demux/id3.ts"),W=P("./src/utils/timescale-conversion.ts"),n=P("./src/utils/webvtt-parser.ts");function D(){return D=Object.assign||function(_){for(var b=1;b<arguments.length;b++){var g=arguments[b];for(var p in g)Object.prototype.hasOwnProperty.call(g,p)&&(_[p]=g[p])}return _},D.apply(this,arguments)}var m="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 o(_,b,g,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],N=Object(G.utf8ArrayToStr)(new Uint8Array(_,v.start,v.end-v.start)),F=Object(W.toTimescaleFromScale)(b,1,g);try{p(d(N,F))}catch(A){C(A)}}function d(_,b){var g=new DOMParser,p=g.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(j,T){return j[T]=C.getAttribute("ttp:"+T)||E[T],j},{}),N=C.getAttribute("xml:space")!=="preserve",F=a(i(C,"styling","style")),A=a(i(C,"layout","region")),H=i(C,"body","[begin]");return[].map.call(H,function(j){var T=r(j,N);if(!T||!j.hasAttribute("begin"))return null;var z=x(j.getAttribute("begin"),v),Q=x(j.getAttribute("dur"),v),ne=x(j.getAttribute("end"),v);if(z===null)throw w(j);if(ne===null){if(Q===null)throw w(j);ne=z+Q}var se=new M.default(z-b,ne-b,T);se.id=Object(n.generateCueId)(se.startTime,se.endTime,se.text);var xe=A[j.getAttribute("region")],ge=F[j.getAttribute("style")];se.position=10,se.size=80;var ve=s(xe,ge),Oe=ve.textAlign;if(Oe){var Re=c[Oe];Re&&(se.lineAlign=Re),se.align=Oe}return D(se,ve),se}).filter(function(j){return j!==null})}function i(_,b,g){var p=_.getElementsByTagName(b)[0];return p?[].slice.call(p.querySelectorAll(g)):[]}function a(_){return _.reduce(function(b,g){var p=g.getAttribute("xml:id");return p&&(b[p]=g),b},{})}function r(_,b){return[].slice.call(_.childNodes).reduce(function(g,p,C){var E;return p.nodeName==="br"&&C?g+`
|
|
`:(E=p.childNodes)!==null&&E!==void 0&&E.length?r(p,b):b?g+p.textContent.trim().replace(/\s+/g," "):g+p.textContent},"")}function s(_,b){var g="http://www.w3.org/ns/ttml#styling",p=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return p.reduce(function(C,E){var v=S(b,g,E)||S(_,g,E);return v&&(C[E]=v),C},{})}function S(_,b,g){return _.hasAttributeNS(b,g)?_.getAttributeNS(b,g):null}function w(_){return new Error("Could not parse ttml timestamp "+_)}function x(_,b){if(!_)return null;var g=Object(U.parseTimeStamp)(_);return g===null&&(f.test(_)?g=L(_,b):h.test(_)&&(g=O(_,b))),g}function L(_,b){var g=f.exec(_),p=(g[4]|0)+(g[5]|0)/b.subFrameRate;return(g[1]|0)*3600+(g[2]|0)*60+(g[3]|0)+p/b.frameRate}function O(_,b){var g=h.exec(_),p=Number(g[1]),C=g[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(Z,X,P){"use strict";P.r(X),P.d(X,"enableLogs",function(){return n}),P.d(X,"logger",function(){return D});var V=function(){},U={trace:V,debug:V,log:V,warn:V,info:V,error:V},M=U;function G(m){var f=self.console[m];return f?f.bind(self.console,"["+m+"] >"):V}function W(m){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(o){M[o]=m[o]?m[o].bind(m):G(o)})}function n(m){if(self.console&&m===!0||typeof m=="object"){W(m,"debug","log","info","warn","error");try{M.log()}catch(f){M=U}}else M=U}var D=M},"./src/utils/mediakeys-helper.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"KeySystems",function(){return V}),P.d(X,"requestMediaKeySystemAccess",function(){return U});var V;(function(M){M.WIDEVINE="com.widevine.alpha",M.PLAYREADY="com.microsoft.playready"})(V||(V={}));var U=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"getMediaSource",function(){return V});function V(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"bin2str",function(){return W}),P.d(X,"readUint16",function(){return n}),P.d(X,"readUint32",function(){return D}),P.d(X,"writeUint32",function(){return m}),P.d(X,"findBox",function(){return f}),P.d(X,"parseSegmentIndex",function(){return h}),P.d(X,"parseInitSegment",function(){return c}),P.d(X,"getStartDTS",function(){return o}),P.d(X,"getDuration",function(){return d}),P.d(X,"computeRawDurationFromSamples",function(){return i}),P.d(X,"offsetStartDTS",function(){return a}),P.d(X,"segmentValidRange",function(){return r}),P.d(X,"appendUint8Array",function(){return s});var V=P("./src/utils/typed-array.ts"),U=P("./src/loader/fragment.ts"),M=Math.pow(2,32)-1,G=[].push;function W(S){return String.fromCharCode.apply(null,S)}function n(S,w){"data"in S&&(w+=S.start,S=S.data);var x=S[w]<<8|S[w+1];return x<0?65536+x:x}function D(S,w){"data"in S&&(w+=S.start,S=S.data);var x=S[w]<<24|S[w+1]<<16|S[w+2]<<8|S[w+3];return x<0?4294967296+x:x}function m(S,w,x){"data"in S&&(w+=S.start,S=S.data),S[w]=x>>24,S[w+1]=x>>16&255,S[w+2]=x>>8&255,S[w+3]=x&255}function f(S,w){var x=[];if(!w.length)return x;var L,O,_;"data"in S?(L=S.data,O=S.start,_=S.end):(L=S,O=0,_=L.byteLength);for(var b=O;b<_;){var g=D(L,b),p=W(L.subarray(b+4,b+8)),C=g>1?b+g:_;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&&G.apply(x,E)}b=C}return x}function h(S){var w=f(S,["moov"]),x=w[0],L=x?x.end:null,O=f(S,["sidx"]);if(!O||!O[0])return null;var _=[],b=O[0],g=b.data[0],p=g===0?8:16,C=D(b,p);p+=4;var E=0,v=0;g===0?p+=8:p+=16,p+=2;var N=b.end+v,F=n(b,p);p+=2;for(var A=0;A<F;A++){var H=p,j=D(b,H);H+=4;var T=j&2147483647,z=(j&2147483648)>>>31;if(z===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var Q=D(b,H);H+=4,_.push({referenceSize:T,subsegmentDuration:Q,info:{duration:Q/C,start:N,end:N+T-1}}),N+=T,H+=4,p=H}return{earliestPresentationTime:E,timescale:C,version:g,referencesCount:F,references:_,moovEndOffset:L}}function c(S){for(var w=[],x=f(S,["moov","trak"]),L=0;L<x.length;L++){var O=x[L],_=f(O,["tkhd"])[0];if(_){var b=_.data[_.start],g=b===0?12:20,p=D(_,g),C=f(O,["mdia","mdhd"])[0];if(C){b=C.data[C.start],g=b===0?12:20;var E=D(C,g),v=f(O,["mdia","hdlr"])[0];if(v){var N=W(v.data.subarray(v.start+8,v.start+12)),F={soun:U.ElementaryStreamTypes.AUDIO,vide:U.ElementaryStreamTypes.VIDEO}[N];if(F){var A=f(O,["mdia","minf","stbl","stsd"])[0],H=void 0;A&&(H=W(A.data.subarray(A.start+12,A.start+16))),w[p]={timescale:E,type:F},w[F]={timescale:E,id:p,codec:H}}}}}}var j=f(S,["moov","mvex","trex"]);return j.forEach(function(T){var z=D(T,4),Q=w[z];Q&&(Q.default={duration:D(T,12),flags:D(T,20)})}),w}function o(S,w){return f(w,["moof","traf"]).reduce(function(x,L){var O=f(L,["tfdt"])[0],_=O.data[O.start],b=f(L,["tfhd"]).reduce(function(g,p){var C=D(p,4),E=S[C];if(E){var v=D(O,4);_===1&&(v*=Math.pow(2,32),v+=D(O,8));var N=E.timescale||9e4,F=v/N;if(isFinite(F)&&(g===null||F<g))return F}return g},null);return b!==null&&isFinite(b)&&(x===null||b<x)?b:x},null)||0}function d(S,w){for(var x=0,L=0,O=0,_=f(S,["moof","traf"]),b=0;b<_.length;b++){var g=_[b],p=f(g,["tfhd"])[0],C=D(p,4),E=w[C];if(!E)continue;var v=E.default,N=D(p,0)|(v==null?void 0:v.flags),F=v==null?void 0:v.duration;N&8&&(N&2?F=D(p,12):F=D(p,8));for(var A=E.timescale||9e4,H=f(g,["trun"]),j=0;j<H.length;j++){if(F){var T=D(H[j],4);x=F*T}else x=i(H[j]);E.type===U.ElementaryStreamTypes.VIDEO?L+=x/A:E.type===U.ElementaryStreamTypes.AUDIO&&(O+=x/A)}}if(L===0&&O===0){var z=h(S);if(z!=null&&z.references)return z.references.reduce(function(Q,ne){return Q+ne.info.duration||0},0)}return L||O}function i(S){var w=D(S,0),x=8;w&1&&(x+=4),w&4&&(x+=4);for(var L=0,O=D(S,4),_=0;_<O;_++){if(w&256){var b=D(S,x);L+=b,x+=4}w&512&&(x+=4),w&1024&&(x+=4),w&2048&&(x+=4)}return L}function a(S,w,x){f(w,["moof","traf"]).forEach(function(L){f(L,["tfhd"]).forEach(function(O){var _=D(O,4),b=S[_];if(!b)return;var g=b.timescale||9e4;f(L,["tfdt"]).forEach(function(p){var C=p.data[p.start],E=D(p,4);if(C===0)m(p,4,E-x*g);else{E*=Math.pow(2,32),E+=D(p,8),E-=x*g,E=Math.max(E,0);var v=Math.floor(E/(M+1)),N=Math.floor(E%(M+1));m(p,4,v),m(p,8,N)}})})})}function r(S){var w={valid:null,remainder:null},x=f(S,["moof"]);if(x){if(x.length<2)return w.remainder=S,w}else return w;var L=x[x.length-1];return w.valid=Object(V.sliceUint8)(S,0,L.start-8),w.remainder=Object(V.sliceUint8)(S,L.start-8),w}function s(S,w){var x=new Uint8Array(S.length+w.length);return x.set(S),x.set(w,S.length),x}},"./src/utils/output-filter.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"default",function(){return V});var V=function(){function U(G,W){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=G,this.trackName=W}var M=U.prototype;return M.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},M.newCue=function(W,n,D){(this.startTime===null||this.startTime>W)&&(this.startTime=W),this.endTime=n,this.screen=D,this.timelineController.createCaptionsTrack(this.trackName)},M.reset=function(){this.cueRanges=[]},U}()},"./src/utils/texttrack-utils.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"sendAddTrackEvent",function(){return U}),P.d(X,"addCueToTrack",function(){return M}),P.d(X,"clearCurrentCues",function(){return G}),P.d(X,"removeCuesInRange",function(){return W}),P.d(X,"getCuesInRange",function(){return D});var V=P("./src/utils/logger.ts");function U(m,f){var h;try{h=new Event("addtrack")}catch(c){h=document.createEvent("Event"),h.initEvent("addtrack",!1,!1)}h.track=m,f.dispatchEvent(h)}function M(m,f){var h=m.mode;if(h==="disabled"&&(m.mode="hidden"),m.cues&&!m.cues.getCueById(f.id))try{if(m.addCue(f),!m.cues.getCueById(f.id))throw new Error("addCue is failed for: "+f)}catch(o){V.logger.debug("[texttrack-utils]: "+o);var c=new self.TextTrackCue(f.startTime,f.endTime,f.text);c.id=f.id,m.addCue(c)}h==="disabled"&&(m.mode=h)}function G(m){var f=m.mode;if(f==="disabled"&&(m.mode="hidden"),m.cues)for(var h=m.cues.length;h--;)m.removeCue(m.cues[h]);f==="disabled"&&(m.mode=f)}function W(m,f,h){var c=m.mode;if(c==="disabled"&&(m.mode="hidden"),m.cues&&m.cues.length>0)for(var o=D(m.cues,f,h),d=0;d<o.length;d++)m.removeCue(o[d]);c==="disabled"&&(m.mode=c)}function n(m,f){if(f<m[0].startTime)return 0;var h=m.length-1;if(f>m[h].endTime)return-1;for(var c=0,o=h;c<=o;){var d=Math.floor((o+c)/2);if(f<m[d].startTime)o=d-1;else if(f>m[d].startTime&&c<h)c=d+1;else return d}return m[c].startTime-f<f-m[o].startTime?c:o}function D(m,f,h){var c=[],o=n(m,f);if(o>-1)for(var d=o,i=m.length;d<i;d++){var a=m[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(Z,X,P){"use strict";P.r(X);var V={toString:function(M){for(var G="",W=M.length,n=0;n<W;n++)G+="["+M.start(n).toFixed(3)+","+M.end(n).toFixed(3)+"]";return G}};X.default=V},"./src/utils/timescale-conversion.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"toTimescaleFromBase",function(){return U}),P.d(X,"toTimescaleFromScale",function(){return M}),P.d(X,"toMsFromMpegTsClock",function(){return G}),P.d(X,"toMpegTsClockFromTimescale",function(){return W});var V=9e4;function U(n,D,m,f){m===void 0&&(m=1),f===void 0&&(f=!1);var h=n*D*m;return f?Math.round(h):h}function M(n,D,m,f){return m===void 0&&(m=1),f===void 0&&(f=!1),U(n,D,1/m,f)}function G(n,D){return D===void 0&&(D=!1),U(n,1e3,1/V,D)}function W(n,D){return D===void 0&&(D=1),U(n,V,1/D)}},"./src/utils/typed-array.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"sliceUint8",function(){return V});function V(U,M,G){return Uint8Array.prototype.slice?U.slice(M,G):new Uint8Array(Array.prototype.slice.call(U,M,G))}},"./src/utils/vttcue.ts":function(Z,X,P){"use strict";P.r(X),X.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var V=["","lr","rl"],U=["start","middle","end","left","right"];function M(m,f){if(typeof f!="string")return!1;if(!Array.isArray(m))return!1;var h=f.toLowerCase();return~m.indexOf(h)?h:!1}function G(m){return M(V,m)}function W(m){return M(U,m)}function n(m){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 o=1;o<arguments.length;o++){var d=arguments[o];for(var i in d)m[i]=d[i]}return m}function D(m,f,h){var c=this,o={enumerable:!0};c.hasBeenReset=!1;var d="",i=!1,a=m,r=f,s=h,S=null,w="",x=!0,L="auto",O="start",_=50,b="middle",g=50,p="middle";Object.defineProperty(c,"id",n({},o,{get:function(){return d},set:function(E){d=""+E}})),Object.defineProperty(c,"pauseOnExit",n({},o,{get:function(){return i},set:function(E){i=!!E}})),Object.defineProperty(c,"startTime",n({},o,{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({},o,{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({},o,{get:function(){return s},set:function(E){s=""+E,this.hasBeenReset=!0}})),Object.defineProperty(c,"region",n({},o,{get:function(){return S},set:function(E){S=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"vertical",n({},o,{get:function(){return w},set:function(E){var v=G(E);if(v===!1)throw new SyntaxError("An invalid or illegal string was specified.");w=v,this.hasBeenReset=!0}})),Object.defineProperty(c,"snapToLines",n({},o,{get:function(){return x},set:function(E){x=!!E,this.hasBeenReset=!0}})),Object.defineProperty(c,"line",n({},o,{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({},o,{get:function(){return O},set:function(E){var v=W(E);if(!v)throw new SyntaxError("An invalid or illegal string was specified.");O=v,this.hasBeenReset=!0}})),Object.defineProperty(c,"position",n({},o,{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({},o,{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({},o,{get:function(){return g},set:function(E){if(E<0||E>100)throw new Error("Size must be between 0 and 100.");g=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"align",n({},o,{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 D.prototype.getCueAsHTML=function(){var m=self.WebVTT;return m.convertCueToDOMTree(self,this.text)},D}()},"./src/utils/vttparser.ts":function(Z,X,P){"use strict";P.r(X),P.d(X,"parseTimeStamp",function(){return M}),P.d(X,"fixLineBreaks",function(){return f}),P.d(X,"VTTParser",function(){return h});var V=P("./src/utils/vttcue.ts"),U=function(){function c(){}var o=c.prototype;return o.decode=function(i,a){if(!i)return"";if(typeof i!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(i))},c}();function M(c){function o(i,a,r,s){return(i|0)*3600+(a|0)*60+(r|0)+parseFloat(s||0)}var d=c.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return d?parseFloat(d[2])>59?o(d[2],d[3],0,d[4]):o(d[1],d[2],d[3],d[4]):null}var G=function(){function c(){this.values=Object.create(null)}var o=c.prototype;return o.set=function(i,a){!this.get(i)&&a!==""&&(this.values[i]=a)},o.get=function(i,a,r){return r?this.has(i)?this.values[i]:a[r]:this.has(i)?this.values[i]:a},o.has=function(i){return i in this.values},o.alt=function(i,a,r){for(var s=0;s<r.length;++s)if(a===r[s]){this.set(i,a);break}},o.integer=function(i,a){/^-?\d+$/.test(a)&&this.set(i,parseInt(a,10))},o.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,o,d,i){var a=i?c.split(i):[c];for(var r in a){if(typeof a[r]!="string")continue;var s=a[r].split(d);if(s.length!==2)continue;var S=s[0],w=s[1];o(S,w)}}var n=new V.default(0,0,""),D=n.align==="middle"?"middle":"center";function m(c,o,d){var i=c;function a(){var S=M(c);if(S===null)throw new Error("Malformed timestamp: "+i);return c=c.replace(/^[^\sa-zA-Z-]+/,""),S}function r(S,w){var x=new G;W(S,function(_,b){var g;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":g=b.split(","),x.integer(_,g[0]),x.percent(_,g[0])&&x.set("snapToLines",!1),x.alt(_,g[0],["auto"]),g.length===2&&x.alt("lineAlign",g[1],["start",D,"end"]);break;case"position":g=b.split(","),x.percent(_,g[0]),g.length===2&&x.alt("positionAlign",g[1],["start",D,"end","line-left","line-right","auto"]);break;case"size":x.percent(_,b);break;case"align":x.alt(_,b,["start",D,"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",D);var O=x.get("position","auto");O==="auto"&&n.position===50&&(O=w.align==="start"||w.align==="left"?0:w.align==="end"||w.align==="right"?100:50),w.position=O}function s(){c=c.replace(/^\s+/,"")}if(s(),o.startTime=a(),s(),c.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+i);c=c.substr(3),s(),o.endTime=a(),s(),r(c,o)}function f(c){return c.replace(/<br(?: \/)?>/gi,`
|
|
`)}var h=function(){function c(){this.state="INITIAL",this.buffer="",this.decoder=new U,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var o=c.prototype;return o.parse=function(i){var a=this;i&&(a.buffer+=a.decoder.decode(i,{stream:!0}));function r(){var O=a.buffer,_=0;for(O=f(O);_<O.length&&O[_]!=="\r"&&O[_]!==`
|
|
`;)++_;var b=O.substr(0,_);return O[_]==="\r"&&++_,O[_]===`
|
|
`&&++_,a.buffer=O.substr(_),b}function s(O){W(O,function(_,b){},/:/)}try{var S="";if(a.state==="INITIAL"){if(!/\r\n|\n/.test(a.buffer))return this;S=r();var w=S.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:S=r();switch(a.state){case"HEADER":/:/.test(S)?s(S):S||(a.state="ID");continue;case"NOTE":S||(a.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(S)){a.state="NOTE";break}if(!S)continue;if(a.cue=new V.default(0,0,""),a.state="CUE",S.indexOf("-->")===-1){a.cue.id=S;continue}case"CUE":if(!a.cue){a.state="BADCUE";continue}try{m(S,a.cue,a.regionList)}catch(O){a.cue=null,a.state="BADCUE";continue}a.state="CUETEXT";continue;case"CUETEXT":{var L=S.indexOf("-->")!==-1;if(!S||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+=S}continue;case"BADCUE":S||(a.state="ID")}}}catch(O){a.state==="CUETEXT"&&a.cue&&a.oncue&&a.oncue(a.cue),a.cue=null,a.state=a.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},o.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(Z,X,P){"use strict";P.r(X),P.d(X,"generateCueId",function(){return h}),P.d(X,"parseWebVTT",function(){return o});var V=P("./src/polyfills/number.ts"),U=P("./src/utils/vttparser.ts"),M=P("./src/demux/id3.ts"),G=P("./src/utils/timescale-conversion.ts"),W=P("./src/remux/mp4-remuxer.ts"),n=/\r\n|\n\r|\n|\r/g,D=function(i,a,r){return r===void 0&&(r=0),i.substr(r,a.length)===a},m=function(i){var a=parseInt(i.substr(-3)),r=parseInt(i.substr(-6,2)),s=parseInt(i.substr(-9,2)),S=i.length>9?parseInt(i.substr(0,i.indexOf(":"))):0;if(!Object(V.isFiniteNumber)(a)||!Object(V.isFiniteNumber)(r)||!Object(V.isFiniteNumber)(s)||!Object(V.isFiniteNumber)(S))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+i);return a+=1e3*r,a+=60*1e3*s,a+=60*60*1e3*S,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 s=i[a],S=i[s.prevCC];if(!S||!S.new&&s.new){i.ccOffset=i.presentationOffset=s.start,s.new=!1;return}for(;(w=S)!==null&&w!==void 0&&w.new;){var w;i.ccOffset+=s.start-S.start,s.new=!1,s=S,S=i[s.prevCC]}i.presentationOffset=r};function o(d,i,a,r,s,S,w,x){var L=new U.VTTParser,O=Object(M.utf8ArrayToStr)(new Uint8Array(d)).trim().replace(n,`
|
|
`).split(`
|
|
`),_=[],b=Object(G.toMpegTsClockFromTimescale)(i,a),g="00:00.000",p=0,C=0,E,v=!0,N=!1;L.oncue=function(F){var A=r[s],H=r.ccOffset,j=(p-b)/9e4;if(A!=null&&A.new&&(C!==void 0?H=r.ccOffset=A.start:c(r,s,j)),j&&(H=j-r.presentationOffset),N){var T=F.endTime-F.startTime,z=Object(W.normalizePts)((F.startTime+H-C)*9e4,S*9e4)/9e4;F.startTime=z,F.endTime=z+T}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(_)},O.forEach(function(F){if(v)if(D(F,"X-TIMESTAMP-MAP=")){v=!1,N=!0,F.substr(16).split(",").forEach(function(A){D(A,"LOCAL:")?g=A.substr(6):D(A,"MPEGTS:")&&(p=parseInt(A.substr(7)))});try{C=m(g)/1e3}catch(A){N=!1,E=A}return}else F===""&&(v=!1);L.parse(F+`
|
|
`)}),L.flush()}},"./src/utils/xhr-loader.ts":function(Z,X,P){"use strict";P.r(X);var V=P("./src/utils/logger.ts"),U=P("./src/loader/load-stats.ts"),M=/^age:\s*[\d.]+\s*$/m,G=function(){function W(D){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=D?D.xhrSetup:null,this.stats=new U.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 m=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),m&&(m.onreadystatechange=null,m.onprogress=null,m.readyState!==4&&(this.stats.aborted=!0,m.abort()))},n.abort=function(){var m;this.abortInternal(),(m=this.callbacks)!==null&&m!==void 0&&m.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},n.load=function(m,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=m,this.config=f,this.callbacks=h,this.retryDelay=f.retryDelay,this.loadInternal()},n.loadInternal=function(){var m=this.config,f=this.context;if(!m)return;var h=this.loader=new self.XMLHttpRequest,c=this.stats;c.loading.first=0,c.loaded=0;var o=this.xhrSetup;try{if(o)try{o(h,f.url)}catch(a){h.open("GET",f.url,!0),o(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),m.timeout),h.send()},n.readystatechange=function(){var m=this.context,f=this.loader,h=this.stats;if(!m||!f)return;var c=f.readyState,o=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(m.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,m,i,f),!this.callbacks)return;var s={url:f.responseURL,data:i};this.callbacks.onSuccess(s,h,m,f)}else h.retry>=o.maxRetry||d>=400&&d<499?(V.logger.error(d+" while loading "+m.url),this.callbacks.onError({code:d,text:f.statusText},m,f)):(V.logger.warn(d+" while loading "+m.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,o.maxRetryDelay),h.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),o.timeout)},n.loadtimeout=function(){V.logger.warn("timeout while loading "+this.context.url);var m=this.callbacks;m&&(this.abortInternal(),m.onTimeout(this.stats,this.context,this.loader))},n.loadprogress=function(m){var f=this.stats;f.loaded=m.loaded,m.lengthComputable&&(f.total=m.total)},n.getCacheAge=function(){var m=null;if(this.loader&&M.test(this.loader.getAllResponseHeaders())){var f=this.loader.getResponseHeader("age");m=f?parseFloat(f):null}return m},W}();X.default=G}}).default})},vHTk:function(je,oe,k){je.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(je,oe,k){"use strict";k.d(oe,"a",function(){return mt});var Z=k("rePB"),X=k("VTBJ"),P=k("KQm4"),V=k("U8pU"),U=k("ODXe"),M=k("q1tI"),G=k("TSYQ"),W=k.n(G),n=k("Gytx"),D=k.n(n),m=k("Kwbf"),f=k("t23M"),h=k("qx4F"),c=k("6eGT"),o=k("IBYe"),d=k("Ff2n"),i=k("c+Xe"),a=k("fyJ8"),r=k("biw7");function s(Ae,Ce,Ve,Qe,Pe){var Fe=Ve[Ae]||{},be=Ve[Ce]||{},fe,pe;Fe.fixed==="left"?fe=Qe.left[Ae]:be.fixed==="right"&&(pe=Qe.right[Ce]);var ie=!1,ae=!1,ce=!1,me=!1,Te=Ve[Ce+1],ke=Ve[Ae-1];if(Pe==="rtl"){if(fe!==void 0){var $e=ke&&ke.fixed==="left";me=!$e}else if(pe!==void 0){var pt=Te&&Te.fixed==="right";ce=!pt}}else if(fe!==void 0){var Ot=Te&&Te.fixed==="left";ie=!Ot}else if(pe!==void 0){var vt=ke&&ke.fixed==="right";ae=!vt}return{fixLeft:fe,fixRight:pe,lastFixLeft:ie,firstFixRight:ae,lastFixRight:ce,firstFixLeft:me,isSticky:Qe.isSticky}}var S=k("sR1s");function w(Ae){var Ce=Ae.cells,Ve=Ae.stickyOffsets,Qe=Ae.flattenColumns,Pe=Ae.rowComponent,Fe=Ae.cellComponent,be=Ae.onHeaderRow,fe=Ae.index,pe=M.useContext(r.a),ie=pe.prefixCls,ae=pe.direction,ce;be&&(ce=be(Ce.map(function(Te){return Te.column}),fe));var me=Object(S.a)(Ce.map(function(Te){return Te.column}));return M.createElement(Pe,Object.assign({},ce),Ce.map(function(Te,ke){var $e=Te.column,pt=s(Te.colStart,Te.colEnd,Qe,Ve,ae),Ot;return $e&&$e.onHeaderCell&&(Ot=Te.column.onHeaderCell($e)),M.createElement(a.a,Object.assign({},Te,{ellipsis:$e.ellipsis,align:$e.align,component:Fe,prefixCls:ie,key:me[ke]},pt,{additionalProps:Ot,rowType:"header"}))}))}w.displayName="HeaderRow";var x=w;function L(Ae){var Ce=[];function Ve(be,fe){var pe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Ce[pe]=Ce[pe]||[];var ie=fe,ae=be.filter(Boolean).map(function(ce){var me={key:ce.key,className:ce.className||"",children:ce.title,column:ce,colStart:ie},Te=1,ke=ce.children;return ke&&ke.length>0&&(Te=Ve(ke,ie,pe+1).reduce(function($e,pt){return $e+pt},0),me.hasSubColumns=!0),"colSpan"in ce&&(Te=ce.colSpan),"rowSpan"in ce&&(me.rowSpan=ce.rowSpan),me.colSpan=Te,me.colEnd=me.colStart+Te-1,Ce[pe].push(me),ie+=Te,Te});return ae}Ve(Ae,0);for(var Qe=Ce.length,Pe=function(fe){Ce[fe].forEach(function(pe){!("rowSpan"in pe)&&!pe.hasSubColumns&&(pe.rowSpan=Qe-fe)})},Fe=0;Fe<Qe;Fe+=1)Pe(Fe);return Ce}function O(Ae){var Ce=Ae.stickyOffsets,Ve=Ae.columns,Qe=Ae.flattenColumns,Pe=Ae.onHeaderRow,Fe=M.useContext(r.a),be=Fe.prefixCls,fe=Fe.getComponent,pe=M.useMemo(function(){return L(Ve)},[Ve]),ie=fe(["header","wrapper"],"thead"),ae=fe(["header","row"],"tr"),ce=fe(["header","cell"],"th");return M.createElement(ie,{className:"".concat(be,"-thead")},pe.map(function(me,Te){var ke=M.createElement(x,{key:Te,flattenColumns:Qe,cells:me,stickyOffsets:Ce,rowComponent:ae,cellComponent:ce,onHeaderRow:Pe,index:Te});return ke}))}var _=O,b=k("hW8S");function g(Ae){for(var Ce=Ae.colWidths,Ve=Ae.columns,Qe=Ae.columCount,Pe=[],Fe=Qe||Ve.length,be=!1,fe=Fe-1;fe>=0;fe-=1){var pe=Ce[fe],ie=Ve&&Ve[fe],ae=ie&&ie[b.a];(pe||ae||be)&&(Pe.unshift(M.createElement("col",Object.assign({key:fe,style:{width:pe,minWidth:pe}},ae))),be=!0)}return M.createElement("colgroup",null,Pe)}var p=g;function C(Ae,Ce){return Object(M.useMemo)(function(){for(var Ve=[],Qe=0;Qe<Ce;Qe+=1){var Pe=Ae[Qe];if(Pe!==void 0)Ve[Qe]=Pe;else return null}return Ve},[Ae.join("_"),Ce])}var E=M.forwardRef(function(Ae,Ce){var Ve=Ae.noData,Qe=Ae.columns,Pe=Ae.flattenColumns,Fe=Ae.colWidths,be=Ae.columCount,fe=Ae.stickyOffsets,pe=Ae.direction,ie=Ae.fixHeader,ae=Ae.offsetHeader,ce=Ae.stickyClassName,me=Ae.onScroll,Te=Object(d.a)(Ae,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),ke=M.useContext(r.a),$e=ke.prefixCls,pt=ke.scrollbarSize,Ot=ke.isSticky,vt=Ot&&!ie?0:pt,st=M.useRef(null),Ke=M.useCallback(function(ct){Object(i.b)(Ce,ct),Object(i.b)(st,ct)},[]);M.useEffect(function(){var ct;function ft(Ie){var Je=Ie.currentTarget,tt=Ie.deltaX;tt&&(me({currentTarget:Je,scrollLeft:Je.scrollLeft+tt}),Ie.preventDefault())}return(ct=st.current)===null||ct===void 0||ct.addEventListener("wheel",ft),function(){var Ie;(Ie=st.current)===null||Ie===void 0||Ie.removeEventListener("wheel",ft)}},[]);var Ge=Pe[Pe.length-1],Ue={fixed:Ge?Ge.fixed:null,onHeaderCell:function(){return{className:"".concat($e,"-cell-scrollbar")}}},le=Object(M.useMemo)(function(){return vt?[].concat(Object(P.a)(Qe),[Ue]):Qe},[vt,Qe]),_e=Object(M.useMemo)(function(){return vt?[].concat(Object(P.a)(Pe),[Ue]):Pe},[vt,Pe]),Xe=Object(M.useMemo)(function(){var ct=fe.right,ft=fe.left;return Object(X.a)(Object(X.a)({},fe),{},{left:pe==="rtl"?[].concat(Object(P.a)(ft.map(function(Ie){return Ie+vt})),[0]):ft,right:pe==="rtl"?ct:[].concat(Object(P.a)(ct.map(function(Ie){return Ie+vt})),[0]),isSticky:Ot})},[vt,fe,Ot]),Be=C(Fe,be);return M.createElement("div",{style:Object(X.a)({overflow:"hidden"},Ot?{top:ae}:{}),ref:Ke,className:W()("".concat($e,"-header"),Object(Z.a)({},ce,!!ce))},M.createElement("table",{style:{tableLayout:"fixed",visibility:Ve||Be?null:"hidden"}},M.createElement(p,{colWidths:Be?[].concat(Object(P.a)(Be),[vt]):[],columCount:be+1,columns:_e}),M.createElement(_,Object.assign({},Te,{stickyOffsets:Xe,columns:le,flattenColumns:_e}))))});E.displayName="FixedHeader";var v=E,N=M.createContext(null),F=N;function A(Ae){var Ce=Ae.prefixCls,Ve=Ae.children,Qe=Ae.component,Pe=Ae.cellComponent,Fe=Ae.fixHeader,be=Ae.fixColumn,fe=Ae.horizonScroll,pe=Ae.className,ie=Ae.expanded,ae=Ae.componentWidth,ce=Ae.colSpan,me=M.useContext(r.a),Te=me.scrollbarSize;return M.useMemo(function(){var ke=Ve;return be&&(ke=M.createElement("div",{style:{width:ae-(Fe?Te:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Ce,"-expanded-row-fixed")},ke)),M.createElement(Qe,{className:pe,style:{display:ie?null:"none"}},M.createElement(a.a,{component:Pe,prefixCls:Ce,colSpan:ce},ke))},[Ve,Qe,Fe,fe,pe,ie,ae,ce,Te])}var H=A;function j(Ae){var Ce=Ae.className,Ve=Ae.style,Qe=Ae.record,Pe=Ae.index,Fe=Ae.rowKey,be=Ae.getRowKey,fe=Ae.rowExpandable,pe=Ae.expandedKeys,ie=Ae.onRow,ae=Ae.indent,ce=ae===void 0?0:ae,me=Ae.rowComponent,Te=Ae.cellComponent,ke=Ae.childrenColumnName,$e=M.useContext(r.a),pt=$e.prefixCls,Ot=$e.fixedInfoList,vt=M.useContext(F),st=vt.fixHeader,Ke=vt.fixColumn,Ge=vt.horizonScroll,Ue=vt.componentWidth,le=vt.flattenColumns,_e=vt.expandableType,Xe=vt.expandRowByClick,Be=vt.onTriggerExpand,ct=vt.rowClassName,ft=vt.expandedRowClassName,Ie=vt.indentSize,Je=vt.expandIcon,tt=vt.expandedRowRender,_t=vt.expandIconColumnIndex,Tt=M.useState(!1),Zt=Object(U.a)(Tt,2),nn=Zt[0],Qt=Zt[1],Lt=pe&&pe.has(Ae.recordKey);M.useEffect(function(){Lt&&Qt(!0)},[Lt]);var On=_e==="row"&&(!fe||fe(Qe)),un=_e==="nest",fn=ke&&Qe&&Qe[ke],Xt=On||un,mn;ie&&(mn=ie(Qe,Pe));var Pn=function(I){if(Xe&&Xt&&Be(Qe,I),mn&&mn.onClick){for(var R,K=arguments.length,ee=new Array(K>1?K-1:0),Y=1;Y<K;Y++)ee[Y-1]=arguments[Y];(R=mn).onClick.apply(R,[I].concat(ee))}},zn;typeof ct=="string"?zn=ct:typeof ct=="function"&&(zn=ct(Qe,Pe,ce));var dt=Object(S.a)(le),Rt=M.createElement(me,Object.assign({},mn,{"data-row-key":Fe,className:W()(Ce,"".concat(pt,"-row"),"".concat(pt,"-row-level-").concat(ce),zn,mn&&mn.className),style:Object(X.a)(Object(X.a)({},Ve),mn?mn.style:null),onClick:Pn}),le.map(function(J,I){var R=J.render,K=J.dataIndex,ee=J.className,Y=dt[I],Ee=Ot[I],Ye;I===(_t||0)&&un&&(Ye=M.createElement(M.Fragment,null,M.createElement("span",{style:{paddingLeft:"".concat(Ie*ce,"px")},className:"".concat(pt,"-row-indent indent-level-").concat(ce)}),Je({prefixCls:pt,expanded:Lt,expandable:fn,record:Qe,onExpand:Be})));var ut;return J.onCell&&(ut=J.onCell(Qe,Pe)),M.createElement(a.a,Object.assign({className:ee,ellipsis:J.ellipsis,align:J.align,component:Te,prefixCls:pt,key:Y,record:Qe,index:Pe,dataIndex:K,render:R,shouldCellUpdate:J.shouldCellUpdate},Ee,{appendNode:Ye,additionalProps:ut}))})),Vn;if(On&&(nn||Lt)){var pr=tt(Qe,Pe,ce+1,Lt),ur=ft&&ft(Qe,Pe,ce);Vn=M.createElement(H,{expanded:Lt,className:W()("".concat(pt,"-expanded-row"),"".concat(pt,"-expanded-row-level-").concat(ce+1),ur),prefixCls:pt,fixHeader:st,fixColumn:Ke,horizonScroll:Ge,component:me,componentWidth:Ue,cellComponent:Te,colSpan:le.length},pr)}var kr;return fn&&Lt&&(kr=(Qe[ke]||[]).map(function(J,I){var R=be(J,I);return M.createElement(j,Object.assign({},Ae,{key:R,rowKey:R,record:J,recordKey:R,index:I,indent:ce+1}))})),M.createElement(M.Fragment,null,Rt,Vn,kr)}j.displayName="BodyRow";var T=j,z=M.createContext(null),Q=z;function ne(Ae){var Ce=Ae.columnKey,Ve=Ae.onColumnResize,Qe=M.useRef();return M.useEffect(function(){Qe.current&&Ve(Ce,Qe.current.offsetWidth)},[]),M.createElement(f.a,{onResize:function(Fe){var be=Fe.offsetWidth;Ve(Ce,be)}},M.createElement("td",{ref:Qe,style:{padding:0,border:0,height:0}},M.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function se(Ae){var Ce=Ae.data,Ve=Ae.getRowKey,Qe=Ae.measureColumnWidth,Pe=Ae.expandedKeys,Fe=Ae.onRow,be=Ae.rowExpandable,fe=Ae.emptyNode,pe=Ae.childrenColumnName,ie=M.useContext(Q),ae=ie.onColumnResize,ce=M.useContext(r.a),me=ce.prefixCls,Te=ce.getComponent,ke=M.useContext(F),$e=ke.fixHeader,pt=ke.horizonScroll,Ot=ke.flattenColumns,vt=ke.componentWidth;return M.useMemo(function(){var st=Te(["body","wrapper"],"tbody"),Ke=Te(["body","row"],"tr"),Ge=Te(["body","cell"],"td"),Ue;Ce.length?Ue=Ce.map(function(_e,Xe){var Be=Ve(_e,Xe);return M.createElement(T,{key:Be,rowKey:Be,record:_e,recordKey:Be,index:Xe,rowComponent:Ke,cellComponent:Ge,expandedKeys:Pe,onRow:Fe,getRowKey:Ve,rowExpandable:be,childrenColumnName:pe})}):Ue=M.createElement(H,{expanded:!0,className:"".concat(me,"-placeholder"),prefixCls:me,fixHeader:$e,fixColumn:pt,horizonScroll:pt,component:Ke,componentWidth:vt,cellComponent:Ge,colSpan:Ot.length},fe);var le=Object(S.a)(Ot);return M.createElement(st,{className:"".concat(me,"-tbody")},Qe&&M.createElement("tr",{"aria-hidden":"true",className:"".concat(me,"-measure-row"),style:{height:0}},le.map(function(_e){return M.createElement(ne,{key:_e,columnKey:_e,onColumnResize:ae})})),Ue)},[Ce,me,Fe,Qe,Pe,Ve,Te,vt,fe,Ot])}var xe=M.memo(se);xe.displayName="Body";var ge=xe,ve=k("wRmb"),Oe=k("xEkU"),Re=k.n(Oe);function he(Ae){var Ce=Object(M.useRef)(Ae),Ve=Object(M.useState)({}),Qe=Object(U.a)(Ve,2),Pe=Qe[1],Fe=Object(M.useRef)(null),be=Object(M.useRef)([]);function fe(pe){Fe.current===null&&(be.current=[],Fe.current=Re()(function(){be.current.forEach(function(ie){Ce.current=ie(Ce.current)}),Fe.current=null,Pe({})})),be.current.push(pe)}return Object(M.useEffect)(function(){return function(){Re.a.cancel(Fe.current)}},[]),[Ce.current,fe]}function ue(Ae){var Ce=Object(M.useRef)(Ae),Ve=Object(M.useRef)(null);function Qe(){window.clearTimeout(Ve.current)}function Pe(be){Ce.current=be,Qe(),Ve.current=window.setTimeout(function(){Ce.current=null,Ve.current=null},100)}function Fe(){return Ce.current}return Object(M.useEffect)(function(){return Qe},[]),[Pe,Fe]}function Me(Ae,Ce,Ve){var Qe=Object(M.useMemo)(function(){for(var Pe=[],Fe=[],be=0,fe=0,pe=0;pe<Ce;pe+=1)if(Ve==="rtl"){Fe[pe]=fe,fe+=Ae[pe]||0;var ie=Ce-pe-1;Pe[ie]=be,be+=Ae[ie]||0}else{Pe[pe]=be,be+=Ae[pe]||0;var ae=Ce-pe-1;Fe[ae]=fe,fe+=Ae[ae]||0}return{left:Pe,right:Fe}},[Ae,Ce,Ve]);return Qe}var et=Me;function it(Ae){var Ce=Ae.className,Ve=Ae.children;return M.createElement("div",{className:Ce},Ve)}var nt=it,at=k("n6Qo");function ze(Ae){var Ce,Ve=Ae.prefixCls,Qe=Ae.record,Pe=Ae.onExpand,Fe=Ae.expanded,be=Ae.expandable,fe="".concat(Ve,"-row-expand-icon");if(!be)return M.createElement("span",{className:W()(fe,"".concat(Ve,"-row-spaced"))});var pe=function(ae){Pe(Qe,ae),ae.stopPropagation()};return M.createElement("span",{className:W()(fe,(Ce={},Object(Z.a)(Ce,"".concat(Ve,"-row-expanded"),Fe),Object(Z.a)(Ce,"".concat(Ve,"-row-collapsed"),!Fe),Ce)),onClick:pe})}function Ze(Ae,Ce,Ve){var Qe=[];function Pe(Fe){(Fe||[]).forEach(function(be,fe){Qe.push(Ce(be,fe)),Pe(be[Ve])})}return Pe(Ae),Qe}var ot=k("zT1h"),de=k("y0+3"),Se=function(Ce,Ve){var Qe,Pe,Fe=Ce.scrollBodyRef,be=Ce.onScroll,fe=Ce.offsetScroll,pe=M.useContext(r.a),ie=pe.prefixCls,ae=((Qe=Fe.current)===null||Qe===void 0?void 0:Qe.scrollWidth)||0,ce=((Pe=Fe.current)===null||Pe===void 0?void 0:Pe.clientWidth)||0,me=ae&&ce*(ce/ae),Te=M.useRef(),ke=he({scrollLeft:0,isHiddenScrollBar:!1}),$e=Object(U.a)(ke,2),pt=$e[0],Ot=$e[1],vt=M.useRef({delta:0,x:0}),st=M.useState(!1),Ke=Object(U.a)(st,2),Ge=Ke[0],Ue=Ke[1],le=function(){Ue(!1)},_e=function(Ie){Ie.persist(),vt.current.delta=Ie.pageX-pt.scrollLeft,vt.current.x=0,Ue(!0),Ie.preventDefault()},Xe=function(Ie){var Je,tt=Ie||((Je=window)===null||Je===void 0?void 0:Je.event),_t=tt.buttons;if(!Ge||_t===0){Ge&&Ue(!1);return}var Tt=vt.current.x+Ie.pageX-vt.current.x-vt.current.delta;Tt<=0&&(Tt=0),Tt+me>=ce&&(Tt=ce-me),be({scrollLeft:Tt/ce*(ae+2)}),vt.current.x=Ie.pageX},Be=function(){var Ie=Object(de.b)(Fe.current).top,Je=Ie+Fe.current.offsetHeight,tt=document.documentElement.scrollTop+window.innerHeight;Je-Object(h.a)()<=tt||Ie>=tt-fe?Ot(function(_t){return Object(X.a)(Object(X.a)({},_t),{},{isHiddenScrollBar:!0})}):Ot(function(_t){return Object(X.a)(Object(X.a)({},_t),{},{isHiddenScrollBar:!1})})},ct=function(Ie){Ot(function(Je){return Object(X.a)(Object(X.a)({},Je),{},{scrollLeft:Ie/ae*ce||0})})};return M.useImperativeHandle(Ve,function(){return{setScrollLeft:ct}}),M.useEffect(function(){var ft=Object(ot.a)(document.body,"mouseup",le,!1),Ie=Object(ot.a)(document.body,"mousemove",Xe,!1);return Be(),function(){ft.remove(),Ie.remove()}},[me,Ge]),M.useEffect(function(){var ft=Object(ot.a)(window,"scroll",Be,!1),Ie=Object(ot.a)(window,"resize",Be,!1);return function(){ft.remove(),Ie.remove()}},[]),M.useEffect(function(){pt.isHiddenScrollBar||Ot(function(ft){var Ie,Je;return Object(X.a)(Object(X.a)({},ft),{},{scrollLeft:Fe.current.scrollLeft/((Ie=Fe.current)===null||Ie===void 0?void 0:Ie.scrollWidth)*((Je=Fe.current)===null||Je===void 0?void 0:Je.clientWidth)})})},[pt.isHiddenScrollBar]),ae<=ce||!me||pt.isHiddenScrollBar?null:M.createElement("div",{style:{height:Object(h.a)(),width:ce,bottom:fe},className:"".concat(ie,"-sticky-scroll")},M.createElement("div",{onMouseDown:_e,ref:Te,className:W()("".concat(ie,"-sticky-scroll-bar"),Object(Z.a)({},"".concat(ie,"-sticky-scroll-bar-active"),Ge)),style:{width:"".concat(me,"px"),transform:"translate3d(".concat(pt.scrollLeft,"px, 0, 0)")}}))},Le=M.forwardRef(Se);function De(Ae,Ce){return M.useMemo(function(){var Ve=!!Ae;return{isSticky:Ve,stickyClassName:Ve?"".concat(Ce,"-sticky-header"):"",offsetHeader:Object(V.a)(Ae)==="object"&&Ae.offsetHeader||0,offsetScroll:Object(V.a)(Ae)==="object"&&Ae.offsetScroll||0}},[Ae,Ce])}var qe=[],lt={},mt="rc-table-internal-hook",gt=M.memo(function(Ae){var Ce=Ae.children;return Ce},function(Ae,Ce){return D()(Ae.props,Ce.props)?Ae.pingLeft!==Ce.pingLeft||Ae.pingRight!==Ce.pingRight:!1});function Ct(Ae){var Ce,Ve=Ae.prefixCls,Qe=Ae.className,Pe=Ae.rowClassName,Fe=Ae.style,be=Ae.data,fe=Ae.rowKey,pe=Ae.scroll,ie=Ae.tableLayout,ae=Ae.direction,ce=Ae.title,me=Ae.footer,Te=Ae.summary,ke=Ae.id,$e=Ae.showHeader,pt=Ae.components,Ot=Ae.emptyText,vt=Ae.onRow,st=Ae.onHeaderRow,Ke=Ae.internalHooks,Ge=Ae.transformColumns,Ue=Ae.internalRefs,le=Ae.sticky,_e=be||qe,Xe=!!_e.length,Be=M.useState(0),ct=Object(U.a)(Be,2),ft=ct[0],Ie=ct[1];M.useEffect(function(){Ie(Object(h.a)())});var Je=M.useMemo(function(){return Object(S.c)(pt,{})},[pt]),tt=M.useCallback(function(wn,gn){return Object(S.b)(Je,wn)||gn},[Je]),_t=M.useMemo(function(){return typeof fe=="function"?fe:function(wn){var gn=wn&&wn[fe];return gn}},[fe]),Tt=Object(b.c)(Ae),Zt=Tt.expandIcon,nn=Tt.expandedRowKeys,Qt=Tt.defaultExpandedRowKeys,Lt=Tt.defaultExpandAllRows,On=Tt.expandedRowRender,un=Tt.onExpand,fn=Tt.onExpandedRowsChange,Xt=Tt.expandRowByClick,mn=Tt.rowExpandable,Pn=Tt.expandIconColumnIndex,zn=Tt.expandedRowClassName,dt=Tt.childrenColumnName,Rt=Tt.indentSize,Vn=Zt||ze,pr=dt||"children",ur=M.useMemo(function(){return On?"row":Ae.expandable&&Ke===mt&&Ae.expandable.__PARENT_RENDER_ICON__||_e.some(function(wn){return wn&&Object(V.a)(wn)==="object"&&wn[pr]})?"nest":!1},[!!On,_e]),kr=M.useState(function(){return Qt||(Lt?Ze(_e,_t,pr):[])}),J=Object(U.a)(kr,2),I=J[0],R=J[1],K=M.useMemo(function(){return new Set(nn||I||[])},[nn,I]),ee=M.useCallback(function(wn){var gn=_t(wn,_e.indexOf(wn)),_n,gr=K.has(gn);gr?(K.delete(gn),_n=Object(P.a)(K)):_n=[].concat(Object(P.a)(K),[gn]),R(_n),un&&un(!gr,wn),fn&&fn(_n)},[_t,K,_e,un,fn]),Y=M.useState(0),Ee=Object(U.a)(Y,2),Ye=Ee[0],ut=Ee[1],yt=Object(ve.b)(Object(X.a)(Object(X.a)(Object(X.a)({},Ae),Tt),{},{expandable:!!On,expandedKeys:K,getRowKey:_t,onTriggerExpand:ee,expandIcon:Vn,expandIconColumnIndex:Pn,direction:ae}),Ke===mt?Ge:null),He=Object(U.a)(yt,2),Et=He[0],It=He[1],Pt=M.useMemo(function(){return{columns:Et,flattenColumns:It}},[Et,It]),qt=M.useRef(),At=M.useRef(),tn=M.useRef(),en=M.useState(!1),kn=Object(U.a)(en,2),Gt=kn[0],An=kn[1],Rn=M.useState(!1),In=Object(U.a)(Rn,2),Sn=In[0],Dn=In[1],Hn=he(new Map),ar=Object(U.a)(Hn,2),Xn=ar[0],xn=ar[1],Bn=Object(S.a)(It),pn=Bn.map(function(wn){return Xn.get(wn)}),yn=M.useMemo(function(){return pn},[pn.join("_")]),bn=et(yn,It.length,ae),zt=pe&&Object(S.d)(pe.y),wt=pe&&Object(S.d)(pe.x),Wt=wt&&It.some(function(wn){var gn=wn.fixed;return gn}),bt=M.useRef(),Jt=De(le,Ve),Nt=Jt.isSticky,Yn=Jt.offsetHeader,cn=Jt.offsetScroll,Qn=Jt.stickyClassName,Kr,wr,Vr;zt&&(wr={overflowY:"scroll",maxHeight:pe.y}),wt&&(Kr={overflowX:"auto"},zt||(wr={overflowY:"hidden"}),Vr={width:pe.x===!0?"auto":pe.x,minWidth:"100%"});var Nr=M.useCallback(function(wn,gn){xn(function(_n){var gr=new Map(_n);return gr.set(wn,gn),gr})},[]),Rr=ue(null),Gr=Object(U.a)(Rr,2),Kn=Gr[0],Ht=Gr[1];function Xr(wn,gn){if(!gn)return;typeof gn=="function"?gn(wn):gn.scrollLeft!==wn&&(gn.scrollLeft=wn)}var br=function(gn){var _n=gn.currentTarget,gr=gn.scrollLeft,Qr=typeof gr=="number"?gr:_n.scrollLeft,qr=_n||lt;if(!Ht()||Ht()===qr){var ri;Kn(qr),Xr(Qr,At.current),Xr(Qr,tn.current),Xr(Qr,(ri=bt.current)===null||ri===void 0?void 0:ri.setScrollLeft)}if(_n){var Ti=_n.scrollWidth,ln=_n.clientWidth;An(Qr>0),Dn(Qr<Ti-ln)}},ni=function(){tn.current&&br({currentTarget:tn.current})},jt=function(gn){var _n=gn.width;ni(),ut(qt.current?qt.current.offsetWidth:_n)};M.useEffect(function(){return ni},[]),M.useEffect(function(){wt&&ni()},[wt]),M.useEffect(function(){Ke===mt&&Ue&&(Ue.body.current=tn.current)});var Yt=tt(["table"],"table"),Kt=M.useMemo(function(){return ie||(Wt?pe.x==="max-content"?"auto":"fixed":zt||It.some(function(wn){var gn=wn.ellipsis;return gn})?"fixed":"auto")},[zt,Wt,It,ie]),rn,on={colWidths:yn,columCount:It.length,stickyOffsets:bn,onHeaderRow:st,fixHeader:zt},Cn=M.useMemo(function(){return Xe?null:typeof Ot=="function"?Ot():Ot},[Xe,Ot]),dn=M.createElement(ge,{data:_e,measureColumnWidth:zt||wt||Nt,expandedKeys:K,rowExpandable:mn,getRowKey:_t,onRow:vt,emptyNode:Cn,childrenColumnName:pr}),jn=M.createElement(p,{colWidths:It.map(function(wn){var gn=wn.width;return gn}),columns:It}),or=Te&&M.createElement(at.b,null,Te(_e)),an=tt(["body"]);if(zt||Nt){var _r;typeof an=="function"?(_r=an(_e,{scrollbarSize:ft,ref:tn,onScroll:br}),on.colWidths=It.map(function(wn,gn){var _n=wn.width,gr=gn===Et.length-1?_n-ft:_n;return typeof gr=="number"&&!Number.isNaN(gr)?gr:(Object(m.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):_r=M.createElement("div",{style:Object(X.a)(Object(X.a)({},Kr),wr),onScroll:br,ref:tn,className:W()("".concat(Ve,"-body"))},M.createElement(Yt,{style:Object(X.a)(Object(X.a)({},Vr),{},{tableLayout:Kt})},jn,dn,or),Nt&&M.createElement(Le,{ref:bt,offsetScroll:cn,scrollBodyRef:tn,onScroll:br})),rn=M.createElement(M.Fragment,null,$e!==!1&&M.createElement(v,Object.assign({noData:!_e.length},on,Pt,{direction:ae,offsetHeader:Yn,stickyClassName:Qn,ref:At,onScroll:br})),_r)}else rn=M.createElement("div",{style:Object(X.a)(Object(X.a)({},Kr),wr),className:W()("".concat(Ve,"-content")),onScroll:br,ref:tn},M.createElement(Yt,{style:Object(X.a)(Object(X.a)({},Vr),{},{tableLayout:Kt})},jn,$e!==!1&&M.createElement(_,Object.assign({},on,Pt)),dn,or));var Tn=Object(b.b)(Ae),qn=M.createElement("div",Object.assign({className:W()(Ve,Qe,(Ce={},Object(Z.a)(Ce,"".concat(Ve,"-rtl"),ae==="rtl"),Object(Z.a)(Ce,"".concat(Ve,"-ping-left"),Gt),Object(Z.a)(Ce,"".concat(Ve,"-ping-right"),Sn),Object(Z.a)(Ce,"".concat(Ve,"-layout-fixed"),ie==="fixed"),Object(Z.a)(Ce,"".concat(Ve,"-fixed-header"),zt),Object(Z.a)(Ce,"".concat(Ve,"-fixed-column"),Wt),Object(Z.a)(Ce,"".concat(Ve,"-scroll-horizontal"),wt),Object(Z.a)(Ce,"".concat(Ve,"-has-fix-left"),It[0]&&It[0].fixed),Object(Z.a)(Ce,"".concat(Ve,"-has-fix-right"),It[It.length-1]&&It[It.length-1].fixed==="right"),Ce)),style:Fe,id:ke,ref:qt},Tn),M.createElement(gt,{pingLeft:Gt,pingRight:Sn,props:Object(X.a)(Object(X.a)({},Ae),{},{stickyOffsets:bn,mergedExpandedKeys:K})},ce&&M.createElement(nt,{className:"".concat(Ve,"-title")},ce(_e)),M.createElement("div",{className:"".concat(Ve,"-container")},rn),me&&M.createElement(nt,{className:"".concat(Ve,"-footer")},me(_e))));wt&&(qn=M.createElement(f.a,{onResize:jt},qn));var er=M.useMemo(function(){return{prefixCls:Ve,getComponent:tt,scrollbarSize:ft,direction:ae,fixedInfoList:It.map(function(wn,gn){return s(gn,gn,It,bn,ae)}),isSticky:Nt}},[Ve,tt,ft,ae,It,bn,ae,Nt]),mr=M.useMemo(function(){return Object(X.a)(Object(X.a)({},Pt),{},{tableLayout:Kt,rowClassName:Pe,expandedRowClassName:zn,componentWidth:Ye,fixHeader:zt,fixColumn:Wt,horizonScroll:wt,expandIcon:Vn,expandableType:ur,expandRowByClick:Xt,expandedRowRender:On,onTriggerExpand:ee,expandIconColumnIndex:Pn,indentSize:Rt})},[Pt,Kt,Pe,zn,Ye,zt,Wt,wt,Vn,ur,Xt,On,ee,Pn,Rt]),Wi=M.useMemo(function(){return{onColumnResize:Nr}},[Nr]);return M.createElement(r.a.Provider,{value:er},M.createElement(F.Provider,{value:mr},M.createElement(Q.Provider,{value:Wi},qn)))}Ct.Column=o.a,Ct.ColumnGroup=c.a,Ct.Summary=at.a,Ct.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var xt=oe.b=Ct},wRmb:function(je,oe,k){"use strict";k.d(oe,"a",function(){return D});var Z=k("rePB"),X=k("KQm4"),P=k("VTBJ"),V=k("Ff2n"),U=k("q1tI"),M=k.n(U),G=k("Kwbf"),W=k("Zm9Q"),n=k("hW8S");function D(o){return Object(W.a)(o).filter(function(d){return U.isValidElement(d)}).map(function(d){var i=d.key,a=d.props,r=a.children,s=Object(V.a)(a,["children"]),S=Object(P.a)({key:i},s);return r&&(S.children=D(r)),S})}function m(o){return o.reduce(function(d,i){var a=i.fixed,r=a===!0?"left":a,s=i.children;return s&&s.length>0?[].concat(Object(X.a)(d),Object(X.a)(m(s).map(function(S){return Object(P.a)({fixed:r},S)}))):[].concat(Object(X.a)(d),[Object(P.a)(Object(P.a)({},i),{},{fixed:r})])},[])}function f(o){for(var d=!0,i=0;i<o.length;i+=1){var a=o[i];if(d&&a.fixed!=="left")d=!1;else if(!d&&a.fixed==="left"){Object(G.a)(!1,"Index ".concat(i-1," of `columns` missing `fixed='left'` prop."));break}}for(var r=!0,s=o.length-1;s>=0;s-=1){var S=o[s];if(r&&S.fixed!=="right")r=!1;else if(!r&&S.fixed==="right"){Object(G.a)(!1,"Index ".concat(s+1," of `columns` missing `fixed='right'` prop."));break}}}function h(o){return o.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(P.a)({fixed:r},a)})}function c(o,d){var i=o.prefixCls,a=o.columns,r=o.children,s=o.expandable,S=o.expandedKeys,w=o.getRowKey,x=o.onTriggerExpand,L=o.expandIcon,O=o.rowExpandable,_=o.expandIconColumnIndex,b=o.direction,g=o.expandRowByClick,p=U.useMemo(function(){return a||D(r)},[a,r]),C=U.useMemo(function(){if(s){var N,F=_||0,A=p[F],H=(N={},Object(Z.a)(N,n.a,{className:"".concat(i,"-expand-icon-col")}),Object(Z.a)(N,"title",""),Object(Z.a)(N,"fixed",A?A.fixed:null),Object(Z.a)(N,"className","".concat(i,"-row-expand-icon-cell")),Object(Z.a)(N,"render",function(z,Q,ne){var se=w(Q,ne),xe=S.has(se),ge=O?O(Q):!0,ve=L({prefixCls:i,expanded:xe,expandable:ge,record:Q,onExpand:x});return g?U.createElement("span",{onClick:function(Re){return Re.stopPropagation()}},ve):ve}),N),j=p.slice();return F>=0&&j.splice(F,0,H),j}return p},[s,p,w,S,L,b]),E=U.useMemo(function(){var N=C;return d&&(N=d(N)),N.length||(N=[{render:function(){return null}}]),N},[d,C,b]),v=U.useMemo(function(){return b==="rtl"?h(m(E)):m(E)},[E,b]);return[E,v]}oe.b=c},"y0+3":function(je,oe,k){"use strict";k.d(oe,"a",function(){return m}),k.d(oe,"b",function(){return h});var Z=/margin|padding|width|height|max|min|offset/,X={left:!0,top:!0},P={cssFloat:1,styleFloat:1,float:1};function V(c){return c.nodeType===1?c.ownerDocument.defaultView.getComputedStyle(c,null):{}}function U(c,o,d){if(o=o.toLowerCase(),d==="auto"){if(o==="height")return c.offsetHeight;if(o==="width")return c.offsetWidth}return o in X||(X[o]=Z.test(o)),X[o]?parseFloat(d)||0:d}function M(c,o){var d=arguments.length,i=V(c);return o=P[o]?"cssFloat"in c.style?"cssFloat":"styleFloat":o,d===1?i:U(c,o,i[o]||c.style[o])}function G(c,o,d){var i=arguments.length;if(o=P[o]?"cssFloat"in c.style?"cssFloat":"styleFloat":o,i===3)return typeof d=="number"&&Z.test(o)&&(d="".concat(d,"px")),c.style[o]=d,d;for(var a in o)o.hasOwnProperty(a)&&G(c,a,o[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 D(){var c=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),o=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:c,height:o}}function m(){var c=document.documentElement.clientWidth,o=window.innerHeight||document.documentElement.clientHeight;return{width:c,height:o}}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 o=c.getBoundingClientRect(),d=document.documentElement;return{left:o.left+(window.pageXOffset||d.scrollLeft)-(d.clientLeft||document.body.clientLeft||0),top:o.top+(window.pageYOffset||d.scrollTop)-(d.clientTop||document.body.clientTop||0)}}},ynwM:function(je,oe,k){var Z=k("MFOe"),X=Z.Global;je.exports={name:"oldFF-globalStorage",read:V,write:U,each:M,remove:G,clearAll:W};var P=X.globalStorage;function V(n){return P[n]}function U(n,D){P[n]=D}function M(n){for(var D=P.length-1;D>=0;D--){var m=P.key(D);n(P[m],m)}}function G(n){return P.removeItem(n)}function W(){M(function(n,D){delete P[n]})}}}]);
|